forked from Yara724/api
25 lines
818 B
TypeScript
25 lines
818 B
TypeScript
import { ApiPropertyOptional } from "@nestjs/swagger";
|
|
import { Type } from "class-transformer";
|
|
import { IsArray, IsOptional, ValidateNested } from "class-validator";
|
|
import { NewPartDto, UserObjectionPartDto } from "./user-objection.dto";
|
|
|
|
/**
|
|
* V2 user objection body — same shape as v1 {@link import("./user-objection.dto").UserObjectionDto}
|
|
* with nested validation enabled for the v2 controller pipeline.
|
|
*/
|
|
export class UserObjectionV2Dto {
|
|
@ApiPropertyOptional({ type: [UserObjectionPartDto] })
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => UserObjectionPartDto)
|
|
objectionParts?: UserObjectionPartDto[];
|
|
|
|
@ApiPropertyOptional({ type: [NewPartDto] })
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => NewPartDto)
|
|
newParts?: NewPartDto[];
|
|
}
|