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): Judge confirms defender and civil claimant defense choices #16480

Merged
merged 22 commits into from
Oct 23, 2024

Conversation

unakb
Copy link
Member

@unakb unakb commented Oct 18, 2024

Dómstóll geti skipað verjendur og réttargæslumenn/lögmenn

Vantar val að geta deilt gögnum með verjanda hjá dómnum

What

  • Added field to register whether defender choice has been confirmed by the judge
  • Added field to register whether civil claimant defender choice has been confirmed by the judge
  • Added field that decides whether defender has access to case files or not

Why

  • To give the judge control in indictment cases over whether and when to open a case and share files with defenders and civil claimant defenders.

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

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

Release Notes

  • New Features

    • Added optional fields for confirming defender choices and spokesperson confirmations across various models and DTOs.
    • Introduced modals for confirming defender and spokesperson choices in the user interface.
    • Enhanced GraphQL queries to include new confirmation fields for defenders and civil claimants.
    • Updated user interface components to manage visibility and interactions related to defender and spokesperson confirmations.
  • Bug Fixes

    • Improved error handling in several services related to defender and spokesperson actions.
  • Documentation

    • Updated message definitions for user prompts related to defender and spokesperson choices.

These updates enhance user experience by providing clearer confirmations and improved data handling related to legal representation.

@datadog-island-is
Copy link

datadog-island-is bot commented Oct 18, 2024

Datadog Report

All test runs 501f1dd 🔗

50 Total Test Services: 0 Failed, 48 Passed
🔻 Test Sessions change in coverage: 3 decreased, 1 increased (+0.04%), 175 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-web 0 0 0 2 0 8.79s 1 no change Link
api 0 0 0 4 0 2.76s 1 no change Link
api-domains-auth-admin 0 0 0 18 0 12.75s 1 no change Link
api-domains-mortgage-certificate 0 0 0 5 0 18.41s 1 no change Link
application-api-files 0 0 0 12 0 5.79s 1 no change Link
application-core 0 0 0 92 0 18.87s 1 no change Link
application-system-api 0 0 0 120 2 3m 36.33s 1 no change Link
application-template-api-modules 0 0 0 123 0 2m 41.78s 1 no change Link
application-templates-accident-notification 0 0 0 148 0 21.87s 1 no change Link
application-templates-criminal-record 0 0 0 2 0 10s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (3)

  • judicial-system-api - jest 19.61% (-0.08%) - Details
  • judicial-system-web - jest 32.1% (-0.08%) - Details
  • services-auth-personal-representative-public - jest 40.69% (-0.03%) - Details

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 27.50000% with 87 lines in your changes missing coverage. Please review.

