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

@@ -3,6 +3,7 @@ import {
IsString,
IsNotEmpty,
IsArray,
ArrayMinSize,
IsBoolean,
IsOptional,
ValidateNested,
@@ -56,6 +57,7 @@ export class PartPricingV2Dto {
description: "Part price in Toman (integer string). Use 0 if the full amount is in salary.",
})
@IsString()
@IsNotEmpty()
@IsRepairLineAmountToman({ allowZero: true })
price: string;
@@ -64,6 +66,7 @@ export class PartPricingV2Dto {
description: "Labor in Toman (integer string). Use 0 if the full amount is in price.",
})
@IsString()
@IsNotEmpty()
@IsRepairLineAmountToman({ allowZero: true })
salary: string;
@@ -72,6 +75,7 @@ export class PartPricingV2Dto {
description: "Line total in Toman (integer string).",
})
@IsString()
@IsNotEmpty()
@IsRepairLineAmountToman()
totalPayment: string;
@@ -101,6 +105,7 @@ export class SubmitExpertReplyV2Dto {
"One line per damaged part (`partId` from claim detail `damagedParts[]`), plus pricing, `daghi`, and `factorNeeded`.",
})
@IsArray()
@ArrayMinSize(1)
@ValidateNested({ each: true })
@Type(() => PartPricingV2Dto)
parts: PartPricingV2Dto[];