1
0
forked from Yara724/api
This commit is contained in:
SepehrYahyaee
2026-04-28 14:27:12 +03:30
parent 9296795166
commit bbd83da2d5
13 changed files with 291 additions and 47 deletions

View File

@@ -0,0 +1,83 @@
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;
}