Skip to content

feat(billing): validate details when adding card - #2994

Merged
RemiBonnet merged 1 commit into
stagingfrom
feat/require-billing-details-onboarding
Sep 22, 2026
Merged

RemiBonnet merged 1 commit into
stagingfrom
feat/require-billing-details-onboarding

Conversation

@RemiBonnet

@RemiBonnet RemiBonnet commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

https://qovery.slack.com/archives/C02P3MA2NKT/p1790002401588209

  • Requires customers to enter their billing address before organization creation instead of silently defaulting to New York.
  • Requires a VAT number for EU billing countries and keeps it optional elsewhere.
  • Validates supported EU and US postal-code formats and trims billing values before submission.
  • Reuses the billing details form and validation between onboarding and organization settings.

Screenshots / Recordings

Screenshot 2026-09-22 at 10 59 40

Testing

  • Onboarding focused Jest suites: 7 tests
  • Organization billing focused Jest suites: 25 tests
  • ESLint on affected files
  • TypeScript checks for both affected libraries
  • Formatting and diff checks

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible - required for semantic-release
  • I only kept necessary comments, written in English
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any assisted code

Summary by cubic

Requires valid billing details before a card can be added in organization settings and stops creating default billing details during onboarding.

  • Removes the implicit New York billing address created at organization creation.
  • Requires a VAT number for EU billing countries, keeps it optional elsewhere, and shows rejected VAT numbers inline on the field.
  • Validates postal codes against supported EU and US formats and requires a value for unsupported countries.
  • Trims billing values before submission and saves them before a card is added.
  • Disables the add/update card button until billing details are valid and the card form is complete.
  • Shows an error toast when adding a card or saving billing details fails validation.
  • Fixes Chargebee card field styling in dark mode.

Written for commit 0aa58ca. Summary will update on new commits.

Review in cubic

@nx-cloud

nx-cloud Bot commented Sep 22, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0aa58ca

Command Status Duration Result
nx run console:build --parallel=3 --configurati... ✅ Succeeded 58s View ↗
nx affected --target=test --parallel=3 --config... ✅ Succeeded 3m 4s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 2m 27s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-22 12:32:11 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread libs/domains/onboarding/feature/src/lib/onboarding-project/onboarding-project.tsx Outdated
Comment thread libs/domains/onboarding/feature/src/lib/onboarding-project/onboarding-project.tsx Outdated
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.24242% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.60%. Comparing base (841ab40) to head (0aa58ca).
⚠️ Report is 2 commits behind head on staging.

Files with missing lines Patch % Lines
...tings-billing-details/settings-billing-details.tsx 70.27% 2 Missing and 9 partials ⚠️
...b/hooks/use-add-credit-card/use-add-credit-card.ts 0.00% 2 Missing ⚠️
...s/use-delete-credit-card/use-delete-credit-card.ts 0.00% 2 Missing ⚠️
...rc/lib/components/inputs/input-text/input-text.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2994      +/-   ##
===========================================
- Coverage    51.43%   50.60%   -0.83%     
===========================================
  Files          710     1264     +554     
  Lines        17398    27758   +10360     
  Branches      5231     8384    +3153     
===========================================
+ Hits          8949    14048    +5099     
- Misses        7002    11390    +4388     
- Partials      1447     2320     +873     
Flag Coverage Δ
unittests 50.60% <74.24%> (-0.83%) ⬇️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RemiBonnet
RemiBonnet force-pushed the feat/require-billing-details-onboarding branch from fcaed5e to 93f8000 Compare September 22, 2026 08:24
@RemiBonnet RemiBonnet changed the title feat(onboarding): require billing details feat(billing): validate details when adding card Sep 22, 2026
@RemiBonnet
RemiBonnet force-pushed the feat/require-billing-details-onboarding branch 14 times, most recently from 540a715 to 3610711 Compare September 22, 2026 10:12
@RemiBonnet
RemiBonnet force-pushed the feat/require-billing-details-onboarding branch from 3610711 to 0aa58ca Compare September 22, 2026 12:24
@RemiBonnet
RemiBonnet enabled auto-merge (squash) September 22, 2026 12:43

@rmnbrd rmnbrd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me ✅

@RemiBonnet
RemiBonnet merged commit c4f6640 into staging Sep 22, 2026
8 of 9 checks passed
@RemiBonnet
RemiBonnet deleted the feat/require-billing-details-onboarding branch September 22, 2026 12:44
@RemiBonnet

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.360.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants