feat: swagger document endpoints

This commit is contained in:
Ahmed Bouhuolia
2025-06-19 21:04:54 +02:00
parent 26c1f118c1
commit 4d52059dba
9 changed files with 218 additions and 14 deletions

View File

@@ -1,16 +1,37 @@
import { IsEmail, IsNotEmpty } from 'class-validator';
import { IsEmail, IsNotEmpty, IsString, IsNumber } from 'class-validator';
import { ApiProperty, ApiExtraModels } from '@nestjs/swagger';
@ApiExtraModels()
export class EditUserDto {
@ApiProperty({
description: 'First name of the user',
example: 'John',
})
@IsString()
@IsNotEmpty()
firstName: string;
@ApiProperty({
description: 'Last name of the user',
example: 'Doe',
})
@IsString()
@IsNotEmpty()
lastName: string;
@ApiProperty({
description: 'Email address of the user',
example: 'john.doe@example.com',
})
@IsEmail()
@IsNotEmpty()
email: string;
@ApiProperty({
description: 'Role ID assigned to the user',
example: 2,
})
@IsNumber()
@IsNotEmpty()
roleId: number;
}