forked from Yara724/api
Fixed resendCarParts label_fa's + OTP
This commit is contained in:
@@ -114,6 +114,7 @@ import {
|
||||
sanitizeDamageSelectedPartV2,
|
||||
type DamageSelectedPartV2,
|
||||
} from "src/helpers/outer-damage-parts";
|
||||
import { normalizeResendCarPartsForStorage } from "src/helpers/claim-expert-resend";
|
||||
import { ClaimVehicleTypeV2 } from "src/static/outer-car-parts-catalog";
|
||||
import { snapshotFromDamageExpert } from "src/helpers/expert-profile-snapshot";
|
||||
import { DamageExpertModel } from "src/users/entities/schema/damage-expert.schema";
|
||||
@@ -2712,19 +2713,12 @@ export class ExpertClaimService {
|
||||
}
|
||||
const uniqueDocs = [...new Set(docs)];
|
||||
|
||||
const normalizedParts = (reply.resendCarParts ?? []).map((p) => {
|
||||
const row: Record<string, unknown> = {
|
||||
key: p.key,
|
||||
label_fa: p.label_fa,
|
||||
label_en: p.label_en,
|
||||
captured: false,
|
||||
};
|
||||
const id = (p as { id?: number }).id;
|
||||
if (typeof id === "number" && Number.isFinite(id)) {
|
||||
row.id = Math.trunc(id);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
const carType = claim.vehicle?.carType as ClaimVehicleTypeV2 | undefined;
|
||||
const normalizedParts = normalizeResendCarPartsForStorage(
|
||||
reply.resendCarParts,
|
||||
carType,
|
||||
claim.damage?.selectedParts,
|
||||
);
|
||||
|
||||
const desc = String(reply.resendDescription ?? "").trim();
|
||||
if (!desc && uniqueDocs.length === 0 && normalizedParts.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user