fix: resolve all bot review comments on billing PRBrowse files at 203d8fd stripsior committed 4 months ago · 15 changed files
- Pin @simpay/typescript to ^1.0.3 in apps/web and packages/payments
- Fix billingUserRelations: billingSubscription one() -> billingSubscriptions many()
- Add unique constraint on billing_transactions.providerTransactionId for idempotent webhooks
- Webhook route: wrap credit logic in DB transaction; catch ER_DUP_ENTRY for duplicate delivery
- billing.ts: remove unused DURATION_LABELS; wrap adminCreateProduct in transaction;
validate duplicate price durations upfront; atomic SQL increment for referral usageCount
- settings.ts: tighten defaultCurrency validation to exactly 3 uppercase letters
- simpay.ts: validate parsed amount is finite and positive; enable validateSourceIp
- stripe.ts: throw if session.url is null; reject webhook if amount_total is null/zero
- panel-sidebar.tsx: shop nav active on /billing/* not just /billing
- billing/page.tsx: remove unused cn import
- wallet/page.tsx: Number.isFinite check on top-up amount; onError handler for topupMutation;
aria-label on icon-only edit referral code button
- admin/billing/page.tsx: remove unused maskKey; i18n all hardcoded strings in
CategoryPreviewCard and EggsDrawerContent; ICU plural for plan count
- GroupedMultiSelect: add noResultsText and clearAllText props
- SearchSelect: add noResultsText prop
- en.json: add preview/uploading/banner keys, selectEggs/searchEggs/selectNodes/searchNodes,
noResults, planCount ICU plural, topUpError, editCode