forked from Yara724/api
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user