-
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): Set court session type to arraignment when subpoena created #17209
base: main
Are you sure you want to change the base?
Conversation
So that it can be displayed in more detail on in the case Table
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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
|
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 (2)
apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx (2)
85-102
: Consider enforcing arraignment type through TypeScriptWhile the implementation correctly sets the court session type to arraignment, the comment "This should always be an arraignment type" suggests this business rule could be better enforced through TypeScript.
Consider creating a specific type for the updates:
type SubpoenaCourtUpdate = { courtSessionType: CourtSessionType.ARRAIGNMENT; indictmentDecision?: null; courtDate?: null; postponedIndefinitelyExplanation?: null; indictmentRulingDecision?: null; mergeCaseId?: null; force?: boolean; };
91-101
: Extract conditional logic into a separate functionThe conditional clearing of fields when rescheduling after court has met would be more maintainable if extracted into a separate function.
Consider refactoring like this:
const getClearanceFields = ( isArraignmentScheduled: boolean, hasIndictmentDecision: boolean, ) => { if (!isArraignmentScheduled || !hasIndictmentDecision) { return {}; } return { indictmentDecision: null, courtDate: null, postponedIndefinitelyExplanation: null, indictmentRulingDecision: null, mergeCaseId: null, force: true, }; }; const additionalUpdates = [{ courtSessionType: CourtSessionType.ARRAIGNMENT, ...getClearanceFields(isArraignmentScheduled, Boolean(workingCase.indictmentDecision)), }];
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx (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 (1)
apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx (1)
8-8
: LGTM: Clean type import
The import of CourtSessionType
from the shared types package follows TypeScript best practices and maintains type safety across the application.
Datadog ReportAll test runs ✅ 98 Total Test Services: 0 Failed, 90 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (1)
|
So that it can be displayed in more detail on in the case Table
Á dagskrá -> Þingfesting
What
Set court session type to arraignment when sending subpoenas
Why
Because that is the court session type being registered, and so we can display it correctly in the active case table
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes