feat: Add feature in component and piece for support group

This commit is contained in:
Matthieu
2025-09-22 08:35:36 +02:00
parent b8559be031
commit b6ca9ae54b
13 changed files with 1550 additions and 206 deletions

View File

@@ -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 {