fix: harden claim review and inquiry workflows

Preserve damage history and current vehicle price, restore depreciation mapping, normalize inquiry/report output, and support resumable expert review with paginated case retrieval.
This commit is contained in:
2026-09-18 16:04:33 +03:30
parent a84d83a135
commit 7d1a50db7b
38 changed files with 2345 additions and 370 deletions

View File

@@ -85,6 +85,7 @@ import {
localizeTimelineMetadata,
} from "./helper/timeline-fa-labels";
import { buildEnrichedDamagedParts } from "src/expert-claim/dto/claim-damaged-part.enricher";
import { serializeDamagedPartSelectionHistory } from "src/helpers/claim-damaged-part-audit";
@Injectable()
export class ExpertInsurerService {
@@ -524,6 +525,8 @@ export class ExpertInsurerService {
const d = { ...(damage as Record<string, unknown>) };
delete d.selectedOuterParts;
delete d.selectedPartIds;
// Expose the stable, URL-enriched contract instead of raw audit storage.
delete d.partSelectionHistory;
return d;
}
@@ -677,6 +680,10 @@ export class ExpertInsurerService {
catalogLikeKeyFromPart,
buildFileLink,
});
const damagedPartsHistory = serializeDamagedPartSelectionHistory({
history: (claim as any).damage?.partSelectionHistory,
currentSelectedParts: selectedNorm,
});
// Then add damagedParts to the return object
const requiredDocs = claim.requiredDocuments as any;
@@ -797,6 +804,7 @@ export class ExpertInsurerService {
: undefined,
carAngles,
damagedParts,
damagedPartsHistory,
videoCapture,
evaluation: evaluationEnriched,
userRating: claim.userRating,