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:
2026-11-21 13:33:41 +03:30
parent 83d7351310
commit 99e6fa0850
10 changed files with 334 additions and 90 deletions
@@ -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,
);
});
});