-
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): API endpoint to update subpoena #15051
Conversation
…land-is/island.is into j-s/fix-config-digital-mailbox
…nd.is into j-s/defenders-api
…nd.is into j-s/defenders-api
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: 2
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts (2 hunks)
- apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.tsx (4 hunks)
Additional context used
Path-based instructions (2)
apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.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/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."
Biome
apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.tsx
[error] 1-1: The default import is only used as a type.
[error] 12-16: Some named imports are only used as types.
apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts
[error] 38-38: Decorators are not valid here.
[error] 41-41: Decorators are not valid here.
[error] 1-2: All these imports are only used as types.
[error] 15-20: Some named imports are only used as types.
[error] 28-29: All these imports are only used as types.
[error] 29-30: All these imports are only used as types.
[error] 30-31: All these imports are only used as types.
[error] 32-33: All these imports are only used as types.
Additional comments not posted (3)
apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.tsx (3)
101-101
: Ensure that thedisabled
property correctly handles theDefenderChoice.WAIVE
state.Verification successful
Ensure that the
disabled
property correctly handles theDefenderChoice.WAIVE
state.
- The search results show that the
disabled
property is used extensively across the codebase.- Specifically, in the file
apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.tsx
, thedisabled
property is set based on thedefendant.defenderChoice === DefenderChoice.WAIVE
condition.Given the extensive usage of the
disabled
property and the specific context provided, it is crucial to verify that theDefenderChoice.WAIVE
state is correctly handled in theSelectDefender.tsx
file.
- The
disabled
property correctly handles theDefenderChoice.WAIVE
state in theSelectDefender.tsx
file. The conditiondefendant.defenderChoice === DefenderChoice.WAIVE
is appropriately used to set thedisabled
property.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Ensure that the `disabled` property correctly handles the `DefenderChoice.WAIVE` state. # Test: Search for the usage of `disabled` property in relation to `DefenderChoice.WAIVE`. Expect: Consistent and correct usage. rg --type typescript $'disabled'Length of output: 66
Script:
#!/bin/bash # Description: Ensure that the `disabled` property correctly handles the `DefenderChoice.WAIVE` state. # Test: Search for the usage of `disabled` property in relation to `DefenderChoice.WAIVE`. Expect: Consistent and correct usage. rg --type ts 'disabled'Length of output: 129601
88-88
: Verify that the checkbox correctly reflects theDefenderChoice.WAIVE
state.Verification successful
The search results indicate that
DefenderChoice.WAIVE
is used consistently in the codebase, including in theSelectDefender.tsx
file where the checkbox state is being set. This suggests that the checkbox should correctly reflect theDefenderChoice.WAIVE
state.
apps/judicial-system/web/src/utils/validate.ts
apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.tsx
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the checkbox correctly reflects the `DefenderChoice.WAIVE` state. # Test: Search for the usage of `DefenderChoice.WAIVE` in the codebase. Expect: Consistent usage according to new requirements. rg --type typescript $'DefenderChoice.WAIVE'Length of output: 78
Script:
#!/bin/bash # Description: Verify that the checkbox correctly reflects the `DefenderChoice.WAIVE` state. # Test: Search for the usage of `DefenderChoice.WAIVE` in the codebase. Expect: Consistent usage according to new requirements. rg --type ts $'DefenderChoice.WAIVE'Length of output: 576
55-58
: Ensure the logic for settingdefenderChoice
aligns with the new business requirements.Verification successful
The logic for setting
defenderChoice
appears to be consistent with the new business requirements across the codebase. The relevant files show thatdefenderChoice
is being set and used appropriately, particularly inSelectDefender.tsx
,validate.ts
,mocks.ts
, andcase.service.ts
.
- In
SelectDefender.tsx
,defenderChoice
is set based ondefendantWaivesRightToCounsel
and used to control form behavior.- In
validate.ts
,defenderChoice
is checked to validate the defender step.- In
mocks.ts
,defenderChoice
is set tonull
for mock data.- In
case.service.ts
,defenderChoice
is used in the context of updating and patching defender information.These usages align with the expected logic and business requirements.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the logic for setting `defenderChoice` aligns with the new business requirements. # Test: Search for the usage of `defenderChoice` in the codebase. Expect: Consistent usage according to new requirements. rg --type typescript $'defenderChoice'Length of output: 72
Script:
#!/bin/bash # Description: Verify that the logic for setting `defenderChoice` aligns with the new business requirements. # Test: Search for the usage of `defenderChoice` in the codebase. Expect: Consistent usage according to new requirements. rg --type-add 'ts:*.{ts,tsx}' --type ts 'defenderChoice'Length of output: 2908
Script:
#!/bin/bash # Extract relevant lines from files where `defenderChoice` is used to verify consistency with new business requirements. # Extract lines from SelectDefender.tsx rg --type-add 'ts:*.{ts,tsx}' --type ts -A 5 -B 5 'defenderChoice' apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.tsx # Extract lines from validate.ts rg --type-add 'ts:*.{ts,tsx}' --type ts -A 5 -B 5 'defenderChoice' apps/judicial-system/web/src/utils/validate.ts # Extract lines from mocks.ts rg --type-add 'ts:*.{ts,tsx}' --type ts -A 5 -B 5 'defenderChoice' apps/judicial-system/web/src/utils/mocks.ts # Extract lines from case.service.ts rg --type-add 'ts:*.{ts,tsx}' --type ts -A 5 -B 5 'defenderChoice' apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.service.tsLength of output: 4419
apps/judicial-system/web/src/routes/Court/Indictments/Defender/SelectDefender.tsx
Show resolved
Hide resolved
apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.controller.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.controller.ts
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql (1 hunks)
- apps/judicial-system/web/src/routes/Defender/Cases/defenderCases.graphql (1 hunks)
- apps/judicial-system/web/src/routes/Shared/Cases/prisonCases.graphql (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql
- apps/judicial-system/web/src/routes/Defender/Cases/defenderCases.graphql
- apps/judicial-system/web/src/routes/Shared/Cases/prisonCases.graphql
API birtingar- endapunktar fyrir pósthólf til að setja verjanda
What
Added new API endpoint to set subpoena defense choice
Added new endpoint (WIP) that returns subpoena information for a defendant
Some refactoring of mapping logic in API layer
Checklist:
Summary by CodeRabbit
New Features
defenderChoice
field to replacedefendantWaivesRightToCounsel
for better clarity on defense choices.Bug Fixes
Refactor
defenderChoice
instead ofdefendantWaivesRightToCounsel
.Tests
defenderChoice
field and refined guard checks.