-
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): Complete Investigation case without ruling #17651
Conversation
* feat(j-s): Add new case decision for closing without ruling
…m/island-is/island.is into j-s/case-completed-without-ruling
…s/case-completed-without-ruling
* fix(j-s): tooltip with correct defender label * fix(j-s): add new investigation types * fix(j-s): format * fix(j-s): revert unrelated changes * fix(j-s): format
…m/island-is/island.is into j-s/case-completed-without-ruling
* feat(j-s): Handle complete case without ruling in UI * Update case.ts * Update SignedVerdictOverview.tsx * Update 20250121143923-update-case.js * fix(j-s): Minor clean up * Update DateLabel.tsx * Update Cases.tsx * Update apps/judicial-system/web/src/routes/Court/InvestigationCase/Ruling/Ruling.tsx Co-authored-by: Thórhildur Thorleiksdóttir <thorhildur@kolibri.is> * chore: nx format:write update dirty files * Update Ruling.tsx --------- Co-authored-by: Thórhildur Thorleiksdóttir <thorhildur@kolibri.is> Co-authored-by: andes-it <builders@andes.is>
…17631) * feat(j-s): Handle complete case without ruling in UI * Update case.ts * Update SignedVerdictOverview.tsx * Update 20250121143923-update-case.js * fix(j-s): Minor clean up * Update DateLabel.tsx * feat(j-s): Add new notification strings * chore(j-s): destructure sendEmail params to increase readability for multiple params * feat(j-s): refactor email property logic to support completed without ruling cases * Update Cases.tsx * Update apps/judicial-system/web/src/routes/Court/InvestigationCase/Ruling/Ruling.tsx Co-authored-by: Thórhildur Thorleiksdóttir <thorhildur@kolibri.is> * chore: nx format:write update dirty files * fix(j-s): add message to queue * fix(j-s): small fixes --------- Co-authored-by: unakb <una@kolibri.is> Co-authored-by: andes-it <builders@andes.is>
WalkthroughThe changes introduce a new case decision ( Changes
Sequence Diagram(s)sequenceDiagram
participant CT as Case Transformer
participant DB as Database / Enum Types
Note over CT,DB: Appeal Information Calculation
CT->>CT: Invoke getAppealInfo()
CT-->>CT: Check case decision (COMPLETED_WITHOUT_RULING?)
CT->>CT: Set flag (wasCompletedWithoutRuling)
CT->>CT: Evaluate appeal eligibility for prosecutor & defender
CT->>CT: Recalculate appealDeadline based on ruling date
sequenceDiagram
participant UI as InvestigationCase UI
participant Func as completeCaseWith()
participant Srv as Case Service
Note over UI,Func: Case Completion Flow
UI->>Func: User action triggers completeCaseWith(action)
Func->>Srv: Process case completion based on action ('signature' | 'noSignature' | 'modification')
Srv-->>UI: Update case state, modal visibility, and PDF button status
Possibly Related PRs
Suggested labels
Suggested reviewers
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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: 1
🧹 Nitpick comments (16)
apps/judicial-system/web/src/components/DateLabel/RulingDateLabel.strings.ts (1)
5-6
: Consider retaining the date context in the default message.By removing
{ruledDate}
from the default message, the label no longer indicates the date directly. If your new design displays the date through another component, this is fine. Otherwise, ensuring the user can see the date context directly in this label may improve clarity.apps/judicial-system/web/src/components/DateLabel/RulingDateLabel.tsx (1)
7-9
: Validate date prop types.The
rulingDate
prop is typed asstring
. Consider allowing aDate
type or validating/formatting the string to ensure correct date handling.apps/judicial-system/web/src/components/DateLabel/DateLabel.tsx (2)
8-11
: Use unified date handling to avoid confusion.Accepting both
string
andDate
for thedate
prop is flexible, but it can introduce confusion if the input is not always guaranteed to be a valid date. Consider standardizing on a single type or adding runtime validation.
17-20
: Prevent extra spaces when no text is provided.Currently, the template literal may produce surplus whitespace if
text
is empty. Consider trimming the final string or conditionally injecting spaces only whentext
is present.-return `${text ?? ''} ${formattedDate} ${!hideTime ? formattedTime : ''}` +const labelText = text ? `${text} ` : '' +return `${labelText}${formattedDate}${!hideTime ? ` ${formattedTime}` : ''}`apps/judicial-system/backend/migrations/20250121143923-update-case.js (1)
1-1
: Remove redundant 'use strict'.All ES modules are executed in strict mode by default. You can safely remove
'use strict'
.- 'use strict'
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.(lint/suspicious/noRedundantUseStrict)
apps/judicial-system/backend/migrations/20250122141848-update-case.js (1)
1-1
: Remove redundant use of 'use strict'Modern modules are in strict mode by default, making this directive unnecessary.
- 'use strict'
🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.(lint/suspicious/noRedundantUseStrict)
apps/judicial-system/backend/src/app/modules/notification/services/institutionNotification/institutionNotification.service.ts (1)
78-83
: Potential HTML injection risk
While constructing thehtml
string, consider sanitizing or escapingbody
andtail
if they can contain user-supplied data. This helps prevent HTML injection.apps/judicial-system/web/src/routes/Shared/SignedVerdictOverview/Components/CaseDocuments/CaseDocuments.tsx (1)
147-169
: Consider extracting conditional UI for readability.Only showing this section when a ruling is required is logically correct. As a minor enhancement, you could extract this block into a smaller component for clarity and easier maintenance.
apps/judicial-system/backend/src/app/modules/notification/baseNotification.service.ts (1)
87-93
: Introduce a dedicated interface for email parameters.Defining a dedicated interface (e.g.,
SendEmailOptions
) could offer more explicit typing and improve type reusability across the codebase.apps/judicial-system/web/src/components/index.ts (1)
95-96
: Confirm naming consistency for date labels.Re-exporting
RulingDateLabel
andDateLabel
side by side is fine, but ensure they have distinct usage contexts. Consider whether these two labels could be consolidated or if the naming clearly differentiates their purposes.apps/judicial-system/api/src/app/modules/case/interceptors/case.transformer.ts (2)
77-79
: Improve readability ofwasCompletedWithoutRuling
check.Defining
wasCompletedWithoutRuling
is straightforward. If more decisions are added in the future, consider using a switch statement or a dedicated function for improved readability and maintainability.
101-106
: Review duplication in appeal checks.Both
canProsecutorAppeal
andcanDefenderAppeal
logic repeat theisAppealableDecision
check. Consider consolidating these checks into a single utility function, reducing duplication and simplifying future enhancements.apps/judicial-system/web/src/routes/Court/InvestigationCase/Confirmation/Confirmation.tsx (1)
100-115
: Switch statement covers all possible actions
The switch statement is well-structured. Consider adding a default case or exhaustive checking with TypeScript to handle unexpected actions more robustly.apps/judicial-system/web/src/routes/Court/InvestigationCase/Ruling/Ruling.tsx (2)
9-9
: Use Next.js-specific router hook for consistency
Consider switching from the default import ofnext/router
to theuseRouter
hook for a more idiomatic Next.js approach.
144-170
: Preserve existing data when toggling “Completed without ruling”?
When the checkbox becomes unchecked, this code setsdecision
tonull
and rewrites theconclusion
field. This can inadvertently discard any previously entered conclusion. If you want to preserve existing user input, consider storing the user’s conclusion in a temporary variable and restoring it if the user reverts the checkbox.- conclusion: formatMessage( - m.sections.completedWithoutRuling.conclusion, - ), + conclusion: target.checked + ? formatMessage(m.sections.completedWithoutRuling.conclusion) + : workingCase.conclusion ?? '',apps/judicial-system/backend/src/app/modules/case/case.service.ts (1)
Line range hint
947-996
: Consider renaming the notification type forCOMPLETED_WITHOUT_RULING
Sending aCaseNotificationType.RULING
for a case completed without a ruling could be confusing. You might enhance clarity by introducing a more specific notification type or message.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (40)
apps/judicial-system/api/src/app/modules/case/interceptors/case.transformer.ts
(4 hunks)apps/judicial-system/backend/migrations/20250121143923-update-case.js
(1 hunks)apps/judicial-system/backend/migrations/20250122141848-update-case.js
(1 hunks)apps/judicial-system/backend/src/app/messages/notifications.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/case/case.service.ts
(3 hunks)apps/judicial-system/backend/src/app/modules/court/court.service.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/notification/baseNotification.service.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts
(42 hunks)apps/judicial-system/backend/src/app/modules/notification/services/civilClaimantNotification/civilClaimantNotification.service.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/notification/services/defendantNotification/defendantNotification.service.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/notification/services/indictmentCaseNotification/indictmentCaseNotification.service.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/notification/services/institutionNotification/institutionNotification.service.ts
(1 hunks)apps/judicial-system/backend/src/app/modules/notification/services/subpoenaNotification/subpoenaNotification.service.ts
(1 hunks)apps/judicial-system/web/messages/Core/rulingAccordion.ts
(1 hunks)apps/judicial-system/web/messages/Core/sections.ts
(1 hunks)apps/judicial-system/web/messages/InvestigationCases/Court/confirmation.ts
(1 hunks)apps/judicial-system/web/src/components/AccordionItems/RulingAccordionItem/RulingAccordionItem.tsx
(2 hunks)apps/judicial-system/web/src/components/CaseTitleInfoAndTags/CaseTitleInfoAndTags.strings.ts
(1 hunks)apps/judicial-system/web/src/components/CaseTitleInfoAndTags/CaseTitleInfoAndTags.tsx
(2 hunks)apps/judicial-system/web/src/components/DateLabel/DateLabel.tsx
(1 hunks)apps/judicial-system/web/src/components/DateLabel/RulingDateLabel.strings.ts
(1 hunks)apps/judicial-system/web/src/components/DateLabel/RulingDateLabel.tsx
(1 hunks)apps/judicial-system/web/src/components/PageLayout/utils/index.ts
(1 hunks)apps/judicial-system/web/src/components/RulingDateLabel/RulingDateLabel.tsx
(0 hunks)apps/judicial-system/web/src/components/RulingInput/RulingInput.tsx
(2 hunks)apps/judicial-system/web/src/components/index.ts
(2 hunks)apps/judicial-system/web/src/routes/Court/InvestigationCase/Confirmation/Confirmation.strings.ts
(1 hunks)apps/judicial-system/web/src/routes/Court/InvestigationCase/Confirmation/Confirmation.tsx
(4 hunks)apps/judicial-system/web/src/routes/Court/InvestigationCase/Ruling/Ruling.strings.ts
(1 hunks)apps/judicial-system/web/src/routes/Court/InvestigationCase/Ruling/Ruling.tsx
(10 hunks)apps/judicial-system/web/src/routes/Shared/AppealToCourtOfAppeals/AppealCaseFiles.tsx
(1 hunks)apps/judicial-system/web/src/routes/Shared/AppealToCourtOfAppeals/AppealToCourtOfAppeals.tsx
(1 hunks)apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx
(2 hunks)apps/judicial-system/web/src/routes/Shared/SignedVerdictOverview/Components/CaseDocuments/CaseDocuments.tsx
(2 hunks)apps/judicial-system/web/src/routes/Shared/Statement/Statement.tsx
(1 hunks)apps/judicial-system/web/src/utils/titleForCase/titleForCase.strings.ts
(1 hunks)apps/judicial-system/web/src/utils/titleForCase/titleForCase.ts
(1 hunks)libs/judicial-system/consts/src/lib/consts.ts
(2 hunks)libs/judicial-system/formatters/src/lib/formatters.ts
(1 hunks)libs/judicial-system/types/src/lib/case.ts
(4 hunks)
💤 Files with no reviewable changes (1)
- apps/judicial-system/web/src/components/RulingDateLabel/RulingDateLabel.tsx
🧰 Additional context used
📓 Path-based instructions (39)
apps/judicial-system/web/src/routes/Court/InvestigationCase/Confirmation/Confirmation.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."
apps/judicial-system/web/src/components/CaseTitleInfoAndTags/CaseTitleInfoAndTags.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."
apps/judicial-system/web/src/routes/Shared/Cases/Cases.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/web/src/components/PageLayout/utils/index.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/routes/Shared/Statement/Statement.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/web/messages/Core/sections.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/AccordionItems/RulingAccordionItem/RulingAccordionItem.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."
libs/judicial-system/types/src/lib/case.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/Shared/SignedVerdictOverview/Components/CaseDocuments/CaseDocuments.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/web/src/components/DateLabel/RulingDateLabel.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/notification/services/institutionNotification/institutionNotification.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/web/src/utils/titleForCase/titleForCase.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."
apps/judicial-system/web/src/components/DateLabel/RulingDateLabel.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/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/web/src/routes/Shared/AppealToCourtOfAppeals/AppealCaseFiles.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/migrations/20250121143923-update-case.js (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/CaseTitleInfoAndTags/CaseTitleInfoAndTags.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/web/messages/Core/rulingAccordion.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/api/src/app/modules/case/interceptors/case.transformer.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/notification/services/subpoenaNotification/subpoenaNotification.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/court/court.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/web/src/routes/Court/InvestigationCase/Ruling/Ruling.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."
apps/judicial-system/backend/src/app/modules/notification/services/civilClaimantNotification/civilClaimantNotification.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/web/src/components/RulingInput/RulingInput.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/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."
apps/judicial-system/web/src/utils/titleForCase/titleForCase.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/index.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/notification/services/caseNotification/caseNotification.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/web/messages/InvestigationCases/Court/confirmation.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/routes/Court/InvestigationCase/Ruling/Ruling.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/notification/baseNotification.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/consts/src/lib/consts.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/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/notification/services/indictmentCaseNotification/indictmentCaseNotification.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/web/src/components/DateLabel/DateLabel.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/migrations/20250122141848-update-case.js (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/routes/Court/InvestigationCase/Confirmation/Confirmation.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/notification/services/defendantNotification/defendantNotification.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/web/src/routes/Shared/AppealToCourtOfAppeals/AppealToCourtOfAppeals.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."
📓 Learnings (2)
apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx (3)
Learnt from: oddsson
PR: island-is/island.is#16939
File: apps/judicial-system/web/src/components/Table/PastCasesTable/PastCasesTable.tsx:126-131
Timestamp: 2024-11-19T21:47:09.093Z
Learning: The `CaseListEntry` interface in `@island.is/judicial-system-web/src/graphql/schema` includes the properties `isValidToDateInThePast`, `indictmentRulingDecision`, and `indictmentDecision`.
Learnt from: oddsson
PR: island-is/island.is#16939
File: apps/judicial-system/web/src/components/Table/PastCasesTable/PastCasesTable.tsx:136-139
Timestamp: 2024-11-20T10:15:04.980Z
Learning: The properties `isValidToDateInThePast`, `indictmentRulingDecision`, and `indictmentDecision` are defined in the `CaseListEntry` interface used in the `PastCasesTable` component.
Learnt from: gudjong
PR: island-is/island.is#16760
File: apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx:112-118
Timestamp: 2024-11-12T15:15:11.835Z
Learning: In `apps/judicial-system/web/src/routes/Prosecutor/components/CasesAwaitingConfirmationTable/CasesAwaitingConfirmationTable.tsx`, `apps/judicial-system/web/src/routes/Court/components/CasesAwaitingAssignmentTable/CasesAwaitingAssignmentTable.tsx`, and one instance in `apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx`, it's correct to pass only the `type` prop to `ColumnCaseType` without the `decision` and `parentCaseId` props.
apps/judicial-system/backend/src/app/modules/notification/services/subpoenaNotification/subpoenaNotification.service.ts (1)
Learnt from: oddsson
PR: island-is/island.is#16329
File: apps/judicial-system/backend/src/app/modules/notification/subpoenaNotification.service.ts:143-177
Timestamp: 2024-11-12T15:15:20.157Z
Learning: In `apps/judicial-system/backend/src/app/modules/notification/subpoenaNotification.service.ts`, the method `sendEmails` currently uses `Promise.all` for multiple recipients, and changing it to `Promise.allSettled` is considered for a future iteration.
🪛 Biome (1.9.4)
apps/judicial-system/backend/migrations/20250121143923-update-case.js
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
apps/judicial-system/backend/migrations/20250122141848-update-case.js
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
🔇 Additional comments (115)
apps/judicial-system/web/src/components/DateLabel/RulingDateLabel.tsx (2)
1-2
: File and folder structure / NextJS consistency check.Since this file resides under
apps/judicial-system/web/src/components/DateLabel/
, the organization looks consistent with the NextJS approach of grouping related components into directories. No immediate structural concerns here.
14-14
: Propagate date string through a specialized parser.While passing
rulingDate
directly is convenient, ensure that the date is in a valid format for consistent display, especially if your environment deals with different locales or time zones.apps/judicial-system/backend/migrations/20250121143923-update-case.js (2)
5-21
: Confirm potential non-breaking impact with existing data.Adding the
COMPLETED_WITHOUT_RULING
enum is straightforward. Verify that existing rows with other decision values are unaffected and that no queries break.
23-37
: Verify rollback compatibility.Ensure that no cases in production use
COMPLETED_WITHOUT_RULING
when rolling back, as this migration will strip that enum value. Validate that necessary fallback handling is in place if rollback is ever needed.apps/judicial-system/web/src/components/CaseTitleInfoAndTags/CaseTitleInfoAndTags.strings.ts (1)
30-34
: New locale message looks good.
This addition follows the project's i18n pattern, consistently naming and structuring the message.apps/judicial-system/web/src/components/RulingInput/RulingInput.tsx (3)
17-17
: Optional disabled prop is well-introduced.
Declaring the prop as optional with a default value fits common React and TypeScript patterns.
20-25
: Destructuring with default value is clear and maintainable.
Settingdisabled = false
helps prevent undefined behavior and makes usage clearer.
61-61
: Prop passthrough to Input is correct.
Ensuring the disabled state is forwarded correctly enables conditional UI behavior for read-only contexts.apps/judicial-system/web/src/components/PageLayout/utils/index.ts (1)
25-27
: Explicitly handling COMPLETED_WITHOUT_RULING is consistent.
This condition helps differentiate outcome handling for investigation cases without a ruling, aligning with new case logic.apps/judicial-system/web/src/utils/titleForCase/titleForCase.ts (1)
29-31
: Refined logic for COMPLETED_WITHOUT_RULING is coherent.
The condition properly distinguishes investigation cases completed without a ruling from traditional accepted cases.apps/judicial-system/web/messages/Core/rulingAccordion.ts (1)
49-56
: Implementation is consistent with existing patternsThe newly introduced
noRuling
section aligns with the established structure ofdefineMessages
. No issues found regarding naming consistency or message definitions.apps/judicial-system/web/src/components/AccordionItems/RulingAccordionItem/RulingAccordionItem.tsx (2)
6-6
: Ensure thorough testing coverage for the new decision typeYou introduced
CaseDecision
and a corresponding condition. Verify that automated tests cover scenarios whereworkingCase.decision
equalsCaseDecision.COMPLETED_WITHOUT_RULING
.
31-63
: Conditional rendering logic looks goodThe conditional rendering logic properly handles the new decision flow. This approach is clear, maintainable, and follows standard React patterns.
apps/judicial-system/backend/migrations/20250122141848-update-case.js (1)
3-77
: Migration script looks correctYour enum replacement logic is valid, and rollback functionality is provided. No further issues found.
apps/judicial-system/web/messages/InvestigationCases/Court/confirmation.ts (1)
23-28
: Reevaluate adding code to a file marked for deletionThere is a
TODO: Delete this file
comment at the top. Confirm if this file is truly intended for removal or still required. Adding new messages to a deprecated file may introduce confusion later.apps/judicial-system/web/src/routes/Court/InvestigationCase/Confirmation/Confirmation.strings.ts (1)
21-26
: New message for case completion without ruling
The newly added message property seamlessly aligns with the existing structure and naming convention, maintaining consistency and clarity.apps/judicial-system/web/src/utils/titleForCase/titleForCase.strings.ts (1)
27-32
: Additional message for concluded investigation cases
This new entry follows the established patterns in the file and clearly indicates a case concluded without a ruling.apps/judicial-system/web/src/components/CaseTitleInfoAndTags/CaseTitleInfoAndTags.tsx (3)
10-10
: Fitting import for anticipated decision usage
ImportingCaseDecision
is appropriate and utilized correctly in the following lines.
15-16
: Imports for conditional date labeling
BothDateLabel
andRulingDateLabel
are introduced for flexible rendering of dates, enhancing clarity and user experience.
39-47
: Well-structured conditional rendering
DisplayingDateLabel
only whendecision
isCOMPLETED_WITHOUT_RULING
ensures clarity and consistency. No issues detected in the logic.apps/judicial-system/backend/src/app/modules/notification/services/civilClaimantNotification/civilClaimantNotification.service.ts (1)
78-85
: Use of named parameters enhances clarity.Switching to named parameters in
sendEmail
improves readability and maintainability by clearly labeling each argument.apps/judicial-system/web/src/routes/Shared/SignedVerdictOverview/Components/CaseDocuments/CaseDocuments.tsx (2)
82-84
: Handle undefined decision checks for safety.Using
!== CaseDecision.COMPLETED_WITHOUT_RULING
is a straightforward check, but consider verifying thatworkingCase.decision
is always defined to avoid potential runtime issues.
145-145
: Disabled property correctly reflects ruling requirement.Disabling this button when
isRulingRequired
is false ensures users cannot proceed with a ruling where none is needed.apps/judicial-system/backend/src/app/modules/notification/baseNotification.service.ts (1)
79-86
: Named parameter object improves maintainability.Shifting to an object parameter in
sendEmail
clarifies argument meanings and helps prevent positional errors.apps/judicial-system/backend/src/app/modules/notification/services/indictmentCaseNotification/indictmentCaseNotification.service.ts (1)
63-70
: Consistent object destructuring usage.Passing parameters as an object aligns well with the overall refactoring, enhancing readability and consistency across services.
apps/judicial-system/web/src/routes/Shared/AppealToCourtOfAppeals/AppealToCourtOfAppeals.tsx (1)
25-25
: Verify usage patterns for clarity and maintainability.Introducing
RequestAppealRulingNotToBePublishedCheckbox
as an import here appears logically consistent with the rest of the component. No major NextJS best practice issues are apparent. However, confirm that its usage is clearly documented to assist future maintainers in understanding the rationale behind publishing or not publishing a ruling.apps/judicial-system/web/src/routes/Shared/AppealToCourtOfAppeals/AppealCaseFiles.tsx (1)
26-27
: Ensure consistency in newly added imports.The addition of
RequestAppealRulingNotToBePublishedCheckbox
andRulingDateLabel
suitably follows the established import pattern. Verify that both components are thoroughly tested and documented for consistent usage across the application.apps/judicial-system/web/src/components/index.ts (1)
117-117
: Check usage and test coverage for new checkbox export.Exporting
RequestAppealRulingNotToBePublishedCheckbox
from here centralizes it in the shared components index, which is good for discoverability. Verify that any relevant unit tests are linked to this re-export and that usage contexts are consistent throughout the codebase.apps/judicial-system/api/src/app/modules/case/interceptors/case.transformer.ts (3)
3-3
: Validate new import alignment.The inclusion of
CaseDecision
from@island.is/judicial-system/types
is appropriate for the additional logic. This helps maintain consistent decision handling across the codebase.
58-58
: Confirmdecision
defaults if undefined.Relying on
decision
to determine case outcomes can lead to unexpected behavior ifdecision
isundefined
. Ensure downstream logic is guarded or thatdecision
is guaranteed to be set before usage.
96-96
: Ensure business logic consistency.Setting
canBeAppealed
tofalse
when the case is completed without ruling aligns with the new decision type. Just confirm that this behavior reflects real-world business rules for all scenario variants.apps/judicial-system/web/src/routes/Shared/Statement/Statement.tsx (1)
26-26
: Good introduction of the new checkbox import
No issues found with the new import. This addition aligns with the existing naming conventions and the usage below.apps/judicial-system/web/src/routes/Court/InvestigationCase/Ruling/Ruling.strings.ts (1)
38-57
: New localized messages for completed without ruling
These new messages are well-structured and follow the standard pattern for defineMessages. The IDs, default messages, and descriptions look consistent and clear.apps/judicial-system/web/src/routes/Court/InvestigationCase/Confirmation/Confirmation.tsx (5)
95-97
: Typed method parameter
Great use of a union type for the'action'
parameter. This strengthens maintainability and clarity in the code.
122-130
: Conditional selection of'noSignature'
vs'signature'
Smart approach to differentiate completion paths depending on'COMPLETED_WITHOUT_RULING'
. This code is concise and legible.
174-176
: Disabling the PDF ruling for completed-without-ruling
Disabling the PDF button forCOMPLETED_WITHOUT_RULING
is logical, given that no ruling is created.
195-196
: Separate continue button text
Nice clarity in the user interface by using a distinct button text forCOMPLETED_WITHOUT_RULING
.
225-225
: InvokingcompleteCaseWith
on modal continue
Good integration of the'modification'
action to handle scenarios with a corrected ruling.apps/judicial-system/backend/src/app/modules/notification/services/defendantNotification/defendantNotification.service.ts (1)
65-72
: Switch to object parameter for sending emails
This refactor improves clarity by consolidating parameters into a single object. SettingskipTail
to true andattachments
to undefined is explicit. No issues found.libs/judicial-system/consts/src/lib/consts.ts (2)
34-36
: Add new case type for "Brottvísun af heimili".
This addition aligns well with the rest of the enum mappings in this library. No issues found regarding reusability or bundling.
74-81
: Add new case types for "Skýrslutaka brotaþola yngri en 18 ára" and "Skýrslutaka fyrir dómi".
These additions are consistent with the updated requirements, and the labels are clear.apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx (2)
33-33
: Importing 'CaseDecision' for newly introduced logic.
This import is necessary to handle the new decision state; usage looks correct.
174-178
: Account for 'COMPLETED_WITHOUT_RULING' in the completion check.
Expanding the condition properly marks cases without a formal ruling as completed. This implementation is consistent with NextJS best practices and the PR’s objective.libs/judicial-system/types/src/lib/case.ts (5)
27-27
: Reintroduce 'PHONE_TAPPING' to the case types.
Check that wherever this value was used or removed, the references are now re-synced.
33-34
: Add 'STATEMENT_FROM_MINOR' and 'STATEMENT_IN_COURT' to minor and court statements.
Consistent naming, no issues with reusability or type usage.
220-220
: Add new 'COMPLETED_WITHOUT_RULING' decision value.
This thoroughly supports the PR’s objective to finalize investigations without a ruling.
342-342
: Add 'COMPLETED_WITHOUT_RULING' to accepted case decisions.
Confirm that business logic for “accepted” decisions behaves as intended when no ruling exists.✅ Verification successful
Business logic for COMPLETED_WITHOUT_RULING is properly implemented
The case decision is correctly handled throughout the codebase, including UI rendering, notifications, and case processing logic. TheisAcceptingCaseDecision
function properly includes this decision type.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify references to COMPLETED_WITHOUT_RULING to ensure consistent handling rg 'COMPLETED_WITHOUT_RULING' -A 5Length of output: 12744
Script:
#!/bin/bash # Check implementation of isAcceptingCaseDecision ast-grep --pattern 'export const isAcceptingCaseDecision = $_'Length of output: 463
324-325
: Include newly introduced case types in 'investigationCases'.
Ensure downstream logic accounts for these entries in queries or condition checks.libs/judicial-system/formatters/src/lib/formatters.ts (1)
165-166
: Add string labels for 'STATEMENT_FROM_MINOR' and 'STATEMENT_IN_COURT'.
This matches the case types from the types library. No typing or bundling concerns found.apps/judicial-system/web/src/routes/Court/InvestigationCase/Ruling/Ruling.tsx (9)
116-117
: Boolean naming clarity
isRulingRequired
is set appropriately based on the case decision. However, if there are more conditions in the future, consider extracting this logic to a helper function or using a more descriptive variable naming if the condition grows.
208-209
: Conditional requirement is consistent
Disabling and making theintroduction
field optional when a ruling is not required aligns with the intended workflow.
251-252
: Matching pattern for “prosecutorDemands”
Similar tointroduction
, disabling and removing the required attribute forprosecutorDemands
is consistent with the case completion logic.
296-297
: “courtCaseFacts” logic
Disabling and removing requirement for “court case facts” is consistent with the new “without ruling” option.
344-345
: “courtLegalArguments” optional
Correctly follows the pattern of disabling fields that are no longer needed if no ruling is required.
358-358
: Disable RulingInput
This is correct, as no ruling input is needed if the decision is to complete the case without a ruling.
410-410
: Disable Decision
TheDecision
component is irrelevant for a “completed without ruling” scenario, so this conditional disable is appropriate.
445-445
: Check user flow
When disabled, any existing conclusion cannot be modified. Confirm whether this is acceptable if the user toggles away from the “completed without ruling” decision.
453-453
: Prevent PDF generation
Disabling thePdfButton
is logical because there is no ruling document to export.apps/judicial-system/web/messages/Core/sections.ts (1)
425-430
: New localization entry
The new message for cases concluded without a ruling is well-defined and consistent with the existing structure.apps/judicial-system/backend/src/app/modules/court/court.service.ts (1)
115-116
: Expanded subtype mappings
AddingSTATEMENT_FROM_MINOR
andSTATEMENT_IN_COURT
follows the established pattern incourtSubtypes
. Love the clarity and consistency here.apps/judicial-system/backend/src/app/messages/notifications.ts (1)
308-329
: New notification messages
Introducing messages for cases accepted without a ruling is clear and accurately describes the scenario. This is a good localization approach.apps/judicial-system/backend/src/app/modules/case/case.service.ts (1)
33-33
: Importing newCaseDecision
type
The new import aligns with the updated logic for cases completed without a ruling.apps/judicial-system/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts (52)
298-305
: New object-based email parameters
The shift to destructured arguments is clear and more manageable. No issues detected.
327-332
: Consistent destructured approach
This instance cleanly matches the updated email interface.
345-350
: Use ofgetCourtEmail
Looks good. The destructured format is consistent with the rest of the codebase.
364-371
: Defender email withskipTail
Ensuring we only append the tail for defenders with a national ID is logical.
525-531
: Prosecutor email notification
All parameters are presented clearly; good to see the consistent pattern.
575-580
: Email to prison
Straightforward destructuring; no issues found.
605-612
: Calendar invite for defender
Adding the.then
block is a nice touch to handle post-send steps. Implementation looks sound.
651-658
: Defender court-date link
The object-based approach enhances readability.
711-726
: Assigned official notification
Works well with the standard pattern.
872-891
: New method for indictment ruling props
Encapsulating subject and HTML creation is a good pattern.
892-923
: Refined logic forCOMPLETED_WITHOUT_RULING
Conditionally adjusting emails for “no ruling” scenarios is clear.
924-936
: Dispatching the correct email props
Nicely dispatches calls to the two specialized methods.
945-1002
: Shared props for defender logic
Reusing shared HTML props is a neat approach. No immediate concerns.
1034-1039
: Prison email for rulings
Parameters match the new object format.
1053-1058
: Prison administration email
Implementation is consistent with the global emailing pattern.
1078-1083
: Rejected custody email
Replicates the standard approach.
Line range hint
1180-1218
: Defender modifications
Changing the email details for isolation vs. standard modifications is handled clearly.
1254-1259
: Sending email to prison admin
Good use of destructuring. Maintains consistency.
1267-1272
: Sending email to prison
Adheres to the established pattern.
1278-1283
: Notification to prosecutor
Works as intended.
1289-1294
: Notification to judge
Straightforward destructuring.
1300-1305
: Notification to registrar
Naming matches the consistent approach in this file.
1358-1365
: Revoked email to prison
Simple adaptation to destructured format.
1391-1398
: Revoked email to defender
Skipping tail is appropriate when no national ID is present.
1428-1435
: Revoked email for indictment case
Destructured arguments appear valid.
1518-1523
: Sending revoked notification
Implementation aligns with the rest of the code.
1705-1712
: Cannot update defendants at court
The object approach is used consistently here too.
1733-1738
: Indictment denied
The destructured method call looks good.
1765-1770
: Indictment returned
Maintains the new format.
1799-1806
: Case files updated
UsingrecipientName: name
andrecipientEmail: email
is consistent with the function signature.
1923-1928
: Email to assigned role
No issues; code is straightforward.
1975-1980
: Appeal to judge
Clean usage of destructured arguments.
1986-1991
: Appeal to court
Every argument is well-defined.
1997-2002
: Appeal to registrar
Again, matches the consistent approach.
2008-2013
: Appeal to prosecutor
Implementation is correct.
2034-2041
: Appeal to defender
Attachments set to undefined andskipTail
condition are correct.
2096-2103
: Appeal received - email to court of appeals
Logic is straightforward.
2118-2123
: Email prosecutor upon appeal
All relevant fields are in place.
2143-2150
: Email defender upon appeal
‘skipTail’ usage again is consistent and valid.
2195-2200
: Appeal statement to assistant
No remarks; neatly matches the pattern.
2206-2211
: Appeal statement to judge1
Destructured fields look accurate.
2217-2222
: Appeal statement to judge2
All parameters set as intended.
2228-2233
: Appeal statement to judge3
Still consistent with the new approach.
2251-2256
: Appeal statement to prosecutor
Simple destructuring approach is correct.
2277-2284
: Appeal statement to defender
Offers a route link only if a national ID is present. Works well.
2338-2343
: Case files updated - court of appeal
The naming is unambiguous.
2360-2365
: Case files updated - prosecutor
All destructured parameters are properly assigned.
2421-2432
: Appeal completed - judge and prosecutor
Propagation of subject and body is standard.
2440-2447
: Appeal completed - prison admin
Matches logic applied to other recipients.
2460-2465
: Appeal completed - prison
No issues found; consistent usage.
2490-2497
: Appeal completed - defender
Ensures the route link is accessible if there's a national ID.
2522-2535
: Appeal discontinued
Both the prosecutor and defender are emailed with separate calls. Looks good.apps/judicial-system/backend/src/app/modules/notification/services/subpoenaNotification/subpoenaNotification.service.ts (1)
70-77
: Object-based email in subpoena service
Updating the call with object destructuring for readability is a valid approach. Consider migrating toPromise.allSettled()
as per prior learning if partial failures need special handling.
...m/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts
Outdated
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 8 Total Test Services: 0 Failed, 8 Passed Test Services
🔻 Code Coverage Decreases vs Default Branch (1)
|
apps/judicial-system/backend/src/app/modules/notification/baseNotification.service.ts
Show resolved
Hide resolved
...modules/notification/services/civilClaimantNotification/civilClaimantNotification.service.ts
Show resolved
Hide resolved
...src/app/modules/notification/services/defendantNotification/defendantNotification.service.ts
Show resolved
Hide resolved
...dules/notification/services/indictmentCaseNotification/indictmentCaseNotification.service.ts
Show resolved
Hide resolved
...d/src/app/modules/notification/services/subpoenaNotification/subpoenaNotification.service.ts
Show resolved
Hide resolved
...udicial-system/web/src/components/AccordionItems/RulingAccordionItem/RulingAccordionItem.tsx
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
...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
...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
...m/backend/src/app/modules/notification/services/caseNotification/caseNotification.service.ts
Outdated
Show resolved
Hide resolved
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: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/judicial-system/web/src/components/FormProvider/case.graphql
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/judicial-system/web/src/components/FormProvider/case.graphql (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/components/FormProvider/case.graphql (1)
Learnt from: gudjong
PR: island-is/island.is#16863
File: apps/judicial-system/web/src/components/FormProvider/case.graphql:47-47
Timestamp: 2024-11-27T14:33:19.485Z
Learning: In the `Case` GraphQL query at `apps/judicial-system/web/src/components/FormProvider/case.graphql`, the `defendantId` field is not needed in the `subpoenas` object within the `mergedCases.defendants` array.
🔇 Additional comments (4)
apps/judicial-system/web/src/components/FormProvider/case.graphql (4)
112-121
: Verify new case management fields for non-ruling investigations.
The addition of fields such asvalidToDate
,isValidToDateInThePast
,isCustodyIsolation
,isolationToDate
, and the subsequent fields (e.g.conclusion
,endOfSessionBookings
, etc.) supports the new functionality for completing investigation cases without a ruling. Please ensure that:
- These fields are correctly defined in the GraphQL schema,
- The backend resolvers are updated to supply proper data for them, and
- Their naming and types are consistent with the rest of the schema.
204-207
: Ensure proper backend support for additional case fields.
New fields likeopenedByDefender
,defendantWaivesRightToCounsel
,crimeScenes
, andindictmentIntroduction
have been incorporated to provide more nuanced case data for scenarios where a formal ruling isn’t submitted. Please verify that these fields are fully supported by the backend resolvers and that the data types match the schema definitions.
298-300
: Review the "mergeCase" field integration.
The query now includes a nestedmergeCase
object. Confirm that its structure (e.g. includingid
andcourtCaseNumber
) correctly reflects the updated case relationship model and that the backend is prepared to return data in this format.
153-153
: Check nested "decision" field consistency in parentCase.
Within theparentCase
selection (line 153), the fielddecision
still appears even though the main (root) case query now has this field removed (or commented out). Ensure that this discrepancy is intentional—if the nested case must return a decision field, it should be clearly documented to avoid client-side confusion.
apps/judicial-system/web/src/components/FormProvider/case.graphql
Outdated
Show resolved
Hide resolved
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)
apps/judicial-system/web/src/routes/Shared/Cases/cases.graphql (1)
26-26
: Addition of Gender Field in Defendant ObjectThe introduction of the
gender
field enhances the defendant details in the cases query. Please ensure that all downstream components and client-side consumers of this data are updated to handle the new field appropriately.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/judicial-system/web/src/components/PageLayout/utils/index.spec.tsx
(1 hunks)apps/judicial-system/web/src/routes/Shared/Cases/cases.graphql
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/judicial-system/web/src/components/PageLayout/utils/index.spec.tsx
🧰 Additional context used
📓 Path-based instructions (1)
`apps/**/*`: "Confirm that the code adheres to the following...
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/routes/Shared/Cases/cases.graphql
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: build (judicial-system-backend)
- GitHub Check: build (judicial-system-api,judicial-system-digital-mailbox-api,judicial-system-message-handler,ju...
- GitHub Check: linting (judicial-system-api,judicial-system-backend,judicial-system-web,judicial-system-consts,j...
- GitHub Check: tests (judicial-system-backend)
- GitHub Check: formatting
- GitHub Check: tests (judicial-system-api,judicial-system-auth,judicial-system-consts,judicial-system-digital-ma...
- GitHub Check: linting-workspace
Máli lokið hjá héraðsdómi án undirritaðs úrskurðar (t.d. skýrslutaka)
What
Allow judges to complete investigation cases without submitting a ruling
Why
Because some cases don't require rulings and when that happens currently the judge has no way to close the case so that it moves out of the Active case list where it doesn't belong anymore.
Video
Screen.Recording.2025-01-23.at.14.09.48.mov
Checklist:
Summary by CodeRabbit
New Features
Enhancements