-
Notifications
You must be signed in to change notification settings - Fork 61
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(j-s): Notifications sent when court officials are assigned #17169
Conversation
…officials-notifications
WalkthroughThis pull request introduces enhancements to the notification system within the judicial application. It adds a new message group for court official assignments, updates notification rules for judges and registrars, and introduces new methods to send notifications when these officials are assigned to cases. Additionally, new notification types are added to the relevant enums, ensuring that the system can correctly handle and dispatch notifications related to case assignments for district court judges and registrars. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
👮 Files not reviewed due to content moderation or server errors (3)
🧰 Additional context used📓 Path-based instructions (3)apps/judicial-system/backend/src/app/modules/notification/guards/rolesRules.ts (1)Pattern
apps/judicial-system/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts (1)Pattern
apps/judicial-system/backend/src/app/modules/case/case.service.ts (1)Pattern
📓 Learnings (2)apps/judicial-system/backend/src/app/modules/notification/guards/rolesRules.ts (1)
apps/judicial-system/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
…officials-notifications
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17169 +/- ##
==========================================
- Coverage 35.74% 35.73% -0.01%
==========================================
Files 6937 6937
Lines 148255 148284 +29
Branches 42297 42311 +14
==========================================
+ Hits 52989 52995 +6
- Misses 95266 95289 +23
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 18 Total Test Services: 0 Failed, 17 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (1)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I noticed one small content buggy but otherwise I just left few schmall nits and refactoring suggestion/thoughts
apps/judicial-system/backend/src/app/modules/case/case.service.ts
Outdated
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/case/case.service.ts
Outdated
Show resolved
Hide resolved
...m/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts
Outdated
Show resolved
Hide resolved
...m/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts
Outdated
Show resolved
Hide resolved
…officials-notifications
…-is/island.is into j-s/court-officials-notifications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
apps/judicial-system/backend/src/app/modules/case/case.service.ts (1)
1415-1437
: Consider using more descriptive boolean variable namesThe boolean variables could be more descriptive by using the "is" prefix to better indicate their purpose.
Apply this diff to improve variable naming:
- const judgeChanged = + const isJudgeChanged = updatedCase.judge?.nationalId !== theCase.judge?.nationalId - const registrarChanged = + const isRegistrarChanged = updatedCase.registrar?.nationalId !== theCase.registrar?.nationalId - if (judgeChanged) { + if (isJudgeChanged) { await this.addMessagesForDistrictCourtJudgeAssignedToQueue( updatedCase, user, ) } - if (registrarChanged) { + if (isRegistrarChanged) { await this.addMessagesForDistrictCourtRegistrarAssignedToQueue( updatedCase, user, ) }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/judicial-system/backend/src/app/messages/notifications.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/case/case.service.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/judicial-system/backend/src/app/messages/notifications.ts (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/modules/case/case.service.ts (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (3)
apps/judicial-system/backend/src/app/modules/case/case.service.ts (2)
689-701
: LGTM! Clean implementation of judge notification
The method follows the established pattern for notification handling and uses the correct notification type.
703-715
: LGTM! Clean implementation of registrar notification
The method follows the established pattern for notification handling and uses the correct notification type.
apps/judicial-system/backend/src/app/messages/notifications.ts (1)
859-873
: LGTM with a minor formatting suggestion!
The new message group for court official notifications is well-structured and properly internationalized. The implementation:
- Uses correct message ID namespacing
- Provides clear descriptions for translators
- Handles role-specific text appropriately
- Maintains consistency with existing message patterns
Consider adding a space before the link text for better readability:
- 'Héraðsdómur hefur skráð þig sem {role, select, DISTRICT_COURT_JUDGE {dómara} DISTRICT_COURT_REGISTRAR {dómritara} other {óþekkt}} í máli {courtCaseNumber}. Hægt er að nálgast gögn málsins á {linkStart}yfirlitssíðu málsins í Réttarvörslugátt{linkEnd}',
+ 'Héraðsdómur hefur skráð þig sem {role, select, DISTRICT_COURT_JUDGE {dómara} DISTRICT_COURT_REGISTRAR {dómritara} other {óþekkt}} í máli {courtCaseNumber}. Hægt er að nálgast gögn málsins á {linkStart}yfirlitssíðu málsins í Réttarvörslugátt {linkEnd}',
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, except for some redundant code. The new notification types do not come from the client, but rather the case service, and therefore should not be included in client facing enpoints.
apps/judicial-system/backend/src/app/modules/notification/guards/rolesRules.ts
Outdated
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/notification/guards/rolesRules.ts
Outdated
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/notification/notification.service.ts
Outdated
Show resolved
Hide resolved
…-is/island.is into j-s/court-officials-notifications
…officials-notifications
Notifications sent when court officials are assigned
Asana
What
Send notifications to judges and registrars when they are assigned to a case.
Why
This is done to inform those users about the cases they are responsible for.
Checklist:
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes
Chores