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:
@@ -1,3 +1,4 @@
|
||||
import { UserClaimBranchService, usesUserClaimBranch } from "src/client/user-claim-branch.service";
|
||||
import {
|
||||
hasReviewedTejaratNotifier,
|
||||
isTejaratNotifierLookup,
|
||||
@@ -505,6 +506,7 @@ export class ClaimRequestManagementService {
|
||||
private readonly claimFactorsImageDbService: ClaimFactorsImageDbService,
|
||||
|
||||
private readonly branchDbService: BranchDbService,
|
||||
private readonly userClaimBranchService: UserClaimBranchService,
|
||||
private readonly claimRequiredDocumentDbService: ClaimRequiredDocumentDbService,
|
||||
|
||||
private readonly sandHubService: SandHubService,
|
||||
@@ -8147,6 +8149,10 @@ export class ClaimRequestManagementService {
|
||||
);
|
||||
}
|
||||
|
||||
const selectedBranchId = usesUserClaimBranch(blameRequest)
|
||||
? await this.userClaimBranchService.validate(blameRequest, (blameRequest as any).branchId?.toString())
|
||||
: (blameRequest as any).branchId?.toString();
|
||||
|
||||
// 7. Generate claim number
|
||||
const claimNo = await this.generateUniqueClaimNumber();
|
||||
|
||||
@@ -8163,6 +8169,7 @@ export class ClaimRequestManagementService {
|
||||
publicId: blameRequest.publicId,
|
||||
blameRequestId: new Types.ObjectId(blameRequestId),
|
||||
blameRequestNo: blameRequest.requestNo,
|
||||
...(selectedBranchId ? { branchId: new Types.ObjectId(selectedBranchId) } : {}),
|
||||
status: ClaimCaseStatus.SELECTING_OUTER_PARTS,
|
||||
claimStatus: ClaimStatus.PENDING,
|
||||
inquiries: (blameRequest as any).inquiries ?? {},
|
||||
|
||||
Reference in New Issue
Block a user