forked from Yara724/api
YARA-1020
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user