Skip to content
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): Indictment reassignment and transition to main hearing #14638

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

unakb
Copy link
Member

@unakb unakb commented Apr 29, 2024

Útfæra Endurúthlutunar virkni

What

Added transition called Redistribute that moves a case to a main hearing state and removes judge

Why

To allow judges to redistribute indictment cases

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Introduced a new case state MAIN_HEARING and transition REDISTRIBUTE for judicial processes.
    • Updated user interfaces to reflect new state and transition options.
  • Enhancements

    • Improved accessibility of cases in specific states for prosecution and district court users.
  • Tests

    • Added tests to ensure the correct behavior of new case states and transitions.
  • Documentation

    • Updated component documentation to include new state and transition descriptions.

Copy link
Contributor

coderabbitai bot commented Apr 29, 2024

Walkthrough

The recent update introduces a new case state MAIN_HEARING and a transition REDISTRIBUTE affecting multiple components of the judicial system app. This includes backend changes to enums, service logic, and access filters, along with frontend updates for displaying the new state. The modification facilitates the redistribution of cases by setting judgeId to null and extends access to the new state for specific user roles.

Changes

Files Change Summary
.../migrations/20240424112600-update-case.js Adds MAIN_HEARING to the enum values for 'state' in the 'case' table.
.../case.controller.ts, .../case.state.ts, .../caseController/transition.spec.ts Adds REDISTRIBUTE transition, affecting case state changes and controller logic.
.../case.service.ts, .../case.state.spec.ts Modifies UpdateCase interface and adds tests for new case transitions.
.../case.filter.ts, .../cases.filter.ts, .../cases.filter.spec.ts Updates case access and query filters to include MAIN_HEARING.
.../rolesRules.ts Updates role rules to include REDISTRIBUTE transition for district court judges.
.../TagCaseState/... Frontend updates to handle display and styling for the new MAIN_HEARING state.
.../types/src/lib/case.ts Updates enums for CaseState and CaseTransition to include new state and transition.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@unakb unakb marked this pull request as ready for review April 29, 2024 15:58
@unakb unakb requested a review from a team as a code owner April 29, 2024 15:58
Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.16%. Comparing base (57a4c05) to head (717b16c).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #14638   +/-   ##
=======================================
  Coverage   37.16%   37.16%           
=======================================
  Files        6237     6237           
  Lines      126380   126384    +4     
  Branches    36157    36158    +1     
=======================================
+ Hits        46970    46974    +4     
  Misses      79410    79410           
Flag Coverage Δ
judicial-system-api 16.98% <100.00%> (+0.06%) ⬆️
judicial-system-formatters 83.15% <100.00%> (+0.05%) ⬆️
judicial-system-message 65.51% <ø> (ø)
judicial-system-message-handler 64.27% <100.00%> (+0.07%) ⬆️
judicial-system-types 41.04% <100.00%> (+0.29%) ⬆️
judicial-system-web 28.67% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...em/backend/src/app/modules/case/case.controller.ts 81.31% <ø> (ø)
...ystem/backend/src/app/modules/case/case.service.ts 92.37% <ø> (ø)
...ackend/src/app/modules/case/filters/case.filter.ts 95.49% <ø> (ø)
...ckend/src/app/modules/case/filters/cases.filter.ts 97.72% <ø> (ø)
.../backend/src/app/modules/case/guards/rolesRules.ts 32.00% <ø> (ø)
...m/backend/src/app/modules/case/state/case.state.ts 100.00% <ø> (ø)
...rc/components/TagCaseState/TagCaseState.strings.ts 100.00% <ø> (ø)
...m/web/src/components/TagCaseState/TagCaseState.tsx 100.00% <100.00%> (ø)
libs/judicial-system/types/src/lib/case.ts 95.05% <100.00%> (+0.05%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57a4c05...717b16c. Read the comment docs.

@datadog-island-is
Copy link

Datadog Report

All test runs 7bc8967 🔗

9 Total Test Services: 0 Failed, 9 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.06%), 5 increased, 5 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Code Coverage Change Test Service View
judicial-system-api 0 0 0 52 0 280.36ms 1 increased (+0.07%) Link
judicial-system-backend 0 0 0 13685 0 15m 52.02s 1 no change Link
judicial-system-formatters 0 0 0 36 0 189.41ms 1 increased (+0.04%) Link
judicial-system-message 0 0 0 27 0 310.06ms 1 no change Link
judicial-system-message-handler 0 0 0 3 0 39.57ms 1 increased (+0.07%) Link
judicial-system-types 0 0 0 19 0 65.73ms 1 increased (+0.42%) Link
judicial-system-web 0 0 0 311 0 46.21s 1 decreased (-0.06%) Link
judicial-system-xrd-api 0 0 0 6 0 123.89ms 1 increased (+0.06%) Link
web 0 0 0 84 0 3.54s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • judicial-system-web - jest 33.13% (-0.06%) - Details

@oddsson oddsson added the automerge Merge this PR as soon as all checks pass label Apr 30, 2024
@kodiakhq kodiakhq bot merged commit cfc06df into main Apr 30, 2024
35 checks passed
@kodiakhq kodiakhq bot deleted the j-s/reassignment-indictment branch April 30, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants