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(auth-admin): Delegation admin module #15867

Merged
merged 16 commits into from
Sep 11, 2024
Merged

Conversation

GunnlaugurG
Copy link
Member

@GunnlaugurG GunnlaugurG commented Sep 3, 2024

What

Create a admin portal module for delegation lookup by national id

Why

So agents can lookup Delegations by national id and see all incoming and outgoing delegations

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 delegation administration capabilities, including new navigation items and API endpoints for managing delegations.
    • Added a structured way to fetch delegation data based on national IDs.
    • Implemented a new GraphQL resolver for managing delegation systems with various query and mutation methods.
    • Enhanced access control with new delegation admin scopes for improved user permissions.
    • Improved configurability of the AccessCard component with new properties for delegation direction and modification capabilities.
  • Bug Fixes

    • Corrected naming conventions and improved clarity in component logic.

Copy link
Contributor

coderabbitai bot commented Sep 3, 2024

Walkthrough

The changes enhance the auth-admin service by introducing new delegation management features. This includes the addition of new scopes for delegation administration, a dedicated module for handling delegation functionalities, and the implementation of a RESTful API controller alongside a GraphQL resolver for managing delegations. Modifications to the AccessCard component improve its configurability and correctness in handling delegation actions.

Changes

File Path Change Summary
apps/portals/admin/src/auth.ts Added properties delegationSystem and delegationSystemAdmin to AdminPortalScope.
apps/portals/admin/src/lib/masterNavigation.ts Included delegationAdminNav in the TOP_NAVIGATION array for enhanced navigation.
apps/portals/admin/src/lib/modules.ts Added delegationAdminModule to the modules array.
apps/services/auth/delegation-api/src/app/app.module.ts Imported DelegationsAdminModule into the main application module.
apps/services/auth/delegation-api/src/app/delegation-admin/delegation-admin.controller.ts Introduced DelegationAdminController with endpoints for retrieving and deleting delegations.
apps/services/auth/delegation-api/src/app/delegation-admin/delegation-admin.module.ts Created DelegationsAdminModule to manage delegation functionalities, including the new controller.
libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.resolver.ts Added DelegationAdminResolver for GraphQL queries and mutations related to delegations.
libs/auth/scopes/src/lib/auth.scope.ts Introduced DelegationAdminScopes constant for managing delegation-related permissions.
libs/auth-api-lib/src/lib/delegations/admin/delegation-admin-custom.service.ts Added DelegationAdminCustomService for managing delegations, including methods for retrieving and deleting delegations.
libs/auth-api-lib/src/lib/delegations/delegation-scope.service.ts Modified delete method to accept an optional transaction parameter and updated findAll method to include a useMaster: true option for enhanced querying.
libs/portals/shared-modules/delegations/src/components/access/AccessCard.tsx Updated AccessCardProps interface and AccessCard component logic to include new properties direction and canModify, enhancing configurability and correctness.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DelegationAdminController
    participant DelegationAdminCustomService
    participant DelegationAdminResolver

    User->>DelegationAdminController: GET /delegations
    DelegationAdminController->>DelegationAdminCustomService: getAllDelegationsByNationalId(nationalId)
    DelegationAdminCustomService-->>DelegationAdminController: Return delegations
    DelegationAdminController-->>User: Return delegations

    User->>DelegationAdminController: DELETE /delegations/{id}
    DelegationAdminController->>DelegationAdminCustomService: deleteDelegation(user, delegationId)
    DelegationAdminCustomService-->>DelegationAdminController: Confirm deletion
    DelegationAdminController-->>User: Confirm deletion successful
Loading

Possibly related PRs

Suggested labels

automerge


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.

@GunnlaugurG GunnlaugurG marked this pull request as ready for review September 3, 2024 12:49
@GunnlaugurG GunnlaugurG requested review from a team as code owners September 3, 2024 12:49
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: 5

Outside diff range, codebase verification and nitpick comments (8)
libs/portals/admin/delegation-admin/src/lib/navigation.ts (2)

17-17: Consider removing the activeIfExact property for the child navigation item.

Since the child navigation item has the same path as the parent item and is set to be hidden from the navigation menu (navHide: true), having activeIfExact set to true for the child item may not be necessary. The parent item's activeIfExact property should be sufficient to determine the active state.

Consider removing the activeIfExact property from the child navigation item:

  {
    name: m.delegationAdmin,
    path: DelegationAdminPaths.DelegationAdmin,
-   activeIfExact: true,
    navHide: true,
  },

14-19: Consider removing the redundant child navigation item.

The child navigation item has the same path as the parent item (DelegationAdminPaths.DelegationAdmin) and is set to be hidden from the navigation menu (navHide: true). Having a hidden child item with the same path as the parent item seems redundant and unnecessary.

Consider removing the entire child navigation item:

  children: [
-   {
-     name: m.delegationAdmin,
-     path: DelegationAdminPaths.DelegationAdmin,
-     activeIfExact: true,
-     navHide: true,
-   },
  ],
libs/auth-api-lib/sequelize.config.js (2)

5-5: Environment Variable Not Set

The DB_PASS_AUTH_DB environment variable is not set, which means the fallback value 'dev_db' will be used. Ensure that this environment variable is set in environments where it is required, such as production.

Analysis chain

Verify the environment variable usage.

Ensure that the DB_PASS_AUTH_DB environment variable is correctly set in the development environment.

Run the following script to verify the environment variable usage:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the `DB_PASS_AUTH_DB` environment variable is correctly set.

# Test: Check if the environment variable is set. Expect: The environment variable to be set.
if [[ -z "${DB_PASS_AUTH_DB}" ]]; then
  echo "The DB_PASS_AUTH_DB environment variable is not set."
else
  echo "The DB_PASS_AUTH_DB environment variable is set to ${DB_PASS_AUTH_DB}."
fi

Length of output: 128


9-9: Environment Variable Not Set

The DB_PORT_AUTH_DB environment variable is not set. Please verify the environment setup to ensure that the correct database port is being used in the development environment. If 5433 is not the intended default, update the environment configuration accordingly.

Analysis chain

Verify the environment variable usage.

Ensure that the DB_PORT_AUTH_DB environment variable is correctly set in the development environment.

Run the following script to verify the environment variable usage:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the `DB_PORT_AUTH_DB` environment variable is correctly set.

# Test: Check if the environment variable is set. Expect: The environment variable to be set.
if [[ -z "${DB_PORT_AUTH_DB}" ]]; then
  echo "The DB_PORT_AUTH_DB environment variable is not set."
else
  echo "The DB_PORT_AUTH_DB environment variable is set to ${DB_PORT_AUTH_DB}."
fi

Length of output: 128

libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.service.ts (1)

17-26: Remove the async keyword.

The method is marked as async but does not use await when calling this.delegationsWithAuth.

Apply this diff to remove the async keyword:

