feat(dto): update group and person DTOs with streamlined properties

- Added `description` field to create and update group DTOs.
- Simplified person DTOs by consolidating fields into `name`, replacing various attributes.
- Added `skills` field to create and update person DTOs for array-based skill representation.
This commit is contained in:
Mathis HERRIOT
2025-05-16 23:51:50 +02:00
parent 634c2d046e
commit 9620fd689d
4 changed files with 32 additions and 112 deletions

View File

@@ -3,14 +3,8 @@ import {
IsOptional,
IsObject,
IsUUID,
IsEnum,
IsInt,
IsBoolean,
Min,
Max
IsArray
} from 'class-validator';
import { Type } from 'class-transformer';
import { Gender, OralEaseLevel } from './create-person.dto';
/**
* DTO for updating a person
@@ -18,51 +12,17 @@ import { Gender, OralEaseLevel } from './create-person.dto';
export class UpdatePersonDto {
@IsString()
@IsOptional()
firstName?: string;
@IsString()
@IsOptional()
lastName?: string;
@IsEnum(Gender)
@IsOptional()
gender?: Gender;
@IsInt()
@Min(1)
@Max(5)
@IsOptional()
@Type(() => Number)
technicalLevel?: number;
@IsBoolean()
@IsOptional()
@Type(() => Boolean)
hasTechnicalTraining?: boolean;
@IsInt()
@Min(1)
@Max(5)
@IsOptional()
@Type(() => Number)
frenchSpeakingLevel?: number;
@IsEnum(OralEaseLevel)
@IsOptional()
oralEaseLevel?: OralEaseLevel;
@IsInt()
@IsOptional()
@Min(18)
@Max(100)
@Type(() => Number)
age?: number;
name?: string;
@IsUUID()
@IsOptional()
projectId?: string;
@IsArray()
@IsOptional()
skills?: string[];
@IsObject()
@IsOptional()
attributes?: Record<string, any>;
}
metadata?: Record<string, any>;
}