refactor: prepare multi-machine inventory associations
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { IsString, IsOptional, IsNumber, ValidateIf } from 'class-validator';
|
||||
import { IsString, IsOptional, IsNumber } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
|
||||
export class CreateComposantDto {
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@ValidateIf((dto) => !dto.parentComposantId)
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
machineId?: string;
|
||||
|
||||
@ValidateIf((dto) => !dto.machineId)
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
parentComposantId?: string;
|
||||
|
||||
@@ -30,8 +30,9 @@ export class CreateComposantDto {
|
||||
@IsString()
|
||||
typeComposantId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typeMachineComponentRequirementId: string;
|
||||
typeMachineComponentRequirementId?: string;
|
||||
}
|
||||
|
||||
export class UpdateComposantDto {
|
||||
|
||||
@@ -10,6 +10,10 @@ export class MachineComponentSelectionDto {
|
||||
@IsString()
|
||||
typeComposantId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
composantId?: string;
|
||||
|
||||
@IsOptional()
|
||||
definition?: any;
|
||||
}
|
||||
@@ -22,6 +26,10 @@ export class MachinePieceSelectionDto {
|
||||
@IsString()
|
||||
typePieceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
pieceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
definition?: any;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { IsString, IsOptional, IsNumber, ValidateIf } from 'class-validator';
|
||||
import { IsString, IsOptional, IsNumber } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
|
||||
export class CreatePieceDto {
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@ValidateIf((dto) => !dto.composantId)
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
machineId?: string;
|
||||
|
||||
@ValidateIf((dto) => !dto.machineId)
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
composantId?: string;
|
||||
|
||||
@@ -30,8 +30,9 @@ export class CreatePieceDto {
|
||||
@IsString()
|
||||
typePieceId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
typeMachinePieceRequirementId: string;
|
||||
typeMachinePieceRequirementId?: string;
|
||||
}
|
||||
|
||||
export class UpdatePieceDto {
|
||||
|
||||
@@ -258,4 +258,3 @@ export class UpdateTypePieceDto {
|
||||
@IsObject()
|
||||
structure?: PieceModelStructure;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user