diff --git a/src/request-management/dto/expert-initiated.dto.ts b/src/request-management/dto/expert-initiated.dto.ts index 070ba09..803b27f 100644 --- a/src/request-management/dto/expert-initiated.dto.ts +++ b/src/request-management/dto/expert-initiated.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; -import { IsEnum, IsOptional, IsString } from "class-validator"; +import { IsBoolean, IsEnum, IsOptional } from "class-validator"; import { CreationMethod } from "../entities/schema/request-management.schema"; export class CreateExpertInitiatedFileDto { @@ -18,4 +18,17 @@ export class CreateExpertInitiatedFileDto { }) @IsEnum(CreationMethod) creationMethod: CreationMethod; + + /** + * V5 only. When true the resulting claim will require FileMaker approval + * before fanavaran submission. V4 files must leave this unset (or false). + */ + @ApiPropertyOptional({ + description: + "V5 only — when true the claim requires FileMaker approval before fanavaran submission.", + example: false, + }) + @IsBoolean() + @IsOptional() + requiresFileMakerApproval?: boolean; } diff --git a/src/request-management/file-maker-blame-v5.controller.ts b/src/request-management/file-maker-blame-v5.controller.ts index 5d1c782..3dffb2a 100644 --- a/src/request-management/file-maker-blame-v5.controller.ts +++ b/src/request-management/file-maker-blame-v5.controller.ts @@ -88,7 +88,7 @@ export class FileMakerBlameV5Controller { ) { return this.requestManagementService.createExpertInitiatedBlameV2( fileMaker, - { ...dto, creationMethod: CreationMethod.IN_PERSON }, + { ...dto, creationMethod: CreationMethod.IN_PERSON, requiresFileMakerApproval: true }, ); } diff --git a/src/request-management/request-management.service.ts b/src/request-management/request-management.service.ts index b304d0a..d1aab38 100644 --- a/src/request-management/request-management.service.ts +++ b/src/request-management/request-management.service.ts @@ -4835,6 +4835,9 @@ export class RequestManagementService { ? FilledBy.EXPERT : FilledBy.CUSTOMER, ...(isFileMakerRole ? { isMadeByFileMaker: true } : {}), + // V5 only: flag that causes the resulting claim to require FileMaker + // approval before fanavaran submission. V4 files never set this. + ...(dto.requiresFileMakerApproval ? { requiresFileMakerApproval: true } : {}), }); const requestId = String((created as any)._id); @@ -8876,9 +8879,10 @@ export class RequestManagementService { }, } : {}), - // V5 (isMadeByFileMaker): mark approval gate at claim creation so the flag - // is always present regardless of whether upload-video is called. - ...((req as any).isMadeByFileMaker + // V5 only: propagate the approval gate from the blame record to the claim. + // isMadeByFileMaker is true for both V4 and V5; only V5 blame records also + // carry requiresFileMakerApproval=true (set at create time by the V5 controller). + ...((req as any).requiresFileMakerApproval ? { requiresFileMakerApproval: true, fileMakerApprovalActorId: new Types.ObjectId(actor.sub),