diff --git a/src/ai/ai.service.ts b/src/ai/ai.service.ts index 1eff579..759ab79 100644 --- a/src/ai/ai.service.ts +++ b/src/ai/ai.service.ts @@ -25,7 +25,7 @@ export class AiService implements OnModuleInit { username: process.env.AI_USERNAME, password: process.env.AI_PASSWORD, }, - timeout: 30000, // 30 second timeout + timeout: 1000, // 30 second timeout }; private get profileOptions(): AxiosRequestConfig { diff --git a/src/expert-blame/dto/all-request.dto.ts b/src/expert-blame/dto/all-request.dto.ts index e70ee01..0123123 100644 --- a/src/expert-blame/dto/all-request.dto.ts +++ b/src/expert-blame/dto/all-request.dto.ts @@ -117,6 +117,8 @@ export class AllRequestDtoV2 { type: string; blameStatus: string; partiesInitialForms: { firstParty: string; secondParty: string }; + firstPartyVehicle: string; + secondPartyVehicle?: string; } export class AllRequestDtoRsV2 { diff --git a/src/expert-blame/expert-blame.service.ts b/src/expert-blame/expert-blame.service.ts index ca6496a..2a57914 100644 --- a/src/expert-blame/expert-blame.service.ts +++ b/src/expert-blame/expert-blame.service.ts @@ -381,6 +381,8 @@ export class ExpertBlameService { firstParty: statementToFormKey(firstParty?.statement) ?? "", secondParty: statementToFormKey(secondParty?.statement) ?? "", }, + firstPartyVehicle: doc.parties[0]?.person?.vehicle?.name, + secondPartyVehicle: doc.parties[1]?.person?.vehicle?.name, }; } diff --git a/src/expert-claim/expert-claim.service.ts b/src/expert-claim/expert-claim.service.ts index f05980d..d37dc20 100644 --- a/src/expert-claim/expert-claim.service.ts +++ b/src/expert-claim/expert-claim.service.ts @@ -2828,11 +2828,33 @@ export class ExpertClaimService { } // Build damaged parts map + const getPartLabelFa = (key: string): string => { + const labels: Record = { + hood: "کاپوت", + trunk: "صندوق عقب", + roof: "سقف", + front_right_door: "درب جلو راست", + front_left_door: "درب جلو چپ", + rear_right_door: "درب عقب راست", + rear_left_door: "درب عقب چپ", + front_bumper: "سپر جلو", + rear_bumper: "سپر عقب", + front_right_fender: "گلگیر جلو راست", + front_left_fender: "گلگیر جلو چپ", + rear_right_fender: "گلگیر عقب راست", + rear_left_fender: "گلگیر عقب چپ", + }; + return labels[key] || key; + }; const damagedPartsData = claim.media?.damagedParts as any; - const damagedParts: Record = {}; + const damagedParts: Record< + string, + { label_fa: string; captured: boolean; url?: string } + > = {}; for (const p of claim.damage?.selectedParts || []) { const cap = hasCapture(damagedPartsData, p); damagedParts[p] = { + label_fa: getPartLabelFa(p), captured: !!cap, url: cap?.url || (cap?.path ? buildFileLink(cap.path) : undefined), };