feat(taxcode): seed default Stripe tax codes at server startup#4039
feat(taxcode): seed default Stripe tax codes at server startup#4039borbelyr-kong wants to merge 1 commit intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR adds default tax code provisioning to the server startup sequence. It introduces a new interface method to the TaxCodeService for seeding predefined Stripe tax codes, implements the method with idempotent conflict handling, defines the default tax code seeds, and wires the provisioning call into server initialization before meter setup. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| // seed CreateTaxCode call will hit the unique constraint and be silently skipped. | ||
| var DefaultStripeTaxCodes = []DefaultTaxCodeSeed{ | ||
| { | ||
| Key: "stripe_txcd_00000000", |
There was a problem hiding this comment.
I'd choose a key that's specific to our platform. When we support other providers, the same tax code will map between providers.
| Key: "stripe_txcd_00000000", | |
| Key: "non_taxable", |
or we can define a format for OM
| Key: "stripe_txcd_00000000", | |
| Key: "om_......", |
| import "github.com/samber/lo" | ||
|
|
||
| // DefaultTaxCodeSeed holds the minimal inputs needed to seed one well-known tax code. | ||
| type DefaultTaxCodeSeed struct { |
There was a problem hiding this comment.
Can't we reuse the CreateTaxCodeInput type?
| // Keys follow the same convention used by GetOrCreateByAppMapping: "stripe_<code>". | ||
| // This ensures that if a code was already auto-created by the billing flow, the | ||
| // seed CreateTaxCode call will hit the unique constraint and be silently skipped. | ||
| var DefaultStripeTaxCodes = []DefaultTaxCodeSeed{ |
There was a problem hiding this comment.
These should come from config.
Summary by CodeRabbit