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): Select subpoena type #15164

Merged
merged 39 commits into from
Jun 20, 2024
Merged

feat(j-s): Select subpoena type #15164

merged 39 commits into from
Jun 20, 2024

Conversation

oddsson
Copy link
Member

@oddsson oddsson commented Jun 10, 2024

Select subpoena type

Asana

What

Select either ARREST or ABSENCE subpoena types.

Why

This is a part of the indictments flow we are creating.

Screenshots / Gifs

image

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 subpoena functionality with multiple types (e.g., absence, arrest) in the judicial system app.
    • Added a required court room field in court arrangements when necessary.
  • Bug Fixes

    • Changed policeCaseNumber prop to elementId in indictment case files list.
  • Improvements

    • Enhanced PDF generation service to include subpoenas.
    • Updated role and permission checks for accessing subpoena PDFs.
  • Styling

    • Added responsive grid layout specific to subpoena pages.

Copy link
Contributor

coderabbitai bot commented Jun 10, 2024

Warning

Rate limit exceeded

@kodiakhq[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 23 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between f51869a and 6635fce.

Walkthrough

This update brings multiple enhancements to the judicial system's web and backend components. Major changes include the addition of a new subpoena feature, updates to various React components to handle new properties and functionalities, and renaming services for consistency. The web module now includes subpoena-related UI components and logic, while backend adjustments support generating and managing subpoena PDFs.

Changes

Files/Groups Change Summary
apps/judicial-system/web/src/components/CourtArrangements/..., IndictmentCaseFilesList/..., PdfButton/... Added new props, altered parameter names, and expanded enums.
apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/... Introduced subpoena-related UI components, messages, and styles.
apps/judicial-system/web/src/routes/Court/components/ReceptionAndAssignment/... Removed useState import and usage.
apps/judicial-system/web/src/routes/Shared/Cases/Cases.spec.tsx Removed imports and declarations related to CaseType, mockPrisonUserQuery, and PrisonCasesDocument.
apps/judicial-system/api/src/app/modules/auth/auth.controller.ts Reordered parameters in the login method of AuthController.
apps/judicial-system/api/src/app/modules/file/file.controller.ts Added and removed various imports, modified method signatures, and introduced new functionalities.
apps/judicial-system/backend/src/app/formatters/index.ts, subpoenaPdf.ts Added export for createSubpoena and updated function signatures to handle subpoenas.
apps/judicial-system/backend/src/app/modules/case/... Renamed PDFService to PdfService, added method getSubpoenaPdf, and updated import paths.
apps/judicial-system/backend/src/app/modules/defendant/... Added PdfService to controllers and services, and introduced new imports for handling subpoenas.
apps/judicial-system/backend/src/app/modules/defendant/test/... Included tests for new subpoena PDF guards and role rules, updated module setup to include PdfService.
libs/judicial-system/audit-trail/src/lib/auditTrail.service.ts Added GET_SUBPOENA_PDF to the AuditedAction enum.

Sequence Diagram(s)

Subpoena PDF Request Flow

sequenceDiagram
    participant DefendantController
    participant PdfService
    participant DefendantService
    participant PdfGenerator

    DefendantController->>DefendantService: Validate Defendant
    DefendantService-->>DefendantController: Defendant Info
    DefendantController->>PdfService: Request Subpoena PDF
    PdfService->>PdfGenerator: Generate Subpoena PDF
    PdfGenerator-->>PdfService: Subpoena PDF
    PdfService-->>DefendantController: Subpoena PDF
    DefendantController-->>Client: Return Subpoena PDF
Loading

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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.

@datadog-island-is
Copy link

datadog-island-is bot commented Jun 10, 2024

Datadog Report

All test runs 9006483 🔗

5 Total Test Services: 0 Failed, 5 Passed
🔻 Test Sessions change in coverage: 2 decreased, 3 increased, 2 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
judicial-system-api 0 0 0 54 0 8.55s 1 decreased (-0.03%) Link
judicial-system-audit-trail 0 0 0 7 0 17.31s 1 increased (+0.09%) Link
judicial-system-backend 0 0 0 20407 0 17m 50.71s 1 increased (+0.06%) Link
judicial-system-web 0 0 0 312 0 59.52s 1 decreased (-0.06%) Link
judicial-system-xrd-api 0 0 0 6 0 9.68s 1 increased (+0.03%) Link

🔻 Code Coverage Decreases vs Default Branch (2)

  • judicial-system-web - jest 32.52% (-0.06%) - Details
  • judicial-system-api - jest 19.58% (-0.03%) - Details

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 36.66667% with 57 lines in your changes missing coverage. Please review.

Project coverage is 37.09%. Comparing base (538b16b) to head (6635fce).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15164      +/-   ##
==========================================
- Coverage   37.14%   37.09%   -0.05%     
==========================================
  Files        6477     6458      -19     
  Lines      131920   131489     -431     
  Branches    37725    37639      -86     
==========================================
- Hits        48997    48782     -215     
+ Misses      82923    82707     -216     
Flag Coverage Δ
judicial-system-api 18.15% <0.00%> (-0.05%) ⬇️
judicial-system-audit-trail 67.75% <100.00%> (+0.08%) ⬆️
judicial-system-backend 56.15% <67.39%> (+0.06%) ⬆️

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

Files Coverage Δ
...udicial-system/backend/src/app/formatters/index.ts 100.00% <100.00%> (ø)
...em/backend/src/app/modules/case/case.controller.ts 84.17% <100.00%> (ø)
...icial-system/backend/src/app/modules/case/index.ts 100.00% <100.00%> (ø)
...ckend/src/app/modules/case/internalCase.service.ts 85.60% <100.00%> (ø)
...c/app/modules/case/limitedAccessCase.controller.ts 97.56% <100.00%> (ø)
.../src/app/modules/case/limitedAccessCase.service.ts 72.07% <100.00%> (ø)
...c/app/modules/case/test/createTestingCaseModule.ts 100.00% <100.00%> (ø)
.../src/app/modules/defendant/defendant.controller.ts 100.00% <100.00%> (ø)
...end/src/app/modules/defendant/defendant.service.ts 81.60% <ø> (ø)
...les/defendant/test/createTestingDefendantModule.ts 100.00% <100.00%> (ø)
... and 14 more

... and 79 files with indirect coverage changes


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 538b16b...6635fce. Read the comment docs.

@oddsson oddsson changed the title Add UI for selecting subpoena type feat(j-s): Select subpoena type Jun 11, 2024
@gudjong gudjong added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Jun 20, 2024
@oddsson oddsson added deprecated:automerge (Disabled) Merge this PR as soon as all checks pass and removed deprecated:automerge (Disabled) Merge this PR as soon as all checks pass labels Jun 20, 2024
@kodiakhq kodiakhq bot merged commit 1ac3a91 into main Jun 20, 2024
33 of 34 checks passed
@kodiakhq kodiakhq bot deleted the j-s/subpoenaType branch June 20, 2024 15:49
@coderabbitai coderabbitai bot mentioned this pull request Jan 15, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants