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(health-directorate): New application for Embætti Landlæknis (Work permit/license to pratice) #15146

Merged
merged 40 commits into from
Jun 18, 2024

Conversation

Ballioli
Copy link
Member

@Ballioli Ballioli commented Jun 7, 2024

...

Attach a link to issue if relevant

What

Specify what you're trying to achieve

Why

Specify why you need to achieve this

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 a comprehensive healthcare work permit application template.
    • Added forms for personal information, selecting work permits, and confirmation.
  • Bug Fixes

    • Added error handling for various potential issues, like data retrieval failures and invalid citizenship checks.
  • Documentation

    • Provided detailed README for the healthcare work permit template library.
  • Tests

    • Configured Jest for unit testing the healthcare work permit application templates.
  • Chores

    • Updated tsconfig.base.json to include the new healthcare work permit template library.
    • Added Babel and ESLint configurations specific to the healthcare work permit template.

@Ballioli Ballioli requested review from a team as code owners June 7, 2024 11:25
Copy link
Contributor

coderabbitai bot commented Jun 7, 2024

Walkthrough

This update introduces a comprehensive module for managing healthcare work permits within a NestJS application. A new HealthcareWorkPermitModule has been created, covering registration, permit processing, and submitting applications. Supporting functionalities include managing user data, loading templates, and validating citizenship within the European Economic Area (EES). The configurations and messages are set up for ease of integration and usage within the application.

Changes

File(s) Summary
libs/application/template-api-modules/.../healthcare-work-permit.module.ts Added HealthcareWorkPermitModule with a registration method, providers, exports, and various client modules.
libs/application/template-api-modules/.../healthcare-work-permit.service.ts Introduced HealthcareWorkPermitService with methods for healthcare licenses, permits processing, and submissions.
libs/application/template-api-modules/.../shared/api/national-registry/EES.ts Added EES array with detailed info about various European countries.
libs/application/template-api-modules/.../shared/api/national-registry/national-registry.service.ts Added method validateCitizenshipWithinEES to check citizenship against EES countries.
libs/application/template-api-modules/.../templates/index.ts Exported HealthcareWorkPermitModule and HealthcareWorkPermitService.
libs/application/template-loader/src/lib/templateLoaders.ts Added HEALTHCARE_WORK_PERMIT loader function for the new template.
libs/application/templates/healthcare-work-permit/* (multiple files) Introduction of a new healthcare work permit template, including Babel, ESLint, Jest, README, forms, and components.
libs/application/core/src/lib/messages.ts Added a new message nationalRegistryCitizenshipNotWithinEES.
tsconfig.base.json Included an entry for the new healthcare work permit template.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Application
    participant HealthcareWorkPermitService
    participant NationalRegistryService
    participant EES
    participant HealthDirectorateClient
    participant UniversityCareersClient

    User->>Application: Submit healthcare work permit application
    Application->>HealthcareWorkPermitService: Start permit process
    HealthcareWorkPermitService->>NationalRegistryService: Validate citizenship
    NationalRegistryService->>EES: Check EES countries
    EES-->>NationalRegistryService: Return validation result
    NationalRegistryService-->>HealthcareWorkPermitService: Citizenship valid/invalid
    HealthcareWorkPermitService->>UniversityCareersClient: Obtain career information
    UniversityCareersClient-->>HealthcareWorkPermitService: Return career information
    HealthcareWorkPermitService->>HealthDirectorateClient: Submit healthcare permit application
    HealthDirectorateClient-->>HealthcareWorkPermitService: Confirm permit submission
    HealthcareWorkPermitService-->>Application: Return final result
    Application-->>User: Notifies user of application status
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

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

Documentation and Community

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

@datadog-island-is
Copy link

datadog-island-is bot commented Jun 7, 2024

Datadog Report

All test runs 66c5334 🔗

101 Total Test Services: 1 Failed, 98 Passed
🔻 Test Sessions change in coverage: 3 decreased, 27 increased, 170 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
services-auth-delegation-api 1 0 0 253 0 3m 31.4s 1 increased (+0.02%) Link
air-discount-scheme-backend 0 0 0 81 0 33.31s N/A Link
air-discount-scheme-web 0 0 0 2 0 8.53s N/A Link
api 0 0 0 4 0 4.53s N/A Link
api-catalogue-services 0 0 0 23 0 16.86s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 36.01s N/A Link
api-domains-assets 0 0 0 3 0 25.36s N/A Link
api-domains-auth-admin 0 0 0 18 0 11.77s N/A Link
api-domains-communications 0 0 0 5 0 38.86s N/A Link
api-domains-criminal-record 0 0 0 5 0 15.29s N/A Link

❌ Failed Tests (1)

  • DelegationsIndexService indexDelegations Index delegations of type: personalRepresentative should index delegations - apps/services/auth/delegation-api/src/app/delegations/test/delegation-index/delegation-index.service.spec.ts - Details

    Expand for error
     expect(received).toBe(expected) // Object.is equality
     
     Expected: 1
     Received: 0
    

🔻 Code Coverage Decreases vs Default Branch (3)

  • application-template-api-modules - jest 26.01% (-0.1%) - Details
  • application-system-api - jest 37.52% (-0.1%) - Details
  • application-types - jest 6.11% (-0.02%) - 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: 17

Outside diff range and nitpick comments (3)
libs/application/templates/healthcare-work-permit/src/lib/messages/information.ts (1)

3-89: Refine message descriptions for better clarity.

Some message descriptions (lines 7, 21, 37, 55, 61, 71, 77) could be more descriptive to provide better context for translators and developers. For example, instead of 'Select work permit section title', a more descriptive text could be 'Title for the section where users select their desired work permit'.

libs/application/templates/healthcare-work-permit/src/lib/messages/error.ts (1)

3-94: Improve error message descriptions for better clarity.

The descriptions for error messages (lines 7, 13, 25, 39, 47, 53, 63, 70) could be more detailed to provide better context for translators and developers. For example, instead of 'Unhandled error in data provider', a more detailed description could be 'Error message displayed when an unexpected error occurs while fetching data from a provider'.

libs/application/templates/healthcare-work-permit/src/lib/HealthcareWorkPermitTemplate.ts (1)

118-118: Consider adding a comment to explain why the pruning time is set to 60 minutes. This will help maintainers understand the rationale behind this specific duration.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fbf8efc and 026e033.

Files selected for processing (53)
  • libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.service.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/index.ts (3 hunks)
  • libs/application/template-loader/src/lib/templateLoaders.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/.babelrc (1 hunks)
  • libs/application/templates/healthcare-work-permit/.eslintrc.json (1 hunks)
  • libs/application/templates/healthcare-work-permit/README.md (1 hunks)
  • libs/application/templates/healthcare-work-permit/jest.config.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/project.json (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/assets/Logo.tsx (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/dataProviders/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/fields/CustomFormConclusionSectionField/index.tsx (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/fields/CustomFormConclusionSectionField/styles.css.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/fields/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/forms/Confirmation/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/personalSection.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/selectWorkPermitSection.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/forms/Prerequisites/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/HealthcareWorkPermitTemplate.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/constants.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/dataSchema.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/application.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/confirmation.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/error.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/externalData.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/information.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/payment.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/messages/personal.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/lib/types.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/shared/constants.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/shared/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/utils/EES.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/utils/formatDate.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/utils/getChargeItemCodes.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/src/utils/index.ts (1 hunks)
  • libs/application/templates/healthcare-work-permit/tsconfig.json (1 hunks)
  • libs/application/templates/healthcare-work-permit/tsconfig.lib.json (1 hunks)
  • libs/application/templates/healthcare-work-permit/tsconfig.spec.json (1 hunks)
  • libs/application/types/src/lib/ApplicationTypes.ts (2 hunks)
  • libs/application/types/src/lib/InstitutionMapper.ts (1 hunks)
  • libs/clients/health-directorate/src/clientConfig.json (6 hunks)
  • libs/clients/health-directorate/src/lib/apiConfiguration.ts (2 hunks)
  • libs/clients/health-directorate/src/lib/healthDirectorateClient.service.ts (4 hunks)
  • libs/clients/health-directorate/src/lib/healthDirectorateClient.types.ts (2 hunks)
  • libs/clients/university-careers/src/lib/dto/index.ts (1 hunks)
  • libs/clients/university-careers/src/lib/dto/studentTrackDto.ts (1 hunks)
  • libs/feature-flags/src/lib/features.ts (1 hunks)
  • libs/shared/constants/src/lib/chargeItemCode.ts (1 hunks)
  • tsconfig.base.json (1 hunks)
Files not summarized due to errors (1)
  • libs/application/templates/healthcare-work-permit/src/assets/Logo.tsx: Error: Message exceeds token limit
Files skipped from review due to trivial changes (22)
  • libs/application/templates/healthcare-work-permit/.babelrc
  • libs/application/templates/healthcare-work-permit/.eslintrc.json
  • libs/application/templates/healthcare-work-permit/README.md
  • libs/application/templates/healthcare-work-permit/jest.config.ts
  • libs/application/templates/healthcare-work-permit/project.json
  • libs/application/templates/healthcare-work-permit/src/fields/CustomFormConclusionSectionField/styles.css.ts
  • libs/application/templates/healthcare-work-permit/src/fields/index.ts
  • libs/application/templates/healthcare-work-permit/src/lib/index.ts
  • libs/application/templates/healthcare-work-permit/src/lib/messages/confirmation.ts
  • libs/application/templates/healthcare-work-permit/src/lib/messages/externalData.ts
  • libs/application/templates/healthcare-work-permit/src/lib/messages/index.ts
  • libs/application/templates/healthcare-work-permit/src/lib/messages/payment.ts
  • libs/application/templates/healthcare-work-permit/src/shared/constants.ts
  • libs/application/templates/healthcare-work-permit/src/shared/index.ts
  • libs/application/templates/healthcare-work-permit/src/utils/EES.ts
  • libs/application/templates/healthcare-work-permit/src/utils/formatDate.ts
  • libs/application/templates/healthcare-work-permit/src/utils/index.ts
  • libs/application/templates/healthcare-work-permit/tsconfig.json
  • libs/application/templates/healthcare-work-permit/tsconfig.lib.json
  • libs/application/templates/healthcare-work-permit/tsconfig.spec.json
  • libs/clients/university-careers/src/lib/dto/index.ts
  • tsconfig.base.json
Additional context used
Path-based instructions (31)
libs/application/templates/healthcare-work-permit/src/lib/constants.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/application/templates/healthcare-work-permit/src/lib/types.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/application/templates/healthcare-work-permit/src/lib/dataSchema.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/application/templates/healthcare-work-permit/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/university-careers/src/lib/dto/studentTrackDto.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/application/templates/healthcare-work-permit/src/utils/getChargeItemCodes.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/application/templates/healthcare-work-permit/src/dataProviders/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/health-directorate/src/lib/healthDirectorateClient.types.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/application/templates/healthcare-work-permit/src/lib/messages/application.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/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/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/application/templates/healthcare-work-permit/src/forms/Confirmation/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/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/selectWorkPermitSection.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/shared/constants/src/lib/chargeItemCode.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/clients/health-directorate/src/lib/apiConfiguration.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/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.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."
libs/application/templates/healthcare-work-permit/src/lib/messages/personal.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/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/personalSection.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/application/templates/healthcare-work-permit/src/forms/Prerequisites/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/application/templates/healthcare-work-permit/src/lib/messages/information.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/application/templates/healthcare-work-permit/src/lib/messages/error.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/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."
libs/application/templates/healthcare-work-permit/src/fields/CustomFormConclusionSectionField/index.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/application/templates/healthcare-work-permit/src/lib/HealthcareWorkPermitTemplate.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/health-directorate/src/lib/healthDirectorateClient.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/application/template-loader/src/lib/templateLoaders.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/application/types/src/lib/InstitutionMapper.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/application/types/src/lib/ApplicationTypes.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/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.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/application/template-api-modules/src/lib/modules/templates/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/health-directorate/src/clientConfig.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."
libs/application/templates/healthcare-work-permit/src/assets/Logo.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."
Biome
libs/application/templates/healthcare-work-permit/src/assets/Logo.tsx

[error] 4-11: Alternative text title element cannot be empty (lint/a11y/noSvgWithoutTitle)

For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.

Additional comments not posted (34)
libs/application/templates/healthcare-work-permit/src/lib/constants.ts (3)

3-3: The Events type declaration is correctly using the DefaultEvents enum. Good use of TypeScript for type safety.


5-10: The States enum is well-defined, clearly representing the different stages of the application process.


12-14: The Roles enum is simple and appropriate for the application's context, focusing on the user as the APPLICANT.

libs/application/templates/healthcare-work-permit/src/lib/types.ts (2)

3-7: The Message interface is well-defined, suitable for handling localized messages in the application.


9-17: The PermitProgram interface is flexible, with optional fields and integrated error handling using the Message type. This design supports varying data availability and error scenarios.

libs/application/templates/healthcare-work-permit/src/lib/dataSchema.ts (2)

3-10: Both UserInformationSchema and SelectWorkPermitSchema use Zod to enforce minimum string lengths, ensuring basic data validation.


12-16: The HealthcareWorkPermitSchema is comprehensive, integrating sub-schemas and additional validation for the approveExternalData field. This ensures robust data integrity.

libs/application/templates/healthcare-work-permit/src/index.ts (1)

1-18: The organization of imports and exports in this file is efficient, enhancing modularity and maintainability. Dynamic imports for fields and dataProviders are particularly well-implemented for optimizing load times.

libs/clients/university-careers/src/lib/dto/studentTrackDto.ts (2)

24-24: The addition of programId to StudentTrackDto is appropriate for identifying specific programs. Good use of optional typing for flexibility.


24-24: The mapToStudentTrackDto function is well-implemented, with appropriate checks and clean data handling.

libs/application/templates/healthcare-work-permit/src/utils/getChargeItemCodes.ts (2)

6-10: The getChargeItemCodes function effectively abstracts away details, providing a clean API for retrieving charge item codes.


12-33: The getChargeItemCodesAndExtraLabel function is well-structured and uses TypeScript features effectively to ensure type safety and handle potential undefined values.

libs/application/templates/healthcare-work-permit/src/dataProviders/index.ts (1)

8-37: The API configurations in index.ts are correctly set up using defineTemplateApi, ensuring consistency and maintainability. Good use of external data identifiers for clarity.

libs/clients/health-directorate/src/lib/healthDirectorateClient.types.ts (1)

49-57: The HealthcareWorkPermitRequest interface is appropriately structured for capturing necessary details for a healthcare work permit application. The use of an array for education allows handling multiple qualifications, which is a practical approach.

libs/application/templates/healthcare-work-permit/src/lib/messages/application.ts (1)

3-37: All message definitions are correctly internationalized and well-documented.

libs/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/index.ts (1)

10-35: The form structure is modular and integrates well with the defined sections and fields.

Verification successful

The HealthcareWorkPermitForm is properly integrated and used within the application, specifically in the HealthcareWorkPermitTemplate.ts file.

  • libs/application/templates/healthcare-work-permit/src/lib/HealthcareWorkPermitTemplate.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the integration of HealthcareWorkPermitForm in the application.

# Test: Search for the form usage in the application. Expect: Proper integration and usage.
rg --type typescript $'HealthcareWorkPermitForm'

Length of output: 82



Script:

#!/bin/bash
# Description: Verify the integration of HealthcareWorkPermitForm in the application.

# Test: Search for the form usage in the application. Expect: Proper integration and usage.
rg --type ts $'HealthcareWorkPermitForm'

Length of output: 644

libs/application/templates/healthcare-work-permit/src/forms/Confirmation/index.ts (1)

15-53: The confirmation form is well-structured and covers all necessary aspects of the application's final stage.

Verification successful

The search results indicate that the ConfirmationForm is used in multiple locations across different templates. However, the specific integration of the ConfirmationForm from libs/application/templates/healthcare-work-permit/src/forms/Confirmation/index.ts is not explicitly verified in the context of its usage within the healthcare work permit application.

To ensure proper integration, it is necessary to verify that the ConfirmationForm is correctly imported and utilized within the healthcare work permit application.


The search results show that the ConfirmationForm is defined in the libs/application/templates/healthcare-work-permit/src/forms/Confirmation/index.ts file, but there is no evidence of its import or usage elsewhere in the healthcare work permit application.

To ensure proper integration, we need to verify that this form is imported and used in the relevant parts of the healthcare work permit application.


The previous script failed due to a regex parse error. To correct this, we need to escape the single quotes properly and ensure the search pattern is correctly formatted.


The previous attempts to verify the import and usage of ConfirmationForm failed due to regex parse errors. To address this, we should simplify the search pattern and ensure it correctly identifies the import statements.


The previous attempts to verify the import and usage of ConfirmationForm failed due to regex parse errors. To address this, we should simplify the search pattern and ensure it correctly identifies the import statements.


The search results indicate that the ConfirmationForm is imported dynamically in the HealthcareWorkPermitTemplate.ts file. This confirms that the ConfirmationForm is indeed integrated into the healthcare work permit application.

  • libs/application/templates/healthcare-work-permit/src/lib/HealthcareWorkPermitTemplate.ts: import('../forms/Confirmation').then((val) =>

This dynamic import suggests that the ConfirmationForm is used within the healthcare work permit application, ensuring its proper integration.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the integration of ConfirmationForm in the application.

# Test: Search for the form usage in the application. Expect: Proper integration and usage.
rg --type typescript $'ConfirmationForm'

Length of output: 74



Script:

#!/bin/bash
# Description: Verify the integration of ConfirmationForm in the application.

# Test: Search for the form usage in the application. Expect: Proper integration and usage.
rg --type ts 'ConfirmationForm'

Length of output: 1479



Script:

#!/bin/bash
# Description: Verify the import and usage of ConfirmationForm in the healthcare work permit application.

# Test: Search for the import and usage of ConfirmationForm in the healthcare work permit application.
rg --type ts 'ConfirmationForm' | grep 'healthcare-work-permit'

Length of output: 169



Script:

#!/bin/bash
# Description: Verify the import and usage of ConfirmationForm in the healthcare work permit application.

# Test: Search for the import and usage of ConfirmationForm in the healthcare work permit application.
rg --type ts "import { Confirmation } from './forms/Confirmation'"

Length of output: 217



Script:

#!/bin/bash
# Description: Verify the import and usage of ConfirmationForm in the healthcare work permit application.

# Test: Search for the import and usage of ConfirmationForm in the healthcare work permit application.
rg --type ts "import { Confirmation } from './forms/Confirmation'"

Length of output: 217



Script:

#!/bin/bash
# Description: Verify the import and usage of ConfirmationForm in the healthcare work permit application.

# Test: Search for the import and usage of ConfirmationForm in the healthcare work permit application.
rg --type ts "import { Confirmation } from"

Length of output: 165



Script:

#!/bin/bash
# Description: Verify the import and usage of ConfirmationForm in the healthcare work permit application.

# Test: Search for the import and usage of ConfirmationForm in the healthcare work permit application.
rg --type ts "Confirmation" | grep "import"

Length of output: 11736

libs/shared/constants/src/lib/chargeItemCode.ts (1)

29-29: LGTM! The addition of HEALTHCARE_WORK_PERMIT aligns with the PR's objectives.

libs/clients/health-directorate/src/lib/apiConfiguration.ts (1)

12-12: LGTM! The addition of UmsoknStarfsleyfiApi to the exported APIs supports the new healthcare work permit functionalities.

Also applies to: 46-46

libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.module.ts (1)

24-50: LGTM! The HealthcareWorkPermitModule is well-structured and correctly imports necessary configurations and client modules.

libs/application/templates/healthcare-work-permit/src/lib/messages/personal.ts (1)

3-55: LGTM! The message definitions in personal.ts are clear and consistent, supporting the user interface of the healthcare work permit application effectively.

libs/application/types/src/lib/InstitutionMapper.ts (1)

230-233: LGTM! Please verify the correctness of the nationalId and slug values for HEALTHCARE_WORK_PERMIT.

Verification successful

The definitions for InstitutionNationalIds.EMBAETTI_LANDLAEKNIS and InstitutionTypes.EMBAETTI_LANDLAEKNIS were found in the following files:

  • libs/application/types/src/lib/InstitutionNationalIds.ts
  • libs/application/types/src/lib/InstitutionTypes.ts

The values are:

  • InstitutionNationalIds.EMBAETTI_LANDLAEKNIS = '7101695009'
  • InstitutionTypes.EMBAETTI_LANDLAEKNIS = 'embaetti-landlaeknis'

These values appear to be consistent with the intended mappings for the healthcare work permit.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the national ID and slug values for the healthcare work permit.

# Test: Check if the values match expected records. Expect: Values are correct.
echo "Please manually verify the national ID and slug values with the institution records."

Length of output: 178



Script:

#!/bin/bash
# Locate and display the definition of InstitutionNationalIds.EMBAETTI_LANDLAEKNIS
echo "Definition of InstitutionNationalIds.EMBAETTI_LANDLAEKNIS:"
rg 'EMBAETTI_LANDLAEKNIS' --type js --type ts --type tsx

# Locate and display the definition of InstitutionTypes.EMBAETTI_LANDLAEKNIS
echo "Definition of InstitutionTypes.EMBAETTI_LANDLAEKNIS:"
rg 'EMBAETTI_LANDLAEKNIS' --type js --type ts --type tsx

Length of output: 411



Script:

#!/bin/bash
# Locate and display the definition of InstitutionNationalIds.EMBAETTI_LANDLAEKNIS
echo "Definition of InstitutionNationalIds.EMBAETTI_LANDLAEKNIS:"
rg 'EMBAETTI_LANDLAEKNIS' --type js --type ts

# Locate and display the definition of InstitutionTypes.EMBAETTI_LANDLAEKNIS
echo "Definition of InstitutionTypes.EMBAETTI_LANDLAEKNIS:"
rg 'EMBAETTI_LANDLAEKNIS' --type js --type ts

Length of output: 2841

libs/application/types/src/lib/ApplicationTypes.ts (1)

59-59: LGTM! Please ensure the translation key hwp.application is correctly set up in the localization files.

Also applies to: 306-309

libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.service.ts (2)

66-75: Class declaration and constructor setup look good.


121-140: Method getMyHealthcareLicenses is well-implemented with proper async handling and error management.

libs/application/template-api-modules/src/lib/modules/templates/index.ts (4)

76-76: The import of HealthcareWorkPermitModule is correctly placed and follows the existing pattern of module imports.


77-77: The import of HealthcareWorkPermitService is correctly placed and follows the existing pattern of service imports.


187-187: The addition of HealthcareWorkPermitModule to the exported modules array is correct and ensures the module can be utilized appropriately within the application.


256-256: The addition of HealthcareWorkPermitService to the exported services array is correct and ensures the service can be utilized appropriately within the application.

libs/clients/health-directorate/src/clientConfig.json (4)

884-933: Review the newly added NamsUpplysingar schema for completeness and accuracy.

The schema for NamsUpplysingar appears comprehensive and well-defined, covering various aspects of educational data.


192-248: Validate the schema reference for UtbuaStarfsleyfiSkjalRequest.

Verification successful

The schema reference for UtbuaStarfsleyfiSkjalRequest is correctly defined in the clientConfig.json file. The schema includes properties such as name, dateOfBirth, citizenship, email, phoneNo, idProfession, and education, along with their respective types and descriptions.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Validate the schema reference for `UtbuaStarfsleyfiSkjalRequest`.

# Test: Search for the schema definition in the JSON file. Expect: Correct schema definition.
rg --type json '"UtbuaStarfsleyfiSkjalRequest"' libs/clients/health-directorate/src/clientConfig.json

Length of output: 143



Script:

#!/bin/bash
# Description: Extract and display the full schema definition for `UtbuaStarfsleyfiSkjalRequest`.

# Extract the schema definition from the JSON file.
rg --type json -A 20 '"UtbuaStarfsleyfiSkjalRequest"' libs/clients/health-directorate/src/clientConfig.json

Length of output: 792



Script:

#!/bin/bash
# Description: Extract and display the full schema definition for `UtbuaStarfsleyfiSkjalRequest`.

# Extract the schema definition from the JSON file with more lines to capture the complete definition.
rg --type json -A 50 '"UtbuaStarfsleyfiSkjalRequest"' libs/clients/health-directorate/src/clientConfig.json

Length of output: 1758


1020-1067: Confirm the fields in UtbuaStarfsleyfiSkjalRequest are necessary and secure.


934-995: Ensure the StarfsleyfiUmsoknStarfsleyfi schema aligns with data privacy regulations.

libs/application/templates/healthcare-work-permit/src/assets/Logo.tsx (1)

3-42: SVG structure and attributes are correctly implemented.

The SVG code is well-structured and uses appropriate elements and attributes for displaying the logo. Good job on maintaining clean and readable code.

Tools
Biome

[error] 4-11: Alternative text title element cannot be empty (lint/a11y/noSvgWithoutTitle)

For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 38.51351% with 182 lines in your changes missing coverage. Please review.

Project coverage is 37.12%. Comparing base (317bd63) to head (96b0168).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main   #15146    +/-   ##
========================================
  Coverage   37.12%   37.12%            
========================================
  Files        6448     6469    +21     
  Lines      131456   131729   +273     
  Branches    37588    37650    +62     
========================================
+ Hits        48798    48910   +112     
- Misses      82658    82819   +161     
Flag Coverage Δ
application-system-api 42.11% <38.51%> (+0.14%) ⬆️
application-templates-health-insurance 23.38% <ø> (ø)
application-types 7.36% <0.00%> (-0.02%) ⬇️
application-ui-components 1.43% <ø> (ø)
clients-rsk-company-registry 29.31% <100.00%> (+0.07%) ⬆️
clients-zendesk 55.26% <ø> (ø)
cms 0.44% <ø> (ø)
cms-translations 39.78% <100.00%> (+0.02%) ⬆️
email-service 61.42% <ø> (ø)
judicial-system-backend 55.79% <100.00%> (+<0.01%) ⬆️
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
nest-audit 68.20% <ø> (ø)
nest-config 77.54% <100.00%> (+0.13%) ⬆️
nest-feature-flags 51.39% <100.00%> (+0.12%) ⬆️
reference-backend 50.31% <ø> (ø)
services-documents 60.81% <ø> (ø)
services-endorsements-api 55.16% <100.00%> (+0.06%) ⬆️
shared-components 27.92% <ø> (ø)
shared-form-fields 31.92% <ø> (ø)
skilavottord-ws 23.78% <ø> (ø)

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

Files Coverage Δ
apps/application-system/api/src/app/app.module.ts 100.00% <100.00%> (ø)
libs/application/core/src/lib/messages.ts 100.00% <ø> (ø)
...rc/lib/modules/shared/api/national-registry/EES.ts 100.00% <100.00%> (ø)
...hcare-work-permit/healthcare-work-permit.module.ts 100.00% <100.00%> (ø)
...ate-api-modules/src/lib/modules/templates/index.ts 100.00% <100.00%> (ø)
...te/src/lib/HealthcareLicenseCertificateTemplate.ts 54.54% <ø> (ø)
.../healthcare-work-permit/src/dataProviders/index.ts 100.00% <100.00%> (ø)
...tion/templates/healthcare-work-permit/src/index.ts 100.00% <100.00%> (ø)
...plates/healthcare-work-permit/src/lib/constants.ts 100.00% <100.00%> (ø)
...thcare-work-permit/src/lib/messages/application.ts 100.00% <100.00%> (ø)
... and 26 more

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

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 026e033 and 6a8ec2a.

Files selected for processing (1)
  • libs/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/personalSection.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/healthcare-work-permit/src/forms/HealthcareWorkPermitForm/personalSection.ts

Copy link
Member

@saevarma saevarma left a comment

Choose a reason for hiding this comment

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

Core files LGTM

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 df747ae and f2afd93.

Files selected for processing (3)
  • .github/CODEOWNERS (1 hunks)
  • apps/application-system/api/src/app/app.module.ts (2 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.module.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/CODEOWNERS
Additional context used
Path-based instructions (2)
libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.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/application-system/api/src/app/app.module.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."
Biome
libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/healthcare-work-permit.module.ts

[error] 8-21: Avoid classes that contain only static members. (lint/complexity/noStaticOnlyClass)

Prefer using simple functions instead of classes with only static members.

Additional comments not posted (2)
apps/application-system/api/src/app/app.module.ts (2)

41-49: The added imports are correctly placed and necessary for the new functionality pertaining to the healthcare work permit and university careers.


95-101: The client configurations are correctly added to the global load array, ensuring that they are available throughout the application.

Copy link
Member

@jonnigs jonnigs left a comment

Choose a reason for hiding this comment

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

LGTM

@Ballioli Ballioli added the automerge Merge this PR as soon as all checks pass label Jun 14, 2024
@Ballioli Ballioli removed the automerge Merge this PR as soon as all checks pass label Jun 14, 2024
@Ballioli Ballioli dismissed obmagnusson’s stale review June 14, 2024 15:32

Another employee from Norda approved this PR

@Ballioli Ballioli added automerge Merge this PR as soon as all checks pass and removed automerge Merge this PR as soon as all checks pass labels Jun 18, 2024
@Ballioli Ballioli added the automerge Merge this PR as soon as all checks pass label Jun 18, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f2afd93 and c777bb5.

Files selected for processing (1)
  • libs/application/core/src/lib/messages.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/core/src/lib/messages.ts

@lodmfjord lodmfjord added automerge Merge this PR as soon as all checks pass and removed automerge Merge this PR as soon as all checks pass labels Jun 18, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c777bb5 and 96b0168.

Files selected for processing (1)
  • tsconfig.base.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tsconfig.base.json

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.

10 participants