forked from Yara724/api
fix claim validation and expert branch scoping
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
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";
|
||||
|
||||
/**
|
||||
@@ -6,6 +13,19 @@ import { CarDamagePartDto } from "src/claim-request-management/dto/car-part.dto"
|
||||
* 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,
|
||||
|
||||
Reference in New Issue
Block a user