import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { IsString, IsNotEmpty, IsArray, IsBoolean, IsOptional, ValidateNested, } from 'class-validator'; import { Type } from 'class-transformer'; 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'; export class CarPartDamageV2Dto { @ApiProperty({ example: 'left' }) @IsString() side: string; @ApiProperty({ example: 'front_door' }) @IsString() part: string; } export class PartPricingV2Dto { @ApiProperty({ example: 'part-001' }) @IsString() @IsNotEmpty() partId: string; @ApiProperty({ type: CarPartDamageV2Dto }) @ValidateNested() @Type(() => CarPartDamageV2Dto) carPartDamage: CarPartDamageV2Dto; @ApiProperty({ example: 'Minor' }) @IsString() typeOfDamage: string; @ApiProperty({ example: '5000000' }) @IsString() price: string; @ApiProperty({ example: '2000000' }) @IsString() salary: string; @ApiProperty({ example: '7000000' }) @IsString() totalPayment: string; @ApiPropertyOptional({ example: '500000' }) @IsOptional() @IsString() daghi?: string; @ApiProperty({ example: false }) @IsBoolean() factorNeeded: boolean; } export class SubmitExpertReplyV2Dto { @ApiProperty({ example: 'Front door and hood have severe paint damage' }) @IsString() @IsNotEmpty() description: string; @ApiProperty({ type: [PartPricingV2Dto] }) @IsArray() @ValidateNested({ each: true }) @Type(() => PartPricingV2Dto) parts: PartPricingV2Dto[]; } export class ClaimSubmitResendV2Dto { @ApiProperty({ required: true }) resendDescription: string; @ApiProperty({ required: true, examples: ClaimRequiredDocumentType }) resendDocuments: ClaimRequiredDocumentType[]; @ApiProperty({ required: true, type: [DamagedPartItem] }) resendCarParts: DamagedPartItem[]; }