feat: Add feature in component and piece for support group
This commit is contained in:
@@ -33,6 +33,10 @@ export class CreateComposantDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typeComposantId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
composantModelId?: string;
|
||||
}
|
||||
|
||||
export class UpdateComposantDto {
|
||||
@@ -60,4 +64,8 @@ export class UpdateComposantDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typeComposantId?: string;
|
||||
}
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
composantModelId?: string;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -33,6 +33,10 @@ export class CreatePieceDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typePieceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
pieceModelId?: string;
|
||||
}
|
||||
|
||||
export class UpdatePieceDto {
|
||||
@@ -60,4 +64,8 @@ export class UpdatePieceDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typePieceId?: string;
|
||||
}
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
pieceModelId?: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { IsString, IsOptional, IsArray, IsObject, IsBoolean, IsEnum } from 'class-validator';
|
||||
import { IsString, IsOptional, IsArray, IsObject, IsBoolean, IsEnum, IsInt } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { ValidateNested } from 'class-validator';
|
||||
|
||||
export enum CustomFieldType {
|
||||
TEXT = 'text',
|
||||
@@ -50,6 +52,56 @@ export class UpdateCustomFieldDto {
|
||||
options?: string[];
|
||||
}
|
||||
|
||||
export class TypeMachineComponentRequirementDto {
|
||||
@IsString()
|
||||
typeComposantId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
label?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
minCount?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
maxCount?: number | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
required?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
allowNewModels?: boolean;
|
||||
}
|
||||
|
||||
export class TypeMachinePieceRequirementDto {
|
||||
@IsString()
|
||||
typePieceId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
label?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
minCount?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
maxCount?: number | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
required?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
allowNewModels?: boolean;
|
||||
}
|
||||
|
||||
export class CreateTypeMachineDto {
|
||||
@IsString()
|
||||
name: string;
|
||||
@@ -77,6 +129,18 @@ export class CreateTypeMachineDto {
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
customFields?: CreateCustomFieldDto[];
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TypeMachineComponentRequirementDto)
|
||||
componentRequirements?: TypeMachineComponentRequirementDto[];
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TypeMachinePieceRequirementDto)
|
||||
pieceRequirements?: TypeMachinePieceRequirementDto[];
|
||||
}
|
||||
|
||||
export class UpdateTypeMachineDto {
|
||||
@@ -107,6 +171,18 @@ export class UpdateTypeMachineDto {
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
customFields?: CreateCustomFieldDto[];
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TypeMachineComponentRequirementDto)
|
||||
componentRequirements?: TypeMachineComponentRequirementDto[];
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TypeMachinePieceRequirementDto)
|
||||
pieceRequirements?: TypeMachinePieceRequirementDto[];
|
||||
}
|
||||
|
||||
export class CreateTypeComposantDto {
|
||||
@@ -161,4 +237,68 @@ export class UpdateTypePieceDto {
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
customFields?: CreateCustomFieldDto[];
|
||||
}
|
||||
}
|
||||
|
||||
export class CreateComposantModelDto {
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@IsString()
|
||||
typeComposantId: string;
|
||||
|
||||
@IsOptional()
|
||||
structure?: any;
|
||||
}
|
||||
|
||||
export class UpdateComposantModelDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
name?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typeComposantId?: string;
|
||||
|
||||
@IsOptional()
|
||||
structure?: any;
|
||||
}
|
||||
|
||||
export class CreatePieceModelDto {
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@IsString()
|
||||
typePieceId: string;
|
||||
|
||||
@IsOptional()
|
||||
structure?: any;
|
||||
}
|
||||
|
||||
export class UpdatePieceModelDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
name?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typePieceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
structure?: any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user