forked from Yara724/api
YARA-1202 FIX removed all damaged parts
This commit is contained in:
@@ -8198,8 +8198,12 @@ export class ClaimRequestManagementService {
|
||||
);
|
||||
}
|
||||
|
||||
// 4. Validate outer parts haven't been selected yet
|
||||
// 4. Validate outer parts haven't been selected yet.
|
||||
// Skip this guard when FileMaker rejected the claim and the FileReviewer
|
||||
// is updating (overwriting) the previous selection.
|
||||
const isFileMakerRejectedRerun = !!(claimCase as any).fileMakerRejectedPendingReview;
|
||||
if (
|
||||
!isFileMakerRejectedRerun &&
|
||||
claimCase.damage?.selectedParts &&
|
||||
claimCase.damage.selectedParts.length > 0
|
||||
) {
|
||||
@@ -8266,7 +8270,9 @@ export class ClaimRequestManagementService {
|
||||
}));
|
||||
const selectedPartIds = selectedItems.map((p) => p.id);
|
||||
|
||||
// 6. Update claim case with selected parts and move to next step
|
||||
// 6. Update claim case with selected parts and move to next step.
|
||||
// Also clear fileMakerRejectedPendingReview now that the reviewer has
|
||||
// actively re-submitted outer parts.
|
||||
const updatedClaim = await this.claimCaseDbService.findByIdAndUpdate(
|
||||
claimRequestId,
|
||||
{
|
||||
@@ -8276,7 +8282,10 @@ export class ClaimRequestManagementService {
|
||||
status: ClaimCaseStatus.SELECTING_OTHER_PARTS,
|
||||
"workflow.currentStep": ClaimWorkflowStep.SELECT_OTHER_PARTS,
|
||||
"workflow.nextStep": ClaimWorkflowStep.CAPTURE_PART_DAMAGES,
|
||||
$unset: { "damage.selectedOuterParts": "" },
|
||||
$unset: {
|
||||
"damage.selectedOuterParts": "",
|
||||
"fileMakerRejectedPendingReview": "",
|
||||
},
|
||||
$push: {
|
||||
"workflow.completedSteps": ClaimWorkflowStep.SELECT_OUTER_PARTS,
|
||||
history: {
|
||||
@@ -8401,8 +8410,11 @@ export class ClaimRequestManagementService {
|
||||
);
|
||||
}
|
||||
|
||||
// 4. Validate other parts and bank info haven't been submitted yet
|
||||
// 4. Validate other parts and bank info haven't been submitted yet.
|
||||
// Skip when FileMaker rejected the claim — the FileReviewer can update bank info.
|
||||
const isFileMakerRejectedRerun = !!(claimCase as any).fileMakerRejectedPendingReview;
|
||||
if (
|
||||
!isFileMakerRejectedRerun &&
|
||||
claimCase.money?.sheba &&
|
||||
claimCase.money?.nationalCodeOfInsurer &&
|
||||
claimCase.workflow?.currentStep !== ClaimWorkflowStep.USER_EXPERT_RESEND
|
||||
|
||||
Reference in New Issue
Block a user