Project coverage is 36.76%. Comparing base (6e20081) to head (73f03b3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tes/Court/Indictments/Advocates/SelectDefender.tsx 0.00% 41 Missing ⚠️
...ictments/Advocates/SelectCivilClaimantAdvocate.tsx 0.00% 22 Missing ⚠️
...ckend/src/app/modules/subpoena/subpoena.service.ts 0.00% 6 Missing ⚠️
...app/modules/defendant/dto/updateDefendant.input.ts 0.00% 4 Missing ⚠️
...rc/app/modules/defendant/models/defendant.model.ts 0.00% 4 Missing ⚠️
...modules/defendant/dto/updateCivilClaimant.input.ts 0.00% 2 Missing ⚠️
...pp/modules/defendant/models/civilClaimant.model.ts 0.00% 2 Missing ⚠️
...end/src/app/modules/defendant/defendant.service.ts 0.00% 2 Missing ⚠️
apps/judicial-system/web/src/utils/validate.ts 0.00% 2 Missing ⚠️
.../backend/src/app/modules/case/guards/rolesRules.ts 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16480      +/-   ##
==========================================
- Coverage   36.77%   36.76%   -0.01%     
==========================================
  Files        6850     6851       +1     
  Lines      142015   142120     +105     
  Branches    40493    40542      +49     
==========================================
+ Hits        52225    52251      +26     
- Misses      89790    89869      +79     
Flag Coverage Δ
air-discount-scheme-web 0.00% <ø> (ø)
api 3.37% <ø> (ø)
api-domains-auth-admin 48.48% <ø> (ø)
api-domains-mortgage-certificate 34.98% <ø> (ø)
application-api-files 56.76% <ø> (ø)
application-core 71.64% <ø> (ø)
application-system-api 41.37% <ø> (ø)
application-template-api-modules 27.82% <ø> (ø)
application-templates-accident-notification 29.27% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 26.34% <ø> (ø)
application-templates-driving-license 18.34% <ø> (ø)
application-templates-estate 12.31% <ø> (ø)
application-templates-example-payment 25.14% <ø> (ø)
application-templates-financial-aid 15.49% <ø> (ø)
application-templates-general-petition 23.44% <ø> (ø)
application-templates-inheritance-report 6.49% <ø> (ø)
application-templates-marriage-conditions 15.17% <ø> (ø)
application-templates-mortgage-certificate 43.56% <ø> (ø)
application-templates-parental-leave 29.96% <ø> (ø)
application-types 6.63% <ø> (ø)
application-ui-components 1.28% <ø> (ø)
application-ui-shell 21.36% <ø> (ø)
auth-react 22.81% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-syslumenn 49.49% <ø> (ø)
contentful-apps 5.44% <ø> (ø)
financial-aid-backend 56.25% <ø> (ø)
financial-aid-shared 18.94% <ø> (ø)
island-ui-core 28.44% <ø> (ø)
judicial-system-api 18.36% <0.00%> (-0.07%) ⬇️
judicial-system-backend 55.16% <76.74%> (+0.03%) ⬆️
judicial-system-web 27.81% <0.00%> (-0.12%) ⬇️
nest-aws 61.15% <ø> (ø)
portals-admin-regulations-admin 1.85% <ø> (ø)
portals-core 16.14% <ø> (ø)
services-auth-admin-api 51.94% <ø> (ø)
services-auth-delegation-api 57.37% <ø> (ø)
services-auth-ids-api 51.42% <ø> (-0.01%) ⬇️
services-auth-personal-representative 45.15% <ø> (ø)
services-auth-personal-representative-public 41.16% <ø> (-0.08%) ⬇️
services-auth-public-api 48.91% <ø> (ø)
services-endorsements-api 53.59% <ø> (ø)
services-user-notification 46.93% <ø> (ø)
services-user-profile 61.84% <ø> (ø)
shared-components 27.70% <ø> (ø)
shared-form-fields 31.57% <ø> (ø)
skilavottord-ws 24.24% <ø> (ø)
web 1.80% <ø> (ø)

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

Files with missing lines Coverage Δ
...ackend/src/app/modules/case/filters/case.filter.ts 88.88% <100.00%> (ø)
...ckend/src/app/modules/case/filters/cases.filter.ts 97.91% <ø> (ø)
...dules/defendant/dto/internalUpdateDefendant.dto.ts 100.00% <100.00%> (ø)
...c/app/modules/defendant/dto/updateDefendant.dto.ts 96.15% <100.00%> (+0.32%) ⬆️
.../modules/defendant/internalDefendant.controller.ts 90.00% <100.00%> (ø)
...pp/modules/defendant/models/civilClaimant.model.ts 94.44% <100.00%> (+0.50%) ⬆️
...rc/app/modules/defendant/models/defendant.model.ts 89.79% <100.00%> (+2.29%) ⬆️
...nd/src/app/modules/file/guards/caseFileCategory.ts 95.74% <100.00%> (ø)
...src/app/modules/subpoena/dto/updateSubpoena.dto.ts 100.00% <100.00%> (ø)
...s/Court/Indictments/Advocates/Advocates.strings.ts 0.00% <ø> (ø)
... and 11 more

... and 1 file 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 6e20081...73f03b3. Read the comment docs.

@unakb unakb changed the title J s/judge confirms defense choices feat(j-s): Judge confirms defender and civil claimant defense choices Oct 21, 2024
@unakb unakb marked this pull request as ready for review October 21, 2024 12:33
@unakb unakb requested a review from a team as a code owner October 21, 2024 12:33
Copy link
Contributor

coderabbitai bot commented Oct 21, 2024

Walkthrough

This pull request introduces updates to the judicial system's data models and GraphQL schemas, focusing on the addition of new optional boolean fields related to defender and spokesperson confirmations. These changes affect various classes and migration scripts, ensuring that new properties are included in both the database and application logic. The updates enhance validation and access control mechanisms to reflect the new fields, improving the overall functionality of the system.

Changes

File Change Summary
apps/judicial-system/api/src/app/modules/defendant/dto/updateCivilClaimant.input.ts Added optional field isSpokespersonConfirmed (boolean) to UpdateCivilClaimantInput.
apps/judicial-system/api/src/app/modules/defendant/dto/updateDefendant.input.ts Added optional fields isDefenderChoiceConfirmed and caseFilesSharedWithDefender (both boolean) to UpdateDefendantInput.
apps/judicial-system/api/src/app/modules/defendant/models/civilClaimant.model.ts Added optional field isSpokespersonConfirmed (boolean) to CivilClaimant.
apps/judicial-system/api/src/app/modules/defendant/models/defendant.model.ts Added optional fields isDefenderChoiceConfirmed and caseFilesSharedWithDefender (both boolean) to Defendant.
apps/judicial-system/backend/migrations/20241015110312-update-defendant.js Migration to add columns is_defender_choice_confirmed and case_files_shared_with_defender (both BOOLEAN) to defendant table.
apps/judicial-system/backend/migrations/20241018105400-update-civil-claimant.js Migration to add column is_spokesperson_confirmed (BOOLEAN) to civil_claimant table.
apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts Updated updateByNationalId method to include optional user parameter and logic for isDefenderChoiceConfirmed.
apps/judicial-system/backend/src/app/modules/defendant/dto/updateCivilClaimant.dto.ts Added optional property isSpokespersonConfirmed (boolean) to UpdateCivilClaimantDto.
apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts Added optional properties isDefenderChoiceConfirmed and caseFilesSharedWithDefender (both boolean) to UpdateDefendantDto.
apps/judicial-system/backend/src/app/modules/defendant/models/civilClaimant.model.ts Renamed methods and added property isSpokespersonConfirmed (boolean) to CivilClaimant.
apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts Renamed method and added properties isDefenderChoiceConfirmed and caseFilesSharedWithDefender (both boolean) to Defendant.
apps/judicial-system/backend/src/app/modules/subpoena/dto/updateSubpoena.dto.ts Added optional properties isDefenderChoiceConfirmed and caseFilesSharedWithDefender (both boolean) to UpdateSubpoenaDto.
apps/judicial-system/backend/src/app/modules/subpoena/subpoena.service.ts Updated update method to include optional user parameter and logic for isDefenderChoiceConfirmed.
apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.service.ts Updated updateSubpoenaInfo method to include new defender properties.
apps/judicial-system/web/src/components/FormProvider/case.graphql Added fields isDefenderChoiceConfirmed, caseFilesSharedWithDefender, and isSpokespersonConfirmed to GraphQL query.
apps/judicial-system/web/src/routes/Court/Indictments/Advocates/Advocates.strings.ts Added new message definitions related to defender and spokesperson confirmations.
apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectCivilClaimantAdvocate.tsx Added modal for confirming spokesperson choice and updated logic for civil claimant updates.
apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectDefender.tsx Added modal for confirming defender choice and updated logic for managing defender choices.
apps/judicial-system/web/src/utils/validate.ts Updated validation logic for defenderChoice to include new conditions.
apps/judicial-system/xrd-api/src/app/app.service.ts Updated updateSubpoenaInfo method to use structured defenderInfo object for defender details.
apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts Updated access control logic to use confirmed defender and spokesperson methods.
apps/judicial-system/backend/src/app/modules/case/guards/rolesRules.ts Updated defender access rule to use confirmed methods for validation.
apps/judicial-system/backend/src/app/modules/file/guards/caseFileCategory.ts Updated logic to check confirmed defender and spokesperson access rights.
apps/judicial-system/backend/src/app/modules/case/filters/test/defenceUserFilter.spec.ts Updated test cases to include new properties for access verification based on confirmation status.

Possibly related PRs

Suggested labels

automerge

Suggested reviewers

  • oddsson

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Outside diff range and nitpick comments (16)
apps/judicial-system/backend/migrations/20241018105400-update-civil-claimant.js (1)

1-26: Overall implementation is solid, with a minor suggestion for improvement.

The migration file follows Sequelize best practices:

  • Exports up and down functions
  • Uses transactions for data integrity
  • Focuses on a single, atomic change
  • Has a timestamped filename for proper ordering

Suggestion for improvement:
Consider adding explicit error logging to both up and down functions. While Sequelize transactions will automatically rollback on error, logging errors can aid in debugging if issues arise during deployment.

Example implementation:

up: (queryInterface, Sequelize) => {
  return queryInterface.sequelize.transaction((t) =>
    queryInterface.addColumn(
      'civil_claimant',
      'is_spokesperson_confirmed',
      {
        type: Sequelize.BOOLEAN,
        allowNull: true,
      },
      { transaction: t },
    )
  ).catch(error => {
    console.error('Migration up failed:', error);
    throw error;
  });
},
apps/judicial-system/backend/migrations/20241015110312-update-defendant.js (1)

2-25: LGTM! Consider minor formatting improvements.

The 'up' method correctly implements the addition of two new columns to the 'defendant' table, using a transaction for data integrity. The column names and types align with the PR objectives.

Consider improving code readability by aligning the object properties:

 queryInterface.addColumn(
   'defendant',
   'is_defender_choice_confirmed',
   {
-    type: Sequelize.BOOLEAN,
-    allowNull: true,
+    type:      Sequelize.BOOLEAN,
+    allowNull: true,
   },
   { transaction: t },
 ),
apps/judicial-system/api/src/app/modules/defendant/models/civilClaimant.model.ts (1)

47-48: LGTM! Consider adding a comment for clarity.

The new field isSpokespersonConfirmed is well-implemented, adhering to the existing code style and TypeScript best practices. It's properly typed and decorated for GraphQL integration.

Consider adding a brief comment to explain the purpose of this field, for example:

/**
 * Indicates whether the judge has confirmed the spokesperson for this civil claimant.
 */
@Field(() => Boolean, { nullable: true })
readonly isSpokespersonConfirmed?: boolean

This would enhance code readability and maintain consistency with potential documentation in other parts of the codebase.

apps/judicial-system/backend/src/app/modules/defendant/dto/updateCivilClaimant.dto.ts (1)

56-59: LGTM! Consider adding a brief comment for clarity.

The new isSpokespersonConfirmed property is well-implemented and aligns with the PR objectives. The use of decorators is consistent with other properties in the class, and the readonly modifier ensures immutability.

Consider adding a brief comment above the property to explain its purpose and when it's set to true. This would enhance code readability and maintainability. For example:

/**
 * Indicates whether the judge has confirmed the spokesperson for the civil claimant.
 */
@IsOptional()
@IsBoolean()
@ApiPropertyOptional({ type: Boolean })
readonly isSpokespersonConfirmed?: boolean
apps/judicial-system/api/src/app/modules/defendant/dto/updateCivilClaimant.input.ts (1)

65-68: Approved: New field adheres to best practices. Consider adding JSDoc.

The new isSpokespersonConfirmed field is well-implemented, following the established patterns in the class and adhering to GraphQL best practices. It aligns with the PR objectives to enhance judicial control over indictment cases.

Consider adding a JSDoc comment to provide more context about this field:

/**
 * Indicates whether the judge has confirmed the spokesperson for the civil claimant.
 */
@Allow()
@IsOptional()
@Field(() => Boolean, { nullable: true })
readonly isSpokespersonConfirmed?: boolean
apps/judicial-system/backend/src/app/modules/defendant/dto/createDefendant.dto.ts (1)

62-71: LGTM! Consider adding JSDoc comments for clarity.

The new properties isDefenderChoiceConfirmed and caseFilesSharedWithDefender are correctly implemented as optional booleans with appropriate decorators. They align well with the PR objectives and maintain consistency with the existing code style.

To further improve code clarity, consider adding JSDoc comments to describe the purpose of these new fields:

/**
 * Indicates whether the judge has confirmed the defender choice.
 */
@IsOptional()
@IsBoolean()
@ApiPropertyOptional({ type: Boolean })
readonly isDefenderChoiceConfirmed?: boolean;

/**
 * Indicates whether case files have been shared with the defender.
 */
@IsOptional()
@IsBoolean()
@ApiPropertyOptional({ type: Boolean })
readonly caseFilesSharedWithDefender?: boolean;
apps/judicial-system/backend/src/app/modules/subpoena/dto/updateSubpoena.dto.ts (1)

68-76: LGTM! Consider grouping related properties.

The new properties isDefenderChoiceConfirmed and caseFilesSharedWithDefender are well-implemented with appropriate decorators and types. They align with the PR objectives and enhance the judicial process control.

Consider grouping these new properties with other defender-related properties in the DTO for better code organization. For example, you could move them near the defenderChoice property.

apps/judicial-system/api/src/app/modules/defendant/dto/updateDefendant.input.ts (1)

97-106: LGTM! Consider adding JSDoc comments for clarity.

The implementation of isDefenderChoiceConfirmed and caseFilesSharedWithDefender fields is correct and aligns well with the existing code structure and PR objectives. The use of decorators and TypeScript types is appropriate.

To enhance code readability and maintainability, consider adding JSDoc comments to describe the purpose of these new fields. For example:

/**
 * Indicates whether the judge has confirmed the defender's choice.
 */
@Allow()
@IsOptional()
@Field(() => Boolean, { nullable: true })
readonly isDefenderChoiceConfirmed?: boolean

/**
 * Indicates whether case files have been shared with the defender.
 */
@Allow()
@IsOptional()
@Field(() => Boolean, { nullable: true })
readonly caseFilesSharedWithDefender?: boolean
apps/judicial-system/api/src/app/modules/defendant/models/defendant.model.ts (1)

93-97: LGTM! Consider adding JSDoc comments for the new fields.

The new fields isDefenderChoiceConfirmed and caseFilesSharedWithDefender are well-implemented and consistent with the existing code structure. They follow TypeScript and GraphQL best practices, maintaining type safety and proper schema generation.

To improve code documentation, consider adding JSDoc comments for these new fields. For example:

/**
 * Indicates whether the defender's choice has been confirmed by the judge.
 */
@Field(() => Boolean, { nullable: true })
readonly isDefenderChoiceConfirmed?: boolean

/**
 * Indicates whether case files have been shared with the defender.
 */
@Field(() => Boolean, { nullable: true })
readonly caseFilesSharedWithDefender?: boolean

This addition would enhance code readability and provide context for other developers working on this model.

apps/judicial-system/web/src/components/FormProvider/case.graphql (1)

29-29: LGTM: New field caseFilesSharedWithDefender added correctly.

The new field caseFilesSharedWithDefender is appropriately placed in the defendants section and aligns with the PR objectives. It will allow tracking whether case files have been shared with the defender.

Consider using a consistent naming convention for boolean fields. For example, you could rename this field to isCaseFilesSharedWithDefender to match the style of isDefenderChoiceConfirmed.

apps/judicial-system/xrd-api/src/app/app.service.ts (2)

99-107: Good use of TypeScript for defender info structure.

The introduction of the defenderInfo object improves code organization and type safety. Consider using a TypeScript interface or type alias for this structure to enhance reusability and maintainability.

Example improvement:

interface DefenderInfo {
  defenderName: string | undefined;
  defenderEmail: string | undefined;
  defenderPhoneNumber: string | undefined;
}

let defenderInfo: DefenderInfo = {
  defenderName: undefined,
  defenderEmail: undefined,
  defenderPhoneNumber: undefined,
};

156-163: Approved: Consistent updates to updateToSend object.

The additions to the updateToSend object align well with the new defenderInfo structure. Consider using optional chaining for added safety:

requestedDefenderName: defenderInfo?.defenderName,

This change would prevent potential undefined errors if defenderInfo is unexpectedly null or undefined.

apps/judicial-system/web/src/utils/validate.ts (2)

472-473: LGTM! Consider enhancing readability.

The addition of DefenderChoice.DELAY aligns with the PR objectives. It correctly broadens the criteria for valid defender choices.

Consider refactoring the condition for improved readability:

-        defendant.defenderChoice === DefenderChoice.WAIVE ||
-        defendant.defenderChoice === DefenderChoice.DELAY ||
-        !defendant.defenderChoice ||
+        [DefenderChoice.WAIVE, DefenderChoice.DELAY, undefined].includes(defendant.defenderChoice) ||

Line range hint 1-1: Address the TODO comment: Add tests for validation functions.

The TODO comment at the beginning of the file indicates that tests are missing. Given the critical nature of validation functions in ensuring data integrity, it's important to add comprehensive unit tests for these functions.

Would you like assistance in generating unit tests for the validation functions in this file?

apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectCivilClaimantAdvocate.tsx (2)

100-101: Simplify null and undefined checks

You can simplify the condition:

civilClaimant.spokespersonIsLawyer === null ||
civilClaimant.spokespersonIsLawyer === undefined

by using:

civilClaimant.spokespersonIsLawyer == null

which checks for both null and undefined. This makes the code more concise.


Line range hint 70-86: Reduce duplication in RadioButton components

Both RadioButton components share similar code structures. Consider creating a reusable component or mapping over an array of options to generate them dynamically, which would improve code maintainability.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between afc168b and 061cc7d.

📒 Files selected for processing (21)
  • apps/judicial-system/api/src/app/modules/defendant/dto/updateCivilClaimant.input.ts (1 hunks)
  • apps/judicial-system/api/src/app/modules/defendant/dto/updateDefendant.input.ts (1 hunks)
  • apps/judicial-system/api/src/app/modules/defendant/models/civilClaimant.model.ts (1 hunks)
  • apps/judicial-system/api/src/app/modules/defendant/models/defendant.model.ts (1 hunks)
  • apps/judicial-system/backend/migrations/20241015110312-update-defendant.js (1 hunks)
  • apps/judicial-system/backend/migrations/20241018105400-update-civil-claimant.js (1 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/dto/createDefendant.dto.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/dto/updateCivilClaimant.dto.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/models/civilClaimant.model.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/subpoena/dto/updateSubpoena.dto.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/subpoena/subpoena.service.ts (5 hunks)
  • apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.service.ts (1 hunks)
  • apps/judicial-system/web/src/components/FormProvider/case.graphql (2 hunks)
  • apps/judicial-system/web/src/routes/Court/Indictments/Advocates/Advocates.strings.ts (2 hunks)
  • apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectCivilClaimantAdvocate.tsx (7 hunks)
  • apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectDefender.tsx (4 hunks)
  • apps/judicial-system/web/src/utils/validate.ts (1 hunks)
  • apps/judicial-system/xrd-api/src/app/app.service.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (21)
apps/judicial-system/api/src/app/modules/defendant/dto/updateCivilClaimant.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/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/api/src/app/modules/defendant/models/civilClaimant.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/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/migrations/20241015110312-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/backend/migrations/20241018105400-update-civil-claimant.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/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."
apps/judicial-system/backend/src/app/modules/defendant/dto/createDefendant.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/backend/src/app/modules/defendant/dto/updateCivilClaimant.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/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/backend/src/app/modules/defendant/models/civilClaimant.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/backend/src/app/modules/subpoena/dto/updateSubpoena.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/backend/src/app/modules/subpoena/subpoena.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/digital-mailbox-api/src/app/modules/cases/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/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."
apps/judicial-system/web/src/routes/Court/Indictments/Advocates/Advocates.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/Court/Indictments/Advocates/SelectCivilClaimantAdvocate.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/routes/Court/Indictments/Advocates/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/web/src/utils/validate.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/xrd-api/src/app/app.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."
📓 Learnings (2)
apps/judicial-system/api/src/app/modules/defendant/models/civilClaimant.model.ts (1)
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/defendant/civilClaimant.service.ts:75-95
Timestamp: 2024-10-17T11:45:23.482Z
Learning: The `created` field exists in the `CivilClaimant` model in `civilClaimant.model.ts`.
apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.service.ts (1)
Learnt from: unakb
PR: island-is/island.is#16393
File: apps/judicial-system/digital-mailbox-api/src/app/modules/cases/models/subpoena.response.ts:164-169
Timestamp: 2024-10-14T21:34:16.234Z
Learning: Ensure that suggested code changes in `subpoena.response.ts` are accurate and necessary, avoiding redundant suggestions.
🔇 Additional comments (42)
apps/judicial-system/backend/migrations/20241018105400-update-civil-claimant.js (2)

2-14: LGTM: The up function is well-implemented.

The migration adds the new is_spokesperson_confirmed column correctly:

  • Uses a transaction for data integrity
  • Follows naming conventions
  • Allows null values as appropriate for an optional field
  • Utilizes Sequelize's queryInterface correctly

15-25: LGTM: The down function is correctly implemented.

The rollback operation:

  • Uses a transaction for data integrity
  • Correctly removes the added column
  • Utilizes Sequelize's queryInterface appropriately
apps/judicial-system/backend/migrations/20241015110312-update-defendant.js (2)

26-45: LGTM! Proper rollback implementation.

The 'down' method correctly implements the removal of the two columns added in the 'up' method. The use of a transaction ensures data integrity during the rollback process.


1-46: Well-structured migration file.

This migration file correctly implements the addition of two new columns to the 'defendant' table, aligning with the PR objectives. The use of transactions in both 'up' and 'down' methods ensures data integrity. The implementation follows good practices for database migrations.

apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts (1)

111-120: New properties align with PR objectives and follow best practices.

The addition of isDefenderChoiceConfirmed and caseFilesSharedWithDefender properties is consistent with the PR objectives. They allow judges to confirm defender choices and control access to case files. The implementation follows TypeScript and NextJS best practices:

  1. Proper use of @IsOptional() and @IsBoolean() decorators for type safety and validation.
  2. Inclusion of @ApiPropertyOptional() for Swagger documentation.
  3. Consistent naming convention with other properties in the DTO.
  4. Use of readonly for immutability.

These changes enhance the DTO's functionality while maintaining code quality and type safety.

apps/judicial-system/backend/src/app/modules/defendant/models/civilClaimant.model.ts (2)

145-150: LGTM: New property isSpokespersonConfirmed added correctly.

The new isSpokespersonConfirmed property is well-implemented:

  • It follows the existing pattern for optional boolean fields in the model.
  • The use of @ApiPropertyOptional is consistent with other optional properties, ensuring proper Swagger documentation.
  • This addition aligns with the PR objective of allowing judges to confirm spokesperson choices for civil claimants.

145-150: Well-aligned with PR objectives.

The addition of the isSpokespersonConfirmed property directly supports the PR's goal of allowing judges to confirm choices in legal cases. This field will enable tracking whether a judge has confirmed the spokesperson for a civil claimant, enhancing control and oversight in the judicial process.

apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts (3)

171-173: LGTM: New property isDefenderChoiceConfirmed is well-implemented.

The isDefenderChoiceConfirmed property is correctly added as an optional boolean with appropriate decorators for database column and API documentation.


175-177: LGTM: New property caseFilesSharedWithDefender is well-implemented.

The caseFilesSharedWithDefender property is correctly added as an optional boolean with appropriate decorators for database column and API documentation.


170-177: Changes align well with PR objectives and maintain code quality.

The addition of isDefenderChoiceConfirmed and caseFilesSharedWithDefender properties effectively implements the required enhancements for judicial process control. These changes are consistent with the existing code structure and follow TypeScript and NextJS best practices.

apps/judicial-system/web/src/components/FormProvider/case.graphql (3)

28-28: LGTM: New field isDefenderChoiceConfirmed added correctly.

The new boolean field isDefenderChoiceConfirmed is appropriately placed in the defendants section and aligns with the PR objectives. It will allow judges to confirm the defender choice as described in the PR summary.


345-345: LGTM: New field isSpokespersonConfirmed added correctly.

The new boolean field isSpokespersonConfirmed is appropriately placed in the civilClaimants section and aligns with the PR objectives. It will allow judges to confirm the civil claimant's spokesperson choice as described in the PR summary.


Line range hint 1-349: Overall, the changes in this GraphQL query file look good.

The new fields (isDefenderChoiceConfirmed, caseFilesSharedWithDefender, and isSpokespersonConfirmed) have been correctly added to the appropriate sections of the Case query. These additions align well with the PR objectives and will enable the desired functionality for judges to confirm defender and civil claimant choices, as well as manage case file sharing.

The changes adhere to GraphQL best practices and maintain the existing structure of the query. The only minor suggestion is to consider consistent naming for boolean fields, but this is a small nitpick in an otherwise well-implemented set of changes.

apps/judicial-system/xrd-api/src/app/app.service.ts (1)

124-128: LGTM: Proper assignment of lawyer details.

The population of the defenderInfo object with data from chosenLawyer is implemented correctly. This approach ensures that all relevant defender information is captured when a lawyer is found.

apps/judicial-system/web/src/routes/Court/Indictments/Advocates/Advocates.strings.ts (16)

28-33: LGTM: Correct message definition for confirmDefenderChoice

The message definition follows the correct structure and naming conventions for react-intl. The description provides helpful context for translators.


34-39: LGTM: Correct message definition for changeDefenderChoice

The message definition adheres to the react-intl structure and naming conventions. The description is informative for translators.


40-46: LGTM: Well-structured message definition for confirmSpokespersonChoice

The message definition is correct and follows react-intl conventions. Notable is the effective use of the select statement for conditional text based on spokespersonIsLawyer, enhancing the message's flexibility.


47-53: LGTM: Well-structured message definition for changeSpokespersonChoice

The message definition adheres to react-intl standards. The select statement is used effectively for conditional text based on spokespersonIsLawyer, providing appropriate language variants.


117-123: LGTM: Well-structured message definition for confirmDefenderChoiceModalTitle

The message definition is correct and follows react-intl conventions. The select statement is used effectively to provide different text based on isDefenderChoiceConfirmed, enhancing the message's versatility.


124-130: LGTM: Correct message definition for confirmDefenderChoiceModalText

The message definition adheres to react-intl standards. It effectively uses a placeholder for defenderName, allowing for dynamic content insertion.


131-136: LGTM: Correct message definition for confirmDefenderWaivedModalText

The message definition follows the react-intl structure and naming conventions. The description provides clear context for translators.


137-143: LGTM: Correct message definition for confirmDefenderDelayModalText

The message definition adheres to react-intl standards. The description offers clear context for translators.


144-149: LGTM: Correct message definition for changeDefenderChoiceModalText

The message definition follows the react-intl structure and naming conventions. The description provides clear context for translators.


151-157: LGTM: Well-structured message definition for confirmSpokespersonModalTitle

The message definition adheres to react-intl standards. It effectively uses two select statements for conditional text based on isSpokespersonConfirmed and spokespersonIsLawyer, providing a highly flexible message structure.


158-164: LGTM: Well-structured message definition for confirmSpokespersonModalText

The message definition follows react-intl conventions. It effectively uses two select statements for conditional text based on isSpokespersonConfirmed and spokespersonIsLawyer, allowing for a versatile message that adapts to different scenarios.


165-170: LGTM: Correct message definition for confirmModalPrimaryButtonText

The message definition adheres to react-intl standards. The description offers clear context for translators.


171-176: LGTM: Correct message definition for confirmModalSecondaryButtonText

The message definition follows the react-intl structure and naming conventions. The description provides clear context for translators.


177-181: LGTM: Correct message definition for shareFilesWithDefender

The message definition adheres to react-intl standards. The description offers clear context for translators.


182-188: LGTM: Correct message definition for shareFilesWithDefenderTooltip

The message definition follows the react-intl structure and naming conventions. The description provides clear context for translators.


Line range hint 1-188: Overall assessment: Well-structured and consistent message definitions

The new message definitions in this file enhance the functionality related to confirming and changing defender and spokesperson choices in the judicial system's court indictments module. The additions maintain consistency with existing code and adhere to react-intl and TypeScript best practices. Notable features include:

  1. Effective use of conditional text using select statements in several messages, providing flexibility for different scenarios.
  2. Consistent naming conventions and structure throughout the file.
  3. Clear and informative descriptions for translators.

These changes will improve the user interface's ability to handle various defender and spokesperson selection scenarios, enhancing the overall functionality of the court indictments module.

apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts (2)

24-24: LGTM: New import added correctly.

The isDistrictCourtUser import is added correctly and consistently with the existing import structure.


204-213: LGTM with a suggestion for improved authorization.

The changes to the updateByNationalId method align well with the PR objectives. The logic for determining isDefenderChoiceConfirmed is correct and type-safe.

However, consider adding explicit authorization checks to ensure that only users with the appropriate permissions can set isDefenderChoiceConfirmed. This would enhance security and prevent potential misuse.

To verify the usage of isDistrictCourtUser and potential authorization checks, run the following script:

apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectCivilClaimantAdvocate.tsx (5)

36-36: Modal state initialization is correct

The displayModal state is properly initialized using useState.


70-70: Disable RadioButtons appropriately when spokesperson is confirmed

The disabled prop is correctly applied to disable the RadioButton components when isSpokespersonConfirmed is true, preventing further changes.

Also applies to: 86-86


140-162: Button logic for confirming spokesperson choice is well-implemented

The button correctly changes its label and color scheme based on isSpokespersonConfirmed, and the onClick handler properly updates the modal state.


170-180: Ensure null assignments align with API expectations

When resetting spokesperson details, multiple fields are set to null. Verify that the backend API correctly handles null values for these fields. If the fields are optional and can be omitted, consider using undefined instead.


191-215: Modal component usage is appropriate

The Modal component is effectively used, with dynamic titles and texts based on the current state, and handles user actions correctly.

apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectDefender.tsx (1)

188-189: Verify the appropriateness of the destructive color scheme

Using a destructive color scheme for the button might imply a critical or irreversible action, which could confuse users if the action is not destructive.

Please verify whether changing the defender choice is considered a destructive action. If not, consider using a different color scheme to better reflect the nature of the action.

apps/judicial-system/backend/src/app/modules/subpoena/subpoena.service.ts (4)

21-21: Import isDistrictCourtUser for role verification

The addition of the isDistrictCourtUser import is appropriate for determining the user's role in the updated logic.


109-109: Handle optional user parameter in update method carefully

The update method now includes an optional user?: User parameter. Ensure that all callers of this method provide the user object when necessary. Verify that the method correctly handles cases where user is undefined to prevent potential runtime errors.


121-121: Include isDefenderChoiceConfirmed in destructuring

Including isDefenderChoiceConfirmed in the destructured update object aligns with the new confirmation logic.


161-161: Ensure consistent update of isDefenderChoiceConfirmed

Updating isDefenderChoiceConfirmed in the defendantUpdate object with confirmDefenderChoice ensures that the defender choice confirmation status is accurately reflected based on the user's role.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (3)
apps/judicial-system/backend/src/app/modules/file/guards/caseFileCategory.ts (1)

67-72: Improved access control logic aligns with PR objectives.

The changes to canDefenceUserViewCaseFileOfIndictmentCase function enhance the access control mechanism by using more specific checks:

  • Defendant.isConfirmedDefenderOfDefendantWithCaseFileAccess
  • CivilClaimant.isConfirmedSpokespersonOfCivilClaimantWithCaseFileAccess

These updates align well with the PR objectives of allowing judges to confirm defender and civil claimant choices. The separate conditional statements maintain readability and adhere to the previously expressed preference.

Consider adding comments to explain the new access control logic, which could help other developers understand the rationale behind these checks.

Also applies to: 79-81

apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts (1)

389-394: LGTM! Consider minor refactoring for consistency.

The changes to use isConfirmedDefenderOfDefendant and isConfirmedSpokespersonOfCivilClaimant align well with the PR objectives, enhancing the specificity of access checks for defense users. This ensures that only confirmed defenders and spokespersons can access the respective cases.

For consistency, consider extracting the user.nationalId to a variable at the beginning of the function, similar to how it's done in canDefenceUserAccessRequestCase. This would make the function more readable and easier to maintain. For example:

const normalizedAndFormattedNationalId = normalizeAndFormatNationalId(user.nationalId);

// Then use normalizedAndFormattedNationalId in the subsequent checks

Also applies to: 400-402

apps/judicial-system/backend/src/app/modules/case/guards/rolesRules.ts (1)

292-297: Improved access control for defenders and civil claimant spokespersons

The changes enhance security by ensuring that only confirmed defenders and spokespersons with appropriate access can view generated PDFs. This aligns well with the PR objectives.

Consider adding error logging for cases where access is denied. This could help in troubleshooting and auditing. For example:

if (!Defendant.isConfirmedDefenderOfDefendantWithCaseFileAccess(
  user.nationalId,
  theCase.defendants,
)) {
  console.error(`Access denied for user ${user.nationalId} to case ${theCase.id}`);
}

Also applies to: 302-305

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 061cc7d and 2905443.

📒 Files selected for processing (5)
  • apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/case/guards/rolesRules.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/models/civilClaimant.model.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts (3 hunks)
  • apps/judicial-system/backend/src/app/modules/file/guards/caseFileCategory.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/judicial-system/backend/src/app/modules/defendant/models/civilClaimant.model.ts
  • apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts
🧰 Additional context used
📓 Path-based instructions (3)
apps/judicial-system/backend/src/app/modules/case/filters/case.filter.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/case/guards/rolesRules.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/file/guards/caseFileCategory.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."
📓 Learnings (3)
apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts (1)
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts:407-421
Timestamp: 2024-10-17T11:51:57.129Z
Learning: In the `canDefenceUserAccessCase` function (`apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts`), the `forUpdate` parameter is intentionally not passed to `canDefenceUserAccessRequestCase` because defence users can both read and write request cases, so the `forUpdate` parameter is not needed for request cases.
apps/judicial-system/backend/src/app/modules/case/guards/rolesRules.ts (2)
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCaseFilesRecordPdfRolesRules.spec.ts:1-1
Timestamp: 2024-10-17T11:30:12.482Z
Learning: The usage of `defenderRule` in the following test files is intentional and should remain unchanged:

- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createPresignedPostRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/deleteCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/getCaseFileSignedUrlRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRulingPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRequestPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCourtRecordPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getByIdRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getAllFilesZipRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/caseController/getAllRolesRules.spec.ts`
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getIndictmentPdfGuards.spec.ts:24-25
Timestamp: 2024-10-17T11:41:45.565Z
Learning: In certain scenarios within the judicial-system backend, the `RolesGuard` may intentionally follow the `CaseExistsGuard` when specific roles rules require the guard order to be reversed, as seen in tests like `getIndictmentPdfGuards.spec.ts`.
apps/judicial-system/backend/src/app/modules/file/guards/caseFileCategory.ts (2)
Learnt from: oddsson
PR: island-is/island.is#16138
File: apps/judicial-system/backend/src/app/modules/file/guards/caseFileCategory.ts:74-87
Timestamp: 2024-10-08T15:39:04.351Z
Learning: User prefers to keep similar conditional statements separate rather than combining them into a single conditional with logical operators.
Learnt from: oddsson
PR: island-is/island.is#16138
File: apps/judicial-system/backend/src/app/modules/file/guards/caseFileCategory.ts:74-87
Timestamp: 2024-09-24T20:55:56.753Z
Learning: User prefers to keep similar conditional statements separate rather than combining them into a single conditional with logical operators.
🔇 Additional comments (1)
apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts (1)

389-394: Verify consistency with related changes in the codebase.

The modifications to the canDefenceUserAccessIndictmentCase function enhance the access control for defense users without disrupting the existing logic for other user roles. This improvement aligns well with the PR objectives and maintains the overall structure of the access control system.

To ensure consistency across the codebase, please run the following script to verify the related changes:

This script will help verify that the changes in this file are consistent with updates in the Defendant and CivilClaimant models, as well as any related service methods.

Also applies to: 400-402

Copy link
Member

@gudjong gudjong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is some unnecessary code server side in this PR. I also had one question on the client side.

Copy link
Member

@gudjong gudjong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments and questions.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Files that changed from the base of the PR and between 2905443 and acdf637.

📒 Files selected for processing (3)
  • apps/judicial-system/backend/src/app/modules/case/filters/test/defenceUserFilter.spec.ts (2 hunks)
  • apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.service.ts (1 hunks)
  • apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectDefender.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/judicial-system/digital-mailbox-api/src/app/modules/cases/case.service.ts
🧰 Additional context used
📓 Path-based instructions (2)
apps/judicial-system/backend/src/app/modules/case/filters/test/defenceUserFilter.spec.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/Indictments/Advocates/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."
📓 Learnings (1)
apps/judicial-system/backend/src/app/modules/case/filters/test/defenceUserFilter.spec.ts (1)
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCaseFilesRecordPdfRolesRules.spec.ts:1-1
Timestamp: 2024-10-17T11:30:12.482Z
Learning: The usage of `defenderRule` in the following test files is intentional and should remain unchanged:

- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createPresignedPostRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/deleteCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/getCaseFileSignedUrlRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRulingPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRequestPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCourtRecordPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getByIdRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getAllFilesZipRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/caseController/getAllRolesRules.spec.ts`
🔇 Additional comments (5)
apps/judicial-system/web/src/routes/Court/Indictments/Advocates/SelectDefender.tsx (1)

166-166: Verify the disabled Condition for Sharing Files

The disabled prop for the Checkbox component checks if both defendant.defenderName and defendant.defenderEmail are absent:

disabled={!defendant.defenderName && !defendant.defenderEmail}

Ensure that this condition correctly reflects all scenarios where the defender's contact information might be insufficient for sharing files. If there are cases where a defender might have a defenderNationalId without a name or email, consider including it in the condition to avoid unintentionally disabling the checkbox.

For example:

-disabled={!defendant.defenderName && !defendant.defenderEmail}
+disabled={!defendant.defenderName && !defendant.defenderEmail && !defendant.defenderNationalId}

Please verify and adjust the condition if necessary.

apps/judicial-system/backend/src/app/modules/case/filters/test/defenceUserFilter.spec.ts (4)

206-217: Verify access control for unconfirmed defender assigned to case

In this test case, a defender is assigned to the case without the isDefenderChoiceConfirmed flag set to true, and verifyNoAccess(theCase, user) is called. This correctly tests that unconfirmed defenders should not have access. Please ensure this aligns with the intended access control policies for unconfirmed defenders in indictment cases.


219-230: Confirmed defender access test is accurate

The test case correctly assigns a confirmed defender by setting isDefenderChoiceConfirmed: true and uses verifyFullAccess(theCase, user). This appropriately tests that confirmed defenders have full access to the case, aligning with the updated access control logic.


290-306: Verify access restriction for non-confirmed spokesperson

In this test case, a spokesperson is assigned without the isSpokespersonConfirmed flag set to true, and verifyNoAccess(theCase, user) is called. This tests that non-confirmed spokespersons should not have access. Please confirm that this behavior matches the intended access control policies for spokespersons.


314-318: Confirmed spokesperson read access test is valid

The test accurately represents a confirmed spokesperson by setting isSpokespersonConfirmed: true and correctly uses verifyReadAccess(theCase, user). This ensures that confirmed spokespersons are granted read access, consistent with the access control requirements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (3)
apps/judicial-system/backend/src/app/modules/file/guards/test/limitedAccessViewCaseFileGuard.spec.ts (3)

181-187: LGTM! Consider adding more test cases.

The new properties isDefenderChoiceConfirmed and caseFilesSharedWithDefender are correctly added to the test case, reflecting the enhanced access control for defenders. This aligns with the PR objectives.

Consider adding additional test cases to cover scenarios where isDefenderChoiceConfirmed or caseFilesSharedWithDefender are false, to ensure the guard behaves correctly in all situations.


215-215: LGTM! Consider adding a negative test case.

The new property isSpokespersonConfirmed is correctly added to the test case, reflecting the enhanced access control for spokespersons. This is consistent with the changes for defenders and aligns with the PR objectives.

Consider adding a test case where isSpokespersonConfirmed is false to ensure the guard correctly denies access in this scenario.


Line range hint 1-738: Overall, the changes look good and align with the PR objectives.

The modifications to the test cases for the LimitedAccessViewCaseFileGuard accurately reflect the new access control logic for defenders and spokespersons in indictment cases. The addition of isDefenderChoiceConfirmed, caseFilesSharedWithDefender, and isSpokespersonConfirmed properties enhances the specificity of the tests and aligns with the goal of improving judge control over indictment cases.

To further improve the test coverage:

  1. Add test cases where isDefenderChoiceConfirmed or caseFilesSharedWithDefender are false for defenders.
  2. Add a test case where isSpokespersonConfirmed is false for spokespersons.
  3. Consider adding tests for scenarios where only one of the conditions is met (e.g., defender choice confirmed but case files not shared) to ensure the guard behaves correctly in all situations.

These additional tests will help ensure that the guard correctly handles all possible combinations of the new access control properties.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between acdf637 and 3a91e85.

📒 Files selected for processing (1)
  • apps/judicial-system/backend/src/app/modules/file/guards/test/limitedAccessViewCaseFileGuard.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/judicial-system/backend/src/app/modules/file/guards/test/limitedAccessViewCaseFileGuard.spec.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."
📓 Learnings (1)
apps/judicial-system/backend/src/app/modules/file/guards/test/limitedAccessViewCaseFileGuard.spec.ts (4)
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/file/guards/test/limitedAccessViewCaseFileGuard.spec.ts:175-185
Timestamp: 2024-10-17T11:53:19.983Z
Learning: In the Jest tests for the `LimitedAccessViewCaseFileGuard` in `apps/judicial-system/backend/src/app/modules/file/guards/test/limitedAccessViewCaseFileGuard.spec.ts`, code duplication in the `beforeEach` blocks is acceptable and should remain unchanged.
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCaseFilesRecordPdfRolesRules.spec.ts:1-1
Timestamp: 2024-10-17T11:30:12.482Z
Learning: The usage of `defenderRule` in the following test files is intentional and should remain unchanged:

- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createPresignedPostRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/deleteCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/getCaseFileSignedUrlRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRulingPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRequestPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCourtRecordPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getByIdRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getAllFilesZipRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/caseController/getAllRolesRules.spec.ts`
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getIndictmentPdfGuards.spec.ts:24-25
Timestamp: 2024-10-17T11:41:45.565Z
Learning: In certain scenarios within the judicial-system backend, the `RolesGuard` may intentionally follow the `CaseExistsGuard` when specific roles rules require the guard order to be reversed, as seen in tests like `getIndictmentPdfGuards.spec.ts`.
Learnt from: oddsson
PR: island-is/island.is#16463
File: apps/judicial-system/backend/src/app/modules/subpoena/test/limitedAccessSubpoenaController/limitedAccessSubpoenaControllerGuards.spec.ts:17-17
Timestamp: 2024-10-21T21:14:47.668Z
Learning: In `LimitedAccessSubpoenaController`, `SubpoenaExistsOptionalGuard` is still used on specific endpoints not covered by the test file `limitedAccessSubpoenaControllerGuards.spec.ts`.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between aaac754 and 9e7d46f.

📒 Files selected for processing (3)
  • apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/dto/internalUpdateDefendant.dto.ts (1 hunks)
  • apps/judicial-system/backend/src/app/modules/defendant/internalDefendant.controller.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/judicial-system/backend/src/app/modules/defendant/defendant.service.ts
🧰 Additional context used
📓 Path-based instructions (2)
apps/judicial-system/backend/src/app/modules/defendant/dto/internalUpdateDefendant.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/backend/src/app/modules/defendant/internalDefendant.controller.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."
🔇 Additional comments (3)
apps/judicial-system/backend/src/app/modules/defendant/internalDefendant.controller.ts (3)

23-23: Good separation of internal and external DTOs!

The switch to InternalUpdateDefendantDto follows security best practices by clearly separating internal API contracts from external ones. This is particularly important in a judicial system where data access control is critical.


74-74: Verify validation and error handling for sensitive data.

While the DTO type change is correct, please ensure:

  1. The InternalUpdateDefendantDto includes proper validation decorators for the new judge confirmation fields
  2. The Swagger documentation (@ApiOkResponse) reflects the new fields in the response type
  3. Error cases are handled for invalid confirmation states

Let's verify the DTO implementation:


Line range hint 31-85: Verify judge-specific access control.

Since this PR introduces judge confirmation features, consider:

  1. Adding a specific guard to verify judge permissions for the update endpoint
  2. Logging the judge's identity when confirmation fields are updated

Let's check for existing judge-related guards:

@unakb
Copy link
Member Author

unakb commented Oct 23, 2024

I need to add one thing before merging this, so keep open for a little bit longer

@unakb unakb added the automerge Merge this PR as soon as all checks pass label Oct 23, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 16bb3e2 and fc41139.

📒 Files selected for processing (2)
  • apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/case/filters/test/cases.filter.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.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/case/filters/test/cases.filter.spec.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."
📓 Learnings (2)
apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.ts (1)
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts:407-421
Timestamp: 2024-10-17T11:51:57.129Z
Learning: In the `canDefenceUserAccessCase` function (`apps/judicial-system/backend/src/app/modules/case/filters/case.filter.ts`), the `forUpdate` parameter is intentionally not passed to `canDefenceUserAccessRequestCase` because defence users can both read and write request cases, so the `forUpdate` parameter is not needed for request cases.
apps/judicial-system/backend/src/app/modules/case/filters/test/cases.filter.spec.ts (1)
Learnt from: gudjong
PR: island-is/island.is#16389
File: apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCaseFilesRecordPdfRolesRules.spec.ts:1-1
Timestamp: 2024-10-17T11:30:12.482Z
Learning: The usage of `defenderRule` in the following test files is intentional and should remain unchanged:

- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createPresignedPostRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/deleteCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/createCaseFileRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/file/test/limitedAccessFileController/getCaseFileSignedUrlRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRulingPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getRequestPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getCourtRecordPdfRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getByIdRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/limitedAccessCaseController/getAllFilesZipRolesRules.spec.ts`
- `apps/judicial-system/backend/src/app/modules/case/test/caseController/getAllRolesRules.spec.ts`
🔇 Additional comments (2)
apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.ts (1)

286-286: Verify the impact of new confirmation requirements.

The addition of is_defender_choice_confirmed and is_spokesperson_confirmed conditions aligns with the PR objectives. However, let's verify that existing defenders won't lose access to their cases.

Also applies to: 295-295

apps/judicial-system/backend/src/app/modules/case/filters/test/cases.filter.spec.ts (1)

462-462: Verify the impact of new confirmation flags on existing cases.

The addition of is_defender_choice_confirmed and is_spokesperson_confirmed conditions might affect access to existing cases where these flags are not set.

Let's check if there are any existing cases that might be affected:

Also applies to: 471-471

@kodiakhq kodiakhq bot merged commit 4919948 into main Oct 23, 2024
138 checks passed
@kodiakhq kodiakhq bot deleted the j-s/judge-confirms-defense-choices branch October 23, 2024 14:37
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.

3 participants