Files
yara724api/src/sand-hub/esg-car-body-inquiry.mapper.spec.ts
2026-09-06 14:11:32 +03:30

66 lines
1.8 KiB
TypeScript

import { mapEsgCarBodyPolicyToInquiry } from "./esg-car-body-inquiry.mapper";
describe("mapEsgCarBodyPolicyToInquiry", () => {
it("maps the processed CAR_BODY lookup while retaining useful policy, customer, and vehicle fields", () => {
const mapped = mapEsgCarBodyPolicyToInquiry({
product: "car-body",
insuranceLine: "CAR_BODY",
insuranceLineId: 4,
policyId: 15292336,
policy: {
CINumber: "70019846985",
ContractId: 12525,
BeginDate: "1405/05/18",
EndDate: "1406/05/18",
PolicyIssuDate: "1405/05/18",
VehicleValue: 18510000000,
TotalPremium: 73299600,
EndoNo: 0,
},
customer: {
Name: "سهيل",
LastName: "حاجي زاده",
NationalCode: "4311402422",
Mobile: "09226187419",
},
vehicle: {
BuiltYear: 1403,
ChassisNo: "NAAR03HFFRDE07024",
MotorNo: "172B0222818",
VIN: "NAAR03HFFRDE07024",
vehicleKind: {
Caption: "پژو 207I",
VehicleSystemCaption: "پژو",
CylinderCount: 4,
PassengerCount: 5,
},
used: { Caption: "شخصي" },
plaque: {
leftTwoDigits: "29",
serialLetter: "د",
threeDigits: "782",
rightTwoDigits: "60",
},
},
});
expect(mapped).toMatchObject({
policyNumber: "70019846985",
policyId: 15292336,
contractId: 12525,
insurerName: null,
insurerNationalCode: null,
ownerName: "سهيل حاجي زاده",
ownerNationalCode: "4311402422",
VinNumberField: "NAAR03HFFRDE07024",
MapTypNam: "پژو 207I",
vehicleValue: 18510000000,
totalPremium: 73299600,
platePartOne: "29",
plateLetterTitle: "د",
platePartThree: "782",
plateSerialNumber: "60",
});
});
});