forked from Yara724/api
Map Fanavaran people and licences by party role; allow unlisted base-info lookups.
Resolve driver, owner, and policyholder from participants when they differ, prefer real licence / driverLicenseDate over dummies, and fall back unknown /lookups/fanavaran/{name} to car/base-info/{name} (including vehicle-groups).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -107,6 +107,29 @@ describe("fanavaran claim product", () => {
|
||||
expect(nationalCode).toBe("0012345678");
|
||||
});
|
||||
|
||||
it("prefers CAR_BODY_POLICYHOLDER participant over person.nationalCodeOfInsurer", () => {
|
||||
const nationalCode = pickCarBodyPolicyNationalCode({
|
||||
parties: [
|
||||
{
|
||||
role: PartyRole.FIRST,
|
||||
person: { nationalCodeOfInsurer: "0012345678" },
|
||||
participants: [
|
||||
{
|
||||
participantId: "CAR_BODY_POLICYHOLDER",
|
||||
nationalCode: "0499370899",
|
||||
birthday: "1368/05/20",
|
||||
},
|
||||
],
|
||||
participantRoles: {
|
||||
carBodyPolicyholder: "CAR_BODY_POLICYHOLDER",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(nationalCode).toBe("0499370899");
|
||||
});
|
||||
|
||||
it("flattens car-body inquiry fields onto the damage-case aliases", () => {
|
||||
const { mapped } = fanavaranPartyInquirySources("car-body", {
|
||||
insurance: {
|
||||
|
||||
Reference in New Issue
Block a user