forked from Yara724/api
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import { ApiPropertyOptional } from "@nestjs/swagger";
|
|
import {
|
|
ArrayMinSize,
|
|
ArrayUnique,
|
|
IsArray,
|
|
IsInt,
|
|
IsOptional,
|
|
} from "class-validator";
|
|
import { CarDamagePartDto } from "src/claim-request-management/dto/car-part.dto";
|
|
|
|
/**
|
|
* DTO for field expert to submit claim-needed data in one go (IN_PERSON flow).
|
|
* All fields optional so expert can submit in one or two steps (e.g. car parts first, then sheba/other).
|
|
*/
|
|
export class ExpertCompleteClaimDataDto {
|
|
@ApiPropertyOptional({
|
|
description:
|
|
"Selected damaged-part IDs from the live Fanavaran car-components catalog.",
|
|
example: [9, 10, 30],
|
|
type: [Number],
|
|
})
|
|
@IsOptional()
|
|
@IsArray({ message: "selectedPartIds must be an array" })
|
|
@ArrayMinSize(1, { message: "At least one part ID must be selected" })
|
|
@ArrayUnique({ message: "Duplicate part IDs are not allowed" })
|
|
@IsInt({ each: true, message: "Each selected part ID must be an integer" })
|
|
selectedPartIds?: number[];
|
|
|
|
@ApiPropertyOptional({
|
|
description: "Car part damage selection (same as selectCarPartDamage). Required for first claim data step.",
|
|
type: CarDamagePartDto,
|
|
})
|
|
carPartDamage?: CarDamagePartDto;
|
|
|
|
@ApiPropertyOptional({
|
|
description: "Sheba number",
|
|
example: "IR123456789012345678901234",
|
|
})
|
|
sheba?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: "National code of insurer",
|
|
example: "1234567890",
|
|
})
|
|
nationalCodeOfInsurer?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: "Other parts / extra damage items",
|
|
example: [{ "حسگر درها": true }],
|
|
})
|
|
otherParts?: any[];
|
|
}
|