fix(car-body): validate policy coverage on accident date

Validate hull coverage against the accident date, select the covering renewal, and defer validation until that date is collected.
This commit is contained in:
2026-11-21 12:04:09 +03:30
parent 8f15040080
commit 5c6e21dd14
13 changed files with 499 additions and 56 deletions
+9
View File
@@ -874,6 +874,13 @@ export class LookupsController {
@ApiQuery({ name: "plaqueLetter", required: false, example: "ب" })
@ApiQuery({ name: "plaqueRight", required: false, example: "345" })
@ApiQuery({ name: "plaqueSerial", required: false, example: "67" })
@ApiQuery({
name: "accidentDate",
required: false,
example: "1405/05/18",
description:
"Coverage date (Jalali or Gregorian). Without it, coverage validation is deferred.",
})
@ApiOkResponse({
description: "Mapped last body policy plus vehicle",
schema: { type: "object" },
@@ -885,9 +892,11 @@ export class LookupsController {
@Query("plaqueLetter") plaqueLetter?: string,
@Query("plaqueRight") plaqueRight?: string,
@Query("plaqueSerial") plaqueSerial?: string,
@Query("accidentDate") accidentDate?: string,
) {
return this.lookupsService.findLastProcessedCarPolicy("car-body", {
nationalCode,
accidentDate,
vin,
plaqueLeft,
plaqueLetter,