forked from Yara724/api
Merge pull request 'Fix' (#39) from s.yahyaee/yara724-api:main into main
Reviewed-on: Yara724/api#39
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -117,6 +117,8 @@ export class AllRequestDtoV2 {
|
||||
type: string;
|
||||
blameStatus: string;
|
||||
partiesInitialForms: { firstParty: string; secondParty: string };
|
||||
firstPartyVehicle: string;
|
||||
secondPartyVehicle?: string;
|
||||
}
|
||||
|
||||
export class AllRequestDtoRsV2 {
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -2828,11 +2828,33 @@ export class ExpertClaimService {
|
||||
}
|
||||
|
||||
// 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 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 || []) {
|
||||
const cap = hasCapture(damagedPartsData, p);
|
||||
damagedParts[p] = {
|
||||
label_fa: getPartLabelFa(p),
|
||||
captured: !!cap,
|
||||
url: cap?.url || (cap?.path ? buildFileLink(cap.path) : undefined),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user