-async getDelegationAdmin(
+getDelegationAdmin(
apps/services/auth/delegation-api/src/app/delegation-admin/test/delegation-admin.spec.ts (1)

35-53: Add more assertions to verify the response body.

The test case is well-written and covers the expected behavior of the endpoint. However, it can be improved by adding more assertions to verify the response body.

Consider adding the following assertions:

// Assert
expect(res.status).toEqual(200)
expect(res.body).toHaveLength(1)
expect(res.body[0].id).toEqual(delegation.id)
expect(res.body[0].fromNationalId).toEqual(user.nationalId)
libs/portals/admin/delegation-admin/src/screens/Root.action.ts (1)

42-70: LGTM with a suggestion!

The FindDelegationForNationalId function is correctly implemented and handles the validation and redirection based on the nationalId field.

Consider handling the case when the nationalId is not present in the form data. You can add a check for the presence of the nationalId field before extracting it from the form data and return an appropriate error if it's missing.

+    if (!formData.has('nationalId')) {
+      return {
+        errors: [{ message: 'National ID is required' }],
+        data: null,
+      }
+    }
+
     const nationalId = formData.get('nationalId') as string
apps/services/auth/delegation-api/src/app/delegation-admin/delegation-admin.controller.ts (1)

68-97: LGTM with a minor typo fix!

The delete method adheres to NestJS best practices and correctly handles the deletion of a delegation by ID. The method is well-documented and audited. However, there is a small typo in the @Scopes decorator:

-@Scopes(DelegationAdminScopes.amdin)
+@Scopes(DelegationAdminScopes.admin)
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9a67d75 and 8023226.

Files selected for processing (49)
  • apps/portals/admin/src/auth.ts (1 hunks)
  • apps/portals/admin/src/lib/masterNavigation.ts (2 hunks)
  • apps/portals/admin/src/lib/modules.ts (2 hunks)
  • apps/services/auth/delegation-api/src/app/app.module.ts (2 hunks)
  • apps/services/auth/delegation-api/src/app/delegation-admin/delegation-admin.controller.ts (1 hunks)
  • apps/services/auth/delegation-api/src/app/delegation-admin/delegation-admin.module.ts (1 hunks)
  • apps/services/auth/delegation-api/src/app/delegation-admin/test/delegation-admin.auth.spec.ts (1 hunks)
  • apps/services/auth/delegation-api/src/app/delegation-admin/test/delegation-admin.spec.ts (1 hunks)
  • libs/api/domains/auth-admin/src/lib/auth-admin.module.ts (2 hunks)
  • libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.resolver.ts (1 hunks)
  • libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.service.ts (1 hunks)
  • libs/api/domains/auth-admin/src/lib/delegationAdmin/models/delegation.model.ts (1 hunks)
  • libs/api/domains/auth-admin/src/lib/delegationProvider/delegation-provider.resolver.ts (1 hunks)
  • libs/api/domains/auth/src/index.ts (1 hunks)
  • libs/auth-api-lib/sequelize.config.js (1 hunks)
  • libs/auth-api-lib/src/index.ts (2 hunks)
  • libs/auth-api-lib/src/lib/delegations/admin/delegation-admin-custom.service.ts (1 hunks)
  • libs/auth-api-lib/src/lib/delegations/delegation-scope.service.ts (1 hunks)
  • libs/auth-api-lib/src/lib/delegations/delegations.module.ts (3 hunks)
  • libs/auth-api-lib/src/lib/delegations/dto/delegation-admin-custom.dto.ts (1 hunks)
  • libs/auth/scopes/src/lib/admin-portal.scope.ts (1 hunks)
  • libs/auth/scopes/src/lib/auth.scope.ts (1 hunks)
  • libs/clients/auth/delegation-api/src/index.ts (1 hunks)
  • libs/clients/auth/delegation-api/src/lib/apis.ts (2 hunks)
  • libs/portals/admin/delegation-admin/.babelrc (1 hunks)
  • libs/portals/admin/delegation-admin/.eslintrc.json (1 hunks)
  • libs/portals/admin/delegation-admin/README.md (1 hunks)
  • libs/portals/admin/delegation-admin/codegen.yml (1 hunks)
  • libs/portals/admin/delegation-admin/jest.config.ts (1 hunks)
  • libs/portals/admin/delegation-admin/project.json (1 hunks)
  • libs/portals/admin/delegation-admin/src/components/DelegationList.tsx (1 hunks)
  • libs/portals/admin/delegation-admin/src/index.ts (1 hunks)
  • libs/portals/admin/delegation-admin/src/lib/messages.ts (1 hunks)
  • libs/portals/admin/delegation-admin/src/lib/navigation.ts (1 hunks)
  • libs/portals/admin/delegation-admin/src/lib/paths.ts (1 hunks)
  • libs/portals/admin/delegation-admin/src/module.tsx (1 hunks)
  • libs/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.graphql (1 hunks)
  • libs/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.loader.ts (1 hunks)
  • libs/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.tsx (1 hunks)
  • libs/portals/admin/delegation-admin/src/screens/Root.action.ts (1 hunks)
  • libs/portals/admin/delegation-admin/src/screens/Root.tsx (1 hunks)
  • libs/portals/admin/delegation-admin/tsconfig.json (1 hunks)
  • libs/portals/admin/delegation-admin/tsconfig.lib.json (1 hunks)
  • libs/portals/admin/delegation-admin/tsconfig.spec.json (1 hunks)
  • libs/portals/shared-modules/delegations/src/components/access/AccessCard.tsx (3 hunks)
  • libs/portals/shared-modules/delegations/src/components/delegations/incoming/DelegationsIncoming.tsx (1 hunks)
  • libs/portals/shared-modules/delegations/src/index.ts (1 hunks)
  • libs/services/auth/testing/src/fixtures/fixture-factory.ts (1 hunks)
  • tsconfig.base.json (1 hunks)
Files skipped from review due to trivial changes (13)
  • libs/api/domains/auth-admin/src/lib/delegationProvider/delegation-provider.resolver.ts
  • libs/auth-api-lib/src/lib/delegations/delegation-scope.service.ts
  • libs/portals/admin/delegation-admin/.babelrc
  • libs/portals/admin/delegation-admin/.eslintrc.json
  • libs/portals/admin/delegation-admin/README.md
  • libs/portals/admin/delegation-admin/codegen.yml
  • libs/portals/admin/delegation-admin/jest.config.ts
  • libs/portals/admin/delegation-admin/project.json
  • libs/portals/admin/delegation-admin/src/index.ts
  • libs/portals/admin/delegation-admin/src/lib/paths.ts
  • libs/portals/admin/delegation-admin/tsconfig.lib.json
  • libs/portals/admin/delegation-admin/tsconfig.spec.json
  • libs/services/auth/testing/src/fixtures/fixture-factory.ts
Additional context used
Path-based instructions (35)
libs/clients/auth/delegation-api/src/index.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/portals/shared-modules/delegations/src/index.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/dto/delegation-admin-custom.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/portals/admin/delegation-admin/tsconfig.json (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/delegation-api/src/app/delegation-admin/delegation-admin.module.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/api/domains/auth-admin/src/lib/delegationAdmin/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."
libs/clients/auth/delegation-api/src/lib/apis.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/portals/admin/delegation-admin/src/lib/navigation.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/api/domains/auth/src/index.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/scopes/src/lib/auth.scope.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/portals/admin/delegation-admin/src/components/DelegationList.tsx (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/sequelize.config.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/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.graphql (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/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.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/scopes/src/lib/admin-portal.scope.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/portals/admin/delegation-admin/src/module.tsx (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/portals/admin/src/lib/modules.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."
libs/portals/admin/delegation-admin/src/lib/messages.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/portals/admin/src/auth.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."
libs/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.loader.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/api/domains/auth-admin/src/lib/auth-admin.module.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/delegation-api/src/app/delegation-admin/test/delegation-admin.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/delegation-api/src/app/app.module.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/portals/admin/delegation-admin/src/screens/Root.action.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/portals/admin/src/lib/masterNavigation.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."
libs/portals/admin/delegation-admin/src/screens/Root.tsx (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/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.tsx (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/delegation-api/src/app/delegation-admin/delegation-admin.controller.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/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.resolver.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/portals/shared-modules/delegations/src/components/delegations/incoming/DelegationsIncoming.tsx (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.module.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/delegation-api/src/app/delegation-admin/test/delegation-admin.auth.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."
libs/auth-api-lib/src/lib/delegations/admin/delegation-admin-custom.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/portals/shared-modules/delegations/src/components/access/AccessCard.tsx (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/index.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 (67)
libs/clients/auth/delegation-api/src/index.ts (1)

5-5: LGTM!

The new export statement for DelegationDTO enhances the module's interface and adheres to the reusability guideline for the libs directory.

libs/portals/shared-modules/delegations/src/index.ts (2)

8-8: LGTM!

The export of the AccessCard component is approved as it adheres to the reusability of components across different NextJS apps.


9-9: LGTM!

The export of the DelegationsEmptyState component is approved as it adheres to the reusability of components across different NextJS apps.

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

1-11: LGTM!

The code changes are approved. The DTO class is well-structured, follows best practices, and promotes reusability.

libs/portals/admin/delegation-admin/tsconfig.json (1)

1-20: TypeScript configuration looks good!

The TypeScript configuration file is well-structured and follows best practices:

  • The compilerOptions are appropriately set to use react-jsx, disallow JavaScript files, enable synthetic default imports, and enforce strict type checking. This ensures a consistent and type-safe development environment.
  • The empty files and include arrays indicate that no files are directly specified for compilation, which is fine since the configuration is likely inherited from the referenced files.
  • The references array properly includes paths to additional TypeScript configuration files for the library and tests, promoting a modular and organized structure.
  • Extending the base TypeScript configuration (../../../../tsconfig.base.json) ensures consistency across the project.

Overall, the TypeScript configuration adheres to best practices and promotes a robust development setup.

apps/services/auth/delegation-api/src/app/delegation-admin/delegation-admin.module.ts (1)

10-14: LGTM!

The DelegationsAdminModule follows the NestJS architecture by using the @Module decorator and defining imports, controllers, and providers. The module imports necessary dependencies and declares a controller for handling HTTP requests.

libs/api/domains/auth-admin/src/lib/delegationAdmin/models/delegation.model.ts (1)

1-17: LGTM!

The code changes in this file are approved for the following reasons:

  • The DelegationAdminCustomModel class is defined using NestJS decorators, following the framework's convention for creating GraphQL object types.
  • The fields are marked as non-nullable, ensuring that they are always present in the GraphQL schema.
  • The CustomDelegation type is imported and reused, promoting code reusability.
  • The file is well-structured, follows a consistent naming convention, and is located in the appropriate directory within the libs folder structure.
libs/clients/auth/delegation-api/src/lib/apis.ts (1)

10-10: LGTM!

The code changes are approved. The addition of DelegationAdminApi to the exported APIs is consistent with the AI-generated summary and enhances the functionality of the module.

Also applies to: 22-22

libs/portals/admin/delegation-admin/src/lib/navigation.ts (1)

1-21: LGTM! The code follows a clear and structured approach.

The navigation definition for the delegation admin portal is well-organized and modular. The use of separate files for messages and paths promotes reusability and maintainability. The PortalNavigationItem type ensures type safety and consistency.

libs/api/domains/auth/src/index.ts (6)

9-9: LGTM!

The code changes are approved.


11-11: LGTM!

The code changes are approved.


12-12: LGTM!

The code changes are approved.


14-14: LGTM!

The code changes are approved.


7-7: Verify the usage of TypeScript for defining the DomainDataLoader type.

Ensure that the DomainDataLoader type is defined using TypeScript for better type safety.

Run the following script to verify the TypeScript usage:

Verification successful

The DomainDataLoader type is correctly defined using TypeScript.

The type DomainDataLoader is defined with TypeScript in libs/api/domains/auth/src/lib/loaders/domain.loader.ts, ensuring type safety and proper usage across the codebase. The export statement in libs/api/domains/auth/src/index.ts is correct.

  • libs/api/domains/auth/src/lib/loaders/domain.loader.ts:10: export type DomainDataLoader = DataLoader<DomainInput, Domain | null, string>
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of TypeScript for defining the `DomainDataLoader` type.

# Test: Search for the type definition. Expect: TypeScript type definition.
ast-grep --lang typescript --pattern $'type DomainDataLoader = $_'

Length of output: 203


6-6: Verify the reusability of DomainLoader across different NextJS apps.

Ensure that DomainLoader is implemented in a way that allows it to be reused across different NextJS apps.

Run the following script to verify the reusability:

Verification successful

Reusability of DomainLoader is confirmed within the domain and admin modules.

The DomainLoader is used across various modules within the auth and auth-admin domains, indicating its reusability within these contexts. However, there is no evidence of its usage across entirely separate NextJS applications from the current search results.

  • Usage found in libs/api/domains/auth/src/lib/resolvers and libs/api/domains/auth-admin/src/lib/delegationAdmin.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the reusability of `DomainLoader` across different NextJS apps.

# Test: Search for the loader usage in other NextJS apps. Expect: Occurrences in other apps.
rg --type typescript -A 5 $'DomainLoader'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify the reusability of `DomainLoader` across different NextJS apps.

# Test: Search for the loader usage in other NextJS apps. Expect: Occurrences in other apps.
rg --glob '*.ts' -A 5 'DomainLoader'

Length of output: 7257

libs/portals/admin/delegation-admin/src/components/DelegationList.tsx (1)

10-28: LGTM!

The DelegationList component is correctly implemented and follows the React functional component pattern. The reuse of the AccessCard component from the shared modules is a good practice.

libs/auth-api-lib/sequelize.config.js (2)

4-4: Verify the environment variable usage.

Ensure that the DB_USER_AUTH_DB environment variable is correctly set in the development environment.

Run the following script to verify the environment variable usage:

Verification successful

Environment variable not set; fallback value will be used.

The DB_USER_AUTH_DB environment variable is not set, so the fallback value 'dev_db' will be used in the development environment. Ensure that this is the intended behavior or set the environment variable if a different username is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the `DB_USER_AUTH_DB` environment variable is correctly set.

# Test: Check if the environment variable is set. Expect: The environment variable to be set.
if [[ -z "${DB_USER_AUTH_DB}" ]]; then
  echo "The DB_USER_AUTH_DB environment variable is not set."
else
  echo "The DB_USER_AUTH_DB environment variable is set to ${DB_USER_AUTH_DB}."
fi

Length of output: 128


6-6: Verify the environment variable usage.

Ensure that the DB_NAME_AUTH_DB environment variable is correctly set in the development environment.

Run the following script to verify the environment variable usage:

libs/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.graphql (1)

1-58: The GraphQL query looks good and follows the best practices.

The getCustomDelegationsAdmin query is well-structured and retrieves all the necessary data for displaying delegation details in the admin portal. It adheres to the GraphQL syntax and naming conventions, making it easy to understand and maintain.

The query also follows the reusability and TypeScript usage instructions for the libs directory, ensuring that it can be effectively used across different NextJS apps.

Great job!

libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.service.ts (1)

13-15: LGTM!

The code changes are approved.

libs/auth/scopes/src/lib/admin-portal.scope.ts (2)

19-19: LGTM!

The code changes are approved.


20-20: LGTM!

The code changes are approved.

libs/portals/admin/delegation-admin/src/module.tsx (4)

1-7: LGTM!

The code segment follows best practices for importing dependencies. It uses named imports and relative imports for local files. The imports are well-organized and grouped based on their origin.


9-12: LGTM!

The code segment follows the best practice of lazy loading components to optimize performance. It uses the lazy function from react and dynamic imports to achieve lazy loading.


14-17: LGTM!

The code segment defines the allowed scopes for access control. It uses scopes from a centralized location (AdminPortalScope), which promotes reusability and maintainability.


19-42: LGTM!

The code segment defines the delegation admin module using the PortalModule interface. It follows a consistent and structured approach for defining the module name, access control, and routes.

The module structure includes:

  • name: Specifies the module name using a localized message.
  • enabled: Implements access control by checking if the user has any of the allowed scopes.
  • routes: Defines the module routes using an array of route objects, specifying the route name, path, component, and additional properties like actions and loaders.

The code segment demonstrates good practices by using appropriate types, functions, and a modular structure.

apps/portals/admin/src/lib/modules.ts (1)

34-34: LGTM!

The addition of delegationAdminModule to the modules array follows the established pattern and does not introduce any type mismatches or logical errors. The code change is approved.

libs/portals/admin/delegation-admin/src/lib/messages.ts (1)

1-44: LGTM!

The code changes are approved for the following reasons:

  • The file correctly uses defineMessages from react-intl to define messages.
  • The message IDs follow a consistent naming convention.
  • The default messages are in Icelandic, which seems to be the expected language.
  • The messages cover various aspects of the delegation admin feature, providing a comprehensive set of translations.
apps/portals/admin/src/auth.ts (1)

41-42: LGTM! The code changes adhere to best practices.

The addition of the new properties delegationSystem and delegationSystemAdmin to the AdminPortalScope object expands the functionality of the admin portal by incorporating additional scopes related to delegation management. This aligns with the PR objective of introducing a delegation management feature.

The code adheres to TypeScript best practices by utilizing the AdminPortalScope enum for type safety.

libs/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.loader.ts (1)

21-54: LGTM!

The delegationAdminLoader function is well-implemented and follows best practices:

  • It handles errors and edge cases appropriately.
  • It unmasks the nationalId to ensure data privacy.
  • It uses the network-only fetch policy to ensure fresh data.
  • It redirects if the delegation admin data is not found.

The code changes are approved.

libs/api/domains/auth-admin/src/lib/auth-admin.module.ts (4)

16-16: LGTM!

The code changes are approved.


17-18: LGTM!

The code changes are approved.


22-22: LGTM!

The code changes are approved.


35-37: LGTM!

The code changes are approved.

apps/services/auth/delegation-api/src/app/delegation-admin/test/delegation-admin.spec.ts (1)

9-54: LGTM!

The test suite is well-structured and the helper functions are useful for setting up the test case.

apps/services/auth/delegation-api/src/app/app.module.ts (1)

28-28: LGTM!

The code changes adhere to the following:

  • NestJS architecture, including modules, services, and controllers.
  • Dependency injection patterns and service encapsulation.

The code changes are consistent with the existing code structure and style, do not introduce any new warnings or errors, and are properly formatted.

Also applies to: 43-43

libs/portals/admin/delegation-admin/src/screens/Root.action.ts (3)

1-15: LGTM!

The imports are used appropriately in the code.


17-19: LGTM!

The ErrorType enum is used to represent the error type for an invalid national ID.


26-40: LGTM!

The schema object is correctly defined using the zod library and used for validating the nationalId field.

apps/portals/admin/src/lib/masterNavigation.ts (2)

50-51: LGTM!

The code changes are approved. The inclusion of delegationAdminNav in the TOP_NAVIGATION array enhances the navigation structure by providing access to delegation administration features.


17-17: Verify the module path for delegation-admin.

Ensure that the delegation-admin module is correctly installed and the import path is valid.

Run the following script to verify the module path:

libs/portals/admin/delegation-admin/src/screens/Root.tsx (1)

1-72: LGTM!

The code changes are approved. The component is well-structured, follows best practices, and adheres to the additional instructions provided.

Some additional suggestions:

  • Consider extracting the form into a separate component for better reusability and maintainability.
  • Consider adding more tests to cover the different scenarios like form submission, error handling, and rendering of the Outlet component.
  • Consider adding more documentation to explain the purpose and usage of the component.
libs/portals/admin/delegation-admin/src/screens/DelegationAdminDetails/DelegationAdmin.tsx (4)

1-12: LGTM!

The import statements are well-organized, grouped based on their origin and purpose, and adhere to the project's coding style and conventions. There are no unused imports or missing dependencies.


14-72: LGTM!

The component follows a clear and logical structure, with a top-down approach. It separates the data fetching logic using the useLoaderData hook, which is a good practice for code organization and separation of concerns. The use of the useLocale hook for localization and the useNavigate hook for navigation is appropriate and follows the recommended patterns.

The component handles the scenarios when there are no incoming or outgoing delegations by rendering an empty state component, providing a good user experience. It is also broken down into smaller, reusable components, such as BackButton, IntroHeader, DelegationList, and DelegationsEmptyState, which promotes modularity and maintainability.


23-26: LGTM!

The component takes accessibility into consideration by using the IntroHeader component to properly announce the delegation admin name and national ID to assistive technologies. The Tabs component from @island.is/island-ui/core is likely to be accessible and follow the necessary accessibility guidelines. The label prop on the Tabs component provides a label for the tabs, which is important for screen readers and other assistive technologies.

Additionally, the imageAlt prop on the DelegationsEmptyState component ensures that the empty state image has alternative text, making it accessible to users with visual impairments.

Also applies to: 28-67


15-15: LGTM!

The component properly handles localization by using the useLocale hook to access the formatMessage function. The formatMessage function is used to localize the labels for the tabs and the empty state messages, ensuring that all user-facing text is localized.

The localized messages are imported from a separate file (../../lib/messages), which is a good practice for organizing and managing localization messages. The component does not hardcode any text content, demonstrating a commitment to localization best practices.

Also applies to: 33-33, 43-45, 60-62

apps/services/auth/delegation-api/src/app/delegation-admin/delegation-admin.controller.ts (1)

41-66: LGTM!

The getDelegationAdmin method adheres to NestJS best practices and correctly handles the retrieval of delegations by national ID. The method is well-documented and audited.

libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.resolver.ts (5)

37-55: LGTM!

The getDelegationSystem method correctly defines a GraphQL query to fetch delegation data for a given nationalId. It uses the @CurrentUser() decorator to access the authenticated user and injects IdentityDataLoader for efficient loading of identity data. The returned object matches the structure of DelegationAdminCustomModel.


57-63: LGTM!

The deleteDelegationSystem method correctly defines a GraphQL mutation to delete a delegation by id. It uses the @CurrentUser() decorator to access the authenticated user and delegates the deletion logic to the delegationAdminService.


65-79: LGTM!

The resolveFromIdentity and resolveToIdentity methods correctly define field resolvers for the from and to fields of CustomDelegation. They efficiently load the related identity data using IdentityDataLoader.


81-92: LGTM!

The resolveValidTo method correctly defines a field resolver for the validTo field of CustomDelegation. It handles the case when validTo is not present by returning undefined and checks if all scopes have the same validTo date to ensure consistency.


94-110: LGTM!

The resolveDomain method correctly defines a field resolver for the domain field of CustomDelegation. It efficiently loads the related domain data using DomainDataLoader and handles the case when the domain is not found by throwing a NotFoundException.

libs/portals/shared-modules/delegations/src/components/delegations/incoming/DelegationsIncoming.tsx (1)

79-79: LGTM!

The addition of the direction prop to the AccessCard component enhances its reusability by allowing it to handle different types of delegations effectively. Setting the prop explicitly to "incoming" is a good practice for clarity and maintainability.

The change adheres to the additional instructions provided for files matching the path pattern libs/**/*:

  • The component is located within a shared module for delegations, indicating reusability across different NextJS apps.
  • TypeScript is being used for defining props and exporting types.
libs/auth-api-lib/src/lib/delegations/delegations.module.ts (2)

36-36: LGTM!

The import statement is correctly importing the DelegationAdminCustomService from the relative path.


75-75: LGTM!

The DelegationAdminCustomService is correctly added to the imports and exports arrays of the @Module decorator, making it available for dependency injection within the module and for other modules that import this module.

Also applies to: 84-84

apps/services/auth/delegation-api/src/app/delegation-admin/test/delegation-admin.auth.spec.ts (3)

34-57: LGTM!

The test case is well-structured and verifies the expected behavior when the user is not authenticated.


59-87: LGTM!

The test case is well-structured and verifies the expected behavior when the user does not have the correct scope. The cleanup after the test is also handled properly.


89-118: LGTM!

The test case is well-structured and verifies the expected behavior when the user does not have the admin scope. The cleanup after the test is also handled properly.

libs/auth-api-lib/src/lib/delegations/admin/delegation-admin-custom.service.ts (1)

25-96: LGTM!

The getAllDelegationsByNationalId method is well-implemented and follows best practices for querying the database using Sequelize. The method efficiently fetches incoming and outgoing delegations along with related data using eager loading and filters the results based on relevant conditions. The method also maps the Sequelize model instances to DTOs before returning, which is a good practice to avoid exposing internal implementation details.

libs/portals/shared-modules/delegations/src/components/access/AccessCard.tsx (4)

51-51: LGTM!

The changes to the AccessCardProps interface are approved. The new optional properties direction and canModify enhance the configurability of the AccessCard component and are correctly typed.

Also applies to: 57-59


67-68: LGTM!

The changes to the AccessCard component's parameters are approved. The default values for direction and canModify align with the AccessCardProps interface and provide sensible defaults.


160-160: LGTM!

The changes to the showActions variable are approved. The logic correctly incorporates the new canModify property and ensures that actions are only displayed when appropriate based on the delegation type and direction.


207-208: LGTM!

The changes to the delegation name rendering logic are approved. The comment provides valuable context about the previous logic error, and the corrected condition ensures that the delegation name is rendered correctly based on the direction property.

libs/auth-api-lib/src/index.ts (3)

43-43: LGTM!

The export statement for delegation-admin-custom.dto is correctly defined.


58-58: LGTM!

The export statement for delegation-admin-custom.service is correctly defined.


Line range hint 1-200: Adherence to additional instructions confirmed.

The code in this file adheres to the following:

  • The granular exports allow for reusability across different NextJS apps.
  • The exports are from TypeScript files, indicating the usage of TypeScript for defining props and exporting types.
  • The granular exports enable effective tree-shaking and bundling practices.
tsconfig.base.json (1)

1114-1115: The change looks good!

The new path mapping for the delegation-admin module is added correctly, pointing to the appropriate source file. This will allow the project to properly resolve and utilize the module.

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 37.03704% with 102 lines in your changes missing coverage. Please review.

Project coverage is 36.84%. Comparing base (0cfcd0b) to head (4f6b869).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...c/lib/delegationAdmin/delegation-admin.resolver.ts 0.00% 46 Missing ⚠️
...legations/admin/delegation-admin-custom.service.ts 50.00% 18 Missing ⚠️
...rc/lib/delegationAdmin/delegation-admin.service.ts 0.00% 14 Missing ⚠️
...src/lib/delegationAdmin/models/delegation.model.ts 0.00% 11 Missing ⚠️
.../app/v2/delegations/delegation-admin.controller.ts 68.00% 8 Missing ⚠️
...pi/domains/auth-admin/src/lib/auth-admin.module.ts 0.00% 4 Missing ⚠️
...delegationProvider/delegation-provider.resolver.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15867      +/-   ##
==========================================
- Coverage   36.84%   36.84%   -0.01%     
==========================================
  Files        6702     6709       +7     
  Lines      137374   137533     +159     
  Branches    39069    39095      +26     
==========================================
+ Hits        50617    50675      +58     
- Misses      86757    86858     +101     
Flag Coverage Δ
air-discount-scheme-backend 54.08% <100.00%> (+0.03%) ⬆️
air-discount-scheme-web 0.00% <ø> (ø)
api 3.39% <ø> (ø)
api-domains-air-discount-scheme 36.88% <100.00%> (+0.09%) ⬆️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 49.89% <0.00%> (-4.01%) ⬇️
api-domains-communications 40.53% <ø> (ø)
api-domains-criminal-record 47.81% <ø> (ø)
api-domains-driving-license 44.28% <100.00%> (+0.04%) ⬆️
api-domains-education 31.25% <ø> (ø)
api-domains-health-insurance 34.63% <ø> (ø)
api-domains-mortgage-certificate 35.75% <ø> (ø)
api-domains-payment-schedule 41.17% <100.00%> (+0.08%) ⬆️
application-api-files 57.52% <ø> (ø)
application-core 72.28% <ø> (+0.08%) ⬆️
application-system-api 41.69% <100.00%> (+<0.01%) ⬆️
application-template-api-modules 23.47% <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.14% <100.00%> (+0.04%) ⬆️
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% <ø> (ø)
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% <ø> (ø)
auth-react 22.82% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-driving-license 40.61% <ø> (ø)
clients-driving-license-book 43.88% <ø> (ø)
clients-financial-statements-inao 49.13% <ø> (ø)
clients-license-client 1.83% <ø> (ø)
clients-middlewares 72.75% <ø> (+0.25%) ⬆️
clients-regulations 42.58% <ø> (ø)
clients-rsk-company-registry 29.76% <ø> (ø)
clients-syslumenn 49.77% <ø> (ø)
cms 0.42% <ø> (ø)
cms-translations 39.68% <ø> (ø)
download-service 44.57% <100.00%> (+0.04%) ⬆️
financial-aid-backend 56.53% <100.00%> (+0.03%) ⬆️
financial-aid-shared 19.03% <ø> (ø)
icelandic-names-registry-backend 54.64% <100.00%> (+0.11%) ⬆️
judicial-system-api 19.35% <ø> (ø)
judicial-system-backend 55.88% <ø> (ø)
license-api 42.77% <100.00%> (-0.12%) ⬇️
nest-audit 68.20% <ø> (ø)
nest-feature-flags 51.97% <ø> (ø)
nest-problem 46.48% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
portals-admin-regulations-admin 1.96% <ø> (ø)
portals-core 16.14% <ø> (ø)
reference-backend 50.57% <ø> (ø)
services-auth-admin-api 52.72% <68.23%> (+1.80%) ⬆️
services-auth-delegation-api 61.43% <63.26%> (+<0.01%) ⬆️
services-auth-ids-api 54.07% <61.22%> (+0.02%) ⬆️
services-auth-personal-representative 48.01% <61.22%> (+0.10%) ⬆️
services-auth-personal-representative-public 43.88% <59.18%> (+0.02%) ⬆️
services-auth-public-api 51.85% <61.22%> (+0.05%) ⬆️
services-documents 61.26% <100.00%> (+0.07%) ⬆️
services-endorsements-api 54.99% <100.00%> (+0.03%) ⬆️
services-sessions 65.75% <100.00%> (+<0.01%) ⬆️
services-university-gateway 48.55% <ø> (+0.02%) ⬆️
services-user-notification 47.73% <100.00%> (+0.01%) ⬆️
services-user-profile 62.17% <100.00%> (-0.07%) ⬇️
shared-components 27.65% <ø> (ø)
shared-form-fields 31.58% <ø> (ø)
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 Δ
apps/services/auth/admin-api/src/app/app.module.ts 100.00% <100.00%> (ø)
.../src/app/v2/delegations/delegation-admin.module.ts 100.00% <100.00%> (ø)
libs/auth-api-lib/src/index.ts 100.00% <100.00%> (ø)
...ib/src/lib/delegations/delegation-scope.service.ts 92.94% <100.00%> (-1.11%) ⬇️
...-api-lib/src/lib/delegations/delegations.module.ts 100.00% <100.00%> (ø)
...lib/delegations/dto/delegation-admin-custom.dto.ts 100.00% <100.00%> (ø)
libs/auth/scopes/src/lib/admin-portal.scope.ts 100.00% <100.00%> (ø)
libs/auth/scopes/src/lib/auth.scope.ts 100.00% <100.00%> (ø)
libs/clients/auth/delegation-api/src/index.ts 100.00% <100.00%> (ø)
...vices/auth/testing/src/fixtures/fixture-factory.ts 91.32% <ø> (ø)
... 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 0cfcd0b...4f6b869. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Sep 3, 2024

Datadog Report

All test runs 799a55a 🔗

75 Total Test Services: 0 Failed, 73 Passed
🔻 Test Sessions change in coverage: 2 decreased, 17 increased, 181 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 32.93s 1 increased (+0.04%) Link
air-discount-scheme-web 0 0 0 2 0 9.61s 1 no change Link
api 0 0 0 4 0 2.84s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 18.78s 1 increased (+0.08%) Link
api-domains-assets 0 0 0 3 0 11.64s 1 no change Link
api-domains-auth-admin 0 0 0 18 0 13.95s 1 decreased (-3.67%) Link
api-domains-communications 0 0 0 5 0 32.49s 1 no change Link
api-domains-criminal-record 0 0 0 5 0 9.72s 1 no change Link
api-domains-driving-license 0 0 0 23 0 32.93s 1 increased (+0.02%) Link
api-domains-education 0 0 0 8 0 22.67s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (2)

  • api-domains-auth-admin - jest 49.28% (-3.67%) - Details
  • license-api - jest 33.87% (-0.02%) - Details

@GunnlaugurG GunnlaugurG requested a review from a team as a code owner September 9, 2024 10:50
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 8023226 and 7e1526d.

Files selected for processing (8)
  • apps/services/auth/admin-api/infra/auth-admin-api.ts (2 hunks)
  • apps/services/auth/admin-api/src/app/app.module.ts (3 hunks)
  • apps/services/auth/admin-api/src/app/v2/delegations/delegation-admin.controller.ts (1 hunks)
  • apps/services/auth/admin-api/src/app/v2/delegations/delegation-admin.module.ts (1 hunks)
  • libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.service.ts (1 hunks)
  • libs/clients/auth/admin-api/src/index.ts (1 hunks)
  • libs/clients/auth/admin-api/src/lib/apis.ts (2 hunks)
  • libs/clients/auth/admin-api/src/lib/auth-admin-api-client.config.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.service.ts
Additional context used
Path-based instructions (7)
apps/services/auth/admin-api/src/app/v2/delegations/delegation-admin.module.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/clients/auth/admin-api/src/index.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/clients/auth/admin-api/src/lib/auth-admin-api-client.config.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/clients/auth/admin-api/src/lib/apis.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/admin-api/src/app/app.module.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/admin-api/src/app/v2/delegations/delegation-admin.controller.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/admin-api/infra/auth-admin-api.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 (13)
apps/services/auth/admin-api/src/app/v2/delegations/delegation-admin.module.ts (1)

7-11: Module setup looks good, but consider explaining the absence of providers.

The module is correctly set up with necessary imports and the controller. However, it's unusual for a NestJS module not to register any providers. If the logic is entirely within the controller or external services are injected directly into the controller, this setup is fine. Otherwise, consider adding relevant providers to encapsulate business logic or data access.

libs/clients/auth/admin-api/src/index.ts (1)

16-17: New exports are correctly added.

The addition of DelegationAdminApi and DelegationAdminCustomDto is well-integrated into the existing export structure. This change supports the new delegation management features and adheres to TypeScript best practices.

libs/clients/auth/admin-api/src/lib/auth-admin-api-client.config.ts (1)

Line range hint 6-27: Configuration enhancements are robust and well-implemented.

The addition of the basePath property to the Zod schema and its required setting in the configuration loader enhances the robustness of the API client configuration. This change ensures that the API path is correctly set for different environments, adhering to best practices for secure and reliable configuration management.

libs/clients/auth/admin-api/src/lib/apis.ts (3)

5-5: Approved import addition.

The addition of DelegationAdminApi is necessary for the new delegation admin functionality.


27-27: Approved explicit typing for exportedApis.

The explicit typing as Provider[] enhances type safety and clarity in the code.


49-61: Approved API factory addition with a suggestion.

The addition of DelegationAdminApi to exportedApis is consistent with existing patterns. However, ensure that the basePath used in the configuration is correct and consistent with other API configurations.

Verification successful

Consistent basePath Configuration for DelegationAdminApi.

The basePath configuration for DelegationAdminApi is consistent with other APIs in the codebase, using config.basePath as expected. No issues were found regarding its configuration.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the basePath configuration for DelegationAdminApi.

# Test: Search for the basePath configuration. Expect: Consistent basePath across APIs.
rg --type typescript -A 5 $'basePath'

Length of output: 71


Script:

#!/bin/bash
# Description: Verify the basePath configuration for DelegationAdminApi.

# Test: Search for the basePath configuration. Expect: Consistent basePath across APIs.
rg --type ts -A 5 $'basePath'

Length of output: 147015

apps/services/auth/admin-api/src/app/app.module.ts (3)

28-28: Approved module addition.

The addition of DelegationAdminModule is crucial for enhancing delegation management functionalities within the application.


56-67: Approved configuration updates with a suggestion.

The updates to the ConfigModule.forRoot method to load new configurations are necessary for the expanded service integration. Ensure that all configurations are correctly loaded and functional.


6-6: Approved configuration imports with a suggestion.

The addition of DelegationApiUserSystemNotificationConfig and related configurations is essential for supporting the new DelegationAdminModule. Ensure that these configurations are correctly integrated and do not conflict with existing settings.

Verification successful

Integration of DelegationApiUserSystemNotificationConfig Verified

The DelegationApiUserSystemNotificationConfig is integrated across multiple modules, including delegation-api and admin-api services, as well as within the auth-api-lib library. It is used in provider definitions and module imports, indicating correct integration into the system. There are no apparent conflicts or issues with its usage.

  • Files Involved:
    • apps/services/auth/delegation-api/src/app/app.module.ts
    • apps/services/auth/admin-api/src/app/app.module.ts
    • libs/auth-api-lib/src/lib/user-notification/apiConfiguration.ts
    • libs/auth-api-lib/src/lib/user-notification/user-system-notification.module.ts
    • libs/auth-api-lib/src/lib/user-notification/user-system-notification.config.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of new configurations.

# Test: Search for configuration usage. Expect: Correct integration without conflicts.
rg --type typescript -A 5 $'DelegationApiUserSystemNotificationConfig'

Length of output: 104


Script:

#!/bin/bash
# Description: Verify the integration of new configurations.

# Test: Search for configuration usage. Expect: Correct integration without conflicts.
rg --type ts -A 5 $'DelegationApiUserSystemNotificationConfig'

Length of output: 4808

apps/services/auth/admin-api/infra/auth-admin-api.ts (4)

3-13: Refactor: Centralize Redis configuration.

The introduction of REDIS_NODE_CONFIG centralizes Redis node configurations for different environments, which enhances maintainability and clarity. This is a good practice as it avoids duplication and centralizes configuration management.


15-17: Enhance modularity with service parameter.

The modification of the serviceSetup function to accept a services parameter with a userNotification service builder enhances modularity and flexibility. This change allows the function to dynamically reference and integrate the user notification service, which is a good practice in service-oriented architecture.


66-69: Confirm secret management practices.

The configuration of secrets for IDENTITY_SERVER_CLIENT_SECRET and NATIONAL_REGISTRY_IDS_CLIENT_SECRET is crucial for security. Ensure that these secrets are managed securely, not exposed in logs, and accessible only to necessary parts of the application.


42-60: Verify new service configurations.

The addition of several new configuration entries related to the X-Road national registry and RSK procuring services, as well as the USER_NOTIFICATION_API_URL and COMPANY_REGISTRY_XROAD_PROVIDER_ID, significantly expands the service's capabilities. It is crucial to ensure that these configurations are correctly set up and do not introduce any security or operational 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

Outside diff range, codebase verification and nitpick comments (1)
apps/services/auth/admin-api/infra/auth-admin-api.ts (1)

20-22: Enhancement: Modular service setup via dependency injection.

The modification of the serviceSetup function to accept a services parameter aligns well with NestJS's dependency injection patterns. This change promotes modularity and flexibility in service configuration, allowing for dynamic integration of services like userNotification.

Consider documenting the expected structure and types of the services parameter to ensure clear usage and integration by other developers.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7e1526d and 33597a7.

Files selected for processing (1)
  • apps/services/auth/admin-api/infra/auth-admin-api.ts (2 hunks)
Additional context used
Path-based instructions (1)
apps/services/auth/admin-api/infra/auth-admin-api.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/admin-api/infra/auth-admin-api.ts (3)

8-18: Refactor: Centralize Redis configuration for maintainability.

The introduction of REDIS_NODE_CONFIG is a positive change, centralizing Redis node configurations for different environments. This approach enhances maintainability and clarity by avoiding scattered configurations throughout the codebase.


71-74: Security Check: Validate the handling of secrets.

The paths for secrets like IDENTITY_SERVER_CLIENT_SECRET and NATIONAL_REGISTRY_IDS_CLIENT_SECRET are specified, which is crucial for security. Ensure these secrets are managed securely, not exposed in logs, and accessible only to necessary parts of the application.


47-66: Verify: Ensure new service configurations are correctly integrated.

The addition of various service configurations, such as tokens and paths for X-Road services and the user notification API URL, needs careful integration testing. These configurations are crucial for the application's interaction with external services and must be verified to ensure they are correctly implemented and do not introduce any 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 33597a7 and 8a11aca.

Files selected for processing (1)
  • apps/services/auth/admin-api/infra/auth-admin-api.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/services/auth/admin-api/infra/auth-admin-api.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: 3

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8a11aca and f2ca10c.

Files selected for processing (3)
  • charts/identity-server/values.dev.yaml (3 hunks)
  • charts/identity-server/values.prod.yaml (3 hunks)
  • charts/identity-server/values.staging.yaml (3 hunks)
Additional comments not posted (23)
charts/identity-server/values.prod.yaml (9)

213-213: Verify Redis configuration for security and correctness.

Ensure that the specified Redis nodes are correctly configured and secured to prevent unauthorized access.


214-214: Confirm the correctness of the XRoad provider ID.

Ensure that the COMPANY_REGISTRY_XROAD_PROVIDER_ID is correctly formatted and matches the expected value for the integration.


224-224: Verify the purpose and appropriateness of the XRoad actor token.

Confirm that the XROAD_NATIONAL_REGISTRY_ACTOR_TOKEN is set correctly for its intended use and does not expose the system to security risks.


225-225: Verify Redis configuration for the national registry.

Ensure that the XROAD_NATIONAL_REGISTRY_REDIS_NODES are correctly configured and secured to prevent unauthorized access.


226-226: Confirm the correctness of the XRoad national registry service path.

Ensure that the XROAD_NATIONAL_REGISTRY_SERVICE_PATH is correctly formatted and points to a valid and secure service endpoint.


227-227: Verify the purpose and appropriateness of the XRoad RSK procuring actor token.

Confirm that the XROAD_RSK_PROCURING_ACTOR_TOKEN is set correctly for its intended use and does not expose the system to security risks.


228-228: Verify Redis configuration for RSK procuring.

Ensure that the XROAD_RSK_PROCURING_REDIS_NODES are correctly configured and secured to prevent unauthorized access.


282-282: Verify the security and management of the identity server client secret.

Ensure that the IDENTITY_SERVER_CLIENT_SECRET is stored securely and managed appropriately to prevent unauthorized access.


283-283: Verify the security and management of the national registry client secret.

Ensure that the NATIONAL_REGISTRY_IDS_CLIENT_SECRET is stored securely and managed appropriately to prevent unauthorized access.

charts/identity-server/values.staging.yaml (6)

217-217: Verify the appropriateness of the X-Road provider ID for the staging environment.

The COMPANY_REGISTRY_XROAD_PROVIDER_ID includes IS-TEST, which suggests it's intended for testing. Confirm that this is appropriate for the staging environment and ensure it does not propagate to production unintentionally.


227-227: Clarify the use of XROAD_NATIONAL_REGISTRY_ACTOR_TOKEN.

The value true for a token is unusual as tokens are typically specific strings. Please clarify if this is a placeholder and consider using actual token values or secure references.


229-229: Verify the appropriateness of the XROAD service path for the staging environment.

The XROAD_NATIONAL_REGISTRY_SERVICE_PATH includes IS-TEST, indicating it's intended for testing. Confirm that this is suitable for the staging environment and ensure it does not propagate to production settings unintentionally.


230-230: Clarify the use of XROAD_RSK_PROCURING_ACTOR_TOKEN.

Setting the actor token for RSK procuring to true is unusual. Tokens are typically specific strings. Please clarify if this is a placeholder and consider using actual token values or secure references.


285-285: Verify the security of the identity server client secret storage.

The path for the IDENTITY_SERVER_CLIENT_SECRET is specified, which is good practice. However, ensure that the secret storage mechanism is secure and complies with best practices for secret management.


286-286: Verify the security of the national registry IDS client secret storage.

The path for the NATIONAL_REGISTRY_IDS_CLIENT_SECRET is specified, which is good practice. However, ensure that the secret storage mechanism is secure and complies with best practices for secret management.

charts/identity-server/values.dev.yaml (8)

216-216: Approved: Redis nodes configuration for company registry.

The configuration for COMPANY_REGISTRY_REDIS_NODES is correctly formatted and uses a standard addressing scheme for Redis clusters in AWS. This should support high availability and performance for the company registry.


217-217: Approved: X-Road provider ID for company registry.

The COMPANY_REGISTRY_XROAD_PROVIDER_ID is correctly formatted according to X-Road conventions. This configuration is essential for integrating with the X-Road data exchange layer.


227-227: Approved: Actor token configuration for national registry.

The XROAD_NATIONAL_REGISTRY_ACTOR_TOKEN is set to true, indicating that an actor token is used for interactions with the national registry. This is a crucial setting for secure communication.


228-228: Approved: Redis nodes configuration for national registry.

The XROAD_NATIONAL_REGISTRY_REDIS_NODES configuration is correctly formatted and consistent with Redis cluster setups, ensuring high availability for the national registry.


229-229: Approved: Service path configuration for national registry.

The XROAD_NATIONAL_REGISTRY_SERVICE_PATH is correctly formatted, facilitating the correct routing of requests within the X-Road framework.


230-230: Approved: Actor token configuration for RSK procuring service.

The XROAD_RSK_PROCURING_ACTOR_TOKEN is set to true, enabling secure token-based interactions with the RSK procuring service.


231-231: Approved: Redis nodes configuration for RSK procuring service.

The XROAD_RSK_PROCURING_REDIS_NODES configuration is correctly formatted, ensuring high availability for the RSK procuring service.


285-286: Approved: Secrets configuration for identity server and national registry client.

The paths for IDENTITY_SERVER_CLIENT_SECRET and NATIONAL_REGISTRY_IDS_CLIENT_SECRET are correctly set to secure locations, ensuring that sensitive information is handled appropriately.

charts/identity-server/values.staging.yaml Show resolved Hide resolved
charts/identity-server/values.staging.yaml Show resolved Hide resolved
charts/identity-server/values.staging.yaml Show resolved Hide resolved
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 f2ca10c and c6fb163.

Files selected for processing (3)
  • apps/services/auth/admin-api/src/app/v2/delegations/delegation-admin.controller.ts (1 hunks)
  • libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.resolver.ts (1 hunks)
  • libs/auth/scopes/src/lib/auth.scope.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • libs/api/domains/auth-admin/src/lib/delegationAdmin/delegation-admin.resolver.ts
Files skipped from review as they are similar to previous changes (1)
  • apps/services/auth/admin-api/src/app/v2/delegations/delegation-admin.controller.ts
Additional context used
Path-based instructions (1)
libs/auth/scopes/src/lib/auth.scope.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 (1)
libs/auth/scopes/src/lib/auth.scope.ts (1)

19-22: Approved: Addition of DelegationAdminScopes.

The new DelegationAdminScopes constant is well-defined and follows best practices for scope management in authentication systems. The correction of the previously noted typo is also verified.

Run the following script to verify the integration of DelegationAdminScopes with existing constants and system architecture:

Verification successful

Verified: Integration of DelegationAdminScopes is successful.

The DelegationAdminScopes constant is correctly integrated and used within the delegation-admin.controller.ts file to manage access permissions via the @Scopes decorator. There are no conflicts or redundancies observed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of `DelegationAdminScopes` with existing constants and system architecture.

# Test: Search for usage of `DelegationAdminScopes` and related constants. Expect: Proper integration without redundancy or conflicts.
rg --type typescript -A 5 $'DelegationAdminScopes'

Length of output: 84


Script:

#!/bin/bash
# Description: Verify the integration of `DelegationAdminScopes` with existing constants and system architecture.

# Test: Search for usage of `DelegationAdminScopes` in TypeScript files. Expect: Proper integration without redundancy or conflicts.
rg 'DelegationAdminScopes' --glob '*.ts' -A 5

Length of output: 2370

Copy link
Member

@baering baering left a comment

Choose a reason for hiding this comment

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

Great work, LGTM.

I left some minor comments for you to look at.

@GunnlaugurG GunnlaugurG added the automerge Merge this PR as soon as all checks pass label Sep 10, 2024
jonnigs pushed a commit that referenced this pull request Sep 12, 2024
* created new admin module for paper delegations and get route

* field resolver DelegationAdminModel

* lookup for delegations with detailed view

* Cleanup and rest and graphql for DeleteDelegation

* small cleanup

* chore: nx format:write update dirty files

* move delegationAdmin service to admin-api from delegation-api

* chore: nx format:write update dirty files

* fix config value

* chore: charts update dirty files

* fix api build issues

* fix pr comments

* remove resolved comment

---------

Co-authored-by: andes-it <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
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.

4 participants