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

@@ -94,11 +94,17 @@ export class PartPricingV2Dto {
@IsRepairLineAmountToman({ allowZero: true })
totalPayment: string;
@ApiProperty({ type: DaghiDetailsV2Dto })
@ApiPropertyOptional({
type: DaghiDetailsV2Dto,
description: "Required for change lines; omit for repair lines.",
})
@ValidateIf(
(part: PartPricingV2Dto) => part.typeOfDamage === TypeOfDamage.Change,
)
@IsNotEmpty()
@ValidateNested()
@Type(() => DaghiDetailsV2Dto)
daghi: DaghiDetailsV2Dto;
daghi?: DaghiDetailsV2Dto;
@ApiProperty({
example: false,