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): Student health insurance declaration length #15808

Merged
merged 9 commits into from
Aug 29, 2024

Conversation

norda-gunni
Copy link
Member

@norda-gunni norda-gunni commented Aug 28, 2024

...

Attach a link to issue if relevant
Issue
Issue

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 mock data source for health insurance declarations, enhancing testing and development capabilities.
    • Added conditional logic to the health insurance declaration form for minimum date selection based on applicant type.
    • Implemented a warning message for students regarding minimum date requirements.
  • Improvements

    • Enhanced user guidance through localized messages related to student insurance declarations.

@norda-gunni norda-gunni requested a review from a team as a code owner August 28, 2024 15:13
Copy link
Contributor

coderabbitai bot commented Aug 28, 2024

Walkthrough

The changes introduce a mock data JSON file for a health insurance declaration API, detailing structured health insurance information and HTTP routes. The HealthInsuranceDeclarationForm.ts file is updated to include minimum date validation based on applicant type and a new alert message for students. Additionally, new localized messages are added in application.ts to inform users about student-specific minimum date requirements.

Changes

Files Change Summary
libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json Introduced a mock data file for the health insurance declaration API, defining structured data, HTTP routes, and responses related to health insurance information.
libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts Added minimum date logic for applicants and a new alert message field for students, enhancing form validation and user feedback.
libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts Added new localized message entries for student minimum date warnings, providing guidance for insurance declarations.

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

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

Documentation and Community

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

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.96%. Comparing base (b303883) to head (70b877d).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #15808   +/-   ##
=======================================
  Coverage   36.96%   36.96%           
=======================================
  Files        6635     6635           
  Lines      136021   136021           
  Branches    38734    38734           
=======================================
  Hits        50280    50280           
  Misses      85741    85741           
Flag Coverage Δ
api 3.42% <ø> (ø)
application-system-api 41.86% <ø> (ø)
application-template-api-modules 23.67% <ø> (+0.01%) ⬆️
application-ui-shell 21.28% <ø> (ø)

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

Files with missing lines Coverage Δ
...urance-declaration/src/lib/messages/application.ts 100.00% <ø> (ø)

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 b303883...70b877d. 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

Outside diff range, codebase verification and nitpick comments (17)
libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json (17)

10-96: Route Section: Ensure Consistency and Completeness

The first route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


97-182: Route Section: Ensure Consistency and Completeness

The second route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


183-354: Route Section: Ensure Consistency and Completeness

The third route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


355-526: Route Section: Ensure Consistency and Completeness

The fourth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


527-612: Route Section: Ensure Consistency and Completeness

The fifth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


613-698: Route Section: Ensure Consistency and Completeness

The sixth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


699-808: Route Section: Ensure Consistency and Completeness

The seventh route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


809-894: Route Section: Ensure Consistency and Completeness

The eighth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


895-980: Route Section: Ensure Consistency and Completeness

The ninth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


981-1066: Route Section: Ensure Consistency and Completeness

The tenth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


1067-1152: Route Section: Ensure Consistency and Completeness

The eleventh route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


1153-1238: Route Section: Ensure Consistency and Completeness

The twelfth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


1239-1348: Route Section: Ensure Consistency and Completeness

The thirteenth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


1349-1444: Route Section: Ensure Consistency and Completeness

The fourteenth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


1445-1544: Route Section: Ensure Consistency and Completeness

The fifteenth route section is well-structured, but ensure that all necessary fields are filled out, especially the documentation field which is currently empty. This can help with understanding the purpose of the route.


1647-1657: Proxy Request Headers: Ensure Completeness

The proxy request headers section is currently empty. Ensure that any necessary headers are added here.


1658-1661: Proxy Response Headers: Ensure Completeness

The proxy response headers section is currently empty. Ensure that any necessary headers are added here.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6082333 and 3ba6768.

Files selected for processing (3)
  • libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json (1 hunks)
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3 hunks)
  • libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (1 hunks)
Additional context used
Path-based instructions (3)
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/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/mockData/health-insurance-declaration.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."
Additional comments not posted (9)
libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (2)

