import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { IsEmail, IsEnum, IsMongoId, IsNotEmpty, IsOptional, IsString } from "class-validator"; import { RoleEnum } from "src/Types&Enums/role.enum"; import { UserType } from "src/Types&Enums/userType.enum"; export class CreateInsurerExpertDto { @ApiProperty({ example: "Ali" }) @IsString() @IsNotEmpty() firstName: string; @ApiProperty({ example: "Ahmadi" }) @IsString() @IsNotEmpty() lastName: string; @ApiProperty({ example: "1234567890" }) @IsString() @IsNotEmpty() nationalCode: string; @ApiProperty({ example: "expert@example.com" }) @IsEmail() email: string; @ApiProperty({ example: "StrongPass!123" }) @IsString() @IsNotEmpty() password: string; @ApiProperty({ example: "09121234567" }) @IsString() @IsNotEmpty() mobile: string; @ApiProperty({ example: "665f0e5ab74d670939b08920", description: "Branch id this expert belongs to", }) @IsMongoId() branchId: string; @ApiPropertyOptional({ enum: UserType, example: UserType.LEGAL }) @IsOptional() @IsEnum(UserType) userType?: UserType; @ApiPropertyOptional({ example: "02112345678" }) @IsOptional() @IsString() phone?: string; @ApiPropertyOptional({ example: "Tehran" }) @IsOptional() @IsString() state?: string; @ApiPropertyOptional({ example: "Tehran" }) @IsOptional() @IsString() city?: string; @ApiPropertyOptional({ example: "No. 12, Sample St." }) @IsOptional() @IsString() address?: string; } export class CreateBlameExpertByInsurerDto extends CreateInsurerExpertDto { @ApiPropertyOptional({ enum: [RoleEnum.EXPERT], default: RoleEnum.EXPERT, }) role?: RoleEnum.EXPERT; } export class CreateClaimExpertByInsurerDto extends CreateInsurerExpertDto { @ApiPropertyOptional({ enum: [RoleEnum.DAMAGE_EXPERT], default: RoleEnum.DAMAGE_EXPERT, }) role?: RoleEnum.DAMAGE_EXPERT; }