Skip to content

Added API end points for creating and viewing review roles #2159

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

Merged
merged 6 commits into from
May 7, 2025

Conversation

ARADDCC002
Copy link
Member

Review roles are a WIP part of dynamic role work. Bailo currently relies on statically defined review roles, whereas in the future we want admins to be able to create whatever role they want for the review process.

@ARADDCC002 ARADDCC002 added enhancement New feature or request javascript Pull requests that update Javascript code draft labels Apr 23, 2025
@ARADDCC002 ARADDCC002 marked this pull request as draft April 23, 2025 15:57
@ARADDCC002 ARADDCC002 marked this pull request as ready for review April 24, 2025 07:55
PE39806
PE39806 previously approved these changes Apr 25, 2025
}

onUpdateReviewRole(req: Request, reviewRole: ReviewRoleInterface) {
this.checkEventType(AuditInfo.CreateReviewRole, req)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateReviewRole?

}

onViewReviewRoles(req: Request) {
this.checkEventType(AuditInfo.ViewReviewRole, req)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ViewReviewRole?

},
{
timestamps: true,
collection: 'v2_webhooks',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2_webhooks?

description: 'Created a new review role',
auditKind: AuditKind.Create,
},
ViewReviewRole: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ViewReviewRoles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added both in case we want a dedicated end point for viewing single review roles by id in the future

@@ -192,6 +203,11 @@ export abstract class BaseAuditConnector {
importResult: MongoDocumentImportInformation | FileImportInformation,
)

abstract onCreateReviewRole(req: Request, reviewRole: ReviewRoleInterface)
abstract onUpdateReviewRole(req: Request, reviewRole: ReviewRoleInterface)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be pre-emptive, but I thought I'd cover possible future end points that might allow for modifying review roles.

@@ -192,6 +203,11 @@ export abstract class BaseAuditConnector {
importResult: MongoDocumentImportInformation | FileImportInformation,
)

abstract onCreateReviewRole(req: Request, reviewRole: ReviewRoleInterface)
abstract onUpdateReviewRole(req: Request, reviewRole: ReviewRoleInterface)
abstract onViewReviewRole(req: Request, reviewRoles: ReviewRoleInterface)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For simplicity I'd rather we just add audit stuff for the stuff we have rather than including code for stuff we might have in the future

} catch (error) {
handleDuplicateKeys(error)
throw error
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other create service functions, we normally return the new mongo model

@ARADDCC013 ARADDCC013 merged commit b6959a7 into main May 7, 2025
21 checks passed
@ARADDCC013 ARADDCC013 deleted the feature/BAI-1394-add-review-role-api branch May 7, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft enhancement New feature or request javascript Pull requests that update Javascript code ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants