forked from Yara724/api
locations dynamically in fanavaran
This commit is contained in:
@@ -1,8 +1,30 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsEmail, IsEnum, IsMongoId, IsNotEmpty, IsOptional, IsString } from "class-validator";
|
||||
import { Type } from "class-transformer";
|
||||
import {
|
||||
IsArray,
|
||||
IsEmail,
|
||||
IsEnum,
|
||||
IsMongoId,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from "class-validator";
|
||||
import { RoleEnum } from "src/Types&Enums/role.enum";
|
||||
import { UserType } from "src/Types&Enums/userType.enum";
|
||||
|
||||
export class ExpertLocationDto {
|
||||
@ApiProperty({ example: "210050", description: "Fanavaran Location / OpBUId" })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
id: string;
|
||||
|
||||
@ApiProperty({ example: "شعبه غرب" })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class CreateInsurerExpertDto {
|
||||
@ApiProperty({ example: "Ali" })
|
||||
@IsString()
|
||||
@@ -88,6 +110,17 @@ export class CreateFileMakerByInsurerDto extends CreateInsurerExpertDto {
|
||||
default: RoleEnum.FILE_MAKER,
|
||||
})
|
||||
role?: RoleEnum.FILE_MAKER;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
type: [ExpertLocationDto],
|
||||
description:
|
||||
"Fanavaran Location entries (id = OpBUId). Used for Parsian V4/V5 submits.",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => ExpertLocationDto)
|
||||
locations?: ExpertLocationDto[];
|
||||
}
|
||||
|
||||
export class CreateFileReviewerByInsurerDto extends CreateInsurerExpertDto {
|
||||
@@ -96,4 +129,15 @@ export class CreateFileReviewerByInsurerDto extends CreateInsurerExpertDto {
|
||||
default: RoleEnum.FILE_REVIEWER,
|
||||
})
|
||||
role?: RoleEnum.FILE_REVIEWER;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
type: [ExpertLocationDto],
|
||||
description:
|
||||
"Fanavaran Location entries. Must overlap FileMaker locations on Parsian V4/V5 cases.",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => ExpertLocationDto)
|
||||
locations?: ExpertLocationDto[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user