@burdenoff/microfe-billing 2026.1108.1 → 2026.1109.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/BillingAdminRoutes.d.ts +1 -2
- package/dist/billing/BillingAdminRoutes.js +11 -12
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/BillingRoot.d.ts +0 -1
- package/dist/billing/BillingRoot.js +10 -9
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/BillingUserRoutes.d.ts +1 -2
- package/dist/billing/BillingUserRoutes.js +13 -14
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/hooks/useBillingAccountSelection.d.ts +0 -1
- package/dist/billing/hooks/useBillingAccountSelection.js +7 -5
- package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -1
- package/dist/billing/hooks/useBillingEventEmitter.d.ts +0 -1
- package/dist/billing/hooks/useBillingEventEmitter.js +1 -2
- package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -1
- package/dist/billing/hooks/useBillingNavigate.d.ts +0 -1
- package/dist/billing/hooks/useBillingNavigate.js +1 -2
- package/dist/billing/hooks/useBillingNavigate.js.map +1 -1
- package/dist/billing/hooks/useBillingPermissions.d.ts +0 -1
- package/dist/billing/hooks/useBillingPermissions.js +2 -3
- package/dist/billing/hooks/useBillingPermissions.js.map +1 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +0 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.js +1 -2
- package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -1
- package/dist/billing/hooks/useProducts.d.ts +0 -1
- package/dist/billing/hooks/useProducts.js +1 -2
- package/dist/billing/hooks/useProducts.js.map +1 -1
- package/dist/billing/index.d.ts +0 -1
- package/dist/billing/lib/native-purchases.d.ts +0 -1
- package/dist/billing/lib/native-purchases.js +1 -2
- package/dist/billing/lib/native-purchases.js.map +1 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +0 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.js +4 -5
- package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -1
- package/dist/billing/modules/addons/hooks/index.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/index.js +3 -2
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js +1 -2
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js.map +1 -1
- package/dist/billing/modules/addons/hooks/useAddons.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/useAddons.js +1 -2
- package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -1
- package/dist/billing/modules/addons/index.d.ts +0 -1
- package/dist/billing/modules/addons/index.js +10 -10
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +15 -16
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +11 -12
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +16 -17
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +16 -17
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +111 -106
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +105 -100
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/index.d.ts +0 -1
- package/dist/billing/modules/addons/pages/index.js +7 -6
- package/dist/billing/modules/addons/store/addonCartStore.d.ts +0 -1
- package/dist/billing/modules/addons/store/addonCartStore.js +2 -7
- package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -1
- package/dist/billing/modules/affiliate/api.d.ts +0 -1
- package/dist/billing/modules/affiliate/api.js +1 -2
- package/dist/billing/modules/affiliate/api.js.map +1 -1
- package/dist/billing/modules/affiliate/index.d.ts +0 -1
- package/dist/billing/modules/affiliate/index.js +1 -2
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +0 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +29 -28
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/index.d.ts +0 -1
- package/dist/billing/modules/analytics/index.js +1 -2
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +0 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +8 -9
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/index.d.ts +0 -1
- package/dist/billing/modules/analytics/pages/index.js +1 -1
- package/dist/billing/modules/billing/hooks/index.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/index.js +5 -4
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.js +1 -2
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.js +1 -2
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.js.map +1 -1
- package/dist/billing/modules/billing/hooks/usePayments.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.js +1 -2
- package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useTransactions.js +30 -31
- package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -1
- package/dist/billing/modules/billing/index.d.ts +0 -1
- package/dist/billing/modules/billing/index.js +15 -15
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +11 -12
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +53 -59
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +81 -87
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +11 -12
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +51 -54
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +33 -34
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +92 -93
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +38 -39
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -30
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/index.d.ts +0 -1
- package/dist/billing/modules/billing/pages/index.js +10 -9
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -2
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -2
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.js +1 -2
- package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -1
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.js +1 -2
- package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts +0 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +35 -32
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.js +1 -2
- package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +0 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +1 -2
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +1 -2
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts +0 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.js +5 -3
- package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +0 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.js +35 -41
- package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -2
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +1 -2
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts +0 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js +5 -6
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js.map +1 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts +0 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +7 -8
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/index.d.ts +0 -1
- package/dist/billing/modules/checkout/components/index.js +12 -11
- package/dist/billing/modules/checkout/hooks/index.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/index.js +5 -4
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +182 -195
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +33 -32
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +1 -2
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +1 -2
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts +4 -8
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js +1 -2
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js.map +1 -1
- package/dist/billing/modules/checkout/index.d.ts +0 -1
- package/dist/billing/modules/checkout/index.js +19 -19
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +0 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +730 -732
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/checkout/pages/index.d.ts +0 -1
- package/dist/billing/modules/checkout/pages/index.js +1 -1
- package/dist/billing/modules/checkout/types/index.d.ts +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.js +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -1
- package/dist/billing/modules/coupons/index.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +5 -6
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +15 -13
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +12 -10
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +7 -11
- package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/index.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/index.js +5 -4
- package/dist/billing/modules/credits/hooks/index.d.ts +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.d.ts +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.js +20 -21
- package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -1
- package/dist/billing/modules/credits/index.d.ts +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +19 -24
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +26 -27
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +54 -52
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +37 -38
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/index.d.ts +0 -1
- package/dist/billing/modules/credits/pages/index.js +5 -4
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -3
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +35 -43
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js +1 -2
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1 -2
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +2 -5
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -2
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/index.js +7 -6
- package/dist/billing/modules/dashboard/hooks/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/index.js +3 -2
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +2 -3
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.js +2 -3
- package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -1
- package/dist/billing/modules/dashboard/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/index.js +11 -10
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +0 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +266 -264
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/pages/index.js +1 -1
- package/dist/billing/modules/discounts/index.d.ts +0 -1
- package/dist/billing/modules/discounts/index.js +1 -2
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +0 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +169 -176
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/index.d.ts +0 -1
- package/dist/billing/modules/discounts/pages/index.js +1 -1
- package/dist/billing/modules/earnings/api.d.ts +0 -1
- package/dist/billing/modules/earnings/api.js +66 -67
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/index.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +17 -17
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +188 -189
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +111 -111
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +29 -30
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +103 -104
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/earnings/payoutAccountStatus.d.ts +0 -1
- package/dist/billing/modules/earnings/payoutAccountStatus.js +1 -2
- package/dist/billing/modules/earnings/payoutAccountStatus.js.map +1 -1
- package/dist/billing/modules/plans/constants/enterprise.d.ts +0 -1
- package/dist/billing/modules/plans/constants/enterprise.js +1 -2
- package/dist/billing/modules/plans/constants/enterprise.js.map +1 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.d.ts +0 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.js +1 -2
- package/dist/billing/modules/plans/constants/featuredQuotas.js.map +1 -1
- package/dist/billing/modules/plans/hooks/index.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/index.js +3 -2
- package/dist/billing/modules/plans/hooks/usePlans.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/usePlans.js +1 -2
- package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -1
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/useQuotas.js +1 -2
- package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -1
- package/dist/billing/modules/plans/index.d.ts +0 -1
- package/dist/billing/modules/plans/index.js +11 -11
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +12 -15
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +38 -39
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +10 -11
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +40 -41
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +15 -16
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +18 -19
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +100 -101
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/index.d.ts +0 -1
- package/dist/billing/modules/plans/pages/index.js +8 -7
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts +0 -1
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.js +1 -2
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.js.map +1 -1
- package/dist/billing/modules/plans/utils/planSelector.d.ts +0 -1
- package/dist/billing/modules/plans/utils/planSelector.js +1 -2
- package/dist/billing/modules/plans/utils/planSelector.js.map +1 -1
- package/dist/billing/modules/promotions/index.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +5 -6
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +5 -6
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/index.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/index.js +3 -2
- package/dist/billing/modules/quota/hooks/index.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/index.js +1 -1
- package/dist/billing/modules/quota/hooks/useQuota.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +1 -2
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -1
- package/dist/billing/modules/quota/index.d.ts +0 -1
- package/dist/billing/modules/quota/index.js +8 -8
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +12 -15
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +3 -3
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +13 -14
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +9 -10
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +12 -13
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +16 -17
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/index.d.ts +0 -1
- package/dist/billing/modules/quota/pages/index.js +6 -5
- package/dist/billing/modules/quota/utils/quotaSelector.d.ts +0 -1
- package/dist/billing/modules/quota/utils/quotaSelector.js +1 -2
- package/dist/billing/modules/quota/utils/quotaSelector.js.map +1 -1
- package/dist/billing/modules/settings/index.d.ts +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +12 -13
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +0 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +32 -32
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/index.d.ts +0 -1
- package/dist/billing/modules/settings/pages/index.js +3 -2
- package/dist/billing/modules/store/graphql/index.d.ts +0 -1
- package/dist/billing/modules/store/index.d.ts +0 -1
- package/dist/billing/modules/store/index.js +1 -2
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +0 -1
- package/dist/billing/modules/store/pages/StoreCheckoutPage.js +1 -2
- package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +0 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +9 -11
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/hooks/index.js +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +0 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +1 -2
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/index.js +6 -6
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +311 -312
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +61 -62
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +30 -31
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/index.js +4 -3
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts +0 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +17 -18
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
- package/dist/billing/modules/usage/hooks/index.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +72 -73
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js +12 -13
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js.map +1 -1
- package/dist/billing/modules/usage/index.d.ts +0 -1
- package/dist/billing/modules/usage/index.js +1 -2
- package/dist/billing/modules/usage/pages/UsagePage.d.ts +0 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +229 -227
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/modules/usage/pages/index.d.ts +0 -1
- package/dist/billing/modules/usage/pages/index.js +1 -1
- package/dist/billing/modules/usage/utils/aiSpend.d.ts +0 -1
- package/dist/billing/modules/usage/utils/aiSpend.js +2 -3
- package/dist/billing/modules/usage/utils/aiSpend.js.map +1 -1
- package/dist/billing/providers/BillingProvider.d.ts +0 -1
- package/dist/billing/providers/BillingProvider.js +3 -4
- package/dist/billing/providers/BillingProvider.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.d.ts +0 -1
- package/dist/billing/shared/components/AccessDenied.js +1 -2
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.d.ts +0 -1
- package/dist/billing/shared/components/ActorIdentity.js +2 -3
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +0 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +1 -2
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
- package/dist/billing/shared/components/EmptyState.d.ts +0 -1
- package/dist/billing/shared/components/EmptyState.js +1 -2
- package/dist/billing/shared/components/EmptyState.js.map +1 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +0 -1
- package/dist/billing/shared/components/PageHeader.d.ts +0 -1
- package/dist/billing/shared/components/PageHeader.js +1 -2
- package/dist/billing/shared/components/PageHeader.js.map +1 -1
- package/dist/billing/shared/components/PushPermissionNudge.d.ts +0 -1
- package/dist/billing/shared/components/PushPermissionNudge.js +2 -3
- package/dist/billing/shared/components/PushPermissionNudge.js.map +1 -1
- package/dist/billing/shared/components/ServerError.d.ts +0 -1
- package/dist/billing/shared/components/ServerError.js +1 -2
- package/dist/billing/shared/components/ServerError.js.map +1 -1
- package/dist/billing/shared/components/StatCard.d.ts +0 -1
- package/dist/billing/shared/components/StatCard.js +1 -2
- package/dist/billing/shared/components/StatCard.js.map +1 -1
- package/dist/billing/shared/components/index.d.ts +0 -1
- package/dist/billing/shared/components/index.js +8 -7
- package/dist/billing/shared/hooks/index.d.ts +0 -1
- package/dist/billing/shared/hooks/index.js +1 -1
- package/dist/billing/shared/hooks/useActorProfiles.d.ts +0 -1
- package/dist/billing/shared/hooks/useActorProfiles.js +4 -8
- package/dist/billing/shared/hooks/useActorProfiles.js.map +1 -1
- package/dist/billing/shared/hooks/useTr.d.ts +0 -1
- package/dist/billing/shared/hooks/useTr.js +1 -2
- package/dist/billing/shared/hooks/useTr.js.map +1 -1
- package/dist/billing/shared/index.d.ts +0 -1
- package/dist/billing/shared/types/graphql.d.ts +0 -1
- package/dist/billing/shared/types/graphql.js +1 -2
- package/dist/billing/shared/types/graphql.js.map +1 -1
- package/dist/billing/shared/types/index.d.ts +0 -1
- package/dist/billing/shared/ui/Card.d.ts +1 -2
- package/dist/billing/shared/ui/Card.js +1 -2
- package/dist/billing/shared/ui/Card.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.d.ts +1 -2
- package/dist/billing/shared/ui/MetricCard.js +1 -2
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/dist/billing/shared/ui/ProgressBar.d.ts +1 -2
- package/dist/billing/shared/ui/ProgressBar.js +1 -2
- package/dist/billing/shared/ui/ProgressBar.js.map +1 -1
- package/dist/billing/shared/ui/SectionHeader.d.ts +1 -2
- package/dist/billing/shared/ui/StatusPill.d.ts +1 -2
- package/dist/billing/shared/ui/StatusPill.js +1 -2
- package/dist/billing/shared/ui/StatusPill.js.map +1 -1
- package/dist/billing/shared/ui/index.d.ts +0 -1
- package/dist/billing/shared/ui/index.js +5 -4
- package/dist/billing/shared/utils/directActivityGraphql.d.ts +2 -1
- package/dist/billing/shared/utils/directActivityGraphql.js +1 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts +2 -1
- package/dist/billing/shared/utils/directBillingGraphql.js +3 -3
- package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
- package/dist/billing/shared/utils/error.d.ts +0 -1
- package/dist/billing/shared/utils/error.js +1 -2
- package/dist/billing/shared/utils/error.js.map +1 -1
- package/dist/billing/shared/utils/format.d.ts +0 -1
- package/dist/billing/shared/utils/format.js +1 -2
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts +2 -1
- package/dist/billing/shared/utils/gatewayGraphql.js +4 -4
- package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
- package/dist/billing/shared/utils/index.d.ts +0 -1
- package/dist/billing/shared/utils/index.js +9 -8
- package/dist/billing/shared/utils/navigation.d.ts +0 -1
- package/dist/billing/shared/utils/navigation.js +1 -2
- package/dist/billing/shared/utils/navigation.js.map +1 -1
- package/dist/billing/shared/utils/paymentTheme.d.ts +0 -1
- package/dist/billing/shared/utils/paymentTheme.js +2 -3
- package/dist/billing/shared/utils/paymentTheme.js.map +1 -1
- package/dist/billing/shared/utils/pinnedRequest.d.ts +48 -0
- package/dist/billing/shared/utils/pinnedRequest.js +63 -0
- package/dist/billing/shared/utils/pinnedRequest.js.map +1 -0
- package/dist/billing/shared/utils/planFeatureQuantity.d.ts +0 -1
- package/dist/billing/shared/utils/planFeatureQuantity.js +2 -3
- package/dist/billing/shared/utils/planFeatureQuantity.js.map +1 -1
- package/dist/billing/shared/utils/status.d.ts +0 -1
- package/dist/billing/shared/utils/status.js +24 -25
- package/dist/billing/shared/utils/status.js.map +1 -1
- package/dist/billing/shared/utils/tokens.d.ts +0 -1
- package/dist/billing/shared/utils/tokens.js +1 -2
- package/dist/billing/shared/utils/tokens.js.map +1 -1
- package/dist/billing/translations/en.d.ts +0 -1
- package/dist/billing/types/index.d.ts +0 -1
- package/dist/dev/main.d.ts +0 -1
- package/dist/generated/global-operations.d.ts +3252 -3206
- package/dist/generated/global-operations.js +445 -422
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/global-types.js +1 -2
- package/dist/generated/global-types.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +76 -47
- package/dist/generated/wspace-operations.js +2 -3
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/dist/node_modules/@capacitor/core/dist/index.js +12 -14
- package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +75 -69
- package/dist/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +66 -55
- package/dist/billing/BillingAdminRoutes.d.ts.map +0 -1
- package/dist/billing/BillingRoot.d.ts.map +0 -1
- package/dist/billing/BillingUserRoutes.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingNavigate.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingPermissions.d.ts.map +0 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +0 -1
- package/dist/billing/hooks/useProducts.d.ts.map +0 -1
- package/dist/billing/index.d.ts.map +0 -1
- package/dist/billing/lib/native-purchases.d.ts.map +0 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +0 -1
- package/dist/billing/modules/addons/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/api.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/index.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/index.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +0 -1
- package/dist/billing/modules/billing/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts.map +0 -1
- package/dist/billing/modules/checkout/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/types/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +0 -1
- package/dist/billing/modules/coupons/index.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +0 -1
- package/dist/billing/modules/credits/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/api.d.ts.map +0 -1
- package/dist/billing/modules/earnings/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/payoutAccountStatus.d.ts.map +0 -1
- package/dist/billing/modules/plans/constants/enterprise.d.ts.map +0 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +0 -1
- package/dist/billing/modules/plans/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts.map +0 -1
- package/dist/billing/modules/plans/utils/planSelector.d.ts.map +0 -1
- package/dist/billing/modules/promotions/index.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +0 -1
- package/dist/billing/modules/quota/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/utils/quotaSelector.d.ts.map +0 -1
- package/dist/billing/modules/settings/index.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/store/graphql/index.d.ts.map +0 -1
- package/dist/billing/modules/store/index.d.ts.map +0 -1
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts.map +0 -1
- package/dist/billing/modules/usage/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/utils/aiSpend.d.ts.map +0 -1
- package/dist/billing/providers/BillingProvider.d.ts.map +0 -1
- package/dist/billing/shared/components/AccessDenied.d.ts.map +0 -1
- package/dist/billing/shared/components/ActorIdentity.d.ts.map +0 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/EmptyState.d.ts.map +0 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/PageHeader.d.ts.map +0 -1
- package/dist/billing/shared/components/PushPermissionNudge.d.ts.map +0 -1
- package/dist/billing/shared/components/ServerError.d.ts.map +0 -1
- package/dist/billing/shared/components/StatCard.d.ts.map +0 -1
- package/dist/billing/shared/components/index.d.ts.map +0 -1
- package/dist/billing/shared/hooks/index.d.ts.map +0 -1
- package/dist/billing/shared/hooks/useActorProfiles.d.ts.map +0 -1
- package/dist/billing/shared/hooks/useTr.d.ts.map +0 -1
- package/dist/billing/shared/index.d.ts.map +0 -1
- package/dist/billing/shared/types/graphql.d.ts.map +0 -1
- package/dist/billing/shared/types/index.d.ts.map +0 -1
- package/dist/billing/shared/ui/Card.d.ts.map +0 -1
- package/dist/billing/shared/ui/MetricCard.d.ts.map +0 -1
- package/dist/billing/shared/ui/ProgressBar.d.ts.map +0 -1
- package/dist/billing/shared/ui/SectionHeader.d.ts.map +0 -1
- package/dist/billing/shared/ui/StatusPill.d.ts.map +0 -1
- package/dist/billing/shared/ui/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/error.d.ts.map +0 -1
- package/dist/billing/shared/utils/format.d.ts.map +0 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/navigation.d.ts.map +0 -1
- package/dist/billing/shared/utils/paymentTheme.d.ts.map +0 -1
- package/dist/billing/shared/utils/planFeatureQuantity.d.ts.map +0 -1
- package/dist/billing/shared/utils/status.d.ts.map +0 -1
- package/dist/billing/shared/utils/tokens.d.ts.map +0 -1
- package/dist/billing/translations/en.d.ts.map +0 -1
- package/dist/billing/types/index.d.ts.map +0 -1
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1,81 +1,76 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useBillingNavigate as e } from "../../../hooks/useBillingNavigate.js";
|
|
2
2
|
import { StatusPill as t } from "../../../shared/ui/StatusPill.js";
|
|
3
|
+
import { useInvoiceMutations as n, usePaginatedInvoices as r } from "../hooks/useInvoices.js";
|
|
4
|
+
import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
|
|
5
|
+
import { useGetBillingAccountsByOrgQuery as a } from "../../../../generated/global-operations.js";
|
|
6
|
+
import { formatCurrency as o, formatDate as s, formatInvoiceNumber as c, formatInvoiceStatus as l } from "../../../shared/utils/format.js";
|
|
7
|
+
import { withBillingAccountId as u } from "../../../shared/utils/navigation.js";
|
|
8
|
+
import { getInvoiceStatusColor as d } from "../../../shared/utils/status.js";
|
|
3
9
|
import "../../../shared/ui/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useBillingPermissions as s } from "../../../hooks/useBillingPermissions.js";
|
|
7
|
-
import { useGetBillingAccountsByOrgQuery as c } from "../../../../generated/global-operations.js";
|
|
8
|
-
import { nativeConfirm as l, nativeImpact as u, nativeNotify as d } from "../../../../utils/nativeBridge.js";
|
|
9
|
-
import { useBillingNavigate as f } from "../../../hooks/useBillingNavigate.js";
|
|
10
|
-
import { withBillingAccountId as p } from "../../../shared/utils/navigation.js";
|
|
11
|
-
import { useInvoiceMutations as m, usePaginatedInvoices as h } from "../hooks/useInvoices.js";
|
|
10
|
+
import { useTr as f } from "../../../shared/hooks/useTr.js";
|
|
11
|
+
import { nativeConfirm as p, nativeImpact as m, nativeNotify as h } from "../../../../utils/nativeBridge.js";
|
|
12
12
|
import { useCallback as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
13
13
|
import { RotateCcw as x } from "lucide-react";
|
|
14
14
|
import { useSearchParams as S } from "react-router";
|
|
15
15
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
16
16
|
import { IllustratedEmptyState as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
|
|
17
|
-
|
|
17
|
+
// src/billing/modules/billing/pages/InvoicesListPage.tsx
|
|
18
18
|
var O = () => {
|
|
19
|
-
let t =
|
|
19
|
+
let t = f(), o = e(), s = i(), [c] = S(), d = c.get("billingAccountId") ?? void 0, { data: p } = a({ fetchPolicy: "cache-first" }), m = v(() => p?.getBillingAccountsByOrg ?? [], [p]), { payInvoice: O, voidInvoice: A } = n(), [j, M] = b(null), [N, P] = b(null), [F, I] = b(d);
|
|
20
20
|
_(() => {
|
|
21
|
-
I(
|
|
22
|
-
}, [
|
|
23
|
-
let L = v(() => (
|
|
21
|
+
I(d);
|
|
22
|
+
}, [d]);
|
|
23
|
+
let L = v(() => (m.find((e) => e.isDefault) ?? m[0])?.id ?? void 0, [m]), R = F === void 0 ? L ?? null : F, [z, B] = b("all"), [V, H] = b(""), [U, W] = b(""), [G, K] = b(1), q = y(null);
|
|
24
24
|
_(() => (q.current && clearTimeout(q.current), q.current = setTimeout(() => {
|
|
25
25
|
W(V), K(1);
|
|
26
26
|
}, 400), () => {
|
|
27
27
|
q.current && clearTimeout(q.current);
|
|
28
28
|
}), [V]);
|
|
29
|
-
let { invoices: J, totalPages: Y, isLoading: X, error: Z, refetch: Q } =
|
|
29
|
+
let { invoices: J, totalPages: Y, isLoading: X, error: Z, refetch: Q } = r({
|
|
30
30
|
billingAccountId: R ?? void 0,
|
|
31
31
|
status: z === "all" ? void 0 : z,
|
|
32
32
|
search: U || void 0,
|
|
33
33
|
page: G,
|
|
34
34
|
pageSize: 20
|
|
35
35
|
}), $ = g(async (e) => {
|
|
36
|
-
let t = e.billingAccountId, n = t ?
|
|
37
|
-
if (!t)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} catch (e) {
|
|
52
|
-
M(e instanceof Error ? e.message : "Failed to pay invoice"), d("error");
|
|
53
|
-
} finally {
|
|
54
|
-
P(null);
|
|
36
|
+
let t = e.billingAccountId, n = t ? m.find((e) => e.id === t)?.defaultPaymentMethod : void 0;
|
|
37
|
+
if (!t) M("No billing account context");
|
|
38
|
+
else if (!n) M("Add and set a default payment method before paying this invoice.");
|
|
39
|
+
else {
|
|
40
|
+
M(null), P({
|
|
41
|
+
invoiceId: e.id,
|
|
42
|
+
action: "pay"
|
|
43
|
+
});
|
|
44
|
+
try {
|
|
45
|
+
await O(e.id, n, t), await Q(), h("success");
|
|
46
|
+
} catch (e) {
|
|
47
|
+
M(e instanceof Error ? e.message : "Failed to pay invoice"), h("error");
|
|
48
|
+
} finally {
|
|
49
|
+
P(null);
|
|
50
|
+
}
|
|
55
51
|
}
|
|
56
52
|
}, [
|
|
57
|
-
|
|
53
|
+
m,
|
|
58
54
|
O,
|
|
59
55
|
Q
|
|
60
56
|
]), ee = g(async (e) => {
|
|
61
57
|
let t = e.billingAccountId;
|
|
62
|
-
if (!t)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
P(null);
|
|
58
|
+
if (!t) M("No billing account context");
|
|
59
|
+
else {
|
|
60
|
+
M(null), P({
|
|
61
|
+
invoiceId: e.id,
|
|
62
|
+
action: "void"
|
|
63
|
+
});
|
|
64
|
+
try {
|
|
65
|
+
await A(e.id, t), await Q(), h("success");
|
|
66
|
+
} catch (e) {
|
|
67
|
+
M(e instanceof Error ? e.message : "Failed to void invoice"), h("error");
|
|
68
|
+
} finally {
|
|
69
|
+
P(null);
|
|
70
|
+
}
|
|
76
71
|
}
|
|
77
72
|
}, [Q, A]);
|
|
78
|
-
return
|
|
73
|
+
return s.canViewInvoices ? X && J.length === 0 ? /* @__PURE__ */ T("div", {
|
|
79
74
|
className: "space-y-6 p-6",
|
|
80
75
|
children: [/* @__PURE__ */ w("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ w("div", {
|
|
81
76
|
className: "space-y-3",
|
|
@@ -154,10 +149,10 @@ var O = () => {
|
|
|
154
149
|
className: "flex items-center gap-3",
|
|
155
150
|
children: [/* @__PURE__ */ T("button", {
|
|
156
151
|
type: "button",
|
|
157
|
-
onClick: () =>
|
|
152
|
+
onClick: () => o("/refunds"),
|
|
158
153
|
className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
|
|
159
154
|
children: [/* @__PURE__ */ w(x, { className: "size-4" }), t("billing.invoices.myRefunds", "My Refunds")]
|
|
160
|
-
}),
|
|
155
|
+
}), m.length > 1 && /* @__PURE__ */ T("div", {
|
|
161
156
|
className: "flex items-center gap-2",
|
|
162
157
|
children: [/* @__PURE__ */ w("label", {
|
|
163
158
|
className: "text-sm text-text-secondary whitespace-nowrap",
|
|
@@ -169,7 +164,7 @@ var O = () => {
|
|
|
169
164
|
children: [/* @__PURE__ */ w("option", {
|
|
170
165
|
value: "",
|
|
171
166
|
children: t("billing.invoices.allAccounts", "All Accounts")
|
|
172
|
-
}),
|
|
167
|
+
}), m.map((e) => /* @__PURE__ */ T("option", {
|
|
173
168
|
value: e.id ?? "",
|
|
174
169
|
children: [e.name ?? e.email ?? e.id, e.isDefault ? t("billing.invoices.defaultSuffix", " (Default)") : ""]
|
|
175
170
|
}, e.id ?? ""))]
|
|
@@ -193,7 +188,7 @@ var O = () => {
|
|
|
193
188
|
B(e), K(1);
|
|
194
189
|
},
|
|
195
190
|
className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${z === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
|
|
196
|
-
children: e === "all" ? "All" :
|
|
191
|
+
children: e === "all" ? "All" : l(e)
|
|
197
192
|
}, e))
|
|
198
193
|
}), /* @__PURE__ */ T("div", {
|
|
199
194
|
className: "relative flex-1 min-w-0 w-full sm:max-w-md",
|
|
@@ -243,7 +238,7 @@ var O = () => {
|
|
|
243
238
|
className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
244
239
|
children: t("billing.common.status", "Status")
|
|
245
240
|
}),
|
|
246
|
-
!R &&
|
|
241
|
+
!R && m.length > 1 && /* @__PURE__ */ w("th", {
|
|
247
242
|
className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden lg:table-cell",
|
|
248
243
|
children: t("billing.common.account", "Account")
|
|
249
244
|
}),
|
|
@@ -268,15 +263,15 @@ var O = () => {
|
|
|
268
263
|
className: "divide-y divide-border-subtle",
|
|
269
264
|
children: J.map((e) => /* @__PURE__ */ w(k, {
|
|
270
265
|
invoice: e,
|
|
271
|
-
onView: () =>
|
|
272
|
-
canPay:
|
|
273
|
-
canVoid:
|
|
266
|
+
onView: () => o(u(`/invoices/${e.id}`, e.billingAccountId)),
|
|
267
|
+
canPay: s.canPayInvoice,
|
|
268
|
+
canVoid: s.canVoidInvoice,
|
|
274
269
|
onPay: $,
|
|
275
270
|
onVoid: ee,
|
|
276
271
|
isProcessing: N?.invoiceId === e.id,
|
|
277
272
|
processingAction: N?.invoiceId === e.id ? N.action : void 0,
|
|
278
|
-
showAccount: !R &&
|
|
279
|
-
accountName:
|
|
273
|
+
showAccount: !R && m.length > 1,
|
|
274
|
+
accountName: m.find((t) => t.id === e.billingAccountId)?.name ?? null
|
|
280
275
|
}, e.id))
|
|
281
276
|
})]
|
|
282
277
|
})
|
|
@@ -337,38 +332,38 @@ var O = () => {
|
|
|
337
332
|
]
|
|
338
333
|
})
|
|
339
334
|
});
|
|
340
|
-
}, k = ({ invoice:
|
|
341
|
-
let y =
|
|
342
|
-
|
|
343
|
-
let
|
|
335
|
+
}, k = ({ invoice: e, onView: n, onPay: r, onVoid: i, canPay: a, canVoid: u, isProcessing: h, processingAction: g, showAccount: _ = !1, accountName: v }) => {
|
|
336
|
+
let y = f(), [x, S] = b(!1), C = d(e.status), E = e.status === "OPEN", D = e.status === "DRAFT", O = async () => {
|
|
337
|
+
m("medium");
|
|
338
|
+
let t = await p({
|
|
344
339
|
title: "Void invoice",
|
|
345
340
|
message: "Are you sure you want to void this invoice?",
|
|
346
341
|
okButtonTitle: "Void",
|
|
347
342
|
cancelButtonTitle: "Cancel"
|
|
348
343
|
});
|
|
349
|
-
|
|
344
|
+
t === !0 ? await i(e) : t === null && S(!0);
|
|
350
345
|
}, k = async () => {
|
|
351
|
-
await
|
|
352
|
-
}, A =
|
|
346
|
+
await i(e), S(!1);
|
|
347
|
+
}, A = e.metadata?.invoicePdfBackupUrl;
|
|
353
348
|
return /* @__PURE__ */ T("tr", {
|
|
354
349
|
className: "hover:bg-bg-sunken transition-colors",
|
|
355
350
|
children: [
|
|
356
351
|
/* @__PURE__ */ T("td", {
|
|
357
352
|
className: "p-4",
|
|
358
|
-
children: [
|
|
359
|
-
href:
|
|
353
|
+
children: [e.invoiceUrl ? /* @__PURE__ */ w("a", {
|
|
354
|
+
href: e.invoiceUrl,
|
|
360
355
|
target: "_blank",
|
|
361
356
|
rel: "noopener noreferrer",
|
|
362
357
|
className: "font-medium text-text-primary hover:text-text-link transition-colors",
|
|
363
|
-
children:
|
|
358
|
+
children: c(e.invoiceNumber)
|
|
364
359
|
}) : /* @__PURE__ */ w("button", {
|
|
365
360
|
type: "button",
|
|
366
|
-
onClick:
|
|
361
|
+
onClick: n,
|
|
367
362
|
className: "font-medium text-text-primary hover:text-text-link transition-colors",
|
|
368
|
-
children:
|
|
369
|
-
}), (
|
|
363
|
+
children: c(e.invoiceNumber)
|
|
364
|
+
}), (e.itemDescription ?? e.subscription?.plan?.name) && /* @__PURE__ */ w("p", {
|
|
370
365
|
className: "text-sm text-text-secondary mt-0.5",
|
|
371
|
-
children:
|
|
366
|
+
children: e.itemDescription ?? e.subscription?.plan?.name
|
|
372
367
|
})]
|
|
373
368
|
}),
|
|
374
369
|
/* @__PURE__ */ w("td", {
|
|
@@ -376,7 +371,7 @@ var O = () => {
|
|
|
376
371
|
children: /* @__PURE__ */ w(t, {
|
|
377
372
|
status: C,
|
|
378
373
|
dot: !0,
|
|
379
|
-
children:
|
|
374
|
+
children: l(e.status)
|
|
380
375
|
})
|
|
381
376
|
}),
|
|
382
377
|
_ && /* @__PURE__ */ w("td", {
|
|
@@ -391,35 +386,35 @@ var O = () => {
|
|
|
391
386
|
}),
|
|
392
387
|
/* @__PURE__ */ w("td", {
|
|
393
388
|
className: "p-4 text-sm text-text-secondary hidden sm:table-cell",
|
|
394
|
-
children:
|
|
389
|
+
children: s(e.createdAt, "short")
|
|
395
390
|
}),
|
|
396
391
|
/* @__PURE__ */ w("td", {
|
|
397
392
|
className: "p-4 text-sm text-text-secondary hidden md:table-cell",
|
|
398
|
-
children:
|
|
393
|
+
children: e.dueDate ? s(e.dueDate, "short") : "—"
|
|
399
394
|
}),
|
|
400
395
|
/* @__PURE__ */ w("td", {
|
|
401
396
|
className: "p-4 text-right font-medium text-text-primary",
|
|
402
|
-
children:
|
|
397
|
+
children: o(e.total, e.currency)
|
|
403
398
|
}),
|
|
404
399
|
/* @__PURE__ */ w("td", {
|
|
405
400
|
className: "p-4 text-right",
|
|
406
401
|
children: /* @__PURE__ */ T("div", {
|
|
407
402
|
className: "relative flex items-center justify-end gap-2",
|
|
408
403
|
children: [
|
|
409
|
-
|
|
410
|
-
href:
|
|
404
|
+
e.invoiceUrl ? /* @__PURE__ */ w("a", {
|
|
405
|
+
href: e.invoiceUrl,
|
|
411
406
|
target: "_blank",
|
|
412
407
|
rel: "noopener noreferrer",
|
|
413
408
|
className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
|
|
414
409
|
children: y("billing.common.view", "View")
|
|
415
410
|
}) : /* @__PURE__ */ w("button", {
|
|
416
411
|
type: "button",
|
|
417
|
-
onClick:
|
|
412
|
+
onClick: n,
|
|
418
413
|
className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
|
|
419
414
|
children: y("billing.common.view", "View")
|
|
420
415
|
}),
|
|
421
|
-
|
|
422
|
-
href:
|
|
416
|
+
e.pdfUrl && /* @__PURE__ */ w("a", {
|
|
417
|
+
href: e.pdfUrl,
|
|
423
418
|
target: "_blank",
|
|
424
419
|
rel: "noopener noreferrer",
|
|
425
420
|
className: "px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200",
|
|
@@ -432,14 +427,14 @@ var O = () => {
|
|
|
432
427
|
className: "px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200",
|
|
433
428
|
children: y("billing.common.pdfBackup", "PDF (backup)")
|
|
434
429
|
}),
|
|
435
|
-
E &&
|
|
430
|
+
E && a && /* @__PURE__ */ w("button", {
|
|
436
431
|
type: "button",
|
|
437
|
-
onClick: () => void
|
|
432
|
+
onClick: () => void r(e),
|
|
438
433
|
disabled: h,
|
|
439
434
|
className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50",
|
|
440
435
|
children: h && g === "pay" ? y("billing.common.paying", "Paying…") : y("billing.common.pay", "Pay")
|
|
441
436
|
}),
|
|
442
|
-
(E || D) &&
|
|
437
|
+
(E || D) && u && /* @__PURE__ */ w("button", {
|
|
443
438
|
type: "button",
|
|
444
439
|
onClick: () => void O(),
|
|
445
440
|
disabled: h,
|
|
@@ -473,7 +468,6 @@ var O = () => {
|
|
|
473
468
|
]
|
|
474
469
|
});
|
|
475
470
|
};
|
|
476
|
-
//#endregion
|
|
477
471
|
export { O as InvoicesListPage };
|
|
478
472
|
|
|
479
473
|
//# sourceMappingURL=InvoicesListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoicesListPage.js","names":[],"sources":["../../../../../src/billing/modules/billing/pages/InvoicesListPage.tsx"],"sourcesContent":["/**\n * Billing Module - Invoices List Page\n * Displays all invoices for the current tenant\n */\n\nimport { useEffect, useState, useMemo, useRef, useCallback, type FC } from 'react';\nimport { RotateCcw } from 'lucide-react';\nimport { useSearchParams } from 'react-router';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useInvoiceMutations, usePaginatedInvoices } from '../hooks/useInvoices';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport {\n useGetBillingAccountsByOrgQuery,\n type GetBillingAccountsByOrgQuery,\n} from '../../../../generated/global-operations';\n\ntype BillingAccountItem = GetBillingAccountsByOrgQuery['getBillingAccountsByOrg'][number];\nimport {\n formatCurrency,\n formatDate,\n formatInvoiceStatus,\n formatInvoiceNumber,\n} from '../../../shared/utils/format';\nimport { withBillingAccountId } from '../../../shared/utils/navigation';\nimport { getInvoiceStatusColor } from '../../../shared/utils/status';\nimport { StatusPill } from '../../../shared/ui';\nimport type { Invoice, InvoiceStatus } from '../../../shared/types';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\n\ntype FilterStatus = 'all' | InvoiceStatus;\ntype InvoiceAction = { invoiceId: string; action: 'pay' | 'void' } | null;\n\nexport const InvoicesListPage: FC = () => {\n const tr = useTr();\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [searchParams] = useSearchParams();\n const urlBillingAccountId = searchParams.get('billingAccountId') ?? undefined;\n\n const { data: accountsData } = useGetBillingAccountsByOrgQuery({ fetchPolicy: 'cache-first' });\n const billingAccounts = useMemo(\n () => accountsData?.getBillingAccountsByOrg ?? [],\n [accountsData]\n );\n const { payInvoice, voidInvoice } = useInvoiceMutations();\n const [actionError, setActionError] = useState<string | null>(null);\n const [activeAction, setActiveAction] = useState<InvoiceAction>(null);\n\n // undefined = user hasn't explicitly chosen yet → auto-pick default\n // null = user explicitly chose \"All Accounts\"\n // string = user explicitly chose a specific account\n const [explicitAccountId, setExplicitAccountId] = useState<string | null | undefined>(\n urlBillingAccountId\n );\n\n useEffect(() => {\n setExplicitAccountId(urlBillingAccountId);\n }, [urlBillingAccountId]);\n\n const defaultAccountId = useMemo(\n () =>\n (billingAccounts.find((a: BillingAccountItem) => a.isDefault) ?? billingAccounts[0])?.id ??\n undefined,\n [billingAccounts]\n );\n\n // Resolved selection: explicit choice wins; before any choice, use the default\n const selectedAccountId: string | null =\n explicitAccountId !== undefined ? explicitAccountId : (defaultAccountId ?? null);\n\n const [filterStatus, setFilterStatus] = useState<FilterStatus>('all');\n const [searchQuery, setSearchQuery] = useState('');\n const [debouncedSearch, setDebouncedSearch] = useState('');\n const [page, setPage] = useState(1);\n const debounceTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (debounceTimer.current) clearTimeout(debounceTimer.current);\n debounceTimer.current = setTimeout(() => {\n setDebouncedSearch(searchQuery);\n setPage(1);\n }, 400);\n return () => {\n if (debounceTimer.current) clearTimeout(debounceTimer.current);\n };\n }, [searchQuery]);\n\n const { invoices, totalPages, isLoading, error, refetch } = usePaginatedInvoices({\n billingAccountId: selectedAccountId ?? undefined,\n status: filterStatus !== 'all' ? (filterStatus as InvoiceStatus) : undefined,\n search: debouncedSearch || undefined,\n page,\n pageSize: 20,\n });\n\n const handlePayInvoice = useCallback(\n async (invoice: Invoice): Promise<void> => {\n const billingAccountId = invoice.billingAccountId;\n const paymentMethodId = billingAccountId\n ? billingAccounts.find((account: BillingAccountItem) => account.id === billingAccountId)\n ?.defaultPaymentMethod\n : undefined;\n\n if (!billingAccountId) {\n setActionError('No billing account context');\n return;\n }\n if (!paymentMethodId) {\n setActionError('Add and set a default payment method before paying this invoice.');\n return;\n }\n\n setActionError(null);\n setActiveAction({ invoiceId: invoice.id, action: 'pay' });\n try {\n await payInvoice(invoice.id, paymentMethodId, billingAccountId);\n await refetch();\n void nativeNotify('success');\n } catch (actionErrorValue) {\n setActionError(\n actionErrorValue instanceof Error ? actionErrorValue.message : 'Failed to pay invoice'\n );\n void nativeNotify('error');\n } finally {\n setActiveAction(null);\n }\n },\n [billingAccounts, payInvoice, refetch]\n );\n\n const handleVoidInvoice = useCallback(\n async (invoice: Invoice): Promise<void> => {\n const billingAccountId = invoice.billingAccountId;\n if (!billingAccountId) {\n setActionError('No billing account context');\n return;\n }\n\n setActionError(null);\n setActiveAction({ invoiceId: invoice.id, action: 'void' });\n try {\n await voidInvoice(invoice.id, billingAccountId);\n await refetch();\n void nativeNotify('success');\n } catch (actionErrorValue) {\n setActionError(\n actionErrorValue instanceof Error ? actionErrorValue.message : 'Failed to void invoice'\n );\n void nativeNotify('error');\n } finally {\n setActiveAction(null);\n }\n },\n [refetch, voidInvoice]\n );\n\n // Permission check\n if (!permissions.canViewInvoices) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-2\">\n <div className=\"size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center\">\n <svg\n className=\"size-6 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary max-w-sm\">\n {tr('billing.invoices.noViewPermission', \"You don't have permission to view invoices.\")}\n </p>\n </div>\n </div>\n );\n }\n\n // Loading state\n if (isLoading && invoices.length === 0) {\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"h-8 w-48 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"space-y-3\">\n {[1, 2, 3, 4, 5].map((i) => (\n <div key={i} className=\"border border-border-subtle rounded-lg p-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-10 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-32 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"h-3 w-48 bg-bg-sunken animate-pulse rounded\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-4\">\n <div className=\"size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center\">\n <svg\n className=\"size-6 text-status-error-text\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.invoices.failedToLoad', 'Failed to load invoices')}\n </h2>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors\"\n >\n {tr('billing.common.tryAgain', 'Try Again')}\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 px-6 lg:px-8 py-6\">\n {/* Header */}\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary\">\n {tr('billing.invoices.title', 'Invoices')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('billing.invoices.subtitle', 'View and manage your billing invoices')}\n </p>\n <PagePurpose className=\"mt-3\">\n {tr(\n 'billing.invoices.purpose',\n 'A record of everything you have been billed for — subscriptions, add-ons and one-off charges. Open an invoice to see line items, download the PDF, pay an outstanding amount, or request a refund.'\n )}\n </PagePurpose>\n </div>\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/refunds')}\n className=\"inline-flex items-center gap-2 px-3 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200\"\n >\n <RotateCcw className=\"size-4\" />\n {tr('billing.invoices.myRefunds', 'My Refunds')}\n </button>\n {billingAccounts.length > 1 && (\n <div className=\"flex items-center gap-2\">\n <label className=\"text-sm text-text-secondary whitespace-nowrap\">\n {tr('billing.invoices.billingAccountLabel', 'Billing Account')}\n </label>\n <select\n value={selectedAccountId ?? ''}\n onChange={(e) => setExplicitAccountId(e.target.value || null)}\n className=\"text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('billing.invoices.allAccounts', 'All Accounts')}</option>\n {billingAccounts.map((account: BillingAccountItem) => (\n <option key={account.id ?? ''} value={account.id ?? ''}>\n {account.name ?? account.email ?? account.id}\n {account.isDefault ? tr('billing.invoices.defaultSuffix', ' (Default)') : ''}\n </option>\n ))}\n </select>\n </div>\n )}\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle\">\n {/* Status Filter */}\n <div className=\"inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken flex-wrap\">\n {(['all', 'OPEN', 'PAID', 'DRAFT', 'VOID'] as FilterStatus[]).map((status) => (\n <button\n type=\"button\"\n key={status}\n onClick={() => {\n setFilterStatus(status);\n setPage(1);\n }}\n className={`px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${\n filterStatus === status\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n >\n {status === 'all' ? 'All' : formatInvoiceStatus(status as InvoiceStatus)}\n </button>\n ))}\n </div>\n\n {/* Search */}\n <div className=\"relative flex-1 min-w-0 w-full sm:max-w-md\">\n <svg\n className=\"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\n />\n </svg>\n <input\n type=\"text\"\n placeholder={tr('billing.invoices.searchPlaceholder', 'Search by invoice number...')}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent\"\n />\n </div>\n </div>\n\n {actionError && (\n <div className=\"rounded-button border border-status-error-border bg-status-error-bg-subtle p-3\">\n <p className=\"text-sm text-status-error-text\">{actionError}</p>\n </div>\n )}\n\n {/* Invoices Table */}\n {!isLoading && invoices.length === 0 ? (\n <IllustratedEmptyState\n illustration={filterStatus !== 'all' || debouncedSearch ? 'empty-search' : 'empty-files'}\n title={tr('billing.invoices.noInvoicesFound', 'No invoices found')}\n description={\n filterStatus !== 'all' || debouncedSearch\n ? tr('billing.invoices.noInvoicesFiltered', 'No invoices match your filters.')\n : tr('billing.invoices.noInvoicesYet', \"You don't have any invoices yet.\")\n }\n />\n ) : (\n <>\n <div className=\"border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden\">\n <table className=\"w-full\">\n <thead className=\"bg-bg-sunken\">\n <tr>\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.invoices.invoice', 'Invoice')}\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.common.status', 'Status')}\n </th>\n {!selectedAccountId && billingAccounts.length > 1 && (\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden lg:table-cell\">\n {tr('billing.common.account', 'Account')}\n </th>\n )}\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden sm:table-cell\">\n {tr('billing.common.date', 'Date')}\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden md:table-cell\">\n {tr('billing.common.dueDate', 'Due Date')}\n </th>\n <th className=\"text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.common.amount', 'Amount')}\n </th>\n <th className=\"text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.common.actions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-subtle\">\n {invoices.map((invoice) => (\n <InvoiceRow\n key={invoice.id}\n invoice={invoice}\n onView={() =>\n navigateTo(\n withBillingAccountId(`/invoices/${invoice.id}`, invoice.billingAccountId)\n )\n }\n canPay={permissions.canPayInvoice}\n canVoid={permissions.canVoidInvoice}\n onPay={handlePayInvoice}\n onVoid={handleVoidInvoice}\n isProcessing={activeAction?.invoiceId === invoice.id}\n processingAction={\n activeAction?.invoiceId === invoice.id ? activeAction.action : undefined\n }\n showAccount={!selectedAccountId && billingAccounts.length > 1}\n accountName={\n billingAccounts.find(\n (a: BillingAccountItem) => a.id === invoice.billingAccountId\n )?.name ?? null\n }\n />\n ))}\n </tbody>\n </table>\n </div>\n\n {totalPages > 1 && (\n <div className=\"flex items-center justify-between pt-2\">\n <p className=\"text-sm text-text-secondary\">\n {tr('billing.common.pageOf', 'Page {{page}} of {{totalPages}}', {\n page,\n totalPages,\n })}\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={page <= 1}\n className=\"px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors\"\n >\n {tr('billing.common.previous', 'Previous')}\n </button>\n <button\n type=\"button\"\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={page >= totalPages}\n className=\"px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors\"\n >\n {tr('billing.common.next', 'Next')}\n </button>\n </div>\n </div>\n )}\n </>\n )}\n </div>\n );\n};\n\n// ============================================================================\n// Invoice Row Component\n// ============================================================================\n\ninterface InvoiceRowProps {\n invoice: Invoice;\n onView: () => void;\n onPay: (invoice: Invoice) => Promise<void>;\n onVoid: (invoice: Invoice) => Promise<void>;\n canPay: boolean;\n canVoid: boolean;\n isProcessing: boolean;\n processingAction?: 'pay' | 'void';\n showAccount?: boolean;\n accountName?: string | null;\n}\n\nconst InvoiceRow: FC<InvoiceRowProps> = ({\n invoice,\n onView,\n onPay,\n onVoid,\n canPay,\n canVoid,\n isProcessing,\n processingAction,\n showAccount = false,\n accountName,\n}) => {\n const tr = useTr();\n const [isConfirmingVoid, setIsConfirmingVoid] = useState(false);\n const statusColor = getInvoiceStatusColor(invoice.status);\n const isOpen = invoice.status === ('OPEN' as InvoiceStatus);\n const isDraft = invoice.status === ('DRAFT' as InvoiceStatus);\n\n const handleVoidRequest = async () => {\n void nativeImpact('medium');\n const confirmed = await nativeConfirm({\n title: 'Void invoice',\n message: 'Are you sure you want to void this invoice?',\n okButtonTitle: 'Void',\n cancelButtonTitle: 'Cancel',\n });\n if (confirmed === true) {\n await onVoid(invoice);\n } else if (confirmed === null) {\n setIsConfirmingVoid(true);\n }\n };\n\n const handleVoidConfirmed = async () => {\n await onVoid(invoice);\n setIsConfirmingVoid(false);\n };\n\n const invoicePdfBackupUrl = (invoice.metadata as Record<string, unknown> | undefined)\n ?.invoicePdfBackupUrl as string | undefined;\n\n return (\n <tr className=\"hover:bg-bg-sunken transition-colors\">\n <td className=\"p-4\">\n {invoice.invoiceUrl ? (\n <a\n href={invoice.invoiceUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"font-medium text-text-primary hover:text-text-link transition-colors\"\n >\n {formatInvoiceNumber(invoice.invoiceNumber)}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={onView}\n className=\"font-medium text-text-primary hover:text-text-link transition-colors\"\n >\n {formatInvoiceNumber(invoice.invoiceNumber)}\n </button>\n )}\n {(invoice.itemDescription ?? invoice.subscription?.plan?.name) && (\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {invoice.itemDescription ?? invoice.subscription?.plan?.name}\n </p>\n )}\n </td>\n <td className=\"p-4\">\n <StatusPill status={statusColor} dot>\n {formatInvoiceStatus(invoice.status)}\n </StatusPill>\n </td>\n {showAccount && (\n <td className=\"p-4 hidden lg:table-cell\">\n {accountName ? (\n <span className=\"inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full bg-bg-sunken text-text-secondary border border-border-subtle\">\n {accountName}\n </span>\n ) : (\n <span className=\"text-sm text-text-secondary\">, </span>\n )}\n </td>\n )}\n <td className=\"p-4 text-sm text-text-secondary hidden sm:table-cell\">\n {formatDate(invoice.createdAt, 'short')}\n </td>\n <td className=\"p-4 text-sm text-text-secondary hidden md:table-cell\">\n {invoice.dueDate ? formatDate(invoice.dueDate, 'short') : '—'}\n </td>\n <td className=\"p-4 text-right font-medium text-text-primary\">\n {formatCurrency(invoice.total, invoice.currency)}\n </td>\n <td className=\"p-4 text-right\">\n <div className=\"relative flex items-center justify-end gap-2\">\n {invoice.invoiceUrl ? (\n <a\n href={invoice.invoiceUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.view', 'View')}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={onView}\n className=\"px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.view', 'View')}\n </button>\n )}\n {invoice.pdfUrl && (\n <a\n href={invoice.pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.pdf', 'PDF')}\n </a>\n )}\n {/* Our own durable backup copy, shown alongside the provider's —\n not a replacement, so this still works if the provider link\n ever breaks. */}\n {invoicePdfBackupUrl && (\n <a\n href={invoicePdfBackupUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.pdfBackup', 'PDF (backup)')}\n </a>\n )}\n {isOpen && canPay && (\n <button\n type=\"button\"\n onClick={() => void onPay(invoice)}\n disabled={isProcessing}\n className=\"px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {isProcessing && processingAction === 'pay'\n ? tr('billing.common.paying', 'Paying…')\n : tr('billing.common.pay', 'Pay')}\n </button>\n )}\n {(isOpen || isDraft) && canVoid && (\n <button\n type=\"button\"\n onClick={() => void handleVoidRequest()}\n disabled={isProcessing}\n className=\"px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle rounded-button transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {isProcessing && processingAction === 'void'\n ? tr('billing.common.voiding', 'Voiding…')\n : tr('billing.common.void', 'Void')}\n </button>\n )}\n {isConfirmingVoid && (\n <div className=\"absolute right-4 mt-12 z-10 w-64 rounded-card border border-status-error-border bg-bg-elevated p-3 text-left shadow-elevation-2\">\n <p className=\"text-sm font-medium text-text-primary\">Void this invoice?</p>\n <div className=\"mt-3 flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => setIsConfirmingVoid(false)}\n className=\"rounded-button border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={() => void handleVoidConfirmed()}\n disabled={isProcessing}\n className=\"rounded-button bg-action-danger-bg px-2.5 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-danger-bgHover disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {isProcessing ? 'Voiding…' : 'Confirm'}\n </button>\n </div>\n </div>\n )}\n </div>\n </td>\n </tr>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,IAAa,UAA6B;CACxC,IAAM,IAAK,EAAM,GACX,IAAa,EAAmB,GAChC,IAAc,EAAsB,GACpC,CAAC,KAAgB,EAAgB,GACjC,IAAsB,EAAa,IAAI,kBAAkB,KAAK,KAAA,GAE9D,EAAE,MAAM,MAAiB,EAAgC,EAAE,aAAa,cAAc,CAAC,GACvF,IAAkB,QAChB,GAAc,2BAA2B,CAAC,GAChD,CAAC,CAAY,CACf,GACM,EAAE,eAAY,mBAAgB,EAAoB,GAClD,CAAC,GAAa,KAAkB,EAAwB,IAAI,GAC5D,CAAC,GAAc,KAAmB,EAAwB,IAAI,GAK9D,CAAC,GAAmB,KAAwB,EAChD,CACF;CAEA,QAAgB;EACd,EAAqB,CAAmB;CAC1C,GAAG,CAAC,CAAmB,CAAC;CAExB,IAAM,IAAmB,SAEpB,EAAgB,MAAM,MAA0B,EAAE,SAAS,KAAK,EAAgB,KAAK,MACtF,KAAA,GACF,CAAC,CAAe,CA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KAAD;OACE,MAAM,EAAQ;OACd,QAAO;OACP,KAAI;OACJ,WAAU;iBAET,EAAG,sBAAsB,KAAK;MAC9B,CAAA;MAKJ,KACC,kBAAC,KAAD;OACE,MAAM;OACN,QAAO;OACP,KAAI;OACJ,WAAU;iBAET,EAAG,4BAA4B,cAAc;MAC7C,CAAA;MAEJ,KAAU,KACT,kBAAC,UAAD;OACE,MAAK;OACL,eAAe,KAAK,EAAM,CAAO;OACjC,UAAU;OACV,WAAU;iBAET,KAAgB,MAAqB,QAClC,EAAG,yBAAyB,SAAS,IACrC,EAAG,sBAAsB,KAAK;MAC5B,CAAA;OAER,KAAU,MAAY,KACtB,kBAAC,UAAD;OACE,MAAK;OACL,eAAe,KAAK,EAAkB;OACtC,UAAU;OACV,WAAU;iBAET,KAAgB,MAAqB,SAClC,EAAG,0BAA0B,UAAU,IACvC,EAAG,uBAAuB,MAAM;MAC9B,CAAA;MAET,KACC,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,KAAD;QAAG,WAAU;kBAAwC;OAAqB,CAAA,GAC1E,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAoB,EAAK;SACxC,WAAU;mBACX;QAEO,CAAA,GACR,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,KAAK,EAAoB;SACxC,UAAU;SACV,WAAU;mBAET,IAAe,aAAa;QACvB,CAAA,CACL;SACF;;KAEJ;;GACH,CAAA;EACF;;AAER"}
|
|
1
|
+
{"version":3,"file":"InvoicesListPage.js","names":["_Fragment","Fragment$1","InvoicesListPage","tr","useTr","navigateTo","useBillingNavigate","permissions","useBillingPermissions","searchParams","useSearchParams","urlBillingAccountId","accountsData","useGetBillingAccountsByOrgQuery","billingAccounts","useMemo","useInvoiceMutations","actionError","setActionError","useState","activeAction","setActiveAction","explicitAccountId","setExplicitAccountId","defaultAccountId","a","selectedAccountId","filterStatus","setFilterStatus","searchQuery","setSearchQuery","debouncedSearch","setDebouncedSearch","page","setPage","debounceTimer","useRef","usePaginatedInvoices","handlePayInvoice","useCallback","billingAccountId","invoice","paymentMethodId","account","payInvoice","refetch","nativeNotify","actionErrorValue","handleVoidInvoice","voidInvoice","isLoading","invoices","i","error","PagePurpose","RotateCcw","status","formatInvoiceStatus","IllustratedEmptyState","InvoiceRow","withBillingAccountId","totalPages","p","isConfirmingVoid","setIsConfirmingVoid","statusColor","getInvoiceStatusColor","isOpen","isDraft","handleVoidRequest","confirmed","nativeConfirm","onVoid","handleVoidConfirmed","invoicePdfBackupUrl","formatInvoiceNumber","onView","StatusPill","showAccount","accountName","formatDate","formatCurrency","canPay","onPay","isProcessing","processingAction","canVoid"],"sources":["../../../../../src/billing/modules/billing/pages/InvoicesListPage.tsx"],"sourcesContent":["/**\n * Billing Module - Invoices List Page\n * Displays all invoices for the current tenant\n */\n\nimport { useEffect, useState, useMemo, useRef, useCallback, type FC } from 'react';\nimport { RotateCcw } from 'lucide-react';\nimport { useSearchParams } from 'react-router';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useInvoiceMutations, usePaginatedInvoices } from '../hooks/useInvoices';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport {\n useGetBillingAccountsByOrgQuery,\n type GetBillingAccountsByOrgQuery,\n} from '../../../../generated/global-operations';\n\ntype BillingAccountItem = GetBillingAccountsByOrgQuery['getBillingAccountsByOrg'][number];\nimport {\n formatCurrency,\n formatDate,\n formatInvoiceStatus,\n formatInvoiceNumber,\n} from '../../../shared/utils/format';\nimport { withBillingAccountId } from '../../../shared/utils/navigation';\nimport { getInvoiceStatusColor } from '../../../shared/utils/status';\nimport { StatusPill } from '../../../shared/ui';\nimport type { Invoice, InvoiceStatus } from '../../../shared/types';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../../../utils/nativeBridge';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\n\ntype FilterStatus = 'all' | InvoiceStatus;\ntype InvoiceAction = { invoiceId: string; action: 'pay' | 'void' } | null;\n\nexport const InvoicesListPage: FC = () => {\n const tr = useTr();\n const navigateTo = useBillingNavigate();\n const permissions = useBillingPermissions();\n const [searchParams] = useSearchParams();\n const urlBillingAccountId = searchParams.get('billingAccountId') ?? undefined;\n\n const { data: accountsData } = useGetBillingAccountsByOrgQuery({ fetchPolicy: 'cache-first' });\n const billingAccounts = useMemo(\n () => accountsData?.getBillingAccountsByOrg ?? [],\n [accountsData]\n );\n const { payInvoice, voidInvoice } = useInvoiceMutations();\n const [actionError, setActionError] = useState<string | null>(null);\n const [activeAction, setActiveAction] = useState<InvoiceAction>(null);\n\n // undefined = user hasn't explicitly chosen yet → auto-pick default\n // null = user explicitly chose \"All Accounts\"\n // string = user explicitly chose a specific account\n const [explicitAccountId, setExplicitAccountId] = useState<string | null | undefined>(\n urlBillingAccountId\n );\n\n useEffect(() => {\n setExplicitAccountId(urlBillingAccountId);\n }, [urlBillingAccountId]);\n\n const defaultAccountId = useMemo(\n () =>\n (billingAccounts.find((a: BillingAccountItem) => a.isDefault) ?? billingAccounts[0])?.id ??\n undefined,\n [billingAccounts]\n );\n\n // Resolved selection: explicit choice wins; before any choice, use the default\n const selectedAccountId: string | null =\n explicitAccountId !== undefined ? explicitAccountId : (defaultAccountId ?? null);\n\n const [filterStatus, setFilterStatus] = useState<FilterStatus>('all');\n const [searchQuery, setSearchQuery] = useState('');\n const [debouncedSearch, setDebouncedSearch] = useState('');\n const [page, setPage] = useState(1);\n const debounceTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (debounceTimer.current) clearTimeout(debounceTimer.current);\n debounceTimer.current = setTimeout(() => {\n setDebouncedSearch(searchQuery);\n setPage(1);\n }, 400);\n return () => {\n if (debounceTimer.current) clearTimeout(debounceTimer.current);\n };\n }, [searchQuery]);\n\n const { invoices, totalPages, isLoading, error, refetch } = usePaginatedInvoices({\n billingAccountId: selectedAccountId ?? undefined,\n status: filterStatus !== 'all' ? (filterStatus as InvoiceStatus) : undefined,\n search: debouncedSearch || undefined,\n page,\n pageSize: 20,\n });\n\n const handlePayInvoice = useCallback(\n async (invoice: Invoice): Promise<void> => {\n const billingAccountId = invoice.billingAccountId;\n const paymentMethodId = billingAccountId\n ? billingAccounts.find((account: BillingAccountItem) => account.id === billingAccountId)\n ?.defaultPaymentMethod\n : undefined;\n\n if (!billingAccountId) {\n setActionError('No billing account context');\n return;\n }\n if (!paymentMethodId) {\n setActionError('Add and set a default payment method before paying this invoice.');\n return;\n }\n\n setActionError(null);\n setActiveAction({ invoiceId: invoice.id, action: 'pay' });\n try {\n await payInvoice(invoice.id, paymentMethodId, billingAccountId);\n await refetch();\n void nativeNotify('success');\n } catch (actionErrorValue) {\n setActionError(\n actionErrorValue instanceof Error ? actionErrorValue.message : 'Failed to pay invoice'\n );\n void nativeNotify('error');\n } finally {\n setActiveAction(null);\n }\n },\n [billingAccounts, payInvoice, refetch]\n );\n\n const handleVoidInvoice = useCallback(\n async (invoice: Invoice): Promise<void> => {\n const billingAccountId = invoice.billingAccountId;\n if (!billingAccountId) {\n setActionError('No billing account context');\n return;\n }\n\n setActionError(null);\n setActiveAction({ invoiceId: invoice.id, action: 'void' });\n try {\n await voidInvoice(invoice.id, billingAccountId);\n await refetch();\n void nativeNotify('success');\n } catch (actionErrorValue) {\n setActionError(\n actionErrorValue instanceof Error ? actionErrorValue.message : 'Failed to void invoice'\n );\n void nativeNotify('error');\n } finally {\n setActiveAction(null);\n }\n },\n [refetch, voidInvoice]\n );\n\n // Permission check\n if (!permissions.canViewInvoices) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-2\">\n <div className=\"size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center\">\n <svg\n className=\"size-6 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary max-w-sm\">\n {tr('billing.invoices.noViewPermission', \"You don't have permission to view invoices.\")}\n </p>\n </div>\n </div>\n );\n }\n\n // Loading state\n if (isLoading && invoices.length === 0) {\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"h-8 w-48 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"space-y-3\">\n {[1, 2, 3, 4, 5].map((i) => (\n <div key={i} className=\"border border-border-subtle rounded-lg p-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"size-10 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-32 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"h-3 w-48 bg-bg-sunken animate-pulse rounded\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-4\">\n <div className=\"size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center\">\n <svg\n className=\"size-6 text-status-error-text\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.invoices.failedToLoad', 'Failed to load invoices')}\n </h2>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors\"\n >\n {tr('billing.common.tryAgain', 'Try Again')}\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 px-6 lg:px-8 py-6\">\n {/* Header */}\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl md:text-3xl font-semibold tracking-tight text-text-primary\">\n {tr('billing.invoices.title', 'Invoices')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('billing.invoices.subtitle', 'View and manage your billing invoices')}\n </p>\n <PagePurpose className=\"mt-3\">\n {tr(\n 'billing.invoices.purpose',\n 'A record of everything you have been billed for — subscriptions, add-ons and one-off charges. Open an invoice to see line items, download the PDF, pay an outstanding amount, or request a refund.'\n )}\n </PagePurpose>\n </div>\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/refunds')}\n className=\"inline-flex items-center gap-2 px-3 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200\"\n >\n <RotateCcw className=\"size-4\" />\n {tr('billing.invoices.myRefunds', 'My Refunds')}\n </button>\n {billingAccounts.length > 1 && (\n <div className=\"flex items-center gap-2\">\n <label className=\"text-sm text-text-secondary whitespace-nowrap\">\n {tr('billing.invoices.billingAccountLabel', 'Billing Account')}\n </label>\n <select\n value={selectedAccountId ?? ''}\n onChange={(e) => setExplicitAccountId(e.target.value || null)}\n className=\"text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('billing.invoices.allAccounts', 'All Accounts')}</option>\n {billingAccounts.map((account: BillingAccountItem) => (\n <option key={account.id ?? ''} value={account.id ?? ''}>\n {account.name ?? account.email ?? account.id}\n {account.isDefault ? tr('billing.invoices.defaultSuffix', ' (Default)') : ''}\n </option>\n ))}\n </select>\n </div>\n )}\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle\">\n {/* Status Filter */}\n <div className=\"inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken flex-wrap\">\n {(['all', 'OPEN', 'PAID', 'DRAFT', 'VOID'] as FilterStatus[]).map((status) => (\n <button\n type=\"button\"\n key={status}\n onClick={() => {\n setFilterStatus(status);\n setPage(1);\n }}\n className={`px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${\n filterStatus === status\n ? 'bg-bg-surface text-text-primary shadow-sm'\n : 'text-text-secondary hover:text-text-primary'\n }`}\n >\n {status === 'all' ? 'All' : formatInvoiceStatus(status as InvoiceStatus)}\n </button>\n ))}\n </div>\n\n {/* Search */}\n <div className=\"relative flex-1 min-w-0 w-full sm:max-w-md\">\n <svg\n className=\"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\n />\n </svg>\n <input\n type=\"text\"\n placeholder={tr('billing.invoices.searchPlaceholder', 'Search by invoice number...')}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent\"\n />\n </div>\n </div>\n\n {actionError && (\n <div className=\"rounded-button border border-status-error-border bg-status-error-bg-subtle p-3\">\n <p className=\"text-sm text-status-error-text\">{actionError}</p>\n </div>\n )}\n\n {/* Invoices Table */}\n {!isLoading && invoices.length === 0 ? (\n <IllustratedEmptyState\n illustration={filterStatus !== 'all' || debouncedSearch ? 'empty-search' : 'empty-files'}\n title={tr('billing.invoices.noInvoicesFound', 'No invoices found')}\n description={\n filterStatus !== 'all' || debouncedSearch\n ? tr('billing.invoices.noInvoicesFiltered', 'No invoices match your filters.')\n : tr('billing.invoices.noInvoicesYet', \"You don't have any invoices yet.\")\n }\n />\n ) : (\n <>\n <div className=\"border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden\">\n <table className=\"w-full\">\n <thead className=\"bg-bg-sunken\">\n <tr>\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.invoices.invoice', 'Invoice')}\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.common.status', 'Status')}\n </th>\n {!selectedAccountId && billingAccounts.length > 1 && (\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden lg:table-cell\">\n {tr('billing.common.account', 'Account')}\n </th>\n )}\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden sm:table-cell\">\n {tr('billing.common.date', 'Date')}\n </th>\n <th className=\"text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden md:table-cell\">\n {tr('billing.common.dueDate', 'Due Date')}\n </th>\n <th className=\"text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.common.amount', 'Amount')}\n </th>\n <th className=\"text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted\">\n {tr('billing.common.actions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border-subtle\">\n {invoices.map((invoice) => (\n <InvoiceRow\n key={invoice.id}\n invoice={invoice}\n onView={() =>\n navigateTo(\n withBillingAccountId(`/invoices/${invoice.id}`, invoice.billingAccountId)\n )\n }\n canPay={permissions.canPayInvoice}\n canVoid={permissions.canVoidInvoice}\n onPay={handlePayInvoice}\n onVoid={handleVoidInvoice}\n isProcessing={activeAction?.invoiceId === invoice.id}\n processingAction={\n activeAction?.invoiceId === invoice.id ? activeAction.action : undefined\n }\n showAccount={!selectedAccountId && billingAccounts.length > 1}\n accountName={\n billingAccounts.find(\n (a: BillingAccountItem) => a.id === invoice.billingAccountId\n )?.name ?? null\n }\n />\n ))}\n </tbody>\n </table>\n </div>\n\n {totalPages > 1 && (\n <div className=\"flex items-center justify-between pt-2\">\n <p className=\"text-sm text-text-secondary\">\n {tr('billing.common.pageOf', 'Page {{page}} of {{totalPages}}', {\n page,\n totalPages,\n })}\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={page <= 1}\n className=\"px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors\"\n >\n {tr('billing.common.previous', 'Previous')}\n </button>\n <button\n type=\"button\"\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={page >= totalPages}\n className=\"px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors\"\n >\n {tr('billing.common.next', 'Next')}\n </button>\n </div>\n </div>\n )}\n </>\n )}\n </div>\n );\n};\n\n// ============================================================================\n// Invoice Row Component\n// ============================================================================\n\ninterface InvoiceRowProps {\n invoice: Invoice;\n onView: () => void;\n onPay: (invoice: Invoice) => Promise<void>;\n onVoid: (invoice: Invoice) => Promise<void>;\n canPay: boolean;\n canVoid: boolean;\n isProcessing: boolean;\n processingAction?: 'pay' | 'void';\n showAccount?: boolean;\n accountName?: string | null;\n}\n\nconst InvoiceRow: FC<InvoiceRowProps> = ({\n invoice,\n onView,\n onPay,\n onVoid,\n canPay,\n canVoid,\n isProcessing,\n processingAction,\n showAccount = false,\n accountName,\n}) => {\n const tr = useTr();\n const [isConfirmingVoid, setIsConfirmingVoid] = useState(false);\n const statusColor = getInvoiceStatusColor(invoice.status);\n const isOpen = invoice.status === ('OPEN' as InvoiceStatus);\n const isDraft = invoice.status === ('DRAFT' as InvoiceStatus);\n\n const handleVoidRequest = async () => {\n void nativeImpact('medium');\n const confirmed = await nativeConfirm({\n title: 'Void invoice',\n message: 'Are you sure you want to void this invoice?',\n okButtonTitle: 'Void',\n cancelButtonTitle: 'Cancel',\n });\n if (confirmed === true) {\n await onVoid(invoice);\n } else if (confirmed === null) {\n setIsConfirmingVoid(true);\n }\n };\n\n const handleVoidConfirmed = async () => {\n await onVoid(invoice);\n setIsConfirmingVoid(false);\n };\n\n const invoicePdfBackupUrl = (invoice.metadata as Record<string, unknown> | undefined)\n ?.invoicePdfBackupUrl as string | undefined;\n\n return (\n <tr className=\"hover:bg-bg-sunken transition-colors\">\n <td className=\"p-4\">\n {invoice.invoiceUrl ? (\n <a\n href={invoice.invoiceUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"font-medium text-text-primary hover:text-text-link transition-colors\"\n >\n {formatInvoiceNumber(invoice.invoiceNumber)}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={onView}\n className=\"font-medium text-text-primary hover:text-text-link transition-colors\"\n >\n {formatInvoiceNumber(invoice.invoiceNumber)}\n </button>\n )}\n {(invoice.itemDescription ?? invoice.subscription?.plan?.name) && (\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {invoice.itemDescription ?? invoice.subscription?.plan?.name}\n </p>\n )}\n </td>\n <td className=\"p-4\">\n <StatusPill status={statusColor} dot>\n {formatInvoiceStatus(invoice.status)}\n </StatusPill>\n </td>\n {showAccount && (\n <td className=\"p-4 hidden lg:table-cell\">\n {accountName ? (\n <span className=\"inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full bg-bg-sunken text-text-secondary border border-border-subtle\">\n {accountName}\n </span>\n ) : (\n <span className=\"text-sm text-text-secondary\">, </span>\n )}\n </td>\n )}\n <td className=\"p-4 text-sm text-text-secondary hidden sm:table-cell\">\n {formatDate(invoice.createdAt, 'short')}\n </td>\n <td className=\"p-4 text-sm text-text-secondary hidden md:table-cell\">\n {invoice.dueDate ? formatDate(invoice.dueDate, 'short') : '—'}\n </td>\n <td className=\"p-4 text-right font-medium text-text-primary\">\n {formatCurrency(invoice.total, invoice.currency)}\n </td>\n <td className=\"p-4 text-right\">\n <div className=\"relative flex items-center justify-end gap-2\">\n {invoice.invoiceUrl ? (\n <a\n href={invoice.invoiceUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.view', 'View')}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={onView}\n className=\"px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.view', 'View')}\n </button>\n )}\n {invoice.pdfUrl && (\n <a\n href={invoice.pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.pdf', 'PDF')}\n </a>\n )}\n {/* Our own durable backup copy, shown alongside the provider's —\n not a replacement, so this still works if the provider link\n ever breaks. */}\n {invoicePdfBackupUrl && (\n <a\n href={invoicePdfBackupUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200\"\n >\n {tr('billing.common.pdfBackup', 'PDF (backup)')}\n </a>\n )}\n {isOpen && canPay && (\n <button\n type=\"button\"\n onClick={() => void onPay(invoice)}\n disabled={isProcessing}\n className=\"px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {isProcessing && processingAction === 'pay'\n ? tr('billing.common.paying', 'Paying…')\n : tr('billing.common.pay', 'Pay')}\n </button>\n )}\n {(isOpen || isDraft) && canVoid && (\n <button\n type=\"button\"\n onClick={() => void handleVoidRequest()}\n disabled={isProcessing}\n className=\"px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle rounded-button transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {isProcessing && processingAction === 'void'\n ? tr('billing.common.voiding', 'Voiding…')\n : tr('billing.common.void', 'Void')}\n </button>\n )}\n {isConfirmingVoid && (\n <div className=\"absolute right-4 mt-12 z-10 w-64 rounded-card border border-status-error-border bg-bg-elevated p-3 text-left shadow-elevation-2\">\n <p className=\"text-sm font-medium text-text-primary\">Void this invoice?</p>\n <div className=\"mt-3 flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => setIsConfirmingVoid(false)}\n className=\"rounded-button border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={() => void handleVoidConfirmed()}\n disabled={isProcessing}\n className=\"rounded-button bg-action-danger-bg px-2.5 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-danger-bgHover disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {isProcessing ? 'Voiding…' : 'Confirm'}\n </button>\n </div>\n </div>\n )}\n </div>\n </td>\n </tr>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,IAAaE,UAA6B;CACxC,IAAMC,IAAKC,EAAM,GACXC,IAAaC,EAAmB,GAChCC,IAAcC,EAAsB,GACpC,CAACC,KAAgBC,EAAgB,GACjCC,IAAsBF,EAAa,IAAI,kBAAkB,KAA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AASyE;OACT,WAAU;OAET,UAAAzE,EAAG,uBAAuB,MAAM;MAC3B,CAAA;MAETsC,EAAQ,UACP,kBAAC,KAAD;OACE,MAAMA,EAAQ;OACd,QAAO;OACP,KAAI;OACJ,WAAU;OAET,UAAAtC,EAAG,sBAAsB,KAAK;MAC9B,CAAA;MAKJuE,KACC,kBAAC,KAAD;OACE,MAAMA;OACN,QAAO;OACP,KAAI;OACJ,WAAU;OAET,UAAAvE,EAAG,4BAA4B,cAAc;MAC7C,CAAA;MAEJgE,KAAUe,KACT,kBAAC,UAAD;OACE,MAAK;OACL,eAAe,KAAKC,EAAM1C,CAAO;OACjC,UAAU2C;OACV,WAAU;OAET,UAAAA,KAAgBC,MAAqB,QAClClF,EAAG,yBAAyB,SAAS,IACrCA,EAAG,sBAAsB,KAAK;MAC5B,CAAA;OAERgE,KAAUC,MAAYkB,KACtB,kBAAC,UAAD;OACE,MAAK;OACL,eAAe,KAAKjB,EAAkB;OACtC,UAAUe;OACV,WAAU;OAET,UAAAA,KAAgBC,MAAqB,SAClClF,EAAG,0BAA0B,UAAU,IACvCA,EAAG,uBAAuB,MAAM;MAC9B,CAAA;MAET4D,KACC,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,KAAD;QAAG,WAAU;QAAwC,UAAA;OAAqB,CAAA,GAC1E,kBAAC,OAAD;QAAK,WAAU;QAAf,UAAA,CACE,kBAAC,UAAD;SACE,MAAK;SACL,eAAeC,EAAoB,EAAK;SACxC,WAAU;SACX,UAAA;QAEO,CAAA,GACR,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,KAAKS,EAAoB;SACxC,UAAUW;SACV,WAAU;SAET,UAAAA,IAAe,aAAa;QACvB,CAAA,CACL;OACF,CAAA,CAAA;;KAEJ;;GACH,CAAA;EACF;;AAER"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
|
|
2
2
|
import { PageHeader as t } from "../../../shared/components/PageHeader.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useBillingPermissions as n } from "../../../hooks/useBillingPermissions.js";
|
|
4
4
|
import { ServerError as r } from "../../../shared/components/ServerError.js";
|
|
5
|
-
import "
|
|
5
|
+
import "../hooks/index.js";
|
|
6
6
|
import { formatDateTime as i } from "../../../shared/utils/format.js";
|
|
7
7
|
import { isServerError as a } from "../../../shared/utils/error.js";
|
|
8
|
+
import "../../../shared/components/index.js";
|
|
8
9
|
import "../../../shared/utils/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import "../hooks/index.js";
|
|
10
|
+
import { useOrderCallbackMutations as o, useOrderCallbacks as s } from "../hooks/useOrderCallbacks.js";
|
|
11
|
+
import { statusTokens as c } from "../../../shared/utils/tokens.js";
|
|
12
12
|
import { useState as l } from "react";
|
|
13
13
|
import { AlertTriangle as u, CheckCircle as d, ChevronLeft as f, ChevronRight as p, Clock as m, Eye as h, Loader2 as g, RefreshCw as _, RotateCw as v, X as y } from "lucide-react";
|
|
14
14
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
15
|
import { IllustratedEmptyState as S, ResponsiveTable as C } from "@burdenoff/fe-libs/ui";
|
|
16
|
-
|
|
16
|
+
// src/billing/modules/billing/pages/OrderCallbackLogsPage.tsx
|
|
17
17
|
var w = 25, T = [
|
|
18
18
|
"PENDING",
|
|
19
19
|
"SUCCESS",
|
|
20
20
|
"FAILED"
|
|
21
21
|
], E = (e) => e.callbackStatus === "FAILED" ? {
|
|
22
22
|
label: "Failed",
|
|
23
|
-
className: `${
|
|
23
|
+
className: `${c.error.bg} ${c.error.text}`,
|
|
24
24
|
icon: u
|
|
25
25
|
} : e.callbackStatus === "SUCCESS" ? {
|
|
26
26
|
label: "Delivered",
|
|
27
|
-
className: `${
|
|
27
|
+
className: `${c.success.bg} ${c.success.text}`,
|
|
28
28
|
icon: d
|
|
29
29
|
} : {
|
|
30
30
|
label: e.callbackStatus || "Pending",
|
|
31
|
-
className: `${
|
|
31
|
+
className: `${c.warning.bg} ${c.warning.text}`,
|
|
32
32
|
icon: m
|
|
33
33
|
}, D = ({ order: e, onClose: t, onRetry: n, isRetrying: r }) => {
|
|
34
34
|
if (!e) return null;
|
|
@@ -157,8 +157,8 @@ var w = 25, T = [
|
|
|
157
157
|
})
|
|
158
158
|
});
|
|
159
159
|
}, O = () => {
|
|
160
|
-
let
|
|
161
|
-
if (!
|
|
160
|
+
let c = n(), [u, d] = l(0), [m, g] = l({}), [v, y] = l(null), [O, k] = l(null), { orders: A, totalCount: j, isLoading: M, error: N, refetch: P } = s(m, u, w), { retryOrderCallback: F, isRetrying: I } = o();
|
|
161
|
+
if (!c.isBillingAdmin) return /* @__PURE__ */ b(e, { message: "You don't have permission to view order callback logs." });
|
|
162
162
|
if (N && a(N)) return /* @__PURE__ */ b("div", {
|
|
163
163
|
className: "p-6",
|
|
164
164
|
children: /* @__PURE__ */ b(r, {
|
|
@@ -421,7 +421,6 @@ var w = 25, T = [
|
|
|
421
421
|
]
|
|
422
422
|
});
|
|
423
423
|
};
|
|
424
|
-
//#endregion
|
|
425
424
|
export { O as OrderCallbackLogsPage };
|
|
426
425
|
|
|
427
426
|
//# sourceMappingURL=OrderCallbackLogsPage.js.map
|