@burdenoff/microfe-billing 2026.517.1 → 2026.517.2
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/BillingUserRoutes.js +1 -1
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts +1 -0
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -1
- package/dist/billing/modules/billing/hooks/useInvoices.js +26 -20
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +170 -176
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +4 -4
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +2 -2
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +209 -178
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +2 -2
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +2 -2
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/api.d.ts +4 -0
- package/dist/billing/modules/earnings/api.d.ts.map +1 -1
- package/dist/billing/modules/earnings/api.js +14 -10
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +523 -233
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +101 -44
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +105 -46
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +16 -15
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +158 -165
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts +3 -0
- package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +1 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +4 -1
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +44 -22
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/shared/types/graphql.d.ts +2 -0
- package/dist/billing/shared/types/graphql.d.ts.map +1 -1
- package/dist/billing/shared/types/graphql.js.map +1 -1
- package/dist/generated/global-operations.d.ts +51 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +313 -293
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +350 -1392
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +2907 -11652
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,273 +1,563 @@
|
|
|
1
1
|
import { useBilling as e } from "../../../providers/BillingProvider.js";
|
|
2
2
|
import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
|
|
3
3
|
import { PageHeader as n } from "../../../shared/components/PageHeader.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ServerError as a } from "../../../shared/components/ServerError.js";
|
|
4
|
+
import { EmptyState as r } from "../../../shared/components/EmptyState.js";
|
|
5
|
+
import { ServerError as i } from "../../../shared/components/ServerError.js";
|
|
7
6
|
import "../../../shared/components/index.js";
|
|
8
|
-
import { useBillingEventEmitter as
|
|
9
|
-
import { formatCurrency as
|
|
10
|
-
import { isServerError as
|
|
7
|
+
import { useBillingEventEmitter as a } from "../../../hooks/useBillingEventEmitter.js";
|
|
8
|
+
import { formatCurrency as o, formatDateTime as s } from "../../../shared/utils/format.js";
|
|
9
|
+
import { isServerError as c } from "../../../shared/utils/error.js";
|
|
11
10
|
import "../../../shared/utils/index.js";
|
|
12
|
-
import { useBillingPermissions as
|
|
13
|
-
import { approvePayoutRequest as
|
|
14
|
-
import { useEffect as
|
|
15
|
-
import { AlertTriangle as y, CheckCircle2 as b,
|
|
16
|
-
import { jsx as
|
|
11
|
+
import { useBillingPermissions as l } from "../../../hooks/useBillingPermissions.js";
|
|
12
|
+
import { approvePayoutRequest as u, fetchAdminPayoutRequests as d, fetchAdminPayoutSummary as f, markPayoutPaid as p, rejectPayoutRequest as m } from "../api.js";
|
|
13
|
+
import { useEffect as h, useMemo as g, useState as _ } from "react";
|
|
14
|
+
import { AlertTriangle as v, Banknote as y, CheckCircle2 as b, ChevronDown as x, ChevronUp as S, Clock as C, CreditCard as w, ReceiptText as T, RefreshCw as E, XCircle as D } from "lucide-react";
|
|
15
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
17
16
|
//#region src/billing/modules/earnings/pages/PayoutAdminPage.tsx
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
var j = {
|
|
18
|
+
REQUESTED: "Requested",
|
|
19
|
+
APPROVED: "Approved",
|
|
20
|
+
REJECTED: "Rejected",
|
|
21
|
+
PROCESSING: "Processing",
|
|
22
|
+
PAID: "Paid",
|
|
23
|
+
FAILED: "Failed",
|
|
24
|
+
CANCELED: "Canceled"
|
|
25
|
+
}, M = {
|
|
26
|
+
REQUESTED: "bg-warning-surface text-warning-foreground",
|
|
27
|
+
APPROVED: "bg-info-surface text-info-foreground",
|
|
28
|
+
REJECTED: "bg-destructive/10 text-destructive",
|
|
29
|
+
PROCESSING: "bg-info-surface text-info-foreground",
|
|
30
|
+
PAID: "bg-success-surface text-success-foreground",
|
|
31
|
+
FAILED: "bg-destructive/10 text-destructive",
|
|
32
|
+
CANCELED: "bg-muted text-muted-foreground"
|
|
33
|
+
};
|
|
34
|
+
function N({ status: e }) {
|
|
35
|
+
return /* @__PURE__ */ k("span", {
|
|
36
|
+
className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${M[e] ?? "bg-muted text-muted-foreground"}`,
|
|
37
|
+
children: j[e] ?? e
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function P({ account: e }) {
|
|
41
|
+
let [t, n] = _(!1), r = e.accountDetails;
|
|
42
|
+
return /* @__PURE__ */ A("div", {
|
|
43
|
+
className: "rounded-md border border-border bg-muted/40 p-3 text-sm",
|
|
44
|
+
children: [/* @__PURE__ */ A("div", {
|
|
45
|
+
className: "flex items-center justify-between",
|
|
46
|
+
children: [/* @__PURE__ */ A("div", {
|
|
47
|
+
className: "flex items-center gap-2 text-foreground font-medium",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ k(w, { className: "h-4 w-4 text-muted-foreground" }),
|
|
50
|
+
e.displayName ?? e.label,
|
|
51
|
+
/* @__PURE__ */ A("span", {
|
|
52
|
+
className: "text-xs text-muted-foreground font-normal",
|
|
53
|
+
children: [
|
|
54
|
+
"(",
|
|
55
|
+
e.type === "UPI" ? "UPI" : "Bank",
|
|
56
|
+
" · ",
|
|
57
|
+
e.country ?? "Unknown",
|
|
58
|
+
" ·",
|
|
59
|
+
" ",
|
|
60
|
+
e.currency,
|
|
61
|
+
")"
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}), r && /* @__PURE__ */ k("button", {
|
|
66
|
+
type: "button",
|
|
67
|
+
onClick: () => n((e) => !e),
|
|
68
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
69
|
+
children: k(t ? S : x, { className: "h-4 w-4" })
|
|
70
|
+
})]
|
|
71
|
+
}), t && r && /* @__PURE__ */ A("div", {
|
|
72
|
+
className: "mt-2 grid gap-1 text-xs",
|
|
73
|
+
children: [
|
|
74
|
+
r.accountHolderName && /* @__PURE__ */ A("div", {
|
|
75
|
+
className: "flex gap-2",
|
|
76
|
+
children: [/* @__PURE__ */ k("span", {
|
|
77
|
+
className: "text-muted-foreground w-32 shrink-0",
|
|
78
|
+
children: "Account holder"
|
|
79
|
+
}), /* @__PURE__ */ k("span", {
|
|
80
|
+
className: "text-foreground",
|
|
81
|
+
children: r.accountHolderName
|
|
82
|
+
})]
|
|
83
|
+
}),
|
|
84
|
+
r.bankName && /* @__PURE__ */ A("div", {
|
|
85
|
+
className: "flex gap-2",
|
|
86
|
+
children: [/* @__PURE__ */ k("span", {
|
|
87
|
+
className: "text-muted-foreground w-32 shrink-0",
|
|
88
|
+
children: "Bank"
|
|
89
|
+
}), /* @__PURE__ */ k("span", {
|
|
90
|
+
className: "text-foreground",
|
|
91
|
+
children: r.bankName
|
|
92
|
+
})]
|
|
93
|
+
}),
|
|
94
|
+
e.accountLast4 && /* @__PURE__ */ A("div", {
|
|
95
|
+
className: "flex gap-2",
|
|
96
|
+
children: [/* @__PURE__ */ k("span", {
|
|
97
|
+
className: "text-muted-foreground w-32 shrink-0",
|
|
98
|
+
children: "Account (last 4)"
|
|
99
|
+
}), /* @__PURE__ */ A("span", {
|
|
100
|
+
className: "text-foreground font-mono",
|
|
101
|
+
children: ["••••", e.accountLast4]
|
|
102
|
+
})]
|
|
103
|
+
}),
|
|
104
|
+
r.ifsc && /* @__PURE__ */ A("div", {
|
|
105
|
+
className: "flex gap-2",
|
|
106
|
+
children: [/* @__PURE__ */ k("span", {
|
|
107
|
+
className: "text-muted-foreground w-32 shrink-0",
|
|
108
|
+
children: "IFSC"
|
|
109
|
+
}), /* @__PURE__ */ k("span", {
|
|
110
|
+
className: "text-foreground font-mono",
|
|
111
|
+
children: r.ifsc
|
|
112
|
+
})]
|
|
113
|
+
}),
|
|
114
|
+
r.routingNumberLast4 && /* @__PURE__ */ A("div", {
|
|
115
|
+
className: "flex gap-2",
|
|
116
|
+
children: [/* @__PURE__ */ k("span", {
|
|
117
|
+
className: "text-muted-foreground w-32 shrink-0",
|
|
118
|
+
children: "Routing (last 4)"
|
|
119
|
+
}), /* @__PURE__ */ A("span", {
|
|
120
|
+
className: "text-foreground font-mono",
|
|
121
|
+
children: ["••••", r.routingNumberLast4]
|
|
122
|
+
})]
|
|
123
|
+
}),
|
|
124
|
+
r.upiIdMasked && /* @__PURE__ */ A("div", {
|
|
125
|
+
className: "flex gap-2",
|
|
126
|
+
children: [/* @__PURE__ */ k("span", {
|
|
127
|
+
className: "text-muted-foreground w-32 shrink-0",
|
|
128
|
+
children: "UPI ID"
|
|
129
|
+
}), /* @__PURE__ */ k("span", {
|
|
130
|
+
className: "text-foreground font-mono",
|
|
131
|
+
children: r.upiIdMasked
|
|
132
|
+
})]
|
|
133
|
+
}),
|
|
134
|
+
r.swift && /* @__PURE__ */ A("div", {
|
|
135
|
+
className: "flex gap-2",
|
|
136
|
+
children: [/* @__PURE__ */ k("span", {
|
|
137
|
+
className: "text-muted-foreground w-32 shrink-0",
|
|
138
|
+
children: "SWIFT"
|
|
139
|
+
}), /* @__PURE__ */ k("span", {
|
|
140
|
+
className: "text-foreground font-mono",
|
|
141
|
+
children: r.swift
|
|
142
|
+
})]
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
})]
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function F({ request: e, onApprove: t, onReject: n, onMarkPaid: r }) {
|
|
149
|
+
let i = e.status === "REQUESTED" || e.status === "REJECTED", a = e.status === "REQUESTED" || e.status === "APPROVED", c = e.status === "APPROVED" || e.status === "PROCESSING";
|
|
150
|
+
return /* @__PURE__ */ A("div", {
|
|
151
|
+
className: "rounded-lg border border-border bg-card p-5 space-y-4",
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ A("div", {
|
|
154
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
155
|
+
children: [/* @__PURE__ */ A("div", {
|
|
156
|
+
className: "space-y-1",
|
|
157
|
+
children: [/* @__PURE__ */ A("div", {
|
|
158
|
+
className: "flex items-center gap-2",
|
|
159
|
+
children: [/* @__PURE__ */ k("span", {
|
|
160
|
+
className: "text-xl font-semibold text-foreground",
|
|
161
|
+
children: o(e.requestedAmount, e.currency)
|
|
162
|
+
}), /* @__PURE__ */ k(N, { status: e.status })]
|
|
163
|
+
}), /* @__PURE__ */ A("div", {
|
|
164
|
+
className: "text-xs text-muted-foreground space-x-2",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ A("span", { children: ["Requested ", s(e.createdAt)] }),
|
|
167
|
+
e.requesterUserId && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("span", { children: "·" }), /* @__PURE__ */ A("span", { children: ["by ", e.requesterUserId] })] }),
|
|
168
|
+
/* @__PURE__ */ k("span", { children: "·" }),
|
|
169
|
+
/* @__PURE__ */ A("span", {
|
|
170
|
+
className: "font-mono text-xs",
|
|
171
|
+
children: [e.id.slice(0, 8), "…"]
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
})]
|
|
175
|
+
}), /* @__PURE__ */ A("div", {
|
|
176
|
+
className: "flex flex-wrap gap-2",
|
|
177
|
+
children: [
|
|
178
|
+
i && /* @__PURE__ */ A("button", {
|
|
179
|
+
type: "button",
|
|
180
|
+
onClick: () => t(e),
|
|
181
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground",
|
|
182
|
+
children: [/* @__PURE__ */ k(b, { className: "h-3.5 w-3.5" }), "Approve"]
|
|
183
|
+
}),
|
|
184
|
+
c && /* @__PURE__ */ A("button", {
|
|
185
|
+
type: "button",
|
|
186
|
+
onClick: () => r(e),
|
|
187
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-success-surface border border-success-border px-3 py-1.5 text-xs font-medium text-success-foreground",
|
|
188
|
+
children: [/* @__PURE__ */ k(y, { className: "h-3.5 w-3.5" }), "Mark as Paid"]
|
|
189
|
+
}),
|
|
190
|
+
a && /* @__PURE__ */ A("button", {
|
|
191
|
+
type: "button",
|
|
192
|
+
onClick: () => n(e),
|
|
193
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-destructive",
|
|
194
|
+
children: [/* @__PURE__ */ k(D, { className: "h-3.5 w-3.5" }), "Reject"]
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
})]
|
|
198
|
+
}),
|
|
199
|
+
e.payoutAccount && /* @__PURE__ */ k(P, { account: e.payoutAccount }),
|
|
200
|
+
e.userNotes && /* @__PURE__ */ A("div", {
|
|
201
|
+
className: "rounded-md bg-muted/40 border border-border px-3 py-2 text-sm",
|
|
202
|
+
children: [/* @__PURE__ */ k("span", {
|
|
203
|
+
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
|
|
204
|
+
children: "User note"
|
|
205
|
+
}), /* @__PURE__ */ k("p", {
|
|
206
|
+
className: "mt-1 text-foreground",
|
|
207
|
+
children: e.userNotes
|
|
208
|
+
})]
|
|
209
|
+
}),
|
|
210
|
+
(e.internalNotes ?? e.failureReason ?? e.externalReference) && /* @__PURE__ */ A("div", {
|
|
211
|
+
className: "grid gap-1 text-xs text-muted-foreground",
|
|
212
|
+
children: [
|
|
213
|
+
e.externalReference && /* @__PURE__ */ A("div", {
|
|
214
|
+
className: "flex gap-2",
|
|
215
|
+
children: [/* @__PURE__ */ k(T, { className: "h-3.5 w-3.5 mt-px shrink-0" }), /* @__PURE__ */ A("span", { children: ["Ref: ", /* @__PURE__ */ k("span", {
|
|
216
|
+
className: "font-mono text-foreground",
|
|
217
|
+
children: e.externalReference
|
|
218
|
+
})] })]
|
|
219
|
+
}),
|
|
220
|
+
e.internalNotes && /* @__PURE__ */ A("div", {
|
|
221
|
+
className: "flex gap-2",
|
|
222
|
+
children: [/* @__PURE__ */ k("span", {
|
|
223
|
+
className: "shrink-0",
|
|
224
|
+
children: "Internal note:"
|
|
225
|
+
}), /* @__PURE__ */ k("span", {
|
|
226
|
+
className: "text-foreground",
|
|
227
|
+
children: e.internalNotes
|
|
228
|
+
})]
|
|
229
|
+
}),
|
|
230
|
+
e.failureReason && /* @__PURE__ */ A("div", {
|
|
231
|
+
className: "flex gap-2 text-destructive",
|
|
232
|
+
children: [/* @__PURE__ */ k(v, { className: "h-3.5 w-3.5 mt-px shrink-0" }), /* @__PURE__ */ k("span", { children: e.failureReason })]
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
}),
|
|
236
|
+
(e.paidAt ?? e.processedAt) && /* @__PURE__ */ A("div", {
|
|
237
|
+
className: "flex flex-wrap gap-4 text-xs text-muted-foreground",
|
|
238
|
+
children: [e.processedAt && /* @__PURE__ */ A("span", {
|
|
239
|
+
className: "flex items-center gap-1",
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ k(C, { className: "h-3 w-3" }),
|
|
242
|
+
"Processed ",
|
|
243
|
+
s(e.processedAt)
|
|
244
|
+
]
|
|
245
|
+
}), e.paidAt && /* @__PURE__ */ A("span", {
|
|
246
|
+
className: "flex items-center gap-1",
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ k(b, { className: "h-3 w-3" }),
|
|
249
|
+
"Paid ",
|
|
250
|
+
s(e.paidAt)
|
|
251
|
+
]
|
|
252
|
+
})]
|
|
253
|
+
})
|
|
254
|
+
]
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function I({ summary: e }) {
|
|
258
|
+
return /* @__PURE__ */ A("div", {
|
|
259
|
+
className: "grid gap-3 sm:grid-cols-3",
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ A("div", {
|
|
262
|
+
className: "rounded-lg border border-border bg-card p-4",
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ k("div", {
|
|
265
|
+
className: "text-xs text-muted-foreground uppercase tracking-wide",
|
|
266
|
+
children: "Pending payout"
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ k("div", {
|
|
269
|
+
className: "mt-1 text-lg font-semibold text-foreground",
|
|
270
|
+
children: o(e.totalRequestedAmount, "USD")
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ A("div", {
|
|
273
|
+
className: "text-xs text-muted-foreground mt-0.5",
|
|
274
|
+
children: [e.pendingCount, " requests"]
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ A("div", {
|
|
279
|
+
className: "rounded-lg border border-border bg-card p-4",
|
|
280
|
+
children: [/* @__PURE__ */ k("div", {
|
|
281
|
+
className: "text-xs text-muted-foreground uppercase tracking-wide",
|
|
282
|
+
children: "Processing"
|
|
283
|
+
}), /* @__PURE__ */ k("div", {
|
|
284
|
+
className: "mt-1 text-lg font-semibold text-foreground",
|
|
285
|
+
children: o(e.totalProcessingAmount, "USD")
|
|
286
|
+
})]
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ A("div", {
|
|
289
|
+
className: "rounded-lg border border-border bg-card p-4",
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ k("div", {
|
|
292
|
+
className: "text-xs text-muted-foreground uppercase tracking-wide",
|
|
293
|
+
children: "Total paid"
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ k("div", {
|
|
296
|
+
className: "mt-1 text-lg font-semibold text-foreground",
|
|
297
|
+
children: o(e.totalPaidAmount, "USD")
|
|
298
|
+
}),
|
|
299
|
+
e.failedCount > 0 && /* @__PURE__ */ A("div", {
|
|
300
|
+
className: "text-xs text-destructive mt-0.5",
|
|
301
|
+
children: [e.failedCount, " failed"]
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
})
|
|
305
|
+
]
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
function L({ dialog: e, onClose: t, onConfirm: n }) {
|
|
309
|
+
let [r, i] = _(""), [a, s] = _(""), [c, l] = _(""), [u, d] = _(!1), f = async () => {
|
|
310
|
+
e.type === "reject" && !a.trim() || (d(!0), await n({
|
|
311
|
+
notes: r.trim() || void 0,
|
|
312
|
+
reason: a.trim() || void 0,
|
|
313
|
+
externalReference: c.trim() || void 0
|
|
314
|
+
}), d(!1));
|
|
315
|
+
};
|
|
316
|
+
return /* @__PURE__ */ k("div", {
|
|
317
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
318
|
+
children: /* @__PURE__ */ A("div", {
|
|
319
|
+
className: "w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg space-y-4",
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", {
|
|
322
|
+
className: "text-base font-semibold text-foreground",
|
|
323
|
+
children: {
|
|
324
|
+
approve: "Approve withdrawal request",
|
|
325
|
+
reject: "Reject withdrawal request",
|
|
326
|
+
mark_paid: "Mark as paid"
|
|
327
|
+
}[e.type]
|
|
328
|
+
}), /* @__PURE__ */ A("p", {
|
|
329
|
+
className: "text-sm text-muted-foreground mt-1",
|
|
330
|
+
children: [
|
|
331
|
+
o(e.amount, e.currency),
|
|
332
|
+
" · ",
|
|
333
|
+
e.accountLabel
|
|
334
|
+
]
|
|
335
|
+
})] }),
|
|
336
|
+
e.type === "mark_paid" && /* @__PURE__ */ A("div", {
|
|
337
|
+
className: "space-y-3",
|
|
338
|
+
children: [/* @__PURE__ */ A("div", { children: [
|
|
339
|
+
/* @__PURE__ */ k("label", {
|
|
340
|
+
className: "text-xs font-medium text-foreground block mb-1",
|
|
341
|
+
children: "Transaction reference / UTR number"
|
|
342
|
+
}),
|
|
343
|
+
/* @__PURE__ */ k("input", {
|
|
344
|
+
type: "text",
|
|
345
|
+
value: c,
|
|
346
|
+
onChange: (e) => l(e.target.value),
|
|
347
|
+
placeholder: "e.g. UTR123456789012, TXN_abc123",
|
|
348
|
+
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ k("p", {
|
|
351
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
352
|
+
children: "Enter the bank reference number so the user can verify the transfer."
|
|
353
|
+
})
|
|
354
|
+
] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
355
|
+
className: "text-xs font-medium text-foreground block mb-1",
|
|
356
|
+
children: "Internal notes (optional)"
|
|
357
|
+
}), /* @__PURE__ */ k("textarea", {
|
|
358
|
+
value: r,
|
|
359
|
+
onChange: (e) => i(e.target.value),
|
|
360
|
+
rows: 2,
|
|
361
|
+
placeholder: "Any internal notes about this payment…",
|
|
362
|
+
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"
|
|
363
|
+
})] })]
|
|
364
|
+
}),
|
|
365
|
+
e.type === "approve" && /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
366
|
+
className: "text-xs font-medium text-foreground block mb-1",
|
|
367
|
+
children: "Internal notes (optional)"
|
|
368
|
+
}), /* @__PURE__ */ k("textarea", {
|
|
369
|
+
value: r,
|
|
370
|
+
onChange: (e) => i(e.target.value),
|
|
371
|
+
rows: 3,
|
|
372
|
+
placeholder: "e.g. Verified bank details, approved for transfer…",
|
|
373
|
+
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"
|
|
374
|
+
})] }),
|
|
375
|
+
e.type === "reject" && /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A("label", {
|
|
376
|
+
className: "text-xs font-medium text-foreground block mb-1",
|
|
377
|
+
children: ["Reason for rejection ", /* @__PURE__ */ k("span", {
|
|
378
|
+
className: "text-destructive",
|
|
379
|
+
children: "*"
|
|
380
|
+
})]
|
|
381
|
+
}), /* @__PURE__ */ k("textarea", {
|
|
382
|
+
value: a,
|
|
383
|
+
onChange: (e) => s(e.target.value),
|
|
384
|
+
rows: 3,
|
|
385
|
+
placeholder: "e.g. Invalid bank details provided, please re-submit with correct IFSC…",
|
|
386
|
+
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"
|
|
387
|
+
})] }),
|
|
388
|
+
/* @__PURE__ */ A("div", {
|
|
389
|
+
className: "flex justify-end gap-2 pt-2",
|
|
390
|
+
children: [/* @__PURE__ */ k("button", {
|
|
391
|
+
type: "button",
|
|
392
|
+
onClick: t,
|
|
393
|
+
disabled: u,
|
|
394
|
+
className: "rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground disabled:opacity-50",
|
|
395
|
+
children: "Cancel"
|
|
396
|
+
}), /* @__PURE__ */ k("button", {
|
|
397
|
+
type: "button",
|
|
398
|
+
onClick: () => void f(),
|
|
399
|
+
disabled: u || e.type === "reject" && !a.trim(),
|
|
400
|
+
className: `rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50 ${e.type === "reject" ? "bg-destructive text-destructive-foreground" : "bg-primary text-primary-foreground"}`,
|
|
401
|
+
children: u ? "Saving…" : e.type === "approve" ? "Approve" : e.type === "reject" ? "Reject" : "Confirm Payment"
|
|
402
|
+
})]
|
|
403
|
+
})
|
|
404
|
+
]
|
|
405
|
+
})
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
var R = () => {
|
|
409
|
+
let o = l(), { emit: s } = a(), { apiGatewayUrl: v, authToken: y, orgId: x } = e(), [S, C] = _(null), [w, T] = _([]), [D, O] = _(!0), [j, M] = _(null), [N, P] = _("pending"), [R, z] = _(null), B = g(() => ({
|
|
410
|
+
apiGatewayUrl: v,
|
|
411
|
+
authToken: y,
|
|
412
|
+
orgId: x
|
|
23
413
|
}), [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
]),
|
|
28
|
-
|
|
414
|
+
v,
|
|
415
|
+
y,
|
|
416
|
+
x
|
|
417
|
+
]), V = async () => {
|
|
418
|
+
O(!0), M(null);
|
|
29
419
|
try {
|
|
30
|
-
let [e, t] = await Promise.all([
|
|
31
|
-
|
|
420
|
+
let [e, t] = await Promise.all([f(B), d(B)]);
|
|
421
|
+
C(e), T(t);
|
|
32
422
|
} catch (e) {
|
|
33
|
-
|
|
423
|
+
M(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load payout queue"));
|
|
34
424
|
} finally {
|
|
35
|
-
|
|
425
|
+
O(!1);
|
|
36
426
|
}
|
|
37
427
|
};
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
if (
|
|
428
|
+
if (h(() => {
|
|
429
|
+
V();
|
|
430
|
+
}, [B]), !o.isBillingAdmin) return /* @__PURE__ */ k(t, { message: "You don't have permission to manage payouts." });
|
|
431
|
+
if (j && c(j)) return /* @__PURE__ */ k(i, {
|
|
42
432
|
title: "Payout queue unavailable",
|
|
43
|
-
message:
|
|
44
|
-
onRetry: () => void
|
|
433
|
+
message: j.message,
|
|
434
|
+
onRetry: () => void V(),
|
|
45
435
|
showRetry: !0
|
|
46
436
|
});
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
437
|
+
let H = w.filter((e) => e.status === "REQUESTED"), U = w.filter((e) => e.status === "APPROVED" || e.status === "PROCESSING"), W = w.filter((e) => [
|
|
438
|
+
"PAID",
|
|
439
|
+
"REJECTED",
|
|
440
|
+
"FAILED",
|
|
441
|
+
"CANCELED"
|
|
442
|
+
].includes(e.status)), G = [
|
|
53
443
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
444
|
+
id: "pending",
|
|
445
|
+
label: "Pending",
|
|
446
|
+
count: H.length
|
|
57
447
|
},
|
|
58
448
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
449
|
+
id: "approved",
|
|
450
|
+
label: "Approved",
|
|
451
|
+
count: U.length
|
|
62
452
|
},
|
|
63
453
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
454
|
+
id: "history",
|
|
455
|
+
label: "History",
|
|
456
|
+
count: W.length
|
|
67
457
|
}
|
|
68
|
-
] :
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
t && (await h(e, t, z), D("billing.payout.rejected", {
|
|
77
|
-
route: "/billing/payouts",
|
|
78
|
-
entityId: e,
|
|
79
|
-
source: "payout-admin",
|
|
80
|
-
reason: t
|
|
81
|
-
}), await B());
|
|
82
|
-
}, W = async (e) => {
|
|
83
|
-
await m(e, z), D("billing.payout.processed", {
|
|
84
|
-
route: "/billing/payouts",
|
|
85
|
-
entityId: e,
|
|
86
|
-
source: "payout-admin"
|
|
87
|
-
}), await B();
|
|
458
|
+
], K = N === "pending" ? H : N === "approved" ? U : W, q = (e, t) => {
|
|
459
|
+
z({
|
|
460
|
+
type: e,
|
|
461
|
+
requestId: t.id,
|
|
462
|
+
amount: t.requestedAmount,
|
|
463
|
+
currency: t.currency,
|
|
464
|
+
accountLabel: t.payoutAccount?.displayName ?? t.payoutAccount?.label ?? "Unknown account"
|
|
465
|
+
});
|
|
88
466
|
};
|
|
89
|
-
return /* @__PURE__ */
|
|
467
|
+
return /* @__PURE__ */ A("div", {
|
|
90
468
|
className: "space-y-6 p-6",
|
|
91
469
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ k(n, {
|
|
93
471
|
title: "Payout queue",
|
|
94
|
-
description: "
|
|
95
|
-
actions: /* @__PURE__ */
|
|
472
|
+
description: "Review withdrawal requests, verify bank details, and mark payments as paid once transferred.",
|
|
473
|
+
actions: /* @__PURE__ */ A("button", {
|
|
96
474
|
type: "button",
|
|
97
|
-
onClick: () => void
|
|
475
|
+
onClick: () => void V(),
|
|
98
476
|
className: "inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-foreground",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ k(E, { className: `h-4 w-4 ${D ? "animate-spin" : ""}` }), "Refresh"]
|
|
100
478
|
})
|
|
101
479
|
}),
|
|
102
|
-
|
|
103
|
-
|
|
480
|
+
S && !D && /* @__PURE__ */ k(I, { summary: S }),
|
|
481
|
+
D && /* @__PURE__ */ k("div", {
|
|
482
|
+
className: "grid gap-3 sm:grid-cols-3",
|
|
104
483
|
children: [
|
|
105
484
|
1,
|
|
106
485
|
2,
|
|
107
|
-
3
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
className: "
|
|
112
|
-
children:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
children: "Status breakdown"
|
|
126
|
-
}), /* @__PURE__ */ w("div", {
|
|
127
|
-
className: "space-y-2 text-sm",
|
|
128
|
-
children: (j.statusBreakdown || []).map((e) => /* @__PURE__ */ T("div", {
|
|
129
|
-
className: "flex items-center justify-between",
|
|
130
|
-
children: [/* @__PURE__ */ w("span", {
|
|
131
|
-
className: "text-muted-foreground",
|
|
132
|
-
children: e.status
|
|
133
|
-
}), /* @__PURE__ */ T("span", {
|
|
134
|
-
className: "font-medium text-foreground",
|
|
135
|
-
children: [
|
|
136
|
-
e.count,
|
|
137
|
-
" · ",
|
|
138
|
-
s(e.totalAmount, "USD")
|
|
139
|
-
]
|
|
140
|
-
})]
|
|
141
|
-
}, e.status))
|
|
142
|
-
})]
|
|
143
|
-
}), /* @__PURE__ */ T("div", {
|
|
144
|
-
className: "rounded-lg border border-border bg-card p-4",
|
|
145
|
-
children: [/* @__PURE__ */ w("h3", {
|
|
146
|
-
className: "mb-3 text-sm font-semibold text-foreground",
|
|
147
|
-
children: "Provider breakdown"
|
|
148
|
-
}), /* @__PURE__ */ w("div", {
|
|
149
|
-
className: "space-y-2 text-sm",
|
|
150
|
-
children: (j.providerBreakdown || []).map((e) => /* @__PURE__ */ T("div", {
|
|
151
|
-
className: "flex items-center justify-between",
|
|
152
|
-
children: [/* @__PURE__ */ w("span", {
|
|
153
|
-
className: "text-muted-foreground",
|
|
154
|
-
children: e.provider
|
|
155
|
-
}), /* @__PURE__ */ T("span", {
|
|
156
|
-
className: "font-medium text-foreground",
|
|
157
|
-
children: [
|
|
158
|
-
e.count,
|
|
159
|
-
" · ",
|
|
160
|
-
s(e.totalAmount, "USD")
|
|
161
|
-
]
|
|
162
|
-
})]
|
|
163
|
-
}, e.provider))
|
|
486
|
+
3
|
|
487
|
+
].map((e) => /* @__PURE__ */ k("div", { className: "h-20 animate-pulse rounded-lg border border-border bg-card" }, e))
|
|
488
|
+
}),
|
|
489
|
+
j && !c(j) && /* @__PURE__ */ k("div", {
|
|
490
|
+
className: "rounded-lg border border-destructive/30 bg-destructive/10 p-4 text-sm text-destructive",
|
|
491
|
+
children: j.message
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ k("div", {
|
|
494
|
+
className: "border-b border-border",
|
|
495
|
+
children: /* @__PURE__ */ k("div", {
|
|
496
|
+
className: "flex gap-0",
|
|
497
|
+
children: G.map((e) => /* @__PURE__ */ A("button", {
|
|
498
|
+
type: "button",
|
|
499
|
+
onClick: () => P(e.id),
|
|
500
|
+
className: `flex items-center gap-2 border-b-2 px-4 py-2.5 text-sm font-medium transition-colors ${N === e.id ? "border-primary text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
|
|
501
|
+
children: [e.label, e.count > 0 && /* @__PURE__ */ k("span", {
|
|
502
|
+
className: `rounded-full px-1.5 py-0.5 text-xs ${N === e.id ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`,
|
|
503
|
+
children: e.count
|
|
164
504
|
})]
|
|
165
|
-
})
|
|
166
|
-
})
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
className: "rounded-lg border border-border bg-
|
|
170
|
-
children:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
/* @__PURE__ */ w("td", {
|
|
217
|
-
className: "px-3 py-2 font-medium",
|
|
218
|
-
children: s(e.requestedAmount, e.currency)
|
|
219
|
-
}),
|
|
220
|
-
/* @__PURE__ */ w("td", {
|
|
221
|
-
className: "px-3 py-2",
|
|
222
|
-
children: e.provider
|
|
223
|
-
}),
|
|
224
|
-
/* @__PURE__ */ w("td", {
|
|
225
|
-
className: "px-3 py-2",
|
|
226
|
-
children: e.status
|
|
227
|
-
}),
|
|
228
|
-
/* @__PURE__ */ w("td", {
|
|
229
|
-
className: "px-3 py-2",
|
|
230
|
-
children: e.payoutAccount?.label || "-"
|
|
231
|
-
}),
|
|
232
|
-
/* @__PURE__ */ w("td", {
|
|
233
|
-
className: "px-3 py-2",
|
|
234
|
-
children: c(e.createdAt)
|
|
235
|
-
}),
|
|
236
|
-
/* @__PURE__ */ w("td", {
|
|
237
|
-
className: "px-3 py-2",
|
|
238
|
-
children: /* @__PURE__ */ T("div", {
|
|
239
|
-
className: "flex flex-wrap gap-2",
|
|
240
|
-
children: [
|
|
241
|
-
e.status === "REQUESTED" || e.status === "REJECTED" ? /* @__PURE__ */ w("button", {
|
|
242
|
-
type: "button",
|
|
243
|
-
onClick: () => void H(e.id),
|
|
244
|
-
className: "rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground",
|
|
245
|
-
children: "Approve"
|
|
246
|
-
}) : null,
|
|
247
|
-
e.status === "REQUESTED" || e.status === "APPROVED" ? /* @__PURE__ */ w("button", {
|
|
248
|
-
type: "button",
|
|
249
|
-
onClick: () => void U(e.id),
|
|
250
|
-
className: "rounded-md border border-border px-3 py-1.5 text-xs font-medium text-destructive",
|
|
251
|
-
children: "Reject"
|
|
252
|
-
}) : null,
|
|
253
|
-
e.status === "APPROVED" ? /* @__PURE__ */ w("button", {
|
|
254
|
-
type: "button",
|
|
255
|
-
onClick: () => void W(e.id),
|
|
256
|
-
className: "rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground",
|
|
257
|
-
children: "Process"
|
|
258
|
-
}) : null
|
|
259
|
-
]
|
|
260
|
-
})
|
|
261
|
-
})
|
|
262
|
-
]
|
|
263
|
-
}, e.id)) })]
|
|
264
|
-
})
|
|
265
|
-
})]
|
|
505
|
+
}, e.id))
|
|
506
|
+
})
|
|
507
|
+
}),
|
|
508
|
+
N === "approved" && U.length > 0 && /* @__PURE__ */ A("div", {
|
|
509
|
+
className: "rounded-lg border border-info-border bg-info-surface px-4 py-3 text-sm text-info-foreground",
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ k("strong", { children: "How to pay:" }),
|
|
512
|
+
" Click the account row to expand bank/UPI details → transfer the exact amount via your bank → click ",
|
|
513
|
+
/* @__PURE__ */ k("strong", { children: "Mark as Paid" }),
|
|
514
|
+
" and enter the UTR / transaction reference number."
|
|
515
|
+
]
|
|
516
|
+
}),
|
|
517
|
+
D ? /* @__PURE__ */ k("div", {
|
|
518
|
+
className: "space-y-4",
|
|
519
|
+
children: [1, 2].map((e) => /* @__PURE__ */ k("div", { className: "h-40 animate-pulse rounded-lg border border-border bg-card" }, e))
|
|
520
|
+
}) : K.length === 0 ? /* @__PURE__ */ k(r, {
|
|
521
|
+
icon: /* @__PURE__ */ k(b, { className: "h-8 w-8" }),
|
|
522
|
+
title: N === "pending" ? "No pending requests" : N === "approved" ? "No approved requests awaiting payment" : "No history yet",
|
|
523
|
+
description: N === "pending" ? "New withdrawal requests will appear here." : N === "approved" ? "Approve pending requests first, then send payment and mark as paid." : "Completed and rejected requests will appear here."
|
|
524
|
+
}) : /* @__PURE__ */ k("div", {
|
|
525
|
+
className: "space-y-4",
|
|
526
|
+
children: K.map((e) => /* @__PURE__ */ k(F, {
|
|
527
|
+
request: e,
|
|
528
|
+
onApprove: (e) => q("approve", e),
|
|
529
|
+
onReject: (e) => q("reject", e),
|
|
530
|
+
onMarkPaid: (e) => q("mark_paid", e)
|
|
531
|
+
}, e.id))
|
|
532
|
+
}),
|
|
533
|
+
R && /* @__PURE__ */ k(L, {
|
|
534
|
+
dialog: R,
|
|
535
|
+
onClose: () => z(null),
|
|
536
|
+
onConfirm: async (e) => {
|
|
537
|
+
if (R) try {
|
|
538
|
+
R.type === "approve" ? (await u(R.requestId, e.notes ?? null, B), s("billing.payout.approved", {
|
|
539
|
+
route: "/billing/payouts",
|
|
540
|
+
entityId: R.requestId,
|
|
541
|
+
source: "payout-admin"
|
|
542
|
+
})) : R.type === "reject" ? (await m(R.requestId, e.reason ?? "", B), s("billing.payout.rejected", {
|
|
543
|
+
route: "/billing/payouts",
|
|
544
|
+
entityId: R.requestId,
|
|
545
|
+
source: "payout-admin",
|
|
546
|
+
reason: e.reason
|
|
547
|
+
})) : R.type === "mark_paid" && (await p(R.requestId, e.externalReference ?? null, e.notes ?? null, B), s("billing.payout.processed", {
|
|
548
|
+
route: "/billing/payouts",
|
|
549
|
+
entityId: R.requestId,
|
|
550
|
+
source: "payout-admin"
|
|
551
|
+
})), z(null), await V();
|
|
552
|
+
} catch (e) {
|
|
553
|
+
M(e instanceof Error ? e : /* @__PURE__ */ Error("Action failed"));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
266
556
|
})
|
|
267
557
|
]
|
|
268
558
|
});
|
|
269
559
|
};
|
|
270
560
|
//#endregion
|
|
271
|
-
export {
|
|
561
|
+
export { R as PayoutAdminPage };
|
|
272
562
|
|
|
273
563
|
//# sourceMappingURL=PayoutAdminPage.js.map
|