This commit is contained in:
SepehrYahyaee
2026-04-25 17:38:01 +03:30
parent 05c5b70b4d
commit 7184142137
4 changed files with 28 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ export class AiService implements OnModuleInit {
username: process.env.AI_USERNAME, username: process.env.AI_USERNAME,
password: process.env.AI_PASSWORD, password: process.env.AI_PASSWORD,
}, },
timeout: 30000, // 30 second timeout timeout: 1000, // 30 second timeout
}; };
private get profileOptions(): AxiosRequestConfig { private get profileOptions(): AxiosRequestConfig {

View File

@@ -117,6 +117,8 @@ export class AllRequestDtoV2 {
type: string; type: string;
blameStatus: string; blameStatus: string;
partiesInitialForms: { firstParty: string; secondParty: string }; partiesInitialForms: { firstParty: string; secondParty: string };
firstPartyVehicle: string;
secondPartyVehicle?: string;
} }
export class AllRequestDtoRsV2 { export class AllRequestDtoRsV2 {

View File

@@ -381,6 +381,8 @@ export class ExpertBlameService {
firstParty: statementToFormKey(firstParty?.statement) ?? "", firstParty: statementToFormKey(firstParty?.statement) ?? "",
secondParty: statementToFormKey(secondParty?.statement) ?? "", secondParty: statementToFormKey(secondParty?.statement) ?? "",
}, },
firstPartyVehicle: doc.parties[0]?.person?.vehicle?.name,
secondPartyVehicle: doc.parties[1]?.person?.vehicle?.name,
}; };
} }

View File

@@ -2828,11 +2828,33 @@ export class ExpertClaimService {
} }
// Build damaged parts map // Build damaged parts map
const getPartLabelFa = (key: string): string => {
const labels: Record<string, string> = {
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 damagedPartsData = claim.media?.damagedParts as any;
const damagedParts: Record<string, { captured: boolean; url?: string }> = {}; const damagedParts: Record<
string,
{ label_fa: string; captured: boolean; url?: string }
> = {};
for (const p of claim.damage?.selectedParts || []) { for (const p of claim.damage?.selectedParts || []) {
const cap = hasCapture(damagedPartsData, p); const cap = hasCapture(damagedPartsData, p);
damagedParts[p] = { damagedParts[p] = {
label_fa: getPartLabelFa(p),
captured: !!cap, captured: !!cap,
url: cap?.url || (cap?.path ? buildFileLink(cap.path) : undefined), url: cap?.url || (cap?.path ? buildFileLink(cap.path) : undefined),
}; };