diff --git a/backend/src/case_file/case_file.service.ts b/backend/src/case_file/case_file.service.ts index a9fe14aa..1c26bc5e 100644 --- a/backend/src/case_file/case_file.service.ts +++ b/backend/src/case_file/case_file.service.ts @@ -767,9 +767,9 @@ export class CaseFileService { async updateReview(reviewInput: ReviewInput): Promise { try { + const { isReviewRequired, caseIdentifier, reviewComplete, leadIdentifier } = reviewInput; await this.prisma.$transaction(async (db) => { - const { isReviewRequired, caseIdentifier } = reviewInput; - //update review_required_ind in table case_file + // Update review_required_ind in table case_file await db.case_file.update({ where: { case_file_guid: caseIdentifier, @@ -778,8 +778,23 @@ export class CaseFileService { review_required_ind: isReviewRequired, }, }); + + // If reviewComplete is provided, update the corresponding action + if (reviewComplete && reviewComplete.actionId) { + const { actionId, activeIndicator } = reviewComplete; + + await db.action.update({ + where: { + action_guid: actionId, + }, + data: { + active_ind: activeIndicator, + }, + }); + } }); - return reviewInput; + + return this.findOneByLeadId(leadIdentifier); } catch (err) { this.logger.error(err); throw new GraphQLError("Error in updateReview", {}); diff --git a/backend/src/case_file/case_file_inputs.graphql b/backend/src/case_file/case_file_inputs.graphql index 4045b07b..c31ce91c 100644 --- a/backend/src/case_file/case_file_inputs.graphql +++ b/backend/src/case_file/case_file_inputs.graphql @@ -73,6 +73,7 @@ input ReviewActionInput { date: Date! actionCode: String! actionId: String + activeIndicator: Boolean } input CreateSupplementalNoteInput { diff --git a/backend/src/case_file/dto/review-input.ts b/backend/src/case_file/dto/review-input.ts index 496442f7..e5082fb9 100644 --- a/backend/src/case_file/dto/review-input.ts +++ b/backend/src/case_file/dto/review-input.ts @@ -10,5 +10,6 @@ export class ReviewInput { date: Date; actionCode: string; actionId?: string; + activeIndicator?: boolean; }; } diff --git a/backend/src/case_file_action/case_file_action.service.ts b/backend/src/case_file_action/case_file_action.service.ts index 1707b8b9..b6a21e81 100644 --- a/backend/src/case_file_action/case_file_action.service.ts +++ b/backend/src/case_file_action/case_file_action.service.ts @@ -122,6 +122,7 @@ export class CaseFileActionService { action_code: actionCaseCode, }, }, + active_ind: true, }, select: { action_guid: true,