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(application-system): New application - Health Insurance declaration #14748

Merged

Conversation

Halli1414
Copy link
Contributor

@Halli1414 Halli1414 commented May 8, 2024

New application - Health Insurance declaration

Attach a link to issue if relevant

What

New application - Health Insurance declaration

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 new application template for health insurance declarations, including specific configurations, data schema, and role mappings.
    • Added a feature flag for health insurance declarations to enable or disable the feature.
  • Error Handling

    • Defined error messages for required fields, date validations, and external errors in health insurance declarations.

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 414bcb2 and dcf901d.
Files selected for processing (40)
  • libs/application/template-api-modules/src/lib/modules/templates/complaints-to-althingi-ombudsman/attachments/providers/applicationAttachmentProvider.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/attachments/provider.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.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/health-insurance-declaration/.babelrc (1 hunks)
  • libs/application/templates/health-insurance-declaration/.eslintrc.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/README.md (1 hunks)
  • libs/application/templates/health-insurance-declaration/jest.config.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/project.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/assets/Logo.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/fields/applicantList.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/fields/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/Submitted.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/constants/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/conclution.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/prerequsites.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/shared/constants.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/types/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/utils/data.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/utils/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/tsconfig.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/tsconfig.lib.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/tsconfig.spec.json (1 hunks)
  • libs/application/types/src/lib/ApplicationTypes.ts (2 hunks)
  • libs/application/types/src/lib/InstitutionMapper.ts (1 hunks)
  • libs/application/types/src/lib/template-api/shared-api/shared-api-definitions/health-insurance-api.ts (1 hunks)
  • libs/clients/icelandic-health-insurance/rights-portal/src/index.ts (1 hunks)
  • libs/clients/icelandic-health-insurance/rights-portal/src/lib/providers.ts (2 hunks)
  • tsconfig.base.json (1 hunks)
Files not summarized due to errors (1)
  • libs/application/templates/health-insurance-declaration/src/assets/Logo.tsx: Error: Message exceeds token limit
Files skipped from review due to trivial changes (19)
  • libs/application/template-loader/src/lib/templateLoaders.ts
  • libs/application/templates/health-insurance-declaration/.babelrc
  • libs/application/templates/health-insurance-declaration/.eslintrc.json
  • libs/application/templates/health-insurance-declaration/README.md
  • libs/application/templates/health-insurance-declaration/jest.config.ts
  • libs/application/templates/health-insurance-declaration/project.json
  • libs/application/templates/health-insurance-declaration/src/fields/index.ts
  • libs/application/templates/health-insurance-declaration/src/index.ts
  • libs/application/templates/health-insurance-declaration/src/lib/constants/index.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/conclution.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/prerequsites.ts
  • libs/application/templates/health-insurance-declaration/src/shared/constants.ts
  • libs/application/templates/health-insurance-declaration/src/utils/index.ts
  • libs/application/templates/health-insurance-declaration/tsconfig.json
  • libs/application/templates/health-insurance-declaration/tsconfig.lib.json
  • libs/application/templates/health-insurance-declaration/tsconfig.spec.json
  • libs/application/types/src/lib/template-api/shared-api/shared-api-definitions/health-insurance-api.ts
Additional Context Used
Path-based Instructions (20)
libs/clients/icelandic-health-insurance/rights-portal/src/lib/providers.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/health-insurance-declaration/health-insurance-declaration.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/template-api-modules/src/lib/modules/templates/health-insurance-declaration/attachments/provider.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/icelandic-health-insurance/rights-portal/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/application/template-api-modules/src/lib/modules/templates/complaints-to-althingi-ombudsman/attachments/providers/applicationAttachmentProvider.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/health-insurance-declaration/src/forms/Submitted.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/health-insurance-declaration/src/types/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/health-insurance-declaration/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/health-insurance-declaration/src/forms/Prerequisites.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/health-insurance-declaration/src/fields/applicantList.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/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.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/health-insurance-declaration/src/utils/data.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/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.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/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.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/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/templates/health-insurance-declaration/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/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/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/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.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/health-insurance-declaration/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."
Additional comments not posted (21)
libs/clients/icelandic-health-insurance/rights-portal/src/lib/providers.ts (2)

