locations dynamically in fanavaran

This commit is contained in:
2026-09-02 15:31:55 +03:30
parent ebfeef9e01
commit 5c2b660600
10 changed files with 307 additions and 4 deletions

View File

@@ -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[];
}