diff --git a/src/expert-claim/expert-claim.service.ts b/src/expert-claim/expert-claim.service.ts index 22e45b9..4bf2b95 100644 --- a/src/expert-claim/expert-claim.service.ts +++ b/src/expert-claim/expert-claim.service.ts @@ -4242,9 +4242,10 @@ export class ExpertClaimService { ); } + // Manual path — change totalPriceDrop → total to match calculated path const manualPayload = { manualOverride: true, - totalPriceDrop: body.manualPriceDrop, + total: body.manualPriceDrop, // ← was totalPriceDrop partLines: [], }; @@ -4269,6 +4270,18 @@ export class ExpertClaimService { } // Calculated path — existing logic unchanged + // At the top of the calculated path, after the manualPriceDrop early return: + const existingPriceDrop = (claim as any).evaluation?.priceDrop; + if ( + existingPriceDrop?.manualOverride === true && + !body.partSeverities?.length + ) { + throw new BadRequestException( + "This claim has a manual price-drop correction. " + + "To recalculate, provide partSeverities explicitly — this will replace the manual correction.", + ); + } + const carType = claim.vehicle?.carType as ClaimVehicleTypeV2 | undefined; const selectedNorm = normalizeDamageSelectedParts( claim.damage?.selectedParts,