12-12: The addition of InsurancestatementsApi to the imports is correctly implemented.


22-22: Correct inclusion of InsurancestatementsApi in the exportedApis array, following the established dependency injection pattern.

libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.module.ts (1)

9-24: The setup of HealthInsuranceDeclarationModule is correctly implemented, adhering to NestJS best practices for module configuration and integration.

libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/attachments/provider.ts (1)

22-43: The implementation of ApplicationAttachmentProvider and its method getFiles is well-structured and correctly handles file retrieval and mapping, adhering to best practices for asynchronous operations and dependency injection.

libs/clients/icelandic-health-insurance/rights-portal/src/index.ts (2)

20-20: Correct export of InsurancestatementsApi, making it available for use across the application.


21-24: Correct export of DTOs related to insurance statements, ensuring type safety and integration with the front-end.

libs/application/templates/health-insurance-declaration/src/forms/Submitted.ts (1)

17-53: The form configuration for the HealthInsuranceDeclarationSubmitted state is correctly implemented, using the application's core builders effectively to create a user-friendly interface.

libs/application/templates/health-insurance-declaration/src/types/index.ts (1)

9-74: The TypeScript type definitions for the health insurance declaration application are comprehensive and well-structured, enhancing type safety and maintainability.

libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (1)

5-58: The Zod schema for the health insurance declaration form data is well-defined, providing robust validations and ensuring data integrity.

libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts (1)

22-83: Ensure proper error handling for external data providers.

libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts (1)

20-153: Check for potential data races and ensure thread safety in utility functions.

Verification successful

No asynchronous operations were found in the utility functions of the health-insurance-declaration.utils.ts file, indicating that there are no thread safety issues or potential data races related to asynchronous code execution in this context.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify thread safety and potential data races in utility functions.

# Test: Search for asynchronous operations and shared data access patterns. Expect: Proper locking mechanisms or atomic operations where shared data is accessed.
rg --type typescript $'async|await' libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts

Length of output: 202



Script:

#!/bin/bash
# Description: Re-verify thread safety and potential data races in utility functions by searching for asynchronous operations.

# Correcting the previous script error by not specifying the file type, as 'typescript' is not recognized by rg.
rg 'async|await' libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts

Length of output: 149

libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx (1)

37-172: Ensure state transitions are correctly configured and handle all possible states.

libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1)

22-157: Validate input data and handle potential exceptions in service methods.

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

270-273: Confirm the mapping for HEALTH_INSURANCE_DECLARATION is correctly configured.

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

68-68: Added new enum value HEALTH_INSURANCE_DECLARATION to handle health insurance declarations. This aligns with the PR's objective to introduce a new application for health insurance declarations.


341-344: Added configuration for HEALTH_INSURANCE_DECLARATION. Ensure that the slug and translation keys are correctly set up and match the intended usage within the application.

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

Line range hint 128-196: Imported and registered HealthInsuranceDeclarationModule. Verify that the module is correctly implemented and integrates well with other modules.

Verification successful

The verification process has confirmed that the HealthInsuranceDeclarationModule is correctly implemented and integrated within the codebase. The module is both imported and registered in the index.ts file, and it is defined and utilized within its own module file health-insurance-declaration.module.ts. This aligns with the expectations set in the review comment.

  • The module is imported and registered in libs/application/template-api-modules/src/lib/modules/templates/index.ts.
  • The module's class is defined and used in libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.module.ts.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct implementation and integration of HealthInsuranceDeclarationModule.

# Test: Search for the module usage and integration. Expect: Correct settings and interactions with other modules.
rg --type typescript $'HealthInsuranceDeclarationModule'

Length of output: 90



Script:

#!/bin/bash
# Description: Verify the correct implementation and integration of HealthInsuranceDeclarationModule.

# Test: Search for the module usage and integration. Expect: Correct settings and interactions with other modules.
rg --type ts 'HealthInsuranceDeclarationModule'

Length of output: 707


Line range hint 129-264: Imported and registered HealthInsuranceDeclarationService. Ensure that the service is correctly implemented and that it interacts properly with the required APIs and data sources.

Verification successful

The verification process has confirmed that the HealthInsuranceDeclarationService is correctly imported and registered within the index.ts file. Additionally, the service is defined in its own file (health-insurance-declaration.service.ts) and is properly set up in its module file (health-insurance-declaration.module.ts), where it is also exported.

This setup suggests that the service is likely implemented correctly and structured to interact with the necessary APIs and data sources as per typical patterns in this codebase. However, without specific details on the API interactions within the service's methods, a full verification of the interaction with APIs and data sources cannot be conclusively determined just from the import and registration checks.

Recommendation:

  • Review the implementation within health-insurance-declaration.service.ts to ensure that API interactions and data handling are performed correctly according to the project's standards and requirements.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct implementation and interaction of HealthInsuranceDeclarationService with APIs and data sources.

# Test: Search for the service usage and its interactions. Expect: Proper API calls and data handling.
rg --type typescript $'HealthInsuranceDeclarationService'

Length of output: 91



Script:

#!/bin/bash
# Description: Verify the correct implementation and interaction of HealthInsuranceDeclarationService with APIs and data sources.

# Correcting the file type for TypeScript and re-running the search for service usage and its interactions.
rg --type ts 'HealthInsuranceDeclarationService'

Length of output: 1146

libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (1)

1-530: The form HealthInsuranceDeclarationForm is well-structured with appropriate fields for capturing necessary information. Ensure all external data interactions are secure and that default values are correctly fetched from the external data sources.

libs/application/templates/health-insurance-declaration/src/assets/Logo.tsx (1)

1-84: The implementation of the Logo component is clean and follows React functional component best practices. The SVG paths are correctly defined, and the component is properly exported.

tsconfig.base.json (1)

403-405: The addition of the path for @island.is/application/templates/health-insurance-declaration is correctly formatted and aligns with the project's existing structure for application templates.

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

Out of diff range and nitpick comments (4)
libs/application/templates/health-insurance-declaration/src/utils/data.ts (3)

36-47: Consider caching the results of getCountriesFromExternalData to improve performance.


78-89: Consider caching the results of getContinentsFromExternalData to improve performance.


95-108: Consider caching the results of getChildrenFromExternalData to improve performance.

libs/application/templates/health-insurance-declaration/src/assets/Logo.tsx (1)

1-1: Ensure consistent import usage.

Consider using named imports for React hooks or components if they are used frequently in your project for consistency and easier refactoring.

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 414bcb2 and d8aef68.
Files selected for processing (40)
  • libs/application/template-api-modules/src/lib/modules/templates/complaints-to-althingi-ombudsman/attachments/providers/applicationAttachmentProvider.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/attachments/provider.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.module.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.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/health-insurance-declaration/.babelrc (1 hunks)
  • libs/application/templates/health-insurance-declaration/.eslintrc.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/README.md (1 hunks)
  • libs/application/templates/health-insurance-declaration/jest.config.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/project.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/assets/Logo.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/fields/applicantList.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/fields/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/Submitted.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/constants/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/conclution.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/prerequsites.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/shared/constants.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/types/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/utils/data.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/utils/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/tsconfig.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/tsconfig.lib.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/tsconfig.spec.json (1 hunks)
  • libs/application/types/src/lib/ApplicationTypes.ts (2 hunks)
  • libs/application/types/src/lib/InstitutionMapper.ts (1 hunks)
  • libs/application/types/src/lib/template-api/shared-api/shared-api-definitions/health-insurance-api.ts (1 hunks)
  • libs/clients/icelandic-health-insurance/rights-portal/src/index.ts (1 hunks)
  • libs/clients/icelandic-health-insurance/rights-portal/src/lib/providers.ts (2 hunks)
  • tsconfig.base.json (1 hunks)
Files not summarized due to errors (1)
  • libs/application/templates/health-insurance-declaration/src/assets/Logo.tsx: Error: Message exceeds token limit
Files skipped from review as they are similar to previous changes (38)
  • libs/application/template-api-modules/src/lib/modules/templates/complaints-to-althingi-ombudsman/attachments/providers/applicationAttachmentProvider.ts
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/attachments/provider.ts
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.module.ts
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts
  • libs/application/template-api-modules/src/lib/modules/templates/index.ts
  • libs/application/template-loader/src/lib/templateLoaders.ts
  • libs/application/templates/health-insurance-declaration/.babelrc
  • libs/application/templates/health-insurance-declaration/.eslintrc.json
  • libs/application/templates/health-insurance-declaration/README.md
  • libs/application/templates/health-insurance-declaration/jest.config.ts
  • libs/application/templates/health-insurance-declaration/project.json
  • libs/application/templates/health-insurance-declaration/src/fields/applicantList.tsx
  • libs/application/templates/health-insurance-declaration/src/fields/index.ts
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts
  • libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts
  • libs/application/templates/health-insurance-declaration/src/forms/Submitted.ts
  • libs/application/templates/health-insurance-declaration/src/index.ts
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx
  • libs/application/templates/health-insurance-declaration/src/lib/constants/index.ts
  • libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/conclution.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/prerequsites.ts
  • libs/application/templates/health-insurance-declaration/src/shared/constants.ts
  • libs/application/templates/health-insurance-declaration/src/types/index.ts
  • libs/application/templates/health-insurance-declaration/src/utils/index.ts
  • libs/application/templates/health-insurance-declaration/tsconfig.json
  • libs/application/templates/health-insurance-declaration/tsconfig.lib.json
  • libs/application/templates/health-insurance-declaration/tsconfig.spec.json
  • libs/application/types/src/lib/ApplicationTypes.ts
  • libs/application/types/src/lib/InstitutionMapper.ts
  • libs/application/types/src/lib/template-api/shared-api/shared-api-definitions/health-insurance-api.ts
  • libs/clients/icelandic-health-insurance/rights-portal/src/index.ts
  • libs/clients/icelandic-health-insurance/rights-portal/src/lib/providers.ts
  • tsconfig.base.json
Additional Context Used
Path-based Instructions (2)
libs/application/templates/health-insurance-declaration/src/utils/data.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/health-insurance-declaration/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."
Additional comments not posted (8)
libs/application/templates/health-insurance-declaration/src/utils/data.ts (6)

18-21: Ensure proper error handling for potentially undefined properties.


23-24: Ensure proper error handling for potentially undefined properties.


26-28: Ensure that canApply is always defined or handle potential undefined cases.


30-34: Ensure that countries is always defined or handle potential undefined cases.


60-70: Ensure that icelandicName is always defined or handle potential undefined cases.


161-165: Ensure proper error handling for potentially undefined properties.

Verification successful

The search results indicate that the function getInsuranceStatementDataFromExternalData is used in several places within the same file where it is defined. In each usage, the function call is followed by an optional chaining operator (?.), which is used to safely access properties like canApply, countries, and continents. This suggests that there is a handling mechanism for potentially undefined properties returned by the function.

Given this information, it appears that the calling code does indeed handle potential undefined properties appropriately by using optional chaining. This addresses the concern raised in the original review comment about ensuring proper error handling for potentially undefined properties.

Proper error handling for potentially undefined properties is implemented using optional chaining in the calling code.

  • libs/application/templates/health-insurance-declaration/src/utils/data.ts: Uses optional chaining when accessing properties returned by getInsuranceStatementDataFromExternalData.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the calling code handles potential undefined properties in `insuranceStatementData`.

# Test: Search for usages of `getInsuranceStatementDataFromExternalData`. Expect: Proper null checks before accessing properties.
rg --type typescript $'getInsuranceStatementDataFromExternalData'

Length of output: 99



Script:

#!/bin/bash
# Corrected script to search for usages of `getInsuranceStatementDataFromExternalData` in TypeScript files.
rg --type ts 'getInsuranceStatementDataFromExternalData'

Length of output: 639

libs/application/templates/health-insurance-declaration/src/assets/Logo.tsx (2)

3-3: Component definition is clean and concise.

This is a straightforward stateless functional component, appropriate for static content like an SVG logo.


84-84: Proper export of the React component.

Using default export here is suitable since the file contains a single component.

Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 34.01361% with 97 lines in your changes are missing coverage. Please review.

Project coverage is 36.92%. Comparing base (3429079) to head (b051742).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14748      +/-   ##
==========================================
- Coverage   36.97%   36.92%   -0.06%     
==========================================
  Files        6307     6312       +5     
  Lines      128365   128905     +540     
  Branches    36637    36788     +151     
==========================================
+ Hits        47467    47592     +125     
- Misses      80898    81313     +415     
Flag Coverage Δ
air-discount-scheme-web 0.00% <ø> (-22.28%) ⬇️
application-api-files 56.58% <100.00%> (+0.08%) ⬆️
application-core 71.46% <100.00%> (+0.04%) ⬆️
application-templates-car-recycling 4.23% <ø> (ø)
application-templates-criminal-record 21.67% <100.00%> (+0.10%) ⬆️
application-templates-financial-aid 12.27% <100.00%> (+0.04%) ⬆️
application-templates-general-petition 19.14% <100.00%> (+0.10%) ⬆️
application-templates-health-insurance 23.10% <100.00%> (+0.07%) ⬆️
application-templates-inheritance-report 3.96% <100.00%> (+0.03%) ⬆️
application-templates-parental-leave 25.18% <100.00%> (+0.01%) ⬆️
application-ui-shell 21.72% <100.00%> (+0.01%) ⬆️
auth-api-lib 9.91% <ø> (-0.02%) ⬇️
auth-react 22.95% <ø> (ø)
clients-license-client 1.84% <ø> (ø)
contentful-apps 6.58% <ø> (ø)
download-service 44.39% <100.00%> (+0.09%) ⬆️
financial-aid-backend 56.36% <100.00%> (+0.01%) ⬆️
judicial-system-api 17.62% <ø> (ø)
judicial-system-formatters 82.88% <ø> (ø)
judicial-system-message 65.92% <100.00%> (+0.06%) ⬆️
judicial-system-message-handler 66.03% <100.00%> (+0.03%) ⬆️
judicial-system-types 44.71% <ø> (ø)
judicial-system-web 28.22% <ø> (ø)
license-api 43.26% <100.00%> (+0.20%) ⬆️
portals-admin-regulations-admin 2.13% <ø> (ø)
skilavottord-ws 23.79% <ø> (ø)

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

Files Coverage Δ
...chments/providers/applicationAttachmentProvider.ts 26.31% <ø> (ø)
...lates/health-insurance-declaration/consts/index.ts 100.00% <100.00%> (ø)
...declaration/health-insurance-declaration.module.ts 100.00% <100.00%> (ø)
...ate-api-modules/src/lib/modules/templates/index.ts 100.00% <100.00%> (ø)
libs/application/types/src/lib/ApplicationTypes.ts 100.00% <100.00%> (ø)
...ibs/application/types/src/lib/InstitutionMapper.ts 100.00% <ø> (ø)
...api/shared-api-definitions/health-insurance-api.ts 100.00% <100.00%> (ø)
...landic-health-insurance/rights-portal/src/index.ts 100.00% <100.00%> (ø)
...ealth-insurance/rights-portal/src/lib/providers.ts 100.00% <ø> (ø)
libs/feature-flags/src/lib/features.ts 100.00% <100.00%> (ø)
... and 4 more

... and 44 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 3429079...b051742. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented May 8, 2024

Datadog Report

All test runs 0e2a4d7 🔗

101 Total Test Services: 0 Failed, 99 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
air-discount-scheme-backend 0 0 0 81 0 32.74s N/A Link
air-discount-scheme-web 0 0 0 2 0 13.44s N/A Link
api 0 0 0 4 0 4.63s N/A Link
api-catalogue-services 0 0 0 23 0 15.93s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 34.72s N/A Link
api-domains-assets 0 0 0 3 0 22.8s N/A Link
api-domains-auth-admin 0 0 0 18 0 11.51s N/A Link
api-domains-communications 0 0 0 5 0 43.08s N/A Link
api-domains-criminal-record 0 0 0 5 0 15.35s N/A Link
api-domains-driving-license 0 0 0 23 0 1m 1.98s N/A Link

🔻 Code Coverage Decreases vs Default Branch (3)

  • application-template-api-modules - jest 26.31% (-0.11%) - Details
  • auth-api-lib - jest 11.01% (-0.04%) - Details
  • application-types - jest 6.14% (-0.04%) - Details

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 file 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: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between d8aef68 and e529c49.
Files selected for processing (6)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/fields/applicantList.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/conclution.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/utils/data.ts (1 hunks)
Files skipped from review as they are similar to previous changes (6)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts
  • libs/application/templates/health-insurance-declaration/src/fields/applicantList.tsx
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/conclution.ts
  • libs/application/templates/health-insurance-declaration/src/utils/data.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between e529c49 and 3e9015e.
Files selected for processing (1)
  • libs/application/templates/health-insurance-declaration/src/utils/data.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/health-insurance-declaration/src/utils/data.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 3e9015e and fba953c.
Files selected for processing (2)
  • libs/application/templates/health-insurance-declaration/project.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • libs/application/templates/health-insurance-declaration/project.json
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx

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 fba953c and f3f15c9.
Files selected for processing (6)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/consts/index.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/index.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/consts/index.ts
Files skipped from review as they are similar to previous changes (5)
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts
  • libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts
  • libs/application/templates/health-insurance-declaration/src/index.ts
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts

@Halli1414 Halli1414 requested a review from Toti91 May 14, 2024 11:16
Copy link
Member

@Toti91 Toti91 left a comment

Choose a reason for hiding this comment

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

Nice

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 f3f15c9 and cd6a230.
Files selected for processing (4)
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts (1 hunks)
  • libs/feature-flags/src/lib/features.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • libs/feature-flags/src/lib/features.ts
Files skipped from review as they are similar to previous changes (3)
  • libs/application/templates/health-insurance-declaration/src/lib/HealthInsuranceDeclarationTemplate.tsx
  • libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between cd6a230 and d5ea07c.
Files selected for processing (1)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts

@kodiakhq kodiakhq bot merged commit b57eda3 into main May 14, 2024
136 checks passed
@kodiakhq kodiakhq bot deleted the feat/application-health-insurance-declaration-new-application branch May 14, 2024 13:19
Ballioli pushed a commit that referenced this pull request May 17, 2024
…ion (#14748)

* generate lib

* scaffolding

* Prerequsites set up

* Setting up base for each section

* fix typo

* Data from external data providers

* Translation strings

* Overview screen

* Not health insured message screen

* fix markdown text

* conditional section and translation strings

* Validation and overview screen

* date validation

* conclution

* insuranceStatements as a dataProvider

* updated dataprovider

* data from dataProvider

* Spouse from external data

* map answers to post requests

* minor import fix

* Submitted screen

* Applicants pdf data

* submitted screen

* download button

* file download and data mapping

* fix build errors

* Clarify applicants status at endscreen

* Tourist rename

* Loader and error handling

* null checks and code clean up

* remove unused import

* null check

* extract strings and code clean up

* fix breaking tests

* institution name

* feature flag and error messages

* chore: nx format:write update dirty files

---------

Co-authored-by: andes-it <builders@andes.is>
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
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants