update the culprit licenses chnged and ActualPremium

This commit is contained in:
2026-09-19 13:09:28 +03:30
parent 85576e7c5e
commit be06bfe1b5
6 changed files with 36 additions and 6 deletions

View File

@@ -4259,6 +4259,7 @@ export class ClaimRequestManagementService {
/** Blame `Party` row (FIRST party for CAR_BODY); person shape is read via pickPerson* helpers. */
firstParty?: { person?: unknown };
logPrefix: string;
claimCaseId?: string;
}): Promise<void> {
const policyId = parseFanavaranId(input.payload.PolicyId);
if (policyId == null) return;
@@ -4290,6 +4291,13 @@ export class ClaimRequestManagementService {
input.payload.ActualPremium = actualPremium;
}
const vehicleValue = vehicleCurrentValueFromHullPolicyRecord(policyRecord);
if (vehicleValue != null && input.claimCaseId) {
await this.claimCaseDbService.findByIdAndUpdate(input.claimCaseId, {
$set: { "vehicle.carPrice": vehicleValue },
});
}
const person = input.firstParty?.person as
| {
driverIsInsurer?: boolean;
@@ -4522,7 +4530,10 @@ export class ClaimRequestManagementService {
});
let vehicleCurrentValue =
this.parseFanavaranMoney(input.priceDropCarPrice) || null;
this.parseFanavaranMoney(input.claimCase?.vehicle?.carPrice) ||
this.parseFanavaranMoney(input.claimCase?.vehicle?.price) ||
this.parseFanavaranMoney(input.priceDropCarPrice) ||
null;
if (vehicleCurrentValue == null) {
vehicleCurrentValue = vehicleCurrentValueFromHullPolicyRecord(policy);
}
@@ -6132,7 +6143,9 @@ export class ClaimRequestManagementService {
blameCase,
firstParty,
logPrefix,
claimCaseId,
});
delete payload.IsLicenseReplacement;
const hull = toFanavaranHullBaseClaimPayload(payload);
for (const key of Object.keys(payload)) delete payload[key];
Object.assign(payload, hull);