feat: Add Model gestion for piece and component
This commit is contained in:
@@ -22,7 +22,7 @@ export class CreateComposantDto {
|
||||
constructeurId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === '' ? null : value)
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
@IsNumber({}, { message: 'prix must be a valid number' })
|
||||
prix?: number | null;
|
||||
|
||||
@@ -56,7 +56,7 @@ export class UpdateComposantDto {
|
||||
constructeurId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === '' ? null : value)
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
@IsNumber({}, { message: 'prix must be a valid number' })
|
||||
prix?: number | null;
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import { IsEmail, IsOptional, IsString } from 'class-validator'
|
||||
import { IsEmail, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class CreateConstructeurDto {
|
||||
@IsString()
|
||||
name: string
|
||||
name: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsEmail()
|
||||
email?: string
|
||||
email?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
phone?: string
|
||||
phone?: string;
|
||||
}
|
||||
|
||||
export class UpdateConstructeurDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
name?: string
|
||||
name?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsEmail()
|
||||
email?: string
|
||||
email?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
phone?: string
|
||||
phone?: string;
|
||||
}
|
||||
|
||||
@@ -58,4 +58,4 @@ export class UpdateCustomFieldValueDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
value?: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,8 @@ export class MachinePieceSelectionDto {
|
||||
@IsString()
|
||||
requirementId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
pieceModelId?: string;
|
||||
|
||||
@IsOptional()
|
||||
definition?: any;
|
||||
pieceModelId: string;
|
||||
}
|
||||
|
||||
export class CreateMachineDto {
|
||||
|
||||
@@ -22,7 +22,7 @@ export class CreatePieceDto {
|
||||
constructeurId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === '' ? null : value)
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
@IsNumber({}, { message: 'prix must be a valid number' })
|
||||
prix?: number | null;
|
||||
|
||||
@@ -56,7 +56,7 @@ export class UpdatePieceDto {
|
||||
constructeurId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === '' ? null : value)
|
||||
@Transform(({ value }) => (value === '' ? null : value))
|
||||
@IsNumber({}, { message: 'prix must be a valid number' })
|
||||
prix?: number | null;
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { IsNotEmpty, IsString, MaxLength } from 'class-validator'
|
||||
import { IsNotEmpty, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
export class CreateProfileDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(100)
|
||||
firstName!: string
|
||||
firstName!: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(100)
|
||||
lastName!: string
|
||||
lastName!: string;
|
||||
}
|
||||
|
||||
export class ActivateProfileDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
profileId!: string
|
||||
profileId!: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
import { IsString, IsOptional, IsArray, IsObject, IsBoolean, IsEnum, IsInt } from 'class-validator';
|
||||
import {
|
||||
IsString,
|
||||
IsOptional,
|
||||
IsArray,
|
||||
IsObject,
|
||||
IsBoolean,
|
||||
IsEnum,
|
||||
IsInt,
|
||||
} from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { ValidateNested } from 'class-validator';
|
||||
|
||||
@@ -7,7 +15,7 @@ export enum CustomFieldType {
|
||||
NUMBER = 'number',
|
||||
SELECT = 'select',
|
||||
BOOLEAN = 'boolean',
|
||||
DATE = 'date'
|
||||
DATE = 'date',
|
||||
}
|
||||
|
||||
export class CreateCustomFieldDto {
|
||||
|
||||
Reference in New Issue
Block a user