Removed some validations that were unneccesary for expert submit

This commit is contained in:
SepehrYahyaee
2026-09-06 12:09:34 +03:30
parent 233a16d96c
commit c9b5b6f765
5 changed files with 74 additions and 43 deletions

View File

@@ -12,7 +12,7 @@ import {
IsInt,
} from 'class-validator';
import { Type } from 'class-transformer';
import { IsRepairLineAmountToman } from 'src/common/validators/repair-line-amount-toman.validator';
import { IsMoneyAmountString } from 'src/common/validators/money-amount-string.validator';
import { ClaimRequiredDocumentType } from 'src/Types&Enums/claim-request-management/required-document-type.enum';
import { DamagedPartItem } from 'src/claim-request-management/dto/capture-requirements-v2.dto';
import { DaghiOption } from 'src/Types&Enums/claim-request-management/daghi-option.enum';
@@ -35,7 +35,7 @@ export class DaghiDetailsV2Dto {
)
@IsString()
@IsNotEmpty()
@IsRepairLineAmountToman()
@IsMoneyAmountString()
price?: string;
@ApiPropertyOptional({
@@ -56,24 +56,24 @@ export class PartPricingV2Dto {
@ApiProperty({
enum: TypeOfDamage,
description: "'repair' requires price; 'change' may omit it.",
description: "'change' requires price; 'repair' may omit it.",
})
@IsEnum(TypeOfDamage)
typeOfDamage: TypeOfDamage;
@ApiPropertyOptional({
example: "5000000",
description: "Required for repair lines; omitted for change lines. Use 0 if the full amount is in salary.",
description: "Required for change lines; omitted for repair lines. Use 0 if unused.",
})
@ValidateIf(
(part: PartPricingV2Dto) =>
part.typeOfDamage === TypeOfDamage.Repair ||
part.typeOfDamage === TypeOfDamage.Change ||
(part.price != null &&
(typeof part.price !== 'string' || part.price.trim() !== '')),
)
@IsString()
@IsNotEmpty()
@IsRepairLineAmountToman({ allowZero: true })
@IsMoneyAmountString()
price: string;
@ApiProperty({
@@ -82,7 +82,7 @@ export class PartPricingV2Dto {
})
@IsString()
@IsNotEmpty()
@IsRepairLineAmountToman({ allowZero: true })
@IsMoneyAmountString()
salary: string;
@ApiProperty({
@@ -91,7 +91,7 @@ export class PartPricingV2Dto {
})
@IsString()
@IsNotEmpty()
@IsRepairLineAmountToman({ allowZero: true })
@IsMoneyAmountString()
totalPayment: string;
@ApiPropertyOptional({