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:
@@ -37,6 +37,26 @@ describe("SandHubService inquiry mocks", () => {
|
||||
},
|
||||
} as SandHubDetailDto;
|
||||
|
||||
it.each(["IRNKAEK4150012345", userDetail.plate])(
|
||||
"forwards only accidentDate for dated hull inquiries (%s)",
|
||||
async (plate) => {
|
||||
externalInquirySettings.isInquiryLive.mockResolvedValue(true);
|
||||
lookupsService.findLastProcessedCarPolicy.mockResolvedValue({
|
||||
policy: {},
|
||||
vehicle: {},
|
||||
});
|
||||
await service.getCarBodyInquiry({
|
||||
...userDetail,
|
||||
plate,
|
||||
accidentDate: "1400/12/28",
|
||||
});
|
||||
expect(lookupsService.findLastProcessedCarPolicy).toHaveBeenCalledWith(
|
||||
"car-body",
|
||||
expect.objectContaining({ accidentDate: "1400/12/28" }),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
process.env.CLIENT_ID = "8";
|
||||
|
||||
Reference in New Issue
Block a user