updated the fucking mf fanavaran

This commit is contained in:
2026-09-07 16:33:15 +03:30
parent 395e3dbe63
commit b9bffdccc1
5 changed files with 423 additions and 114 deletions

View File

@@ -1,4 +1,5 @@
import {
collectPartyVinCandidates,
filterPoliciesByLine,
insuranceLineLabel,
parseLastCarPolicyInput,
@@ -114,6 +115,39 @@ describe("fanavaran last car policy", () => {
).toBe("NAS451100P4934023");
});
it("does not let chassis stored on vehicle.vin beat the inquiry VIN", () => {
const party = {
vehicle: {
vin: "NAAN01CA9BK493683",
inquiry: {
mapped: {
VIN: "IRFC901V119493683",
ChassisNo: "NAAN01CA9BK493683",
},
},
},
};
expect(pickVinFromPartyVehicle(party)).toBe("IRFC901V119493683");
expect(collectPartyVinCandidates(party)).toEqual([
"IRFC901V119493683",
"NAAN01CA9BK493683",
]);
});
it("prefers the VIN-inquiry row that already has PlaqueKindId", () => {
expect(
pickFanavaranVehicleFromInquiry([
{ Id: 1, VIN: "IRFC901V119493683" },
{ Id: 2, VIN: "IRFC901V119493683", PlaqueKindId: 15, PlaqueSampleId: 24 },
]),
).toEqual({
Id: 2,
VIN: "IRFC901V119493683",
PlaqueKindId: 15,
PlaqueSampleId: 24,
});
});
it("reads plaque kind and sample from VIN inquiry for the lookup filter", () => {
expect(
pickFanavaranPlaqueLookupFields({