Fixed daqi being enforced on REPAIR

This commit is contained in:
SepehrYahyaee
2026-09-05 18:42:07 +03:30
parent e48dffef89
commit 233a16d96c
6 changed files with 107 additions and 26 deletions

View File

@@ -27,6 +27,31 @@ function createService() {
}
describe("ExpertClaimService expert-reply pricing", () => {
it("allows a repair line without daghi and removes a stray daghi payload", () => {
const service = createService() as any;
expect(
service.validateAndNormalizeDaghiForExpertReplyV2([
{
partId: 201,
typeOfDamage: TypeOfDamage.Repair,
price: "10000",
salary: "0",
totalPayment: "10000",
daghi: { option: DaghiOption.NO_VALUE },
},
]),
).toEqual([
{
partId: 201,
typeOfDamage: TypeOfDamage.Repair,
price: "10000",
salary: "0",
totalPayment: "10000",
},
]);
});
it("rejects a blank pricing line on the legacy submit endpoint before changing status", async () => {
const service = createService() as any;
const findAndUpdate = jest.fn();