forked from Yara724/api
Fixed Participants
This commit is contained in:
@@ -115,4 +115,34 @@ describe("inquiry participant persistence", () => {
|
||||
|
||||
expect(() => (query as any)._castUpdate(query.getUpdate())).not.toThrow();
|
||||
});
|
||||
|
||||
it("stores the previous policyholder national code with transferred vehicle data", () => {
|
||||
const BlameRequestModel = model<BlameRequest>(
|
||||
"PreviousPolicyholderPersistenceTest",
|
||||
BlameRequestSchema,
|
||||
);
|
||||
const request = new BlameRequestModel({
|
||||
requestNo: "BL-PREVIOUS-POLICYHOLDER",
|
||||
publicId: "PREVIOUS-POLICYHOLDER",
|
||||
type: BlameRequestType.THIRD_PARTY,
|
||||
parties: [
|
||||
{
|
||||
role: PartyRole.FIRST,
|
||||
person: {},
|
||||
vehicle: {
|
||||
plateId: "22-44-ب-111",
|
||||
previousPlateId: "33-55-ج-222",
|
||||
previousPolicyholderNationalCode: "0098765432",
|
||||
registrationState: "RECENTLY_TRANSFERRED",
|
||||
vin: "NAAM01E15HK123456",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(request.validateSync()).toBeUndefined();
|
||||
expect(request.parties[0].vehicle?.previousPolicyholderNationalCode).toBe(
|
||||
"0098765432",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user