Files
yara724-api/docs/driver-licence-issue-date.md
T
SepehrYahyaee a15c54d017 feat: route user claims by branch and align licence issue dates
Require the damaged party in user flows to select an active insurer branch and preserve branch access rules. Accept older licence issue dates, correct anniversary boundaries, and update Fanavaran audit documentation and regression coverage.
2026-11-14 12:24:14 +03:30

39 lines
1.9 KiB
Markdown

# Driver licence issue dates
Updated: 2026-11-14.
The inquiry field is the **issue date**, `driver.driverLicenseDate`, labelled
«تاریخ صدور گواهینامه». It is not an expiry date. Both UIs keep the existing
structured inquiry contract and send the actual selected date. No replacement
checkbox or client-generated Fanavaran status is added.
For a licensed driver, the date is still required and must be valid and not in
the future. The ten-year lower bound has been removed from both UI schemas and
the shared API inquiry validator; otherwise an older date would pass the form
and still fail at submission. Drivers without a licence retain their existing
payload behavior, which omits the licence date.
The API derives the Fanavaran flag against the **accident date**, preserving the
mapping introduced by the pulled changes:
| Age at accident | Outbound value |
|---|---|
| Through the third issue-date anniversary | `0` |
| After the third anniversary through the tenth anniversary | `null` |
| After the tenth anniversary | `1` |
Hull uses `IsLicenseReplaced`; third-party uses `IsLicenseReplacement`. Recent
licences still receive explicit `0` because the current Fanavaran rule requires
an answer. Users do not enter this flag themselves. Anniversary comparison uses
the actual Jalali year/month/day, so ten years plus one day no longer waits until
eleven completed years to become `1`.
The UIs validate against Iran's current date and reject invalid month/day
combinations rather than accepting a date-picker library's rollover. The
existing missing-date fallback for legacy records remains unchanged.
Validation covers old/current/future dates, invalid Jalali dates, Persian input,
both insurance products, licensed/unlicensed drivers, inquiry payloads, and
three-/ten-year anniversary boundaries. Run `npm run test:ui` in each UI and
`npm test -- --runInBand` in the API.