Skip to content

Commit

Permalink
Update type
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarlett-Truong committed Apr 3, 2024
1 parent 4c6b824 commit db02c75
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
22 changes: 10 additions & 12 deletions backend/src/case_file/case_file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ export class CaseFileService {
}

//Mutation createReview
async createReview(reviewInput: ReviewInput) {
async createReview(reviewInput: ReviewInput): Promise<CaseFile> {
try {
let result = {
...reviewInput
Expand Down Expand Up @@ -696,19 +696,17 @@ export class CaseFileService {
}
}

async updateReview(reviewInput: ReviewInput) {
async updateReview(reviewInput: ReviewInput): Promise<CaseFile> {
try {
const { isReviewRequired, caseIdentifier } = reviewInput;
await this.prisma.$transaction(async (db) => {
//update review_required_ind in table case_file
await db.case_file.update({
where: {
case_file_guid: caseIdentifier
},
data: {
review_required_ind: isReviewRequired
}
});
//update review_required_ind in table case_file
await this.prisma.case_file.update({
where: {
case_file_guid: caseIdentifier
},
data: {
review_required_ind: isReviewRequired
}
});
return reviewInput;
}
Expand Down
8 changes: 2 additions & 6 deletions backend/src/case_file/entities/case_file.entity.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { Assessment } from "./assessment.entity";
import { Prevention } from "./prevention.entity";
import { ReviewComplete } from "./review_complete";

export class CaseFile {
caseIdentifier?: string;
leadIdentifier: string;
assessmentDetails?: Assessment;
preventionDetails?: Prevention;
isReviewRequired?: boolean;
reviewComplete?: {
actor: string
date: Date
actionCode: string
actionId?: string
}
reviewComplete?: ReviewComplete
}
6 changes: 6 additions & 0 deletions backend/src/case_file/entities/review_complete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export class ReviewComplete {
actor: string
date: Date
actionCode: string
actionId?: string
}

0 comments on commit db02c75

Please sign in to comment.