-
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
fix(j-s): DB Queries #16045
fix(j-s): DB Queries #16045
Conversation
WalkthroughThe changes primarily focus on improving the handling of national IDs in the judicial system application. 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: 11
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (13)
- apps/judicial-system/backend/src/app/modules/case/case.service.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.ts (5 hunks)
- apps/judicial-system/backend/src/app/modules/case/filters/test/cases.filter.spec.ts (1 hunks)
- apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts (3 hunks)
- apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/findDefenderByNationalId.spec.ts (1 hunks)
- apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts (2 hunks)
- apps/judicial-system/digital-mailbox-api/src/app/modules/cases/models/subpoena.response.ts (2 hunks)
- apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx (1 hunks)
- apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/SelectConnectedCase.tsx (1 hunks)
- libs/judicial-system/formatters/src/lib/formatters.spec.ts (2 hunks)
- libs/judicial-system/formatters/src/lib/formatters.ts (1 hunks)
Additional context used
Path-based instructions (13)
apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/SelectConnectedCase.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."
apps/judicial-system/digital-mailbox-api/src/app/modules/cases/models/subpoena.response.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/test/limitedAccessCaseController/findDefenderByNationalId.spec.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/web/src/components/CourtArrangements/CourtArrangements.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."
apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.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/filters/case.filter.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/defendant/defendant.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."
libs/judicial-system/formatters/src/lib/formatters.spec.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/backend/src/app/modules/case/filters/test/cases.filter.spec.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/formatters/src/lib/formatters.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/backend/src/app/modules/case/limitedAccessCase.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."
apps/judicial-system/backend/src/app/modules/case/internalCase.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."
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."
Learnings (1)
apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/SelectConnectedCase.tsx (1)
Learnt from: unakb PR: island-is/island.is#15378 File: apps/judicial-system/web/src/routes/Court/Indictments/Summary/Summary.tsx:86-100 Timestamp: 2024-06-27T14:37:07.823Z Learning: User unakb prefers explicit case handling in switch statements for key functionalities like `getRulingDecisionTagColor` to ensure clarity and avoid assumptions that a case was overlooked.
Additional comments not posted (8)
apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/SelectConnectedCase.tsx (1)
44-55
: LGTM!The filtering logic correctly filters connected cases to those with a single defendant and matching court IDs. This ensures that only eligible cases are available for merging, aligning with the requirement.
apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/findDefenderByNationalId.spec.ts (1)
78-78
: LGTM!The test correctly verifies that the
findOne
method is called with the correct query parameters, checking both the unformatted and formatted defender national IDs.apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx (1)
84-84
: Verify server compatibility with ISO date format.The date is now being converted using
date.toISOString()
. Ensure that the server accepts and correctly parses ISO 8601 formatted strings. If the server expects a specific date format, consider updating the server or utilizing a date formatting function that matches the expected format.apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts (1)
333-345
: EnsurenormalizeAndFormatNationalId
returns an array for proper usage withincludes
.Verify that
normalizeAndFormatNationalId
returns an array of national ID variations. Usingincludes
assumes that the return value is an array where each element can be compared todefendant.defenderNationalId
. Confirm that this comparison accurately determines access rights based on national ID.apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts (1)
14-14
: Importing Correct FunctionnormalizeAndFormatNationalId
The import statement correctly updates the imported function to
normalizeAndFormatNationalId
, which aligns with the changes in the formatter utilities.apps/judicial-system/backend/src/app/modules/case/case.service.ts (3)
23-23
: Import ofnormalizeAndFormatNationalId
is appropriateThe
normalizeAndFormatNationalId
function is correctly imported for use in normalizing national IDs for defendant matching.
1358-1363
: Initialization ofwhereClause
with appropriate conditionsThe initial conditions for the
whereClause
array are well-defined, ensuring that only relevant indictment cases are retrieved.
1393-1397
: Ensure Replacements are Passed to Query ExecutionIf using bind parameters for the
whereClause
, ensure that thereplacements
object is passed to thefindAll
method to prevent errors.Please confirm that the
replacements
object is correctly passed to thefindAll
method when using bind parameters.
apps/judicial-system/digital-mailbox-api/src/app/modules/cases/models/subpoena.response.ts
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.ts
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/case/filters/test/cases.filter.spec.ts
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16045 +/- ##
==========================================
+ Coverage 36.73% 36.75% +0.02%
==========================================
Files 6735 6733 -2
Lines 138318 138111 -207
Branches 39339 39248 -91
==========================================
- Hits 50812 50768 -44
+ Misses 87506 87343 -163
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 40 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 5 Total Test Services: 0 Failed, 5 Passed Test 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.
This looks good, there's a lot of rabbit comments so might have another look over once those are resolved but I'll approve 😊
DB Queries
Skila öllum varnaraðilum með málum
What
Why
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation