-
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
chore(j-s): Update substances and combine drugs and prescribed medication lists #17689
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces new substances (Bromazolam and Flualprazolam) to the judicial system's substance tracking and localization infrastructure. The changes involve updating multiple files across different modules to include these new substances in enumerations, type definitions, and localization strings. The modifications centralize substance management by creating a new Changes
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
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
|
...tem/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCountSubstanceEnum.strings.ts
Show resolved
Hide resolved
...tem/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCountSubstanceEnum.strings.ts
Show resolved
Hide resolved
4bff0d4
to
7802db8
Compare
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
🧹 Nitpick comments (1)
libs/judicial-system/types/src/lib/substances.ts (1)
46-88
: Consider documenting the criteria for inclusion in ILLEGAL_DRUGS_AND_PRESCRIPTION_DRUGS_DRIVING.The constant excludes ALCOHOL from the list. It would be helpful to document why certain substances are included or excluded from this list.
+// This constant defines substances that are relevant for both illegal drugs and prescription +// drugs driving offenses. Alcohol is handled separately as it belongs to a different category +// of driving offenses. export const ILLEGAL_DRUGS_AND_PRESCRIPTION_DRUGS_DRIVING = [
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCountSubstanceEnum.strings.ts
(2 hunks)apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/Substances/SubstancesEnum.strings.ts
(1 hunks)libs/judicial-system/types/src/index.ts
(1 hunks)libs/judicial-system/types/src/lib/indictmentCount.ts
(1 hunks)libs/judicial-system/types/src/lib/substances.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
libs/judicial-system/types/src/lib/substances.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCountSubstanceEnum.strings.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."
libs/judicial-system/types/src/index.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/judicial-system/types/src/lib/indictmentCount.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/Substances/SubstancesEnum.strings.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."
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: tests (judicial-system-backend)
🔇 Additional comments (7)
libs/judicial-system/types/src/lib/indictmentCount.ts (2)
1-4
: LGTM! Clean import structure.The imports are well-organized and properly scoped.
20-23
: Verify the implications of using the same list for both illegal and prescription drugs.Using
ILLEGAL_DRUGS_AND_PRESCRIPTION_DRUGS_DRIVING
for both offense types might need validation to ensure this aligns with legal requirements.✅ Verification successful
Shared substance list is appropriate and legally sound
The use of a single comprehensive list (
ILLEGAL_DRUGS_AND_PRESCRIPTION_DRUGS_DRIVING
) is correct because many substances can be either legal or illegal depending on prescription context. The legal distinction is properly maintained through separate offense types (ILLEGAL_DRUGS_DRIVING
vsPRESCRIPTION_DRUGS_DRIVING
), each with its own UI labels and incident descriptions.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if there are any existing distinctions between illegal and prescription drugs in the codebase # Search for any existing classifications or distinctions rg -i "illegal.*drugs|prescription.*drugs" --type tsLength of output: 7184
Script:
#!/bin/bash # Check the contents of the substances list cat libs/judicial-system/types/src/lib/substances.tsLength of output: 2443
libs/judicial-system/types/src/lib/substances.ts (1)
1-44
: LGTM! Well-structured enum definition.The Substance enum is comprehensive and maintains alphabetical ordering, making it easy to maintain.
libs/judicial-system/types/src/index.ts (1)
124-124
: LGTM! Clean export restructuring.The Substance export is properly moved to align with the new organization of substance management.
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/Substances/SubstancesEnum.strings.ts (1)
22-33
: LGTM! Consistent localization implementation.The new substance entries (FLUALPRAZOLAM and BROMAZOLAM) follow the established pattern and maintain proper Icelandic character usage in their default messages.
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCountSubstanceEnum.strings.ts (2)
84-88
: LGTM! New substance entry follows established patterns.The BROMAZOLAM entry maintains consistency with existing entries in terms of:
- ID format
- Message structure with {amount} placeholder
- Unit specification (ng/ml)
- Icelandic localization
119-123
: LGTM! New substance entry follows established patterns.The FLUALPRAZOLAM entry maintains consistency with existing entries in terms of:
- ID format
- Message structure with {amount} placeholder
- Unit specification (ng/ml)
- Icelandic localization
Update substances and combine drugs and prescribed medication lists
What
Why
Screenshots / Gifs
Checklist:
Summary by CodeRabbit
Release Notes
New Features
Refactor
Documentation