YARA-1020

This commit is contained in:
SepehrYahyaee
2026-07-19 16:34:44 +03:30
parent 06d69aa4d0
commit 9fc4ad9931
5 changed files with 159 additions and 13 deletions

View File

@@ -372,6 +372,21 @@ export class ExpertClaimService {
await enrichApproval("ownerInsurerApproval");
await enrichApproval("ownerPricedPartsApproval");
// Resolve objection invoice paths to downloadable URLs.
const objection = ev.objection as Record<string, unknown> | undefined;
if (objection) {
const invoices = objection.invoices as Array<Record<string, unknown>> | undefined;
if (Array.isArray(invoices) && invoices.length > 0) {
ev.objection = {
...objection,
invoices: invoices.map((inv) => ({
...inv,
url: inv.path ? buildFileLink(inv.path as string) : undefined,
})),
};
}
}
return ev;
}
@@ -4998,6 +5013,10 @@ export class ExpertClaimService {
if (enrichedEvaluation.priceDrop !== undefined) {
evaluationForApi.priceDrop = enrichedEvaluation.priceDrop;
}
// objection: include when present so experts can see the disputed parts and any attached invoices.
if (enrichedEvaluation.objection !== undefined) {
evaluationForApi.objection = enrichedEvaluation.objection;
}
if (Object.keys(evaluationForApi).length === 0) {
evaluationForApi = undefined;
}