@burdenoff/microfe-billing 2026.1113.3 → 2026.1113.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PayoutsPage.js","names":["_Fragment","Fragment$1","payoutRequestColumns","formatCurrency","request","formatDateTime","PayoutsPage","permissions","useBillingPermissions","isFluidgrids","useIsFluidgridsVariant","isReviewingPayout","setIsReviewingPayout","useState","isSubmittingPayout","setIsSubmittingPayout","payoutError","setPayoutError","payoutResult","setPayoutResult","useBillingEventEmitter","useBilling","billingAccountData","useGetDefaultBillingAccountSettingsQuery","billingAccountId","accounts","setAccounts","requests","setRequests","loading","setLoading","error","setError","accountForm","setAccountForm","requestAmount","setRequestAmount","selectedAccountId","setSelectedAccountId","editingAccountId","setEditingAccountId","archiveAccountId","setArchiveAccountId","notice","setNotice","requestContext","useMemo","apiGatewayUrl","authToken","orgId","loadData","useCallback","loadedAccounts","loadedRequests","fetchPayoutAccounts","fetchPayoutRequests","pickPayableAccountId","current","loadError","useEffect","AccessDenied","isServerError","ServerError","handleAddAccount","payload","updatePayoutAccount","emit","created","addPayoutAccount","handleSetDefault","setDefaultPayoutAccount","accountId","handleArchive","archivePayoutAccount","handleEditAccount","account","selectedAccount","hasPayableAccount","isPayoutAccountPayable","handleRequestPayout","requestPayout","confirmPayout","err","MoneyActionDialog","PageHeader","PagePurpose","event","Landmark","RefreshCw","IllustratedEmptyState","payoutAccountStatusView","Send","statusView","PAYOUT_ACCOUNT_TONE_CLASSES","ResponsiveTable","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id"],"sources":["../../../../../src/billing/modules/earnings/pages/PayoutsPage.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport { Landmark, RefreshCw, Send } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n ResponsiveTable,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\n\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport { MoneyActionDialog } from '../../../shared/components';\nimport { useBillingEventEmitter } from '../../../hooks/useBillingEventEmitter';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { formatCurrency, formatDateTime, isServerError } from '../../../shared/utils';\nimport { useGetDefaultBillingAccountSettingsQuery } from '../../../../generated/global-operations';\nimport {\n addPayoutAccount,\n archivePayoutAccount,\n fetchPayoutAccounts,\n fetchPayoutRequests,\n requestPayout,\n setDefaultPayoutAccount,\n updatePayoutAccount,\n type PayoutAccount,\n type PayoutRequest,\n} from '../api';\nimport {\n PAYOUT_ACCOUNT_TONE_CLASSES,\n isPayoutAccountPayable,\n payoutAccountStatusView,\n pickPayableAccountId,\n} from '../payoutAccountStatus';\n\nconst payoutRequestColumns: ResponsiveTableColumn<PayoutRequest>[] = [\n {\n key: 'amount',\n header: 'Amount',\n priority: 'primary',\n cell: (request) => (\n <span className=\"tabular-nums\">\n {formatCurrency(request.requestedAmount, request.currency)}\n </span>\n ),\n },\n { key: 'provider', header: 'Provider', cell: (request) => request.provider },\n { key: 'status', header: 'Status', cell: (request) => request.status },\n {\n key: 'account',\n header: 'Account',\n cell: (request) => request.payoutAccount?.label || '-',\n },\n {\n key: 'created',\n header: 'Created',\n cell: (request) => formatDateTime(request.createdAt),\n },\n];\n\nexport const PayoutsPage: FC = () => {\n const permissions = useBillingPermissions();\n const isFluidgrids = useIsFluidgridsVariant();\n // FluidGrids: a review step precedes the request, and the outcome is always shown.\n const [isReviewingPayout, setIsReviewingPayout] = useState(false);\n const [isSubmittingPayout, setIsSubmittingPayout] = useState(false);\n const [payoutError, setPayoutError] = useState<string | null>(null);\n const [payoutResult, setPayoutResult] = useState<{ ok: boolean; message: string } | null>(null);\n const { emit } = useBillingEventEmitter();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n const { data: billingAccountData } = useGetDefaultBillingAccountSettingsQuery({});\n const billingAccountId = billingAccountData?.getDefaultBillingAccount?.id;\n\n const [accounts, setAccounts] = useState<PayoutAccount[]>([]);\n const [requests, setRequests] = useState<PayoutRequest[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [accountForm, setAccountForm] = useState({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n const [requestAmount, setRequestAmount] = useState('');\n const [selectedAccountId, setSelectedAccountId] = useState<string>('');\n const [editingAccountId, setEditingAccountId] = useState<string | null>(null);\n const [archiveAccountId, setArchiveAccountId] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n\n const requestContext = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n orgId,\n }),\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setLoading(true);\n setError(null);\n try {\n const [loadedAccounts, loadedRequests] = await Promise.all([\n fetchPayoutAccounts(billingAccountId, requestContext),\n fetchPayoutRequests(billingAccountId, requestContext),\n ]);\n setAccounts(loadedAccounts);\n setRequests(loadedRequests);\n // Only verified accounts can be paid out to (BOFF-10953).\n setSelectedAccountId((current) => pickPayableAccountId(loadedAccounts, current));\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError : new Error('Failed to load payout data'));\n } finally {\n setLoading(false);\n }\n }, [billingAccountId, requestContext]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n if (!permissions.canManagePaymentMethods) {\n return <AccessDenied message=\"You don't have permission to manage payout accounts.\" />;\n }\n\n if (error && isServerError(error)) {\n return (\n <ServerError\n title=\"Payout data unavailable\"\n message={error.message}\n onRetry={() => void loadData()}\n showRetry\n />\n );\n }\n\n const handleAddAccount = async () => {\n if (!billingAccountId) return;\n setNotice(null);\n const payload = {\n billingAccountId,\n ...accountForm,\n };\n\n if (editingAccountId) {\n await updatePayoutAccount(editingAccountId, payload, requestContext);\n emit('billing.payout_account.updated', {\n route: '/billing/payouts',\n entityId: editingAccountId,\n source: 'payouts',\n });\n } else {\n const created = await addPayoutAccount(payload, requestContext);\n emit('billing.payout_account.added', {\n route: '/billing/payouts',\n entityId: billingAccountId,\n source: 'payouts',\n });\n // RazorpayX and Stripe Connect accounts stay pending until processor\n // onboarding verifies them (BOFF-10895); say so instead of implying the\n // account is ready to receive payouts.\n setNotice(\n created.status === 'ACTIVE'\n ? 'Payout account saved and ready to receive payouts.'\n : 'Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.'\n );\n }\n\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n setEditingAccountId(null);\n await loadData();\n };\n\n const handleSetDefault = async (accountId: string) => {\n setNotice(null);\n await setDefaultPayoutAccount(accountId, requestContext);\n await loadData();\n };\n\n const handleArchive = async (accountId: string) => {\n setNotice(null);\n await archivePayoutAccount(accountId, requestContext);\n emit('billing.payout_account.archived', {\n route: '/billing/payouts',\n entityId: accountId,\n source: 'payouts',\n });\n await loadData();\n };\n\n const handleEditAccount = (account: PayoutAccount) => {\n setNotice(null);\n setEditingAccountId(account.id);\n setAccountForm((current) => ({\n ...current,\n label: account.label,\n type: account.type,\n providerPreference: account.providerPreference,\n country: account.country || current.country,\n currency: account.currency,\n accountHolderName: account.displayName || current.accountHolderName,\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n }));\n };\n\n const selectedAccount = accounts.find((account) => account.id === selectedAccountId);\n const hasPayableAccount = accounts.some(isPayoutAccountPayable);\n\n const handleRequestPayout = async () => {\n if (!billingAccountId || !selectedAccountId || !requestAmount) return;\n if (!selectedAccount || !isPayoutAccountPayable(selectedAccount)) return;\n await requestPayout(\n {\n billingAccountId,\n payoutAccountId: selectedAccountId,\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n },\n requestContext\n );\n emit('billing.payout.requested', {\n route: '/billing/payouts',\n entityId: selectedAccountId,\n source: 'payouts',\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n });\n setRequestAmount('');\n await loadData();\n };\n\n const confirmPayout = async () => {\n setIsSubmittingPayout(true);\n setPayoutError(null);\n try {\n await handleRequestPayout();\n setIsReviewingPayout(false);\n setPayoutResult({\n ok: true,\n message: `Payout of ${formatCurrency(Number(requestAmount), selectedAccount?.currency ?? '')} requested. We'll show its status below.`,\n });\n } catch (err) {\n setPayoutError(err instanceof Error ? err.message : 'The payout request failed.');\n } finally {\n setIsSubmittingPayout(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n {isFluidgrids && (\n <MoneyActionDialog\n open={isReviewingPayout}\n title=\"Review your payout\"\n description=\"The amount is moved out of your available balance when you confirm.\"\n details={[\n {\n label: 'Amount',\n value: formatCurrency(Number(requestAmount), selectedAccount?.currency ?? ''),\n },\n {\n label: 'Paid to',\n value: selectedAccount\n ? `${selectedAccount.label} · ${selectedAccount.currency}`\n : '',\n },\n ]}\n confirmLabel=\"Request payout\"\n busyLabel=\"Requesting…\"\n isBusy={isSubmittingPayout}\n error={payoutError}\n onConfirm={() => void confirmPayout()}\n onCancel={() => setIsReviewingPayout(false)}\n />\n )}\n {isFluidgrids && payoutResult && (\n <div\n role={payoutResult.ok ? 'status' : 'alert'}\n className={`rounded-md border p-3 text-sm ${payoutResult.ok ? 'border-status-success-border text-status-success-text' : 'border-status-error-border text-status-error-text'}`}\n >\n {payoutResult.message}\n </div>\n )}\n <PageHeader\n title=\"Payouts\"\n description=\"Register payout accounts, request withdrawals, and track disbursement status.\"\n />\n\n <PagePurpose>\n Get your earnings paid out to a real bank account or UPI. Register where you want to be\n paid, request a withdrawal of your available balance, and track each request from submission\n through to disbursement here.\n </PagePurpose>\n\n {notice ? (\n <div\n role=\"status\"\n className=\"rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text\"\n >\n {notice}\n </div>\n ) : null}\n\n {error && !isServerError(error) ? (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text\">\n {error.message}\n </div>\n ) : null}\n\n <div className=\"grid gap-6 xl:grid-cols-[1.05fr,1.95fr]\">\n <section className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">\n {editingAccountId ? 'Edit payout account' : 'Add payout account'}\n </h2>\n <div className=\"space-y-3\">\n <input\n value={accountForm.label}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, label: event.target.value }))\n }\n placeholder=\"Label\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <div className=\"grid gap-3 md:grid-cols-2\">\n <select\n value={accountForm.type}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, type: event.target.value }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"BANK_ACCOUNT\">Bank account</option>\n <option value=\"UPI\">UPI</option>\n <option value=\"WALLET\">Wallet</option>\n </select>\n <select\n value={accountForm.providerPreference}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n providerPreference: event.target.value,\n }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"AUTO\">Auto</option>\n <option value=\"STRIPE\">Stripe</option>\n <option value=\"RAZORPAY\">Razorpay</option>\n <option value=\"MANUAL\">Manual</option>\n </select>\n </div>\n <div className=\"grid gap-3 md:grid-cols-2\">\n <input\n value={accountForm.country}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n country: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Country\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.currency}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n currency: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Currency\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </div>\n <input\n value={accountForm.accountHolderName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountHolderName: event.target.value }))\n }\n placeholder=\"Account holder name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n {accountForm.type === 'BANK_ACCOUNT' ? (\n <>\n <input\n value={accountForm.bankName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, bankName: event.target.value }))\n }\n placeholder=\"Bank name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.accountNumber}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountNumber: event.target.value }))\n }\n placeholder=\"Account number\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={\n accountForm.country === 'IN' ? accountForm.ifsc : accountForm.routingNumber\n }\n onChange={(event) =>\n setAccountForm((current) =>\n current.country === 'IN'\n ? { ...current, ifsc: event.target.value }\n : { ...current, routingNumber: event.target.value }\n )\n }\n placeholder={accountForm.country === 'IN' ? 'IFSC' : 'Routing number'}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </>\n ) : accountForm.type === 'UPI' ? (\n <input\n value={accountForm.upiId}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, upiId: event.target.value }))\n }\n placeholder=\"UPI ID\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n ) : null}\n </div>\n <button\n type=\"button\"\n onClick={() => void handleAddAccount()}\n className=\"mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Landmark className=\"size-4\" />\n {editingAccountId ? 'Update payout account' : 'Save payout account'}\n </button>\n {editingAccountId ? (\n <button\n type=\"button\"\n onClick={() => {\n setEditingAccountId(null);\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n }}\n className=\"mt-4 ml-3 inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary\"\n >\n Cancel edit\n </button>\n ) : null}\n </section>\n\n <section className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Request payout</h2>\n <button\n type=\"button\"\n onClick={() => void loadData()}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary\"\n >\n <RefreshCw className=\"size-4\" />\n Refresh\n </button>\n </div>\n {accounts.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No payout accounts yet\"\n description=\"Add a payout account before requesting a withdrawal.\"\n />\n ) : (\n <div className=\"space-y-3\">\n <select\n value={selectedAccountId}\n onChange={(event) => setSelectedAccountId(event.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {!hasPayableAccount ? (\n <option value=\"\">No verified payout account yet</option>\n ) : null}\n {accounts.map((account) => (\n <option\n key={account.id}\n value={account.id}\n disabled={!isPayoutAccountPayable(account)}\n >\n {account.label} · {account.currency} ·{' '}\n {payoutAccountStatusView(account.status).label}\n </option>\n ))}\n </select>\n {!hasPayableAccount ? (\n <p className=\"text-sm text-text-secondary\">\n Payouts can be requested once one of your payout accounts is verified.\n </p>\n ) : null}\n <label className=\"block space-y-1 text-sm font-medium text-text-primary\">\n <span>Amount</span>\n <input\n value={requestAmount}\n onChange={(event) => setRequestAmount(event.target.value)}\n inputMode=\"decimal\"\n placeholder=\"0.00\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary\"\n />\n </label>\n <button\n type=\"button\"\n onClick={() => {\n if (!isFluidgrids) {\n void handleRequestPayout();\n return;\n }\n setPayoutError(null);\n setPayoutResult(null);\n setIsReviewingPayout(true);\n }}\n disabled={!selectedAccount || !isPayoutAccountPayable(selectedAccount)}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Send className=\"size-4\" />\n Request payout\n </button>\n </div>\n )}\n\n {accounts.length > 0 ? (\n <div className=\"mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Saved payout accounts</h3>\n {accounts.map((account) => {\n const statusView = payoutAccountStatusView(account.status);\n return (\n <div\n key={account.id}\n className=\"flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm\"\n >\n <div>\n <p className=\"flex flex-wrap items-center gap-2 font-medium text-text-primary\">\n {account.label} {account.isDefault ? '• Default' : ''}\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${PAYOUT_ACCOUNT_TONE_CLASSES[statusView.tone]}`}\n >\n {statusView.label}\n </span>\n </p>\n <p className=\"text-text-secondary\">\n {account.providerPreference} · {account.currency}\n </p>\n {statusView.hint ? (\n <p className=\"mt-1 text-xs text-text-secondary\">{statusView.hint}</p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Edit\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void handleSetDefault(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Make default\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n Archive\n </button>\n </div>\n </div>\n );\n })}\n </div>\n ) : null}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Payout requests</h2>\n {requests.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No payout requests yet\"\n description=\"Your payout requests and processing updates will appear here.\"\n />\n ) : (\n <ResponsiveTable\n data={requests}\n rowKey={(request) => request.id}\n columns={payoutRequestColumns}\n />\n )}\n </div>\n </section>\n </div>\n\n <AlertDialog\n open={archiveAccountId !== null}\n onOpenChange={(open) => {\n if (!open) setArchiveAccountId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Archive payout account?</AlertDialogTitle>\n <AlertDialogDescription>\n Archive this payout account? You can add a new one at any time.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = archiveAccountId;\n setArchiveAccountId(null);\n if (id) void handleArchive(id);\n }}\n >\n Archive\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0CA,IAAME,KAA+D;CACnE;EACE,KAAK;EACL,QAAQ;EACR,UAAU;EACV,OAAO,MACL,kBAAC,QAAD;GAAM,WAAU;GACb,UAAAC,EAAeC,EAAQ,iBAAiBA,EAAQ,QAAQ;EACrD,CAAA;CAEV;CACA;EAAE,KAAK;EAAY,QAAQ;EAAY,OAAO,MAAYA,EAAQ;CAAS;CAC3E;EAAE,KAAK;EAAU,QAAQ;EAAU,OAAO,MAAYA,EAAQ;CAAO;CACrE;EACE,KAAK;EACL,QAAQ;EACR,OAAO,MAAYA,EAAQ,eAAe,SAAS;CACrD;CACA;EACE,KAAK;EACL,QAAQ;EACR,OAAO,MAAYC,EAAeD,EAAQ,SAAS;CACrD;AACF,GAEaE,UAAwB;CACnC,IAAMC,IAAcC,EAAsB,GACpCC,IAAeC,GAAuB,GAEtC,CAACC,IAAmBC,KAAwBC,EAAS,EAAK,GAC1D,CAACC,GAAoBC,KAAyBF,EAAS,EAAK,GAC5D,CAACG,GAAaC,KAAkBJ,EAAwB,IAAI,GAC5D,CAACK,GAAcC,KAAmBN,EAAkD,IAAI,GACxF,EAAE,YAASO,EAAuB,GAClC,EAAE,kBAAe,cAAW,aAAUC,EAAW,GACjD,EAAE,MAAMC,OAAuBC,EAAyC,CAAC,CAAC,GAC1EC,IAAmBF,IAAoB,0BAA0B,IAEjE,CAACG,GAAUC,MAAeb,EAA0B,CAAC,CAAC,GACtD,CAACc,GAAUC,MAAef,EAA0B,CAAC,CAAC,GACtD,CAACgB,GAASC,KAAcjB,EAAS,EAAI,GACrC,CAACkB,GAAOC,KAAYnB,EAAuB,IAAI,GAC/C,CAACoB,GAAaC,KAAkBrB,EAAS;E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MACb,CAAA,IAED,kBAACK,GAAD;OACE,MAAMnE;OACN,SAAS,MAAYvB,EAAQ;OAC7B,SAASF;MACV,CAAA,CAEA;KACE,CAAA,CAAA;IACN,CAAA,CAAA;;GAEL,kBAAC6F,IAAD;IACE,MAAMtD,MAAqB;IAC3B,eAAe,MAAS;KACtB,AAAKuD,KAAMtD,EAAoB,IAAI;IACrC;IAEA,UAAA,kBAACuD,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAkB,0BAAyC,CAAA,GAC3D,kBAACC,GAAD,EAAA,UAAwB,kEAEA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAmB,SAAyB,CAAA,GAC5C,kBAACC,IAAD;KACE,eAAe;MACb,IAAMC,IAAK/D;MAEX,AADAC,EAAoB,IAAI,GACpB8D,KAAIhC,GAAmBgC,CAAE;KAC/B;KACD,UAAA;IAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAAA;EACV;;AAET"}
1
+ {"version":3,"file":"PayoutsPage.js","names":["_Fragment","Fragment$1","payoutRequestColumns","formatCurrency","request","formatDateTime","PayoutsPage","permissions","useBillingPermissions","isFluidgrids","useIsFluidgridsVariant","tr","useTr","isReviewingPayout","setIsReviewingPayout","useState","isSubmittingPayout","setIsSubmittingPayout","payoutError","setPayoutError","payoutFailure","setPayoutFailure","actionFailure","setActionFailure","payoutResult","setPayoutResult","useBillingEventEmitter","useBilling","billingAccountData","useGetDefaultBillingAccountSettingsQuery","billingAccountId","accounts","setAccounts","requests","setRequests","loading","setLoading","error","setError","accountForm","setAccountForm","requestAmount","setRequestAmount","selectedAccountId","setSelectedAccountId","editingAccountId","setEditingAccountId","archiveAccountId","setArchiveAccountId","notice","setNotice","requestContext","useMemo","apiGatewayUrl","authToken","orgId","loadData","useCallback","loadedAccounts","loadedRequests","fetchPayoutAccounts","fetchPayoutRequests","pickPayableAccountId","current","loadError","useEffect","AccessDenied","isServerError","serverError","ServerError","plainPayoutError","ShowTechnicalDetails","rawErrorText","guarded","action","failure","handleAddAccount","payload","updatePayoutAccount","emit","created","addPayoutAccount","handleSetDefault","setDefaultPayoutAccount","accountId","handleArchive","archivePayoutAccount","handleEditAccount","account","selectedAccount","hasPayableAccount","isPayoutAccountPayable","handleRequestPayout","requestPayout","confirmPayout","err","MoneyActionDialog","PageHeader","PagePurpose","PayoutErrorNotice","event","Landmark","RefreshCw","IllustratedEmptyState","payoutAccountStatusView","Send","PayoutDestinationList","toPayoutDestinations","item","destination","statusView","PAYOUT_ACCOUNT_TONE_CLASSES","ResponsiveTable","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id"],"sources":["../../../../../src/billing/modules/earnings/pages/PayoutsPage.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport { Landmark, RefreshCw, Send } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n ResponsiveTable,\n ShowTechnicalDetails,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\n\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport { MoneyActionDialog } from '../../../shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useBillingEventEmitter } from '../../../hooks/useBillingEventEmitter';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { formatCurrency, formatDateTime, isServerError } from '../../../shared/utils';\nimport { useGetDefaultBillingAccountSettingsQuery } from '../../../../generated/global-operations';\nimport {\n addPayoutAccount,\n archivePayoutAccount,\n fetchPayoutAccounts,\n fetchPayoutRequests,\n requestPayout,\n setDefaultPayoutAccount,\n updatePayoutAccount,\n type PayoutAccount,\n type PayoutRequest,\n} from '../api';\nimport {\n PAYOUT_ACCOUNT_TONE_CLASSES,\n isPayoutAccountPayable,\n payoutAccountStatusView,\n pickPayableAccountId,\n} from '../payoutAccountStatus';\nimport { PayoutDestinationList } from '../components/PayoutDestinationList';\nimport { PayoutErrorNotice } from '../components/PayoutErrorNotice';\nimport { toPayoutDestinations } from '../utils/payoutDestination';\nimport { plainPayoutError, rawErrorText } from '../utils/plainPayoutError';\n\nconst payoutRequestColumns: ResponsiveTableColumn<PayoutRequest>[] = [\n {\n key: 'amount',\n header: 'Amount',\n priority: 'primary',\n cell: (request) => (\n <span className=\"tabular-nums\">\n {formatCurrency(request.requestedAmount, request.currency)}\n </span>\n ),\n },\n { key: 'provider', header: 'Provider', cell: (request) => request.provider },\n { key: 'status', header: 'Status', cell: (request) => request.status },\n {\n key: 'account',\n header: 'Account',\n cell: (request) => request.payoutAccount?.label || '-',\n },\n {\n key: 'created',\n header: 'Created',\n cell: (request) => formatDateTime(request.createdAt),\n },\n];\n\nexport const PayoutsPage: FC = () => {\n const permissions = useBillingPermissions();\n const isFluidgrids = useIsFluidgridsVariant();\n const tr = useTr();\n // FluidGrids: a review step precedes the request, and the outcome is always shown.\n const [isReviewingPayout, setIsReviewingPayout] = useState(false);\n const [isSubmittingPayout, setIsSubmittingPayout] = useState(false);\n const [payoutError, setPayoutError] = useState<string | null>(null);\n // Raw failure kept so its text can sit under \"Show technical details\".\n const [payoutFailure, setPayoutFailure] = useState<unknown>(null);\n // FluidGrids: failures of account actions (save, default, archive) shown in plain words.\n const [actionFailure, setActionFailure] = useState<unknown>(null);\n const [payoutResult, setPayoutResult] = useState<{ ok: boolean; message: string } | null>(null);\n const { emit } = useBillingEventEmitter();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n const { data: billingAccountData } = useGetDefaultBillingAccountSettingsQuery({});\n const billingAccountId = billingAccountData?.getDefaultBillingAccount?.id;\n\n const [accounts, setAccounts] = useState<PayoutAccount[]>([]);\n const [requests, setRequests] = useState<PayoutRequest[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [accountForm, setAccountForm] = useState({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n const [requestAmount, setRequestAmount] = useState('');\n const [selectedAccountId, setSelectedAccountId] = useState<string>('');\n const [editingAccountId, setEditingAccountId] = useState<string | null>(null);\n const [archiveAccountId, setArchiveAccountId] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n\n const requestContext = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n orgId,\n }),\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setLoading(true);\n setError(null);\n try {\n const [loadedAccounts, loadedRequests] = await Promise.all([\n fetchPayoutAccounts(billingAccountId, requestContext),\n fetchPayoutRequests(billingAccountId, requestContext),\n ]);\n setAccounts(loadedAccounts);\n setRequests(loadedRequests);\n // Only verified accounts can be paid out to (BOFF-10953).\n setSelectedAccountId((current) => pickPayableAccountId(loadedAccounts, current));\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError : new Error('Failed to load payout data'));\n } finally {\n setLoading(false);\n }\n }, [billingAccountId, requestContext]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n if (!permissions.canManagePaymentMethods) {\n return <AccessDenied message=\"You don't have permission to manage payout accounts.\" />;\n }\n\n if (error && isServerError(error)) {\n const serverError = (\n <ServerError\n title=\"Payout data unavailable\"\n message={isFluidgrids ? plainPayoutError(error, tr) : error.message}\n onRetry={() => void loadData()}\n showRetry\n />\n );\n return isFluidgrids ? (\n <>\n {serverError}\n <div className=\"px-6\">\n <ShowTechnicalDetails copyable>{rawErrorText(error)}</ShowTechnicalDetails>\n </div>\n </>\n ) : (\n serverError\n );\n }\n\n // FluidGrids: show a failed account action in plain words instead of an unhandled rejection.\n const guarded = async (action: () => Promise<void>): Promise<void> => {\n if (!isFluidgrids) return action();\n setActionFailure(null);\n try {\n await action();\n } catch (failure) {\n setActionFailure(failure);\n }\n };\n\n const handleAddAccount = async () => {\n if (!billingAccountId) return;\n setNotice(null);\n const payload = {\n billingAccountId,\n ...accountForm,\n };\n\n if (editingAccountId) {\n await updatePayoutAccount(editingAccountId, payload, requestContext);\n emit('billing.payout_account.updated', {\n route: '/billing/payouts',\n entityId: editingAccountId,\n source: 'payouts',\n });\n } else {\n const created = await addPayoutAccount(payload, requestContext);\n emit('billing.payout_account.added', {\n route: '/billing/payouts',\n entityId: billingAccountId,\n source: 'payouts',\n });\n // RazorpayX and Stripe Connect accounts stay pending until processor\n // onboarding verifies them (BOFF-10895); say so instead of implying the\n // account is ready to receive payouts.\n setNotice(\n created.status === 'ACTIVE'\n ? 'Payout account saved and ready to receive payouts.'\n : 'Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.'\n );\n }\n\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n setEditingAccountId(null);\n await loadData();\n };\n\n const handleSetDefault = async (accountId: string) => {\n setNotice(null);\n await setDefaultPayoutAccount(accountId, requestContext);\n await loadData();\n };\n\n const handleArchive = async (accountId: string) => {\n setNotice(null);\n await archivePayoutAccount(accountId, requestContext);\n emit('billing.payout_account.archived', {\n route: '/billing/payouts',\n entityId: accountId,\n source: 'payouts',\n });\n await loadData();\n };\n\n const handleEditAccount = (account: PayoutAccount) => {\n setNotice(null);\n setEditingAccountId(account.id);\n setAccountForm((current) => ({\n ...current,\n label: account.label,\n type: account.type,\n providerPreference: account.providerPreference,\n country: account.country || current.country,\n currency: account.currency,\n accountHolderName: account.displayName || current.accountHolderName,\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n }));\n };\n\n const selectedAccount = accounts.find((account) => account.id === selectedAccountId);\n const hasPayableAccount = accounts.some(isPayoutAccountPayable);\n\n const handleRequestPayout = async () => {\n if (!billingAccountId || !selectedAccountId || !requestAmount) return;\n if (!selectedAccount || !isPayoutAccountPayable(selectedAccount)) return;\n await requestPayout(\n {\n billingAccountId,\n payoutAccountId: selectedAccountId,\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n },\n requestContext\n );\n emit('billing.payout.requested', {\n route: '/billing/payouts',\n entityId: selectedAccountId,\n source: 'payouts',\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n });\n setRequestAmount('');\n await loadData();\n };\n\n const confirmPayout = async () => {\n setIsSubmittingPayout(true);\n setPayoutError(null);\n setPayoutFailure(null);\n try {\n await handleRequestPayout();\n setIsReviewingPayout(false);\n setPayoutResult({\n ok: true,\n message: `Payout of ${formatCurrency(Number(requestAmount), selectedAccount?.currency ?? '')} requested. We'll show its status below.`,\n });\n } catch (err) {\n setPayoutFailure(err);\n setPayoutError(plainPayoutError(err, tr));\n } finally {\n setIsSubmittingPayout(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n {isFluidgrids && (\n <MoneyActionDialog\n open={isReviewingPayout}\n title=\"Review your payout\"\n description=\"The amount is moved out of your available balance when you confirm.\"\n details={[\n {\n label: 'Amount',\n value: formatCurrency(Number(requestAmount), selectedAccount?.currency ?? ''),\n },\n {\n label: 'Paid to',\n value: selectedAccount\n ? `${selectedAccount.label} · ${selectedAccount.currency}`\n : '',\n },\n ...(payoutFailure && rawErrorText(payoutFailure)\n ? [\n {\n label: tr('billing.payoutError.technical', 'Technical details'),\n value: (\n <ShowTechnicalDetails copyable>\n {rawErrorText(payoutFailure)}\n </ShowTechnicalDetails>\n ),\n },\n ]\n : []),\n ]}\n confirmLabel=\"Request payout\"\n busyLabel=\"Requesting…\"\n isBusy={isSubmittingPayout}\n error={payoutError}\n onConfirm={() => void confirmPayout()}\n onCancel={() => setIsReviewingPayout(false)}\n />\n )}\n {isFluidgrids && payoutResult && (\n <div\n role={payoutResult.ok ? 'status' : 'alert'}\n className={`rounded-md border p-3 text-sm ${payoutResult.ok ? 'border-status-success-border text-status-success-text' : 'border-status-error-border text-status-error-text'}`}\n >\n {payoutResult.message}\n </div>\n )}\n <PageHeader\n title=\"Payouts\"\n description=\"Register payout accounts, request withdrawals, and track disbursement status.\"\n />\n\n <PagePurpose>\n Get your earnings paid out to a real bank account or UPI. Register where you want to be\n paid, request a withdrawal of your available balance, and track each request from submission\n through to disbursement here.\n </PagePurpose>\n\n {notice ? (\n <div\n role=\"status\"\n className=\"rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text\"\n >\n {notice}\n </div>\n ) : null}\n\n {error && !isServerError(error) ? (\n isFluidgrids ? (\n <PayoutErrorNotice error={error} />\n ) : (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text\">\n {error.message}\n </div>\n )\n ) : null}\n {isFluidgrids && actionFailure ? <PayoutErrorNotice error={actionFailure} /> : null}\n\n <div className=\"grid gap-6 xl:grid-cols-[1.05fr,1.95fr]\">\n <section className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">\n {editingAccountId ? 'Edit payout account' : 'Add payout account'}\n </h2>\n <div className=\"space-y-3\">\n <input\n value={accountForm.label}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, label: event.target.value }))\n }\n placeholder=\"Label\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <div className=\"grid gap-3 md:grid-cols-2\">\n <select\n value={accountForm.type}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, type: event.target.value }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"BANK_ACCOUNT\">Bank account</option>\n <option value=\"UPI\">UPI</option>\n <option value=\"WALLET\">Wallet</option>\n </select>\n <select\n value={accountForm.providerPreference}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n providerPreference: event.target.value,\n }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"AUTO\">Auto</option>\n <option value=\"STRIPE\">Stripe</option>\n <option value=\"RAZORPAY\">Razorpay</option>\n <option value=\"MANUAL\">Manual</option>\n </select>\n </div>\n <div className=\"grid gap-3 md:grid-cols-2\">\n <input\n value={accountForm.country}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n country: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Country\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.currency}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n currency: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Currency\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </div>\n <input\n value={accountForm.accountHolderName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountHolderName: event.target.value }))\n }\n placeholder=\"Account holder name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n {accountForm.type === 'BANK_ACCOUNT' ? (\n <>\n <input\n value={accountForm.bankName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, bankName: event.target.value }))\n }\n placeholder=\"Bank name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.accountNumber}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountNumber: event.target.value }))\n }\n placeholder=\"Account number\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={\n accountForm.country === 'IN' ? accountForm.ifsc : accountForm.routingNumber\n }\n onChange={(event) =>\n setAccountForm((current) =>\n current.country === 'IN'\n ? { ...current, ifsc: event.target.value }\n : { ...current, routingNumber: event.target.value }\n )\n }\n placeholder={accountForm.country === 'IN' ? 'IFSC' : 'Routing number'}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </>\n ) : accountForm.type === 'UPI' ? (\n <input\n value={accountForm.upiId}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, upiId: event.target.value }))\n }\n placeholder=\"UPI ID\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n ) : null}\n </div>\n <button\n type=\"button\"\n onClick={() => void guarded(handleAddAccount)}\n className=\"mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Landmark className=\"size-4\" />\n {editingAccountId ? 'Update payout account' : 'Save payout account'}\n </button>\n {editingAccountId ? (\n <button\n type=\"button\"\n onClick={() => {\n setEditingAccountId(null);\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n }}\n className=\"mt-4 ml-3 inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary\"\n >\n Cancel edit\n </button>\n ) : null}\n </section>\n\n <section className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Request payout</h2>\n <button\n type=\"button\"\n onClick={() => void loadData()}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary\"\n >\n <RefreshCw className=\"size-4\" />\n Refresh\n </button>\n </div>\n {accounts.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No payout accounts yet\"\n description=\"Add a payout account before requesting a withdrawal.\"\n />\n ) : (\n <div className=\"space-y-3\">\n <select\n value={selectedAccountId}\n onChange={(event) => setSelectedAccountId(event.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {!hasPayableAccount ? (\n <option value=\"\">No verified payout account yet</option>\n ) : null}\n {accounts.map((account) => (\n <option\n key={account.id}\n value={account.id}\n disabled={!isPayoutAccountPayable(account)}\n >\n {account.label} · {account.currency} ·{' '}\n {payoutAccountStatusView(account.status).label}\n </option>\n ))}\n </select>\n {!hasPayableAccount ? (\n <p className=\"text-sm text-text-secondary\">\n Payouts can be requested once one of your payout accounts is verified.\n </p>\n ) : null}\n <label className=\"block space-y-1 text-sm font-medium text-text-primary\">\n <span>Amount</span>\n <input\n value={requestAmount}\n onChange={(event) => setRequestAmount(event.target.value)}\n inputMode=\"decimal\"\n placeholder=\"0.00\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary\"\n />\n </label>\n <button\n type=\"button\"\n onClick={() => {\n if (!isFluidgrids) {\n void handleRequestPayout();\n return;\n }\n setPayoutError(null);\n setPayoutFailure(null);\n setPayoutResult(null);\n setIsReviewingPayout(true);\n }}\n disabled={!selectedAccount || !isPayoutAccountPayable(selectedAccount)}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Send className=\"size-4\" />\n Request payout\n </button>\n </div>\n )}\n\n {accounts.length > 0 ? (\n <div className=\"mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Saved payout accounts</h3>\n {isFluidgrids ? (\n <PayoutDestinationList\n destinations={toPayoutDestinations(accounts)}\n renderActions={(destination) => {\n const account = accounts.find((item) => item.id === destination.id);\n if (!account) return null;\n return (\n <>\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.edit', 'Edit')}\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.makeDefault', 'Make default')}\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n {tr('billing.payouts.archive', 'Archive')}\n </button>\n </>\n );\n }}\n />\n ) : (\n <>\n {accounts.map((account) => {\n const statusView = payoutAccountStatusView(account.status);\n return (\n <div\n key={account.id}\n className=\"flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm\"\n >\n <div>\n <p className=\"flex flex-wrap items-center gap-2 font-medium text-text-primary\">\n {account.label} {account.isDefault ? '• Default' : ''}\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${PAYOUT_ACCOUNT_TONE_CLASSES[statusView.tone]}`}\n >\n {statusView.label}\n </span>\n </p>\n <p className=\"text-text-secondary\">\n {account.providerPreference} · {account.currency}\n </p>\n {statusView.hint ? (\n <p className=\"mt-1 text-xs text-text-secondary\">{statusView.hint}</p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Edit\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Make default\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n Archive\n </button>\n </div>\n </div>\n );\n })}\n </>\n )}\n </div>\n ) : null}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Payout requests</h2>\n {requests.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No payout requests yet\"\n description=\"Your payout requests and processing updates will appear here.\"\n />\n ) : (\n <ResponsiveTable\n data={requests}\n rowKey={(request) => request.id}\n columns={payoutRequestColumns}\n />\n )}\n </div>\n </section>\n </div>\n\n <AlertDialog\n open={archiveAccountId !== null}\n onOpenChange={(open) => {\n if (!open) setArchiveAccountId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Archive payout account?</AlertDialogTitle>\n <AlertDialogDescription>\n Archive this payout account? You can add a new one at any time.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = archiveAccountId;\n setArchiveAccountId(null);\n if (id) void guarded(() => handleArchive(id));\n }}\n >\n Archive\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAME,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AAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,MAAD;OAAI,WAAU;OAA+C,UAAA;MAAmB,CAAA,GAC/EvD,EAAS,WAAW,KAAK,CAACE,IACzB,kBAACoE,GAAD;OACE,cAAa;OACb,OAAM;OACN,aAAY;MACb,CAAA,IAED,kBAACS,IAAD;OACE,MAAM/E;OACN,SAAS,MAAY7B,EAAQ;OAC7B,SAASF;MACV,CAAA,CAEA;KACE,CAAA,CAAA;IACN,CAAA,CAAA;;GAEL,kBAAC+G,IAAD;IACE,MAAMlE,OAAqB;IAC3B,eAAe,MAAS;KACtB,AAAKmE,KAAMlE,EAAoB,IAAI;IACrC;IAEA,UAAA,kBAACmE,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAkB,0BAAyC,CAAA,GAC3D,kBAACC,IAAD,EAAA,UAAwB,kEAEA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAmB,SAAyB,CAAA,GAC5C,kBAACC,IAAD;KACE,eAAe;MACb,IAAMC,IAAK3E;MAEX,AADAC,EAAoB,IAAI,GACpB0E,KAAIjD,QAAmBY,GAAcqC,CAAE,CAAC;KAC9C;KACD,UAAA;IAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAAA;EACV;;AAET"}
@@ -0,0 +1,20 @@
1
+ import { PayoutAccount } from '../api';
2
+ import { PayoutAccountStatusView } from '../payoutAccountStatus';
3
+ /**
4
+ * One shape for a saved payout destination, so Payouts and Credit withdrawal
5
+ * list the same account the same way (BOFF-11861, FluidGrids variant).
6
+ * Presentation only: it reads an account, it never changes one.
7
+ */
8
+ export type PayoutDestinationKind = 'bank' | 'upi' | 'wallet' | 'other';
9
+ export interface PayoutDestination {
10
+ id: string;
11
+ label: string;
12
+ /** e.g. "Asha Rao · ···1234 · IN · INR" */
13
+ detail: string;
14
+ kind: PayoutDestinationKind;
15
+ isDefault: boolean;
16
+ status: PayoutAccountStatusView;
17
+ }
18
+ export declare function payoutDestinationKind(type: string): PayoutDestinationKind;
19
+ export declare function toPayoutDestination(account: PayoutAccount): PayoutDestination;
20
+ export declare function toPayoutDestinations(accounts: readonly PayoutAccount[]): PayoutDestination[];
@@ -0,0 +1,27 @@
1
+ import { payoutAccountStatusView as e } from "../payoutAccountStatus.js";
2
+ // src/billing/modules/earnings/utils/payoutDestination.ts
3
+ function t(e) {
4
+ switch (e) {
5
+ case "BANK_ACCOUNT": return "bank";
6
+ case "UPI": return "upi";
7
+ case "WALLET": return "wallet";
8
+ default: return "other";
9
+ }
10
+ }
11
+ function n(n) {
12
+ let r = [];
13
+ return n.displayName && r.push(n.displayName), n.accountLast4 && r.push(`···${n.accountLast4}`), n.country && r.push(n.country), n.currency && r.push(n.currency), {
14
+ id: n.id,
15
+ label: n.label,
16
+ detail: r.join(" · "),
17
+ kind: t(n.type),
18
+ isDefault: n.isDefault,
19
+ status: e(n.status)
20
+ };
21
+ }
22
+ function r(e) {
23
+ return e.map(n);
24
+ }
25
+ export { t as payoutDestinationKind, n as toPayoutDestination, r as toPayoutDestinations };
26
+
27
+ //# sourceMappingURL=payoutDestination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payoutDestination.js","names":["payoutDestinationKind","type","toPayoutDestination","parts","account","payoutAccountStatusView","toPayoutDestinations","accounts"],"sources":["../../../../../src/billing/modules/earnings/utils/payoutDestination.ts"],"sourcesContent":["import type { PayoutAccount } from '../api';\nimport { payoutAccountStatusView, type PayoutAccountStatusView } from '../payoutAccountStatus';\n\n/**\n * One shape for a saved payout destination, so Payouts and Credit withdrawal\n * list the same account the same way (BOFF-11861, FluidGrids variant).\n * Presentation only: it reads an account, it never changes one.\n */\nexport type PayoutDestinationKind = 'bank' | 'upi' | 'wallet' | 'other';\n\nexport interface PayoutDestination {\n id: string;\n label: string;\n /** e.g. \"Asha Rao · ···1234 · IN · INR\" */\n detail: string;\n kind: PayoutDestinationKind;\n isDefault: boolean;\n status: PayoutAccountStatusView;\n}\n\nexport function payoutDestinationKind(type: string): PayoutDestinationKind {\n switch (type) {\n case 'BANK_ACCOUNT':\n return 'bank';\n case 'UPI':\n return 'upi';\n case 'WALLET':\n return 'wallet';\n default:\n return 'other';\n }\n}\n\nexport function toPayoutDestination(account: PayoutAccount): PayoutDestination {\n const parts: string[] = [];\n if (account.displayName) parts.push(account.displayName);\n if (account.accountLast4) parts.push(`···${account.accountLast4}`);\n if (account.country) parts.push(account.country);\n if (account.currency) parts.push(account.currency);\n return {\n id: account.id,\n label: account.label,\n detail: parts.join(' · '),\n kind: payoutDestinationKind(account.type),\n isDefault: account.isDefault,\n status: payoutAccountStatusView(account.status),\n };\n}\n\nexport function toPayoutDestinations(accounts: readonly PayoutAccount[]): PayoutDestination[] {\n return accounts.map(toPayoutDestination);\n}\n"],"mappings":";;AAoBA,SAAgBA,EAAsB,GAAqC;CACzE,QAAQC,GAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,OACH,OAAO;EACT,KAAK,UACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAEA,SAAgBC,EAAoB,GAA2C;CAC7E,IAAMC,IAAkB,CAAC;CAKzB,OAJIC,EAAQ,eAAaD,EAAM,KAAKC,EAAQ,WAAW,GACnDA,EAAQ,gBAAcD,EAAM,KAAK,MAAMC,EAAQ,cAAc,GAC7DA,EAAQ,WAASD,EAAM,KAAKC,EAAQ,OAAO,GAC3CA,EAAQ,YAAUD,EAAM,KAAKC,EAAQ,QAAQ,GAC1C;EACL,IAAIA,EAAQ;EACZ,OAAOA,EAAQ;EACf,QAAQD,EAAM,KAAK,KAAK;EACxB,MAAMH,EAAsBI,EAAQ,IAAI;EACxC,WAAWA,EAAQ;EACnB,QAAQC,EAAwBD,EAAQ,MAAM;CAChD;AACF;AAEA,SAAgBE,EAAqB,GAAyD;CAC5F,OAAOC,EAAS,IAAIL,CAAmB;AACzC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Plain-language wording for failed payout / withdrawal / earnings calls
3
+ * (BOFF-11861, FluidGrids variant only). The raw backend text is never shown as
4
+ * the message; callers render it under "Show technical details" instead.
5
+ */
6
+ export type PayoutErrorTr = (key: string, fallback: string) => string;
7
+ export declare const GENERIC_PAYOUT_ERROR_FALLBACK = "That did not work. Nothing was changed. Please try again.";
8
+ /** The raw text of any thrown value, for "Show technical details". */
9
+ export declare function rawErrorText(error: unknown): string;
10
+ export declare function plainPayoutError(error: unknown, tr: PayoutErrorTr): string;
@@ -0,0 +1,50 @@
1
+ // src/billing/modules/earnings/utils/plainPayoutError.ts
2
+ var e = "That did not work. Nothing was changed. Please try again.";
3
+ function t(e) {
4
+ return e instanceof Error ? e.message : typeof e == "string" ? e : "";
5
+ }
6
+ var n = [
7
+ {
8
+ pattern: /failed to fetch|networkerror|network request failed|load failed|econn|enotfound|timed? ?out|offline|socket hang up/i,
9
+ key: "billing.payoutError.network",
10
+ fallback: "We could not reach the server. Check your connection and try again. Nothing was changed."
11
+ },
12
+ {
13
+ pattern: /insufficient|exceeds .*(balance|available|withdrawable)|not enough|balance too low/i,
14
+ key: "billing.payoutError.insufficient",
15
+ fallback: "You do not have enough available balance for this amount. Enter a smaller amount."
16
+ },
17
+ {
18
+ pattern: /not verified|unverified|pending[_ ]verification|verification (failed|pending)|not active|not payable/i,
19
+ key: "billing.payoutError.notVerified",
20
+ fallback: "This payout account is not verified yet. You can use it once the payout processor verifies it."
21
+ },
22
+ {
23
+ pattern: /minimum|at least|below the|too small/i,
24
+ key: "billing.payoutError.minimum",
25
+ fallback: "That amount is below the minimum allowed. Enter a larger amount."
26
+ },
27
+ {
28
+ pattern: /forbidden|permission|not authori[sz]ed|unauthori[sz]ed|access denied|\b40[13]\b|rbac/i,
29
+ key: "billing.payoutError.permission",
30
+ fallback: "You do not have permission to do this. Ask an owner or admin of this account."
31
+ },
32
+ {
33
+ pattern: /not found|does not exist|no longer exists|archived/i,
34
+ key: "billing.payoutError.notFound",
35
+ fallback: "That payout account is no longer available. Refresh the page and pick another one."
36
+ },
37
+ {
38
+ pattern: /invalid|validation|required|must be|malformed|ifsc|routing|upi/i,
39
+ key: "billing.payoutError.invalid",
40
+ fallback: "Some details look wrong. Check the amount and account details, then try again."
41
+ }
42
+ ];
43
+ function r(r, i) {
44
+ let a = t(r);
45
+ for (let e of n) if (e.pattern.test(a)) return i(e.key, e.fallback);
46
+ return i("billing.payoutError.generic", e);
47
+ }
48
+ export { e as GENERIC_PAYOUT_ERROR_FALLBACK, r as plainPayoutError, t as rawErrorText };
49
+
50
+ //# sourceMappingURL=plainPayoutError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plainPayoutError.js","names":["GENERIC_PAYOUT_ERROR_FALLBACK","rawErrorText","error","RULES","plainPayoutError","raw","rule","tr"],"sources":["../../../../../src/billing/modules/earnings/utils/plainPayoutError.ts"],"sourcesContent":["/**\n * Plain-language wording for failed payout / withdrawal / earnings calls\n * (BOFF-11861, FluidGrids variant only). The raw backend text is never shown as\n * the message; callers render it under \"Show technical details\" instead.\n */\nexport type PayoutErrorTr = (key: string, fallback: string) => string;\n\nexport const GENERIC_PAYOUT_ERROR_FALLBACK =\n 'That did not work. Nothing was changed. Please try again.';\n\n/** The raw text of any thrown value, for \"Show technical details\". */\nexport function rawErrorText(error: unknown): string {\n if (error instanceof Error) return error.message;\n if (typeof error === 'string') return error;\n return '';\n}\n\ninterface ErrorRule {\n pattern: RegExp;\n key: string;\n fallback: string;\n}\n\n// Order matters: the first matching rule wins.\nconst RULES: readonly ErrorRule[] = [\n {\n pattern:\n /failed to fetch|networkerror|network request failed|load failed|econn|enotfound|timed? ?out|offline|socket hang up/i,\n key: 'billing.payoutError.network',\n fallback:\n 'We could not reach the server. Check your connection and try again. Nothing was changed.',\n },\n {\n pattern: /insufficient|exceeds .*(balance|available|withdrawable)|not enough|balance too low/i,\n key: 'billing.payoutError.insufficient',\n fallback: 'You do not have enough available balance for this amount. Enter a smaller amount.',\n },\n {\n pattern:\n /not verified|unverified|pending[_ ]verification|verification (failed|pending)|not active|not payable/i,\n key: 'billing.payoutError.notVerified',\n fallback:\n 'This payout account is not verified yet. You can use it once the payout processor verifies it.',\n },\n {\n pattern: /minimum|at least|below the|too small/i,\n key: 'billing.payoutError.minimum',\n fallback: 'That amount is below the minimum allowed. Enter a larger amount.',\n },\n {\n pattern:\n /forbidden|permission|not authori[sz]ed|unauthori[sz]ed|access denied|\\b40[13]\\b|rbac/i,\n key: 'billing.payoutError.permission',\n fallback: 'You do not have permission to do this. Ask an owner or admin of this account.',\n },\n {\n pattern: /not found|does not exist|no longer exists|archived/i,\n key: 'billing.payoutError.notFound',\n fallback: 'That payout account is no longer available. Refresh the page and pick another one.',\n },\n {\n pattern: /invalid|validation|required|must be|malformed|ifsc|routing|upi/i,\n key: 'billing.payoutError.invalid',\n fallback: 'Some details look wrong. Check the amount and account details, then try again.',\n },\n];\n\nexport function plainPayoutError(error: unknown, tr: PayoutErrorTr): string {\n const raw = rawErrorText(error);\n for (const rule of RULES) {\n if (rule.pattern.test(raw)) return tr(rule.key, rule.fallback);\n }\n return tr('billing.payoutError.generic', GENERIC_PAYOUT_ERROR_FALLBACK);\n}\n"],"mappings":";AAOA,IAAaA,IACX;AAGF,SAAgBC,EAAa,GAAwB;CAGnD,OAFIC,aAAiB,QAAcA,EAAM,UACrC,OAAOA,KAAU,WAAiBA,IAC/B;AACT;AASA,IAAMC,IAA8B;CAClC;EACE,SACE;EACF,KAAK;EACL,UACE;CACJ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;CACA;EACE,SACE;EACF,KAAK;EACL,UACE;CACJ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;CACA;EACE,SACE;EACF,KAAK;EACL,UAAU;CACZ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;CACA;EACE,SAAS;EACT,KAAK;EACL,UAAU;CACZ;AACF;AAEA,SAAgBC,EAAiB,GAAgB,GAA2B;CAC1E,IAAMC,IAAMJ,EAAaC,CAAK;CAC9B,KAAK,IAAMI,KAAQH,GACjB,IAAIG,EAAK,QAAQ,KAAKD,CAAG,GAAG,OAAOE,EAAGD,EAAK,KAAKA,EAAK,QAAQ;CAE/D,OAAOC,EAAG,+BAA+BP,CAA6B;AACxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-billing",
3
- "version": "2026.1113.3",
3
+ "version": "2026.1113.4",
4
4
  "description": "Billing microfrontend for Burdenoff products",
5
5
  "type": "module",
6
6
  "files": [