177-181: LGTM!

The new message entry studentMinDateWarningTitle is correctly defined.

The code changes are approved.


182-187: LGTM!

The new message entry studentMinDateWarning is correctly defined.

The code changes are approved.

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

49-49: LGTM!

The import statement for sub from date-fns is correctly added.

The code changes are approved.


383-388: LGTM!

The minDate logic is correctly implemented and improves the form's validation.

The code changes are approved.


403-414: LGTM!

The buildAlertMessageField component is correctly implemented and improves user experience by providing contextual feedback.

The code changes are approved.

libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json (4)

1-9: Metadata Section: Looks Good

The initial metadata section includes UUID, last migration, name, endpoint prefix, latency, port, hostname, and folders. Everything seems correctly structured.


1545-1615: Root Children Section: Looks Good

The root children section includes references to all route UUIDs. Everything seems correctly structured.


1616-1627: Proxy and TLS Options: Looks Good

The proxy and TLS options section is well-structured. Everything seems correctly set up.


1628-1646: CORS Headers: Looks Good

The CORS headers section is well-structured. Everything seems correctly set up.

@datadog-island-is
Copy link

datadog-island-is bot commented Aug 28, 2024

Datadog Report

All test runs c78d945 🔗

4 Total Test Services: 0 Failed, 4 Passed
➡️ Test Sessions change in coverage: 9 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 3.28s 1 no change Link
application-system-api 0 0 0 111 2 3m 25.43s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 56.85s 1 no change Link
application-ui-shell 0 0 0 74 0 38.01s 1 no change Link

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 3ba6768 and cfe2781.

Files selected for processing (1)
  • libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json

@norda-gunni norda-gunni requested a review from Toti91 August 29, 2024 09:06
@norda-gunni
Copy link
Member Author

Since the mockoon captures are quite specific to each application I figured they would belong with the application templates they relate to rather than in a central location. Also this way we don't have to bother the core team every time we CRUD them.

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 cfe2781 and b905c66.

Files selected for processing (1)
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3 hunks)
Additional context used
Path-based instructions (1)
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."
Additional comments not posted (1)
libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (1)

49-49: LGTM!

The import statement for sub from date-fns is correct and necessary for the new date calculation logic.

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 b905c66 and b93ff8e.

Files selected for processing (1)
  • libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3 hunks)
Additional context used
Path-based instructions (1)
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."
Additional comments not posted (2)
libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (2)

49-49: LGTM!

The import statement for sub from date-fns is correct and necessary for the new date calculation logic.


382-386: LGTM! Consider simplifying the condition for the alert message field.

The new minimum date calculation logic and the new alert message field enhance the form's validation and user experience. However, the condition for the alert message field can be simplified.

Apply this diff to simplify the condition for the alert message field:

-buildAlertMessageField({
-  id: 'dateAlertMessage',
-  alertType: 'warning',
-  title: m.application.date.studentMinDateWarningTitle,
-  message: m.application.date.studentMinDateWarning,
-  condition: (answers) => {
-    return (
-      answers.studentOrTouristRadioFieldTourist ===
-      ApplicantType.STUDENT
-    )
-  },
-}),
+buildAlertMessageField({
+  id: 'dateAlertMessage',
+  alertType: 'warning',
+  title: m.application.date.studentMinDateWarningTitle,
+  message: m.application.date.studentMinDateWarning,
+  condition: (answers) =>
+    answers.studentOrTouristRadioFieldTourist === ApplicantType.STUDENT,
+}),

Also applies to: 401-409

@norda-gunni norda-gunni added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Aug 29, 2024
@kodiakhq kodiakhq bot merged commit 58ad76e into main Aug 29, 2024
36 checks passed
@kodiakhq kodiakhq bot deleted the feat/student-application-length branch August 29, 2024 10:20
jonnigs pushed a commit that referenced this pull request Sep 2, 2024
* Add mock data for the application

* Add minimum date and notification text for students

* chore: nx format:write update dirty files

* Add minimum date and notification text for students

* Remove accidental import

* Coderabbit

---------

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.

3 participants