-
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): Add subpoenaType to Defendant table #15198
Conversation
WalkthroughThe changes introduce a new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant WebApp
participant Backend
participant Database
Client->>WebApp: Update Defendant (subpoenaType)
WebApp->>Backend: Send UpdateDefendantDto (subpoenaType)
Backend->>Database: Update defendant table with subpoena_type
Database->>Backend: Acknowledge update
Backend->>WebApp: Confirm update
WebApp->>Client: Display updated defendant info
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15198 +/- ##
=======================================
Coverage 37.02% 37.02%
=======================================
Files 6423 6423
Lines 131043 131053 +10
Branches 37524 37529 +5
=======================================
+ Hits 48513 48518 +5
- Misses 82530 82535 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
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
Outside diff range and nitpick comments (1)
apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts (1)
Line range hint
1-1
: Please run the autofix to sort the imports as suggested by the linting tool.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (9)
- apps/judicial-system/api/src/app/modules/defendant/dto/updateDefendant.input.ts (2 hunks)
- apps/judicial-system/api/src/app/modules/defendant/models/defendant.model.ts (2 hunks)
- apps/judicial-system/backend/migrations/20240611213639-update-defendant.js (1 hunks)
- apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts (2 hunks)
- apps/judicial-system/web/src/components/FormProvider/case.graphql (1 hunks)
- apps/judicial-system/web/src/utils/hooks/useCase/updateCase.graphql (1 hunks)
- libs/judicial-system/types/src/index.ts (1 hunks)
- libs/judicial-system/types/src/lib/defendant.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- libs/judicial-system/types/src/index.ts
Additional context used
Path-based instructions (8)
libs/judicial-system/types/src/lib/defendant.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/migrations/20240611213639-update-defendant.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/api/src/app/modules/defendant/dto/updateDefendant.input.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/dto/updateDefendant.dto.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/defendant/models/defendant.model.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/models/defendant.model.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/hooks/useCase/updateCase.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."
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."
GitHub Check: linting (judicial-system-backend)
apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts
[failure] 1-1:
Run autofix to sort these imports!
Additional comments not posted (9)
libs/judicial-system/types/src/lib/defendant.ts (1)
14-17
: The addition of theSubpoenaType
enum is well-defined and aligns with the PR objectives.apps/judicial-system/api/src/app/modules/defendant/dto/updateDefendant.input.ts (1)
93-96
: The addition of the optionalsubpoenaType
field is correctly implemented and aligns with the PR objectives.apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts (1)
89-92
: The addition of the optionalsubpoenaType
field is correctly implemented and aligns with the PR objectives.apps/judicial-system/api/src/app/modules/defendant/models/defendant.model.ts (2)
8-8
: The import and registration ofSubpoenaType
are correctly implemented.Also applies to: 15-15
79-80
: The addition of thesubpoenaType
field to theDefendant
class is correctly implemented with appropriate GraphQL decorators.apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts (2)
19-19
: The import ofSubpoenaType
is correctly implemented.
134-140
: The addition of thesubpoenaType
field to theDefendant
model is correctly implemented with appropriate Sequelize decorators and dynamic enum values.apps/judicial-system/web/src/utils/hooks/useCase/updateCase.graphql (1)
25-25
: The addition of thesubpoenaType
field in theupdateCase
mutation is correctly implemented.apps/judicial-system/web/src/components/FormProvider/case.graphql (1)
28-28
: The addition of thesubpoenaType
field in thecase
query is correctly implemented.
apps/judicial-system/backend/migrations/20240611213639-update-defendant.js
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)
|
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.
Nice, looks good! There's just one linting error that Git caught in the update defendant dto.
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/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts
…land.is into j-s/subpoena-type-to-db-pt2
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/utils/hooks/useDefendants/index.ts (2)
Line range hint
55-57
: Consider simplifying the control flow by removing the unnecessaryelse
clause.- } else { - return false - }This change makes the code cleaner and reduces unnecessary nesting.
Line range hint
76-78
: Similar to the previous comment, theelse
clause here is redundant and can be omitted for cleaner code.- } else { - return false - }Removing this will streamline the function and improve readability.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/judicial-system/web/src/utils/hooks/useDefendants/index.ts (1 hunks)
Additional context used
Path-based instructions (1)
apps/judicial-system/web/src/utils/hooks/useDefendants/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."
Biome
apps/judicial-system/web/src/utils/hooks/useDefendants/index.ts
[error] 55-57: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)
Unsafe fix: Omit the else clause.
[error] 76-78: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)
Unsafe fix: Omit the else clause.
Additional comments not posted (2)
apps/judicial-system/web/src/utils/hooks/useDefendants/index.ts (2)
13-15
: Corrected typos in import statements enhance maintainability and prevent potential runtime errors.
Line range hint
1-100
: The implementation adheres to NextJS best practices, including efficient state management and optimal use of TypeScript for type safety.
* Add subpoenaType to Defendant table * Fix lint * Fix build --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* Add subpoenaType to Defendant table * Fix lint * Fix build --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Add subpoena type to case table
Asana
What
Add a new field,
subpoenaType
to DB.Why
This is a part of the new indictment cases flow we are creating.
Checklist:
Summary by CodeRabbit
New Features
subpoenaType
field to various components and models to support different types of subpoenas (e.g., 'ABSENCE' and 'ARREST').Bug Fixes