Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: CE-718 Allow users to remove file review complete actions #65

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions backend/src/case_file/case_file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@ export class CaseFileService {

async updateReview(reviewInput: ReviewInput): Promise<CaseFile> {
try {
const { isReviewRequired, caseIdentifier, reviewComplete } = 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,
Expand All @@ -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(caseIdentifier);
} catch (err) {
this.logger.error(err);
throw new GraphQLError("Error in updateReview", {});
Expand Down
1 change: 1 addition & 0 deletions backend/src/case_file/case_file_inputs.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ input ReviewActionInput {
date: Date!
actionCode: String!
actionId: String
activeIndicator: Boolean
}

input CreateSupplementalNoteInput {
Expand Down
1 change: 1 addition & 0 deletions backend/src/case_file/dto/review-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export class ReviewInput {
date: Date;
actionCode: string;
actionId?: string;
activeIndicator?: boolean;
};
}
1 change: 1 addition & 0 deletions backend/src/case_file_action/case_file_action.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class CaseFileActionService {
action_code: actionCaseCode,
},
},
active_ind: true,
},
select: {
action_guid: true,
Expand Down
Loading