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

fix(application-estate): Email and phone prefill #15829

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

kksteini
Copy link
Member

@kksteini kksteini commented Aug 30, 2024

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • [X ] 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
    • Added contact information (email and phone) to estate information entries for improved data display.
    • Introduced a phone property in the generated heir data structure.
  • Enhancements
    • Improved data mapping for estate members by ensuring email and phone fields default to empty strings when not present.

@kksteini kksteini requested review from a team as code owners August 30, 2024 13:34
Copy link
Contributor

coderabbitai bot commented Aug 30, 2024

Walkthrough

The changes involve the addition of new properties, specifically email and phone, to various functions that generate or map estate-related data. These modifications enhance the data structures returned by the functions without altering their existing logic or control flow. The updates ensure that more comprehensive information is available for each estate participant and heir, improving the overall data handling in the application.

Changes

Files Change Summary
libs/application/template-api-modules/src/lib/modules/templates/estate/utils/fakeData.ts
libs/application/template-api-modules/src/lib/modules/templates/estate/utils/mappers.ts
Added email and phone properties to the objects returned by getFakeEstateInfo and initialized them using the nullish coalescing operator in estateMemberMapper to handle missing data more robustly.
libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/utils/fakeData.ts Introduced a new phone property to the object returned by generateRandomHeir, statically assigned the value '9999999', enhancing the heir data structure.
libs/clients/syslumenn/src/lib/syslumennClient.utils.ts Enhanced estateMemberMapper by adding email and phone properties derived from netfang and simi fields of the input, defaulting to empty strings if those fields are absent.

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.

Tip

Early access features: enabled

We are currently testing the following features in early access:

  • Anthropic claude-3-5-sonnet for code reviews: Anthropic claims that the new Claude model has stronger code understanding and code generation capabilities than their previous models. Note: Our default code review model was also updated late last week. Please compare the quality of the reviews between the two models by toggling the early access feature.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues on the discussion post.

@kksteini kksteini changed the title fix(application-estate) Email and phone prefill fix(application-estate): Email and phone prefill Aug 30, 2024
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 36.97%. Comparing base (1b59a05) to head (3b607a4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../src/lib/modules/templates/estate/utils/mappers.ts 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #15829   +/-   ##
=======================================
  Coverage   36.97%   36.97%           
=======================================
  Files        6658     6658           
  Lines      135993   135997    +4     
  Branches    38633    38637    +4     
=======================================
+ Hits        50280    50282    +2     
- Misses      85713    85715    +2     
Flag Coverage Δ
api 3.42% <ø> (ø)
api-domains-mortgage-certificate 36.04% <0.00%> (-0.04%) ⬇️
application-api-files 57.95% <ø> (ø)
application-system-api 41.85% <0.00%> (-0.01%) ⬇️
application-template-api-modules 23.66% <0.00%> (-0.01%) ⬇️
application-templates-estate 11.88% <ø> (ø)
application-templates-inheritance-report 4.63% <ø> (ø)
application-ui-shell 21.28% <ø> (ø)
clients-syslumenn 50.00% <100.00%> (+0.04%) ⬆️
web 1.88% <ø> (ø)

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

Files with missing lines Coverage Δ
...src/lib/modules/templates/estate/utils/fakeData.ts 9.52% <ø> (ø)
...les/templates/inheritance-report/utils/fakeData.ts 13.79% <ø> (ø)
...clients/syslumenn/src/lib/syslumennClient.utils.ts 49.04% <100.00%> (+0.27%) ⬆️
.../src/lib/modules/templates/estate/utils/mappers.ts 12.62% <0.00%> (-0.25%) ⬇️

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 1b59a05...3b607a4. 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: 2

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0502fd6 and 6412590.

Files selected for processing (4)
  • libs/application/template-api-modules/src/lib/modules/templates/estate/utils/fakeData.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/estate/utils/mappers.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/utils/fakeData.ts (1 hunks)
  • libs/clients/syslumenn/src/lib/syslumennClient.utils.ts (1 hunks)
Additional context used
Path-based instructions (4)
libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/utils/fakeData.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/estate/utils/fakeData.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/estate/utils/mappers.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/syslumenn/src/lib/syslumennClient.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 (2)
libs/application/template-api-modules/src/lib/modules/templates/estate/utils/mappers.ts (1)

30-31: Good use of the nullish coalescing operator to handle potentially missing data.

The use of the nullish coalescing operator (??) for the phone and email properties enhances the robustness of the data mapping process by ensuring meaningful default values are provided when data is missing.

libs/clients/syslumenn/src/lib/syslumennClient.utils.ts (1)

403-404: Enhance data mapping with additional contact details.

The addition of email and phone properties to the estateMemberMapper function is a positive change, enhancing the data structure with more comprehensive contact details. This aligns with the PR's objective to improve user experience by ensuring correct pre-filling of these fields.

However, it's important to ensure that these fields are consistently handled across all relevant functions and that they adhere to TypeScript best practices for type safety and reusability.

The code changes are approved, but I recommend verifying the integration of these new properties across the application to ensure consistency.

@datadog-island-is
Copy link

datadog-island-is bot commented Aug 30, 2024

Datadog Report

All test runs 688bd1b 🔗

8 Total Test Services: 0 Failed, 8 Passed
➡️ Test Sessions change in coverage: 14 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 2.65s 1 no change Link
api-domains-mortgage-certificate 0 0 0 5 0 16.57s 1 no change Link
application-api-files 0 0 0 12 0 5.22s 1 no change Link
application-system-api 0 0 0 111 2 2m 59.45s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 37.07s 1 no change Link
application-ui-shell 0 0 0 74 0 29.86s 1 no change Link
clients-syslumenn 0 0 0 27 0 15.85s 1 no change Link
web 0 0 0 84 0 30.35s 1 no change Link

@albinagu albinagu added the automerge Merge this PR as soon as all checks pass label Sep 2, 2024
@kodiakhq kodiakhq bot merged commit 158246b into main Sep 2, 2024
43 checks passed
@kodiakhq kodiakhq bot deleted the fix/application-estate-email-and-phone-prefill branch September 2, 2024 09:15
jonnigs pushed a commit that referenced this pull request Sep 2, 2024
* fix(application-estate): Fix phone/email mapper

* fix(application-estate): Fix phone/email mapper

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants