forked from Yara724/api
feat: route user claims by branch and align licence issue dates
Require the damaged party in user flows to select an active insurer branch and preserve branch access rules. Accept older licence issue dates, correct anniversary boundaries, and update Fanavaran audit documentation and regression coverage.
This commit is contained in:
@@ -349,6 +349,19 @@ export class RequestManagementV2Controller {
|
||||
/**
|
||||
* V2: User signs/accepts or rejects expert decision
|
||||
*/
|
||||
@Get(":requestId/claim-branches")
|
||||
@ApiOperation({ summary: "Active paying-insurer branches for the damaged user (v1/v6)" })
|
||||
getUserClaimBranches(@Param("requestId") id: string, @CurrentUser() user: any) {
|
||||
return this.requestManagementService.getUserClaimBranches(id, user);
|
||||
}
|
||||
|
||||
@Put(":requestId/claim-branch")
|
||||
@ApiOperation({ summary: "Choose claim branch before a user-led claim is created" })
|
||||
@ApiBody({ schema: { type: "object", required: ["branchId"], properties: { branchId: { type: "string" } } } })
|
||||
selectUserClaimBranch(@Param("requestId") id: string, @CurrentUser() user: any, @Body("branchId") branchId: string) {
|
||||
return this.requestManagementService.selectUserClaimBranch(id, user, branchId);
|
||||
}
|
||||
|
||||
@Put("sign/:requestId")
|
||||
@ApiParam({ name: "requestId", description: "Blame request ID" })
|
||||
@ApiConsumes("multipart/form-data")
|
||||
@@ -363,6 +376,7 @@ export class RequestManagementV2Controller {
|
||||
format: "binary",
|
||||
description: "Signature image file",
|
||||
},
|
||||
branchId: { type: "string", description: "Required when the damaged user accepts in v1/v6; active branch of the paying insurer" },
|
||||
isAccept: {
|
||||
type: "boolean",
|
||||
description: "true to accept expert decision, false to reject",
|
||||
@@ -389,6 +403,7 @@ export class RequestManagementV2Controller {
|
||||
async userSignDecision(
|
||||
@Param("requestId") requestId: string,
|
||||
@Body("isAccept") isAccept: string | boolean,
|
||||
@Body("branchId") branchId: string,
|
||||
@CurrentUser() user: any,
|
||||
@UploadedFile() sign: Express.Multer.File,
|
||||
) {
|
||||
@@ -403,6 +418,7 @@ export class RequestManagementV2Controller {
|
||||
user.sub,
|
||||
acceptDecision,
|
||||
sign,
|
||||
branchId,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user