feat: implement authentication and database modules with relations and group management
Added new authentication strategies (JWT and GitHub OAuth), guards, and controllers. Implemented database module, schema with relations, and group management features, including CRD operations and person-to-group associations. Integrated validation and CORS configuration.
This commit is contained in:
83
backend/src/modules/persons/dto/create-person.dto.ts
Normal file
83
backend/src/modules/persons/dto/create-person.dto.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
import {
|
||||
IsString,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsObject,
|
||||
IsUUID,
|
||||
IsEnum,
|
||||
IsInt,
|
||||
IsBoolean,
|
||||
Min,
|
||||
Max
|
||||
} from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
/**
|
||||
* Enum for gender values
|
||||
*/
|
||||
export enum Gender {
|
||||
MALE = 'MALE',
|
||||
FEMALE = 'FEMALE',
|
||||
NON_BINARY = 'NON_BINARY',
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum for oral ease level values
|
||||
*/
|
||||
export enum OralEaseLevel {
|
||||
SHY = 'SHY',
|
||||
RESERVED = 'RESERVED',
|
||||
COMFORTABLE = 'COMFORTABLE',
|
||||
}
|
||||
|
||||
/**
|
||||
* DTO for creating a new person
|
||||
*/
|
||||
export class CreatePersonDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
firstName: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
lastName: string;
|
||||
|
||||
@IsEnum(Gender)
|
||||
@IsNotEmpty()
|
||||
gender: Gender;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(5)
|
||||
@Type(() => Number)
|
||||
technicalLevel: number;
|
||||
|
||||
@IsBoolean()
|
||||
@Type(() => Boolean)
|
||||
hasTechnicalTraining: boolean;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(5)
|
||||
@Type(() => Number)
|
||||
frenchSpeakingLevel: number;
|
||||
|
||||
@IsEnum(OralEaseLevel)
|
||||
@IsNotEmpty()
|
||||
oralEaseLevel: OralEaseLevel;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@Min(18)
|
||||
@Max(100)
|
||||
@Type(() => Number)
|
||||
age?: number;
|
||||
|
||||
@IsUUID()
|
||||
@IsNotEmpty()
|
||||
projectId: string;
|
||||
|
||||
@IsObject()
|
||||
@IsOptional()
|
||||
attributes?: Record<string, any>;
|
||||
}
|
||||
Reference in New Issue
Block a user