forked from Yara724/api
Added permission for file maker and reviewers to access branches
This commit is contained in:
@@ -53,6 +53,7 @@ import {
|
|||||||
CapturePartV2ResponseDto,
|
CapturePartV2ResponseDto,
|
||||||
} from "./dto/capture-part-v2.dto";
|
} from "./dto/capture-part-v2.dto";
|
||||||
import { GetCaptureRequirementsV2ResponseDto } from "./dto/capture-requirements-v2.dto";
|
import { GetCaptureRequirementsV2ResponseDto } from "./dto/capture-requirements-v2.dto";
|
||||||
|
import { Role } from "src/common/auth/enums";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expert-initiated claim flow that mirrors the normal user claim API
|
* Expert-initiated claim flow that mirrors the normal user claim API
|
||||||
@@ -71,7 +72,7 @@ import { GetCaptureRequirementsV2ResponseDto } from "./dto/capture-requirements-
|
|||||||
@Controller("v2/expert-initiated/claim-request-management")
|
@Controller("v2/expert-initiated/claim-request-management")
|
||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@UseGuards(LocalActorAuthGuard, RolesGuard)
|
@UseGuards(LocalActorAuthGuard, RolesGuard)
|
||||||
@Roles(RoleEnum.FIELD_EXPERT)
|
@Roles(RoleEnum.FIELD_EXPERT, RoleEnum.FILE_MAKER, RoleEnum.FILE_REVIEWER)
|
||||||
export class ExpertInitiatedClaimMirrorController {
|
export class ExpertInitiatedClaimMirrorController {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly claimRequestManagementService: ClaimRequestManagementService,
|
private readonly claimRequestManagementService: ClaimRequestManagementService,
|
||||||
@@ -81,7 +82,8 @@ export class ExpertInitiatedClaimMirrorController {
|
|||||||
@Post("create-from-blame/:blameRequestId")
|
@Post("create-from-blame/:blameRequestId")
|
||||||
@ApiParam({ name: "blameRequestId" })
|
@ApiParam({ name: "blameRequestId" })
|
||||||
@ApiOperation({
|
@ApiOperation({
|
||||||
summary: "[Expert mirror] Create claim from expert-initiated IN_PERSON blame",
|
summary:
|
||||||
|
"[Expert mirror] Create claim from expert-initiated IN_PERSON blame",
|
||||||
description:
|
description:
|
||||||
"Blame must be COMPLETED. Creates a ClaimCase owned by the damaged (non-guilty) party.",
|
"Blame must be COMPLETED. Creates a ClaimCase owned by the damaged (non-guilty) party.",
|
||||||
})
|
})
|
||||||
@@ -173,8 +175,7 @@ export class ExpertInitiatedClaimMirrorController {
|
|||||||
})
|
})
|
||||||
@ApiBody({
|
@ApiBody({
|
||||||
type: SelectOuterPartsV2Dto,
|
type: SelectOuterPartsV2Dto,
|
||||||
description:
|
description: "Selected vehicle type + selected outer part IDs from catalog",
|
||||||
"Selected vehicle type + selected outer part IDs from catalog",
|
|
||||||
examples: {
|
examples: {
|
||||||
example1: {
|
example1: {
|
||||||
summary: "Sedan - minor front damage",
|
summary: "Sedan - minor front damage",
|
||||||
@@ -211,7 +212,10 @@ export class ExpertInitiatedClaimMirrorController {
|
|||||||
description: "Outer parts selected successfully",
|
description: "Outer parts selected successfully",
|
||||||
type: SelectOuterPartsV2ResponseDto,
|
type: SelectOuterPartsV2ResponseDto,
|
||||||
})
|
})
|
||||||
@ApiResponse({ status: 400, description: "Invalid workflow step or validation failed" })
|
@ApiResponse({
|
||||||
|
status: 400,
|
||||||
|
description: "Invalid workflow step or validation failed",
|
||||||
|
})
|
||||||
@ApiResponse({ status: 404, description: "Claim case not found" })
|
@ApiResponse({ status: 404, description: "Claim case not found" })
|
||||||
@ApiResponse({ status: 409, description: "Outer parts already selected" })
|
@ApiResponse({ status: 409, description: "Outer parts already selected" })
|
||||||
async selectOuterParts(
|
async selectOuterParts(
|
||||||
@@ -296,9 +300,15 @@ Optional: upload car green card file in the same step.
|
|||||||
description: "Other parts and bank information saved successfully",
|
description: "Other parts and bank information saved successfully",
|
||||||
type: SelectOtherPartsV2ResponseDto,
|
type: SelectOtherPartsV2ResponseDto,
|
||||||
})
|
})
|
||||||
@ApiResponse({ status: 400, description: "Invalid workflow step or validation failed" })
|
@ApiResponse({
|
||||||
|
status: 400,
|
||||||
|
description: "Invalid workflow step or validation failed",
|
||||||
|
})
|
||||||
@ApiResponse({ status: 404, description: "Claim case not found" })
|
@ApiResponse({ status: 404, description: "Claim case not found" })
|
||||||
@ApiResponse({ status: 409, description: "Bank information already submitted" })
|
@ApiResponse({
|
||||||
|
status: 409,
|
||||||
|
description: "Bank information already submitted",
|
||||||
|
})
|
||||||
async selectOtherParts(
|
async selectOtherParts(
|
||||||
@Param("claimRequestId") claimRequestId: string,
|
@Param("claimRequestId") claimRequestId: string,
|
||||||
@Body() body: SelectOtherPartsV2Dto,
|
@Body() body: SelectOtherPartsV2Dto,
|
||||||
@@ -530,14 +540,22 @@ Returns status of each item (uploaded/captured or not).
|
|||||||
type: "object",
|
type: "object",
|
||||||
required: ["sign", "agree", "branchId"],
|
required: ["sign", "agree", "branchId"],
|
||||||
properties: {
|
properties: {
|
||||||
sign: { type: "string", format: "binary", description: "Signature image" },
|
sign: {
|
||||||
agree: { type: "boolean", description: "true to accept, false to reject" },
|
type: "string",
|
||||||
|
format: "binary",
|
||||||
|
description: "Signature image",
|
||||||
|
},
|
||||||
|
agree: {
|
||||||
|
type: "boolean",
|
||||||
|
description: "true to accept, false to reject",
|
||||||
|
},
|
||||||
branchId: { type: "string", description: "Insurer branch ID" },
|
branchId: { type: "string", description: "Insurer branch ID" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ApiOperation({
|
@ApiOperation({
|
||||||
summary: "Owner signature on expert pricing (Flow 3 — expert acts on behalf of user)",
|
summary:
|
||||||
|
"Owner signature on expert pricing (Flow 3 — expert acts on behalf of user)",
|
||||||
description:
|
description:
|
||||||
"Field expert submits the damaged party's signature during the final approval stage. " +
|
"Field expert submits the damaged party's signature during the final approval stage. " +
|
||||||
"Delegates to the same service method as the user sign endpoint; the expert's " +
|
"Delegates to the same service method as the user sign endpoint; the expert's " +
|
||||||
|
|||||||
Reference in New Issue
Block a user