1
0
forked from Yara724/api

Fixed resendCarParts label_fa's + OTP

This commit is contained in:
SepehrYahyaee
2026-05-25 14:13:17 +03:30
parent 64fa560f73
commit 680f3c1798
10 changed files with 435 additions and 84 deletions

View File

@@ -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;