-
Notifications
You must be signed in to change notification settings - Fork 61
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-insurance-declaration): Make it possible to select only child for health insurance declaration #15818
Conversation
…ration and fix a bug that stopped the list of applicants from including children
WalkthroughThe changes involve a transition from a family-centric model to an applicant-centric model in the health insurance declaration process. This includes updates to data handling, validation logic, user interface text, and utility functions, allowing users to select individual applicants instead of families. Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15818 +/- ##
==========================================
- Coverage 36.93% 36.93% -0.01%
==========================================
Files 6681 6681
Lines 136460 136464 +4
Branches 38749 38749
==========================================
Hits 50401 50401
- Misses 86059 86063 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 4 Total Test Services: 0 Failed, 4 Passed Test Services
|
There was a problem hiding this 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
Files selected for processing (5)
- libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json (1 hunks)
- libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (5 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (4 hunks)
- libs/application/templates/health-insurance-declaration/src/utils/data.ts (3 hunks)
Files skipped from review due to trivial changes (1)
- libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json
Additional context used
Path-based instructions (4)
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/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/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."
Additional comments not posted (14)
libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (3)
26-28
: LGTM!The addition of new fields
registerPersonsApplicantCheckboxField
,registerPersonsSpouseCheckboxField
, andregisterPersonsChildrenCheckboxField
aligns with the requirement to select applicants.
33-44
: LGTM!The validation logic is correctly implemented and enhances the robustness of the schema.
37-44
: LGTM!The custom issues are correctly added and provide clear feedback to the user.
libs/application/templates/health-insurance-declaration/src/utils/data.ts (3)
137-141
: LGTM!The
getApplicantFromExternalData
function is correctly implemented and retrieves the applicant's information from theexternalData
.
143-152
: LGTM!The
getApplicantAsOption
function is correctly implemented and provides the necessary formatting for the applicant's information.
Line range hint
170-227
: LGTM!The
getSelectedApplicants
function is correctly updated to handle the broader scope of functionality and the logic is correctly implemented.libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (5)
46-48
: LGTM!The new section title "Nám/ferðir" is more concise and relevant.
51-53
: LGTM!The new section description "Er sótt um vegna ferða eða náms?" is clearer and better aligns with user intent.
85-89
: LGTM!The new entry
applicantTitle
enhances the structure of the application by providing clearer labels for user input sections.
124-126
: LGTM!The new placeholder text "Veldur land sem ferðast á til" is clearer and more accurate.
226-229
: LGTM!The new identifier
applicantsTableTitle
and default message "Sótt er um fyrir" are more relevant and align with the changes in the application.libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3)
37-38
: LGTM!The import statements are correctly updated to include the new utility functions
getSelectedApplicants
andgetApplicantAsOption
.
273-280
: LGTM!The checkbox field for selecting applicants is correctly implemented, with the default value and options derived using the
getApplicantAsOption
function.
502-506
: LGTM!The static table field is correctly updated to display selected applicants, with the title changed to "Applicants table" and the logic for populating the rows modified to use
getSelectedApplicants
.
libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts
Outdated
Show resolved
Hide resolved
…ration and fix a bug that stopped the list of applicants from including children
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but do we want have to update the submit method in the template-api with this new data?
There was a problem hiding this 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
Files selected for processing (1)
- libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- libs/application/templates/health-insurance-declaration/src/lib/messages/application.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- 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/mockData/health-insurance-declaration.json (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- libs/application/templates/health-insurance-declaration/mockData/health-insurance-declaration.json
Files skipped from review as they are similar to previous changes (1)
- libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts
Additional context used
Path-based instructions (1)
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."
Additional comments not posted (1)
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts (1)
59-73
: Ensure consistency in applicant data.The current implementation uses
answers.applicant.nationalId
andanswers.applicant.name
for the applicant's data. Ensure that this data is consistent with the external data.Run the following script to verify the consistency of applicant data:
...src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
Files selected for processing (2)
- 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/forms/HealthInsuranceDeclarationForm.ts (4 hunks)
Files skipped from review as they are similar to previous changes (2)
- libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts
- libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts
…hild for health insurance declaration (#15818) * feat: Make it posible to select only child for health insurance declaration and fix a bug that stopped the list of applicants from including children * chore: nx format:write update dirty files * feat: Make it posible to select only child for health insurance declaration and fix a bug that stopped the list of applicants from including children * chore: nx format:write update dirty files * Fix default message * pr comment * Update service * chore: nx format:write update dirty files * simplify applicant handling --------- Co-authored-by: andes-it <builders@andes.is> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
and fix a bug that stopped the list of applicants from including children
...
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:
Summary by CodeRabbit
New Features
Improvements
Bug Fixes