HOTFIX: not allowing empty price when expert tries to submit

This commit is contained in:
SepehrYahyaee
2026-09-05 16:44:40 +03:30
parent 70fa49398d
commit feacad58ca
7 changed files with 200 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
import { plainToInstance } from "class-transformer";
import { validate } from "class-validator";
import { DaghiOption } from "src/Types&Enums/claim-request-management/daghi-option.enum";
import { SubmitExpertReplyV2Dto } from "./expert-claim-v2.dto";
describe("SubmitExpertReplyV2Dto", () => {
it("rejects a selected damaged part with blank pricing", async () => {
const dto = plainToInstance(SubmitExpertReplyV2Dto, {
description: "Damage assessment",
parts: [
{
partId: 201,
typeOfDamage: "Minor",
price: "",
salary: "",
totalPayment: "",
factorNeeded: false,
daghi: { option: DaghiOption.NO_VALUE },
},
],
});
const errors = await validate(dto);
expect(errors).not.toHaveLength(0);
});
});