import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsString, IsNotEmpty, IsEnum, IsOptional, IsNumber } from 'class-validator'; import { Role } from '@prisma/client'; export class CreateEmployeeDto { @ApiProperty({ description: 'Номер сотрудника (Табельный номер)' }) @IsString() @IsNotEmpty() code: string; @ApiProperty({ description: 'ФИО сотрудника' }) @IsString() @IsNotEmpty() fullName: string; @ApiProperty({ enum: Role, enumName: 'Role', description: 'Роль сотрудника' }) @IsEnum(Role) role: Role; @ApiProperty({ description: 'Должность сотрудника' }) @IsString() @IsNotEmpty() position: string; @ApiProperty({ required: false, description: 'Код руководителя' }) @IsString() @IsOptional() bossId?: string; @ApiProperty({ required: false, description: 'Стоимость часа работы сотрудника' }) @IsNumber() @IsOptional() @Type(() => Number) price?: number; @ApiProperty({ required: false, description: 'Номер телефона' }) @IsNumber() @IsOptional() @Type(() => Number) phoneNumber?: number; }