This commit is contained in:
2025-11-10 12:39:41 +03:30
parent 06f814b331
commit 45ca2fde06
24 changed files with 794 additions and 586 deletions
+63
View File
@@ -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;
}