user
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import { IsString, IsNotEmpty, IsBoolean, IsNumber, IsEnum, MinLength } from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { EducationLevel } from '../entities/user.entity';
|
||||
|
||||
export class UpdateUserDto {
|
||||
@ApiProperty({ example: ' ', description: "User's first name" })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
firstName: string;
|
||||
|
||||
@ApiProperty({ example: ' ', description: "User's last name" })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
lastName: string;
|
||||
|
||||
@ApiProperty({ example: ' ', description: "User's father's name" })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
fatherName: string;
|
||||
|
||||
// --- Personal Details ---
|
||||
|
||||
@ApiPropertyOptional({ example: true, description: 'Gender: true for male, false for female' })
|
||||
@IsNotEmpty()
|
||||
@IsBoolean()
|
||||
isMale: boolean;
|
||||
|
||||
@ApiPropertyOptional({ example: '1234567890', description: 'Unique national code' })
|
||||
@IsNotEmpty()
|
||||
@MinLength(10)
|
||||
nationalCode: string;
|
||||
|
||||
@ApiPropertyOptional({ example: '1001', description: 'Employee personal code' })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
personalCode: string;
|
||||
|
||||
// --- Employment Details ---
|
||||
|
||||
@ApiPropertyOptional({ example: 'قراردادی', description: 'Type of hire (e.g., permanent, temporary)' })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
hireType: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'اراک', description: 'Primary work location' })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
workLocation: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 5, description: 'Years of work experience' })
|
||||
@IsNotEmpty()
|
||||
@IsNumber()
|
||||
workExperienceYear: number;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
enum: EducationLevel,
|
||||
example: EducationLevel.master,
|
||||
description: 'Highest level of education achieved',
|
||||
})
|
||||
@IsNotEmpty()
|
||||
@IsEnum(EducationLevel)
|
||||
education: EducationLevel;
|
||||
}
|
||||
Reference in New Issue
Block a user