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

[PM-14892] Tax estimation for individuals #11992

Closed
wants to merge 12 commits into from

Conversation

jonashendrickx
Copy link
Member

@jonashendrickx jonashendrickx commented Nov 14, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-14892

📔 Objective

  • Refactoring duplicate code
  • Show the estimated sales tax using Stripe for individuals wanting to subscribe to the Premium plan.
  • onTaxInformationChanged event will emit when country, postal code or tax id have changed, with a 1 second delay to make sure you're done typing. This allows components that integrate this component to listen for changes, and preview the invoice accordingly according to the entered data in the tax information form.
  • Countries that are supported by Stripe are now validated or pulled from the back-end rather than keeping a hardcoded list of country codes in the front-end. It's a bit slower but makes the maintenance easier.

📸 Screenshots

See comment section on https://bitwarden.atlassian.net/browse/PM-13999 for recording.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 4.31655% with 133 lines in your changes missing coverage. Please review.

Project coverage is 33.40%. Comparing base (e6c68b7) to head (2588716).
Report is 18 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...s/web/src/app/billing/shared/tax-info.component.ts 6.45% 58 Missing ⚠️
...pp/billing/individual/premium/premium.component.ts 0.00% 15 Missing ⚠️
...billing/individual/premium/premium-v2.component.ts 0.00% 13 Missing ⚠️
...c/billing/models/response/tax-id-types.response.ts 0.00% 13 Missing ⚠️
...ax-information/manage-tax-information.component.ts 18.18% 8 Missing and 1 partial ⚠️
libs/common/src/billing/services/tax.service.ts 0.00% 8 Missing ⚠️
...illing/models/response/preview-invoice.response.ts 0.00% 7 Missing ⚠️
...src/app/billing/shared/payment-method.component.ts 0.00% 3 Missing ⚠️
libs/angular/src/services/jslib-services.module.ts 0.00% 2 Missing ⚠️
...yment-dialog/adjust-payment-dialog-v2.component.ts 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11992      +/-   ##
==========================================
- Coverage   33.42%   33.40%   -0.03%     
==========================================
  Files        2871     2876       +5     
  Lines       89791    89856      +65     
  Branches    17098    17106       +8     
==========================================
+ Hits        30012    30014       +2     
- Misses      57417    57479      +62     
- Partials     2362     2363       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Contributor

github-actions bot commented Nov 14, 2024

Logo
Checkmarx One – Scan Summary & Details57a1ac13-6139-4e15-8492-3d6ebe42677f

No New Or Fixed Issues Found

@jonashendrickx jonashendrickx marked this pull request as ready for review November 14, 2024 13:32
@jonashendrickx jonashendrickx requested a review from a team as a code owner November 14, 2024 13:32
@jonashendrickx jonashendrickx changed the title [PM-14892] Refactoring tax estimation [PM-14892] Tax estimation for individuals Nov 20, 2024
@jonashendrickx jonashendrickx marked this pull request as draft November 20, 2024 09:08
@jonashendrickx jonashendrickx marked this pull request as ready for review November 20, 2024 14:52
{ name: "Zimbabwe", value: "ZW", disabled: false },
];

private taxSupportedCountryCodes: string[] = [
Copy link
Member Author

Choose a reason for hiding this comment

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

This list seems to match the supported tax id types for the countries in Stripe. I've moved this bit to the back-end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant