fixed branch being mandatory

This commit is contained in:
SepehrYahyaee
2026-09-12 10:18:17 +03:30
parent 55da8188a9
commit ebe45646c1
7 changed files with 209 additions and 1 deletions

View File

@@ -230,4 +230,38 @@ describe("buildInsurerFileReport", () => {
"نیاز به تعویض سپر جلو",
);
});
it("uses the stored V4 licence type for a driver who differs from the policyholder", () => {
const report = buildInsurerFileReport({
overview: { publicId: "A00011" },
blame: {
type: "THIRD_PARTY",
parties: [
{
role: "FIRST",
person: { userId: "guilty", fullName: "مقصر" },
},
{
role: "SECOND",
person: {
userId: "damaged",
fullName: "بیمه‌گذار زیان‌دیده",
driverIsInsurer: false,
nationalCodeOfDriver: "0123456789",
driverLicense: "L-123",
licenseType: "پایه یک",
},
},
],
expert: { decision: { guiltyPartyId: "guilty" } },
},
});
expect(getFieldValue(report, PR.driverSection, PR.nationalCode)).toBe(
"0123456789",
);
expect(getFieldValue(report, PR.driverSection, PR.licenseType)).toBe(
"پایه یک",
);
});
});

View File

@@ -565,7 +565,10 @@ function buildDriverSection(
{ label: PR.name, value: asString(person.fullName) },
{
label: PR.licenseType,
value: licenseType ?? (person.driverLicense ? PR.driverLicense : undefined),
value:
licenseType ??
asString(person.licenseType) ??
(person.driverLicense ? PR.driverLicense : undefined),
},
{
label: PR.licenseDate,