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(ids-api): Add legal representative delegation type and return in delegation list. #15837

Merged
merged 23 commits into from
Sep 11, 2024

Conversation

valurefugl
Copy link
Member

@valurefugl valurefugl commented Aug 30, 2024

https://www.notion.so/Use-delegation-index-to-list-in-delegation-picker-c0c56ddcd94640d996c58cf115a369b8?pvs=4

What

Add LegalRepresentative delegation type and syslumenn provider. Check the index for delegations of this type and return in list.

Why

So we can support this delegation type in our systems.

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

  • New Features

    • Introduced support for legal representative delegation types and providers.
    • Enhanced delegation handling capabilities within various service classes.
    • Added new test cases to validate legal representative functionalities.
    • Expanded the GraphQL API to include a distinct representation for legal representatives.
    • Improved testing capabilities by integrating a mock for the Company Registry Client Service.
    • Added a new constant for standardized reference to unknown names.
    • Updated the notifications module to include delegation type information.
    • Enhanced the DelegationsIncomingService with new dependencies and improved delegation logic.
    • Augmented the module's interface with new exports for constants.
  • Bug Fixes

    • Improved test coverage for legal representative scenarios.
  • Chores

    • Streamlined code structure and imports for better clarity and maintainability.

@valurefugl valurefugl requested review from a team as code owners August 30, 2024 15:50
Copy link
Contributor

coderabbitai bot commented Aug 30, 2024

Walkthrough

The changes introduce a new delegation type for legal representatives, enhancing the delegation management system. This includes updates to test cases, service classes, database migrations, and data transfer objects (DTOs) to support the new functionality. Additionally, new constants and interface properties have been added to facilitate the handling of legal representative delegations across the application.

Changes

Files Change Summary
.../delegations/test/delegations-filters-test-cases.ts Added a new test case legalRepresentative1 to validate legal representative delegation functionality.
.../delegations/test/delegations-filters-types.ts Introduced new constants for legal representative scopes, updated ITestCaseOptions interface and TestCase class to include legal representative data.
.../delegations/test/delegations-filters.spec.ts Enhanced test suite to include new imports and asynchronous operations for creating delegation records involving legal representatives.
.../test/setup.ts Removed mock service for DelegationsIndexService, simplifying dependency injection setup.
.../seeders/20240829140032-add-delegation-type-legal-representative.js Created a migration script for adding and removing legal representative delegation types in the database.
.../models/delegation.model.ts Updated AuthDelegationType to include LegalRepresentative and added a new class LegalRepresentativeDelegation for GraphQL representation.
.../models/delegation-index.model.ts Updated DelegationIndex class to include type in the JSON output.
.../public-api/test/setup.ts Introduced a new dependency, CompanyRegistryClientService, with a mock implementation for testing purposes.
.../delegations/delegations.controller.spec.ts Mocked the indexDelegations method of DelegationsIndexService for improved test isolation.
.../delegations/delegations-incoming.service.ts Enhanced DelegationsIncomingService to handle new delegation types, added new dependencies, and introduced methods for retrieving district commissioners' registry delegations based on feature flags.
.../index.ts Added export statement for UNKNOWN_NAME constant from ./lib/delegations/constants/names.
.../notifications/notificationsWorker/mocks.ts Reorganized imports and updated delegations object structure to include type property set to AuthDelegationType.ProcurationHolder.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DelegationsIncomingService
    participant DelegationsIndexService
    participant FeatureFlagService

    User->>DelegationsIncomingService: Request delegations
    DelegationsIncomingService->>FeatureFlagService: Check if legal representative delegation is enabled
    FeatureFlagService-->>DelegationsIncomingService: Return status
    alt Enabled
        DelegationsIncomingService->>DelegationsIndexService: GetAvailableDistrictCommissionersRegistryRecords
        DelegationsIndexService-->>DelegationsIncomingService: Return delegation records
    end
    DelegationsIncomingService-->>User: Return delegations
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 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: 3

Outside diff range, codebase verification and nitpick comments (2)
libs/auth-api-lib/src/lib/delegations/dto/delegation-index.dto.ts (1)

1-2: Note on import arrangement.

While the rearrangement of imports does not affect functionality, it is important to maintain a consistent style across the project for better readability.

Consider organizing imports in a logical order, such as grouping all decorators together.

libs/auth-api-lib/src/lib/delegations/utils/delegations.ts (1)

1-1: Note on import repositioning.

Repositioning the kennitala import does not affect the functionality but should be consistent with the project's import organization standards.

Ensure that imports are organized in a logical and consistent manner across the project.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bc38e3e and 556f437.

Files selected for processing (14)
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters-test-cases.ts (1 hunks)
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters-types.ts (5 hunks)
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters.spec.ts (2 hunks)
  • apps/services/auth/ids-api/test/setup.ts (1 hunks)
  • libs/auth-api-lib/seeders/20240829140032-add-delegation-type-legal-representative.js (1 hunks)
  • libs/auth-api-lib/src/lib/delegations/delegation-dto.mapper.ts (2 hunks)
  • libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (6 hunks)
  • libs/auth-api-lib/src/lib/delegations/delegations-index.service.ts (2 hunks)
  • libs/auth-api-lib/src/lib/delegations/dto/delegation-index.dto.ts (2 hunks)
  • libs/auth-api-lib/src/lib/delegations/models/delegation-index.model.ts (3 hunks)
  • libs/auth-api-lib/src/lib/delegations/utils/delegations.ts (2 hunks)
  • libs/feature-flags/src/lib/features.ts (1 hunks)
  • libs/services/auth/testing/src/fixtures/fixture-factory.ts (1 hunks)
  • libs/shared/types/src/lib/delegation.ts (1 hunks)
Additional context used
Path-based instructions (14)
libs/shared/types/src/lib/delegation.ts (2)

Pattern libs/shared/**/*: "Confirm that the code adheres to the following:

  • Cross-application utility functions, types, and constants.
  • TypeScript best practices to ensure type safety and reusability.
  • Documentation and examples for library consumers."

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/auth-api-lib/src/lib/delegations/delegation-dto.mapper.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/auth-api-lib/src/lib/delegations/models/delegation-index.model.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/auth-api-lib/seeders/20240829140032-add-delegation-type-legal-representative.js (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/auth-api-lib/src/lib/delegations/dto/delegation-index.dto.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/auth-api-lib/src/lib/delegations/utils/delegations.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
apps/services/auth/ids-api/src/app/delegations/test/delegations-filters.spec.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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/services/auth/ids-api/test/setup.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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/services/auth/ids-api/src/app/delegations/test/delegations-filters-types.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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."
libs/feature-flags/src/lib/features.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
apps/services/auth/ids-api/src/app/delegations/test/delegations-filters-test-cases.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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."
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/auth-api-lib/src/lib/delegations/delegations-index.service.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/services/auth/testing/src/fixtures/fixture-factory.ts (2)

Pattern libs/services/**/*: "Confirm that the code adheres to the following:

  • Shared services and modules that can be utilized across NestJS apps.
  • Proper implementation of NestJS providers, including custom providers.
  • Adherence to NestJS module encapsulation and isolation principles."

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Biome
libs/auth-api-lib/seeders/20240829140032-add-delegation-type-legal-representative.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

Additional comments not posted (20)
libs/shared/types/src/lib/delegation.ts (2)

6-6: New delegation type added successfully.

The addition of LegalRepresentative to the AuthDelegationType enum aligns with the PR objectives and follows existing naming conventions.


14-14: New provider added successfully.

The addition of DistrictCommissionersRegistry to the AuthDelegationProvider enum expands the available sources for delegation providers, aligning with the PR objectives.

libs/auth-api-lib/src/lib/delegations/delegation-dto.mapper.ts (2)

1-3: Import statements are correctly placed.

The new imports for AuthDelegationType and DelegationRecordDTO are necessary for the functionality of the new method and adhere to TypeScript best practices.


20-28: Method implementation is correct and efficient.

The recordToMergedDelegationDTO method correctly transforms a DelegationRecordDTO into a MergedDelegationDTO, ensuring proper type casting and alignment with the new delegation types.

libs/auth-api-lib/src/lib/delegations/models/delegation-index.model.ts (2)

1-5: Streamlined imports enhance clarity.

The consolidation of imports from sequelize into a single block improves code clarity and adheres to best practices for bundling and tree-shaking.


82-82: Inclusion of type in JSON output is appropriate.

The update to include the type property in the JSON output of the DelegationIndex class aligns with the PR objectives and ensures correct handling of the new delegation types.

libs/auth-api-lib/seeders/20240829140032-add-delegation-type-legal-representative.js (2)

4-29: Review SQL transaction handling and queries.

The SQL queries are wrapped in a transaction, which is good practice for ensuring that all operations either complete successfully or roll back in case of an error. However, ensure that the values inserted do not come from user input to avoid SQL injection risks.

The transaction handling is correctly implemented.


31-48: Review SQL rollback logic in the down function.

The rollback logic correctly deletes entries added by the up function. This ensures that the database can be reverted to its previous state if needed.

The rollback logic is correctly implemented.

libs/auth-api-lib/src/lib/delegations/dto/delegation-index.dto.ts (1)

24-27: Approve addition of 'type' property to DelegationRecordDTO.

The new optional property type is well-defined with appropriate validation and API documentation decorators. This addition enhances the flexibility and usability of the delegation records.

The implementation of the new property is correct and follows best practices.

libs/auth-api-lib/src/lib/delegations/utils/delegations.ts (1)

28-30: Approve addition of new delegation type mapping.

The new entry in the delegationProviderTypeMap for AuthDelegationProvider.DistrictCommissionersRegistry mapping to AuthDelegationType.LegalRepresentative is correctly implemented. This enhances the system's ability to handle legal representatives effectively.

The addition is correctly implemented and aligns with the system's requirements.

apps/services/auth/ids-api/src/app/delegations/test/delegations-filters.spec.ts (1)

11-14: Imports for new delegation types are correctly added.

The imports for AuthDelegationProvider and AuthDelegationType are correctly added and used in the test cases to handle the new legal representative delegations.

libs/feature-flags/src/lib/features.ts (1)

109-109: Feature flag addition approved.

The addition of isLegalRepresentativeDelegationEnabled to the Features enum is consistent with the PR objectives and follows the established naming conventions.

apps/services/auth/ids-api/src/app/delegations/test/delegations-filters-test-cases.ts (1)

291-301: Test case addition approved.

The addition of the legalRepresentative1 test case is well-structured and aligns with the PR objectives to support legal representative delegations. Please ensure that all edge cases are covered to maintain robust test coverage.

Verification successful

Test Coverage for Legal Representative Delegations is Comprehensive

The search results indicate that there are multiple references to legal representative scopes and test cases, suggesting that the test coverage is thorough. The legalRepresentative1 test case and supporting structures like legalRepresentativeScopes are present, aligning with the PR objectives.

  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters-test-cases.ts: Contains the legalRepresentative1 test case.
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters-types.ts: Includes definitions and usage of legalRepresentativeScopes.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the completeness of test coverage for legal representative delegations.

# Test: Search for test cases related to legal representatives. Expect: Comprehensive coverage.
rg --type typescript -A 5 $'legalRepresentative'

Length of output: 82


Script:

#!/bin/bash
# Description: Verify the completeness of test coverage for legal representative delegations.

# Test: Search for test cases related to legal representatives. Expect: Comprehensive coverage.
rg --glob '*.ts' -A 5 $'legalRepresentative'

Length of output: 3761

libs/auth-api-lib/src/lib/delegations/delegations-index.service.ts (1)

306-334: Review of getAvailableDistrictCommissionersRegistryRecords method:

The method is well-implemented with clear logic for handling API scopes and retrieving delegation records based on user permissions. The use of Sequelize's findAll method is appropriate, and the conditions for checking supported scopes and access control are well-placed.

The method's implementation is approved.

Suggestion: Add error handling for database operations.

Consider adding try-catch blocks around the Sequelize operations to handle potential database errors gracefully.

+ try {
  return await this.delegationIndexModel
    .findAll({
      where: {
        toNationalId: user.nationalId,
        provider: AuthDelegationProvider.DistrictCommissionersRegistry,
        type: types,
        validTo: { [Op.or]: [{ [Op.gte]: new Date() }, { [Op.is]: null }] },
      },
    })
    .then((d) => d.map((d) => d.toDTO()))
+ } catch (error) {
+   throw new BadRequestException('Failed to fetch delegation records');
+ }
libs/services/auth/testing/src/fixtures/fixture-factory.ts (1)

324-325: Review of new case for AuthDelegationType.LegalRepresentative:

The addition of the case for AuthDelegationType.LegalRepresentative is correctly implemented. It properly returns AuthDelegationProvider.DistrictCommissionersRegistry as expected for this delegation type.

The implementation of this case is approved.

apps/services/auth/ids-api/test/setup.ts (1)

136-136: Confirm removal of MockDelegationsIndexService override.

The AI-generated summary mentions the removal of the MockDelegationsIndexService override, but the provided code does not show this change. Please verify if this change was intended and update the documentation accordingly.

apps/services/auth/ids-api/src/app/delegations/test/delegations-filters-types.ts (4)

32-33: Addition of legal representative scopes.

The new constants legalRepresentativeScope1 and legalRepresentativeScope2 are added to represent legal representative scopes. This is in line with the PR objectives to support the new delegation type.


42-45: Export of legal representative scopes array.

The export of the legalRepresentativeScopes array, which includes the newly defined constants, is correctly implemented. This change supports the integration of these scopes into the delegation management system.


52-52: Addition of fromLegalRepresentative to ITestCaseOptions.

The addition of the fromLegalRepresentative property to the ITestCaseOptions interface allows for specifying legal representatives in test case options, enhancing the testing capabilities for new delegation types.


69-69: Integration of legal representative scopes in TestCase.

The TestCase class is updated to include the fromLegalRepresentative property and integrate the legalRepresentativeScopes into the scopes array. The getDelegationTypes method is also updated to check for these scopes and add the new delegation type if the scope name matches. This comprehensive integration ensures that the new delegation type is properly handled in test scenarios.

Also applies to: 82-88, 173-175

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 556f437 and a16eeb4.

Files selected for processing (1)
  • libs/auth-api-lib/seeders/20240829140032-add-delegation-type-legal-representative.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/auth-api-lib/seeders/20240829140032-add-delegation-type-legal-representative.js

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 a16eeb4 and 9eeb847.

Files selected for processing (1)
  • libs/api/domains/auth/src/lib/models/delegation.model.ts (3 hunks)
Additional context used
Path-based instructions (1)
libs/api/domains/auth/src/lib/models/delegation.model.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Additional comments not posted (2)
libs/api/domains/auth/src/lib/models/delegation.model.ts (2)

9-9: LGTM: Import statement for Identity.

The addition of the Identity import is appropriate as it's used in the Delegation class.


35-36: LGTM: New case for LegalRepresentative delegation type.

The addition of the LegalRepresentative case in the switch statement is consistent with the existing pattern.

Please ensure that the AuthDelegationType enum has been updated to include the LegalRepresentative type. Run the following script to verify:

Verification successful

Verification Successful: AuthDelegationType Enum Updated

The AuthDelegationType enum has been updated to include the LegalRepresentative type, confirming the consistency of the changes made in the switch statement.

  • Location: libs/shared/types/src/lib/delegation.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that AuthDelegationType enum includes LegalRepresentative

# Test: Search for AuthDelegationType enum definition
# Expect: LegalRepresentative to be present in the enum
rg --type typescript -A 10 "enum AuthDelegationType"

Length of output: 89


Script:

#!/bin/bash
# Description: Verify that AuthDelegationType enum includes LegalRepresentative

# Test: Search for AuthDelegationType enum definition
# Expect: LegalRepresentative to be present in the enum
rg --type ts -A 10 "enum AuthDelegationType"

Length of output: 831

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 88.40580% with 8 lines in your changes missing coverage. Please review.

Project coverage is 36.84%. Comparing base (2aae5e1) to head (eddd2f4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...b/src/lib/delegations/delegations-index.service.ts 36.36% 7 Missing ⚠️
...rc/lib/delegations/delegations-incoming.service.ts 96.29% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15837      +/-   ##
==========================================
+ Coverage   36.82%   36.84%   +0.01%     
==========================================
  Files        6692     6693       +1     
  Lines      137195   137245      +50     
  Branches    39017    39030      +13     
==========================================
+ Hits        50522    50564      +42     
- Misses      86673    86681       +8     
Flag Coverage Δ
air-discount-scheme-backend 54.04% <100.00%> (+0.01%) ⬆️
air-discount-scheme-web 0.00% <ø> (ø)
api 3.39% <ø> (ø)
api-domains-air-discount-scheme 36.78% <100.00%> (+0.03%) ⬆️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 53.90% <ø> (ø)
api-domains-communications 40.53% <100.00%> (+0.01%) ⬆️
api-domains-criminal-record 47.81% <100.00%> (+0.03%) ⬆️
api-domains-driving-license 44.24% <100.00%> (+0.01%) ⬆️
api-domains-education 31.25% <100.00%> (+0.03%) ⬆️
api-domains-health-insurance 34.63% <100.00%> (+0.04%) ⬆️
api-domains-mortgage-certificate 35.75% <100.00%> (+0.02%) ⬆️
api-domains-payment-schedule 41.08% <100.00%> (+0.02%) ⬆️
application-api-files 57.52% <100.00%> (+0.02%) ⬆️
application-core 72.28% <ø> (+0.33%) ⬆️
application-system-api 41.68% <100.00%> (+<0.01%) ⬆️
application-template-api-modules 23.53% <100.00%> (+0.01%) ⬆️
application-templates-accident-notification 19.83% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 22.12% <ø> (ø)
application-templates-driving-license 15.58% <ø> (ø)
application-templates-estate 11.86% <ø> (ø)
application-templates-example-payment 20.79% <ø> (ø)
application-templates-financial-aid 12.09% <ø> (ø)
application-templates-general-petition 18.86% <ø> (ø)
application-templates-health-insurance 23.27% <ø> (ø)
application-templates-inheritance-report 4.63% <ø> (ø)
application-templates-marriage-conditions 10.47% <ø> (ø)
application-templates-mortgage-certificate 44.09% <100.00%> (+0.06%) ⬆️
application-templates-parental-leave 28.40% <ø> (ø)
application-types 6.74% <ø> (ø)
application-ui-components 1.52% <ø> (ø)
application-ui-shell 21.08% <ø> (ø)
auth-nest-tools 30.83% <100.00%> (+0.38%) ⬆️
auth-react 22.82% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-driving-license 40.61% <100.00%> (+0.04%) ⬆️
clients-driving-license-book 43.88% <100.00%> (+0.02%) ⬆️
clients-financial-statements-inao 49.13% <100.00%> (+0.03%) ⬆️
clients-license-client 1.83% <ø> (ø)
clients-middlewares 72.15% <100.00%> (+0.04%) ⬆️
clients-regulations 42.58% <100.00%> (+0.04%) ⬆️
clients-rsk-company-registry 29.76% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.77% <100.00%> (+0.02%) ⬆️
cms 0.42% <ø> (ø)
cms-translations 39.68% <100.00%> (+0.02%) ⬆️
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.50% <ø> (ø)
contentful-apps 6.05% <ø> (ø)
dokobit-signing 62.94% <100.00%> (+0.08%) ⬆️
download-service 44.52% <100.00%> (+0.01%) ⬆️
email-service 60.73% <100.00%> (+0.08%) ⬆️
feature-flags 90.76% <100.00%> (+0.07%) ⬆️
file-storage 53.13% <100.00%> (+0.11%) ⬆️
financial-aid-backend 56.49% <100.00%> (+0.01%) ⬆️
financial-aid-shared 19.03% <ø> (ø)
icelandic-names-registry-backend 54.53% <ø> (ø)
island-ui-core 28.59% <ø> (ø)
judicial-system-api 19.35% <ø> (ø)
judicial-system-audit-trail 68.61% <100.00%> (+0.08%) ⬆️
judicial-system-backend 55.88% <100.00%> (+<0.01%) ⬆️
judicial-system-message 66.86% <100.00%> (+0.06%) ⬆️
judicial-system-message-handler 47.71% <100.00%> (+0.09%) ⬆️
judicial-system-scheduler 69.01% <100.00%> (+0.02%) ⬆️
judicial-system-web 28.71% <ø> (ø)
license-api 42.74% <100.00%> (-0.07%) ⬇️
localization 10.15% <ø> (ø)
nest-audit 68.20% <ø> (ø)
nest-config 78.13% <100.00%> (+0.06%) ⬆️
nest-feature-flags 51.97% <100.00%> (+0.06%) ⬆️
nest-problem 46.48% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 62.28% <100.00%> (+0.09%) ⬆️
portals-admin-regulations-admin 1.96% <ø> (ø)
portals-core 16.14% <ø> (ø)
reference-backend 50.57% <ø> (ø)
services-auth-admin-api 50.91% <42.62%> (-0.10%) ⬇️
services-auth-delegation-api 61.35% <44.26%> (-0.15%) ⬇️
services-auth-ids-api 54.03% <88.05%> (+0.23%) ⬆️
services-auth-personal-representative 47.91% <44.26%> (-0.12%) ⬇️
services-auth-personal-representative-public 43.81% <42.62%> (-0.08%) ⬇️
services-auth-public-api 51.80% <52.45%> (-0.10%) ⬇️
services-documents 61.19% <ø> (ø)
services-endorsements-api 54.95% <100.00%> (+0.01%) ⬆️
services-sessions 65.75% <100.00%> (+0.09%) ⬆️
services-university-gateway 48.44% <100.00%> (+0.04%) ⬆️
services-user-notification 47.71% <100.00%> (+0.01%) ⬆️
services-user-profile 62.15% <100.00%> (-0.07%) ⬇️
shared-components 27.65% <ø> (ø)
shared-form-fields 31.58% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 29.26% <ø> (ø)
skilavottord-ws 23.51% <ø> (ø)
web 1.85% <ø> (ø)

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

Files with missing lines Coverage Δ
...delegations/test/delegations-filters-test-cases.ts 100.00% <ø> (ø)
.../app/delegations/test/delegations-filters-types.ts 100.00% <100.00%> (ø)
...modules/notifications/notificationsWorker/mocks.ts 97.67% <100.00%> (+0.05%) ⬆️
libs/auth-api-lib/src/index.ts 100.00% <100.00%> (ø)
...uth-api-lib/src/lib/delegations/constants/names.ts 100.00% <100.00%> (ø)
...i-lib/src/lib/delegations/delegation-dto.mapper.ts 100.00% <100.00%> (ø)
...delegations/delegations-incoming-custom.service.ts 97.63% <100.00%> (ø)
...ons/delegations-incoming-representative.service.ts 85.29% <100.00%> (ø)
...api-lib/src/lib/delegations/delegations.service.ts 26.55% <100.00%> (ø)
...ib/src/lib/delegations/dto/delegation-index.dto.ts 100.00% <100.00%> (ø)
... and 7 more

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 2aae5e1...eddd2f4. Read the comment docs.

@valurefugl valurefugl requested a review from a team as a code owner September 2, 2024 08:58
@datadog-island-is
Copy link

datadog-island-is bot commented Sep 2, 2024

Datadog Report

All test runs 29473d6 🔗

89 Total Test Services: 0 Failed, 87 Passed
🔻 Test Sessions change in coverage: 5 decreased, 26 increased, 169 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-backend 0 0 0 81 0 33.28s N/A Link
air-discount-scheme-web 0 0 0 2 0 8.07s N/A Link
api 0 0 0 4 0 3.1s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 20.81s N/A Link
api-domains-assets 0 0 0 3 0 12.46s N/A Link
api-domains-auth-admin 0 0 0 18 0 12.75s N/A Link
api-domains-communications 0 0 0 5 0 31.51s 1 increased (+0.02%) Link
api-domains-criminal-record 0 0 0 5 0 10.77s N/A Link
api-domains-driving-license 0 0 0 23 0 32.96s 1 increased (+0.01%) Link
api-domains-education 0 0 0 8 0 22.52s N/A Link

🔻 Code Coverage Decreases vs Default Branch (5)

  • services-auth-delegation-api - jest 60.01% (-0.1%) - Details
  • services-auth-admin-api - jest 50.86% (-0.09%) - Details
  • services-auth-personal-representative-public - jest 45.88% (-0.06%) - Details
  • services-auth-public-api - jest 52.54% (-0.05%) - Details
  • services-auth-personal-representative - jest 50.01% (-0.05%) - Details

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, codebase verification and nitpick comments (1)
apps/services/user-notification/src/app/modules/notifications/notificationsWorker/mocks.ts (1)

139-139: LGTM! Consider updating documentation for the new type property.

The addition of the type property to delegation entries is a good preparation for future enhancements. This change allows for more flexibility in handling different types of delegations.

Consider updating any relevant documentation or comments to explain the purpose and potential values of the new type property.

Also applies to: 147-147, 155-155

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9eeb847 and 9c0c0e3.

Files selected for processing (1)
  • apps/services/user-notification/src/app/modules/notifications/notificationsWorker/mocks.ts (2 hunks)
Additional context used
Path-based instructions (1)
apps/services/user-notification/src/app/modules/notifications/notificationsWorker/mocks.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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 not posted (2)
apps/services/user-notification/src/app/modules/notifications/notificationsWorker/mocks.ts (2)

Line range hint 1-209: LGTM! File structure aligns with NestJS architecture.

The overall structure of the file, including mock services and DTOs, adheres well to NestJS architecture and testing practices. The mock data and services provide a good foundation for unit and integration testing.


4-4: Verify the impact of import changes.

The import statements for UserProfileDto, createNationalId, User, and ConfigType have been modified. While this doesn't directly affect the functionality, it's important to ensure that these changes don't introduce any unintended side effects.

Run the following script to check for any usage changes:

Also applies to: 6-6, 11-13

Verification successful

Verification successful: No issues found with import changes.

The import modifications for UserProfileDto, createNationalId, User, and ConfigType are consistent with their usage in the codebase. The changes do not introduce any unintended side effects.

  • UserProfileDto is used in mock user profiles.
  • createNationalId is used for generating national IDs in mock data.
  • User and ConfigType are used as types in mock configurations.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of modified imports

# Test: Check for any changes in how User and ConfigType are used
rg --type typescript -A 5 'User|ConfigType' apps/services/user-notification/src/app/modules/notifications/notificationsWorker/

# Test: Verify that UserProfileDto and createNationalId are still correctly imported and used
rg --type typescript -A 5 'UserProfileDto|createNationalId' apps/services/user-notification/src/app/modules/notifications/notificationsWorker/

Length of output: 343


Script:

#!/bin/bash
# Description: Verify the usage of modified imports

# Test: Check for any changes in how User and ConfigType are used
rg --type ts -A 5 'User|ConfigType' apps/services/user-notification/src/app/modules/notifications/notificationsWorker/

# Test: Verify that UserProfileDto and createNationalId are still correctly imported and used
rg --type ts -A 5 'UserProfileDto|createNationalId' apps/services/user-notification/src/app/modules/notifications/notificationsWorker/

Length of output: 46050

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9c0c0e3 and a950dea.

Files selected for processing (1)
  • libs/auth-api-lib/src/lib/delegations/models/delegation-index.model.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/auth-api-lib/src/lib/delegations/models/delegation-index.model.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: 0

Outside diff range, codebase verification and nitpick comments (4)
apps/services/auth/ids-api/test/setup.ts (1)

Line range hint 1-180: Consider grouping mock classes and interfaces

The file structure is generally good, but we can improve its organization slightly.

Consider grouping all mock classes and interfaces at the beginning of the file, right after the imports. This would improve readability and make it easier to maintain the mocks. For example:

// Imports...

// Mock classes and interfaces
class MockNationalRegistryClientService implements Partial<NationalRegistryClientService> {
  // ...
}

class MockNationalRegistryV3ClientService implements Partial<NationalRegistryV3ClientService> {
  // ...
}

class MockUserProfile {
  // ...
}

interface SetupOptions {
  // ...
}

// Rest of the file...

This organization will make it easier to locate and update mock implementations when needed.

apps/services/auth/ids-api/src/app/delegations/delegations.controller.spec.ts (3)

Line range hint 1-1014: Consider improving test organization and reducing duplication.

The test suite is comprehensive, but consider the following improvements:

  1. Use beforeEach instead of beforeAll where appropriate to ensure a clean state for each test.
  2. Consider extracting common setup logic into helper functions to reduce duplication.
  3. Use describe.each more extensively to parameterize similar test cases.

These changes could make the tests more maintainable and easier to understand.


Line range hint 1-1014: Enhance usage of NestJS testing utilities.

While the test suite follows NestJS testing patterns, consider the following improvements:

  1. Use @nestjs/testing TestingModule for more granular control over the test module.
  2. Utilize @nestjs/testing Test.createTestingModule() for setting up the test module.
  3. Consider using moduleRef.get() instead of app.get() for retrieving dependencies.

These changes would align the test suite more closely with NestJS testing best practices and provide more flexibility in module configuration for tests.


Line range hint 1-1014: Enhance test assertions for improved coverage.

While the test suite covers various scenarios, consider adding more specific assertions:

  1. Add assertions for the structure and content of the returned delegation objects.
  2. Include more specific error case testing, such as network errors or unexpected API responses.
  3. Add tests for pagination and sorting of delegations, if applicable.

These additional assertions would further improve the robustness of the test suite and catch potential edge cases.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a950dea and 22384bb.

Files selected for processing (2)
  • apps/services/auth/ids-api/src/app/delegations/delegations.controller.spec.ts (1 hunks)
  • apps/services/auth/ids-api/test/setup.ts (2 hunks)
Additional context used
Path-based instructions (2)
apps/services/auth/ids-api/test/setup.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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/services/auth/ids-api/src/app/delegations/delegations.controller.spec.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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 not posted (3)
apps/services/auth/ids-api/test/setup.ts (2)

Line range hint 1-180: Overall implementation looks good

The test setup file adheres to NestJS architecture and testing best practices. It effectively uses dependency injection patterns and provides a comprehensive setup for both authenticated and non-authenticated test scenarios.

The implementation is well-structured and maintainable. Good job on following NestJS best practices and providing thorough test setups.


132-132: Verify the impact of removing MockDelegationsIndexService

The MockDelegationsIndexService class has been removed from the test setup. This change might affect how delegations are handled in tests.

Please confirm that:

  1. The removal of MockDelegationsIndexService is intentional.
  2. Existing tests that relied on this mock service have been updated or are still valid.
  3. The actual DelegationsIndexService is now being used in tests, or if a different approach for testing delegations has been implemented.

Run the following script to check for any remaining references to MockDelegationsIndexService:

apps/services/auth/ids-api/src/app/delegations/delegations.controller.spec.ts (1)

148-150: LGTM: Mock implementation for indexDelegations.

The mock implementation for indexDelegations enhances test isolation, which is a good practice in unit testing.

Please ensure that this mock implementation is sufficient for all test cases and doesn't hide any important behavior that should be tested.

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 22384bb and 8384a4d.

Files selected for processing (1)
  • apps/services/auth/public-api/test/setup.ts (2 hunks)
Additional context used
Path-based instructions (1)
apps/services/auth/public-api/test/setup.ts (2)

Pattern apps/services/**/*: "Confirm that the code adheres to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.
  • Integration and unit testing coverage and practices."

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 not posted (2)
apps/services/auth/public-api/test/setup.ts (2)

19-19: LGTM!

The import statement for CompanyRegistryClientService is correctly added.


158-161: LGTM!

The provider override for CompanyRegistryClientService is correctly set up with a mock implementation for the getCompany method.

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8384a4d and a4e8b04.

Files selected for processing (1)
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters.spec.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters.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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a4e8b04 and 0d5c8bf.

Files selected for processing (2)
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters.spec.ts (2 hunks)
  • libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (8 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/services/auth/ids-api/src/app/delegations/test/delegations-filters.spec.ts
Additional context used
Path-based instructions (1)
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Additional comments not posted (6)
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (6)

5-7: LGTM!

The code changes are approved.


29-30: LGTM!

The code changes are approved.


69-70: The past review comment made by @coderabbitai[bot] is still valid and applicable to the current code segment. Please refer to the comment for suggestions on enhancing error handling and logging within the new method to provide clearer insights into operations and potential issues.


133-139: LGTM!

The code changes are approved.


204-223: LGTM!

The code changes are approved.


262-310: The past review comment made by @coderabbitai[bot] is still valid and applicable to the current code segment. Please refer to the comment for suggestions on enhancing error handling and logging within the new method to provide clearer insights into operations and potential issues.

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0d5c8bf and 2237f66.

Files selected for processing (1)
  • libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (8 hunks)
Additional context used
Path-based instructions (1)
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Additional comments not posted (4)
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (4)

5-7: LGTM!

The code changes are approved.


57-58: LGTM!

The code changes are approved.


87-91: LGTM!

The code changes are approved.


Line range hint 135-312: Excellent work on enhancing the delegation management system!

The code changes are well-structured, modular, and follow best practices. The new functionality to support the LegalRepresentative delegation type and syslumenn provider has been implemented effectively. The use of the FeatureFlagService to enable/disable the new functionality is a good practice. The new private methods getAvailableDistrictCommissionersRegistryDelegations and isNotError keep the code DRY and modular.

Some key highlights:

  • The code segment follows the Single Responsibility Principle.
  • The code segment handles errors and edge cases.
  • The code segment uses the NationalRegistryClientService to fetch individual names, which keeps the code DRY.
  • The code segment has a new private method getAvailableDistrictCommissionersRegistryDelegations to fetch delegations from the syslumenn provider, which keeps the code modular and reusable.
  • The code segment has a new private method isNotError to check if an item is not an instance of Error, which keeps the code DRY.

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