forked from Yara724/api
fix(fanavaran): honor supplied submission payload fields
Apply every supplied JSON field over generated defaults, preserving IDs, nested values and explicit nulls across base, damage and expertise submits. Validate manual hull payloads without rewriting their values or premium, and derive an empty replacement flag for old hull licences.
This commit is contained in:
@@ -223,4 +223,13 @@ describe("expertise submit completes earlier Fanavaran stages", () => {
|
||||
"expertise",
|
||||
]);
|
||||
});
|
||||
it("applies arbitrary expertise fields and replaces supplied damage sections", async () => {
|
||||
const { service } = setup("car-body");
|
||||
const body = { ClaimExpertId: 999, DmgSections: [{ AccessoryKindId: 42 }], CustomField: null };
|
||||
await service.submitFanavaranExpertiseV2("claim-1", "parsian", body);
|
||||
expect(service.executeFanavaranExpertiseSubmit).toHaveBeenCalledWith(
|
||||
"claim-1", "parsian", expect.objectContaining(body), expect.anything(), true,
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user