forked from Yara724/api
Fixed resendCarParts label_fa's + OTP
This commit is contained in:
@@ -84,6 +84,7 @@ import { UserRatingDto } from "./dto/user-rating.dto";
|
||||
import {
|
||||
canFinalizeExpertResend,
|
||||
documentKeyAllowedForExpertResend,
|
||||
mapExpertResendCarPartsForClient,
|
||||
normalizeResendDocumentKeys,
|
||||
normalizeResendPartKeys,
|
||||
partKeyAllowedForExpertResend,
|
||||
@@ -4753,7 +4754,11 @@ export class ClaimRequestManagementService {
|
||||
}
|
||||
if (
|
||||
normalizeResendDocumentKeys(r.resendDocuments).length > 0 ||
|
||||
normalizeResendPartKeys(r.resendCarParts).length > 0
|
||||
normalizeResendPartKeys(
|
||||
r.resendCarParts,
|
||||
claimCase.vehicle?.carType as ClaimVehicleTypeV2 | undefined,
|
||||
claimCase.damage?.selectedParts,
|
||||
).length > 0
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
"Upload all requested documents and part photos before completing the resend step.",
|
||||
@@ -6142,6 +6147,8 @@ export class ClaimRequestManagementService {
|
||||
const damagedPartsData = claim.media?.damagedParts as any;
|
||||
const resendPartKeys = normalizeResendPartKeys(
|
||||
claim.evaluation?.damageExpertResend?.resendCarParts,
|
||||
carTypeDetails,
|
||||
claim.damage?.selectedParts,
|
||||
);
|
||||
const displayParts = [...selectedNormDetails];
|
||||
const seenDetailKeys = new Set(
|
||||
@@ -6190,7 +6197,12 @@ export class ClaimRequestManagementService {
|
||||
? {
|
||||
resendDescription: er.resendDescription,
|
||||
resendDocuments: normalizeResendDocumentKeys(er.resendDocuments),
|
||||
resendCarParts: Array.isArray(er.resendCarParts) ? er.resendCarParts : [],
|
||||
resendCarParts: mapExpertResendCarPartsForClient(er.resendCarParts, {
|
||||
carType: carTypeDetails,
|
||||
selectedParts: claim.damage?.selectedParts,
|
||||
damagedPartsData: claim.media?.damagedParts,
|
||||
buildUrl: (path) => buildFileLink(path),
|
||||
}),
|
||||
fulfilledAt: er.fulfilledAt,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
@@ -67,8 +67,24 @@ export class ExpertResendDetailsV2Dto {
|
||||
@ApiPropertyOptional({ type: [String] })
|
||||
resendDocuments?: string[];
|
||||
|
||||
@ApiPropertyOptional({ type: [Object] })
|
||||
resendCarParts?: Array<{ key?: string; label_fa?: string; label_en?: string }>;
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
"Damaged parts the expert asked to re-capture (same shape as damagedParts: id, name, side, label_fa, catalogKey, captured, url).",
|
||||
type: [Object],
|
||||
})
|
||||
resendCarParts?: Array<{
|
||||
id?: number | null;
|
||||
name?: string;
|
||||
side?: string;
|
||||
label_fa?: string;
|
||||
label_en?: string;
|
||||
catalogKey?: string;
|
||||
key?: string;
|
||||
captured?: boolean;
|
||||
url?: string;
|
||||
path?: string;
|
||||
fileName?: string;
|
||||
}>;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Set when the owner satisfied the resend request' })
|
||||
fulfilledAt?: Date;
|
||||
|
||||
Reference in New Issue
Block a user