forked from Yara724/api
YARA-837
This commit is contained in:
@@ -5009,8 +5009,30 @@ export class ClaimRequestManagementService {
|
||||
};
|
||||
}
|
||||
|
||||
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 }
|
||||
> = {};
|
||||
const resendPartKeys = normalizeResendPartKeys(
|
||||
claim.evaluation?.damageExpertResend?.resendCarParts,
|
||||
);
|
||||
@@ -5021,6 +5043,7 @@ export class ClaimRequestManagementService {
|
||||
for (const p of partKeysForDetails) {
|
||||
const cap = hasCapture(damagedPartsData, p);
|
||||
damagedParts[p] = {
|
||||
label_fa: getPartLabelFa(p),
|
||||
captured: !!cap,
|
||||
url: cap?.url || (cap?.path ? buildFileLink(cap.path) : undefined),
|
||||
};
|
||||
@@ -5080,6 +5103,12 @@ export class ClaimRequestManagementService {
|
||||
carAngles,
|
||||
damagedParts,
|
||||
expertResend,
|
||||
evaluation: claim.evaluation
|
||||
? {
|
||||
damageExpertReply: claim.evaluation.damageExpertReply,
|
||||
damageExpertReplyFinal: claim.evaluation.damageExpertReplyFinal,
|
||||
}
|
||||
: undefined,
|
||||
...(isExpertViewer
|
||||
? {
|
||||
userRating: claim.userRating
|
||||
|
||||
@@ -76,7 +76,7 @@ export class ClaimDetailsV2ResponseDto {
|
||||
carAngles?: Record<string, { captured: boolean; url?: string }>;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Damaged parts captured' })
|
||||
damagedParts?: Record<string, { captured: boolean; url?: string }>;
|
||||
damagedParts?: Record<string, { label_fa: string; captured: boolean; url?: string }>;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
@@ -84,6 +84,15 @@ export class ClaimDetailsV2ResponseDto {
|
||||
})
|
||||
expertResend?: ExpertResendDetailsV2Dto;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description: "Damage expert opinion(s): initial and final (after objection).",
|
||||
type: Object,
|
||||
})
|
||||
evaluation?: {
|
||||
damageExpertReply?: unknown;
|
||||
damageExpertReplyFinal?: unknown;
|
||||
};
|
||||
|
||||
@ApiPropertyOptional({ description: 'User satisfaction rating (if submitted)' })
|
||||
userRating?: {
|
||||
progressSpeed: number;
|
||||
|
||||
Reference in New Issue
Block a user