forked from Yara724/api
Removed some validations that were unneccesary for expert submit
This commit is contained in:
@@ -26,7 +26,7 @@ describe("SubmitExpertReplyV2Dto", () => {
|
||||
expect(errors).not.toHaveLength(0);
|
||||
});
|
||||
|
||||
it("accepts a replacement part without a price", async () => {
|
||||
it("rejects a replacement part without a price", async () => {
|
||||
const dto = plainToInstance(SubmitExpertReplyV2Dto, {
|
||||
description: "Damage assessment",
|
||||
parts: [
|
||||
@@ -41,7 +41,7 @@ describe("SubmitExpertReplyV2Dto", () => {
|
||||
],
|
||||
});
|
||||
|
||||
expect(await validate(dto)).toHaveLength(0);
|
||||
expect(await validate(dto)).not.toHaveLength(0);
|
||||
});
|
||||
|
||||
it("accepts a repair part without daghi", async () => {
|
||||
@@ -61,4 +61,33 @@ describe("SubmitExpertReplyV2Dto", () => {
|
||||
|
||||
expect(await validate(dto)).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("accepts the expert's repair and replacement pricing rules", async () => {
|
||||
const dto = plainToInstance(SubmitExpertReplyV2Dto, {
|
||||
description: "Damage assessment",
|
||||
parts: [
|
||||
{
|
||||
partId: 11,
|
||||
typeOfDamage: TypeOfDamage.Repair,
|
||||
salary: "۵,۰۰۰",
|
||||
totalPayment: "5000",
|
||||
factorNeeded: false,
|
||||
},
|
||||
{
|
||||
partId: 23,
|
||||
typeOfDamage: TypeOfDamage.Change,
|
||||
price: "۵۰,۰۰۰",
|
||||
salary: "۱۰۰,۰۰۰",
|
||||
totalPayment: "150000",
|
||||
factorNeeded: false,
|
||||
daghi: {
|
||||
option: DaghiOption.RECYCLED_PARTS_VALUE,
|
||||
price: "۱۰۰,۵۰۰,۰۰۰",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(await validate(dto)).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user