feat: Add feature in component and piece for support group
This commit is contained in:
@@ -1,4 +1,30 @@
|
||||
import { IsString, IsOptional, IsDecimal } from 'class-validator';
|
||||
import { IsString, IsOptional, IsDecimal, IsArray } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { ValidateNested } from 'class-validator';
|
||||
|
||||
export class MachineComponentSelectionDto {
|
||||
@IsString()
|
||||
requirementId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
componentModelId?: string;
|
||||
|
||||
@IsOptional()
|
||||
definition?: any;
|
||||
}
|
||||
|
||||
export class MachinePieceSelectionDto {
|
||||
@IsString()
|
||||
requirementId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
pieceModelId?: string;
|
||||
|
||||
@IsOptional()
|
||||
definition?: any;
|
||||
}
|
||||
|
||||
export class CreateMachineDto {
|
||||
@IsString()
|
||||
@@ -26,6 +52,18 @@ export class CreateMachineDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typeMachineId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => MachineComponentSelectionDto)
|
||||
componentSelections?: MachineComponentSelectionDto[];
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => MachinePieceSelectionDto)
|
||||
pieceSelections?: MachinePieceSelectionDto[];
|
||||
}
|
||||
|
||||
export class UpdateMachineDto {
|
||||
|
||||
Reference in New Issue
Block a user