Fix damaged vehicle identity across claim panels and price estimates

This commit is contained in:
SepehrYahyaee
2026-10-06 14:20:15 +03:30
parent b11128c638
commit 4564798db1
10 changed files with 375 additions and 199 deletions
@@ -323,6 +323,25 @@ describe("price estimate input isolation", () => {
const safe = JSON.stringify(publicEstimateContext(input));
expect(safe).not.toMatch(/PRIVATE|CULPRIT|WRONG-OWNER|files\/claim/);
});
it("does not send the unrelated 111SE variant from a conflicting FAW inquiry", () => {
const { claim, blame } = source();
blame.parties[1].vehicle = {
name: "فائو ( FAW )",
model: "111SE",
inquiry: {
mapped: {
MapTypNam: "فائو ( FAW )",
SystemField: "سايپا",
TypeField: "111SE",
},
},
};
const input = buildEstimateContext(claim, blame, {});
expect(input.vehicle.make).toBe("فائو ( FAW )");
expect(input.vehicle.model).toBeNull();
expect(input.warnings.join(" ")).toContain("هم‌خوان نیست");
expect(JSON.stringify(publicEstimateContext(input))).not.toContain("111SE");
});
it("uses body insurance FIRST, expert-approved vehicle names and supplied current market value", () => {
const { claim, blame } = source();
blame.type = "CAR_BODY";