@burdenoff/microfe-billing 2026.623.3 → 2026.624.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 +3 -3
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +34 -34
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +94 -94
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +162 -187
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +146 -153
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +10 -10
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +62 -62
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +164 -179
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +8 -8
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +243 -305
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +73 -78
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +173 -179
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +4 -4
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +181 -173
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +111 -99
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +68 -83
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.js +4 -4
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.js +8 -8
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +11 -11
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.js +1 -1
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,8 +9,80 @@ import { useEffect as s, useState as c } from "react";
|
|
|
9
9
|
import { ArrowLeft as l, BarChart2 as u, Calendar as d, ChevronLeft as f, ChevronRight as p, Edit as m, History as h, Package as g, Tag as _, Users as v } from "lucide-react";
|
|
10
10
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
11
|
import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
import { ResponsiveTable as C } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
//#region src/billing/modules/coupons/pages/CouponDetailPage.tsx
|
|
13
|
-
|
|
14
|
+
var w = [
|
|
15
|
+
{
|
|
16
|
+
key: "userId",
|
|
17
|
+
header: "User ID",
|
|
18
|
+
priority: "primary",
|
|
19
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
20
|
+
className: "font-mono",
|
|
21
|
+
children: [e.userId.slice(0, 12), "…"]
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: "transaction",
|
|
26
|
+
header: "Transaction",
|
|
27
|
+
cell: (e) => e.transactionId ? /* @__PURE__ */ x("span", {
|
|
28
|
+
className: "font-mono text-xs text-text-link",
|
|
29
|
+
children: [e.transactionId.slice(0, 12), "…"]
|
|
30
|
+
}) : e.orderId ? /* @__PURE__ */ x("span", {
|
|
31
|
+
className: "text-xs text-text-muted",
|
|
32
|
+
children: [
|
|
33
|
+
"Order: ",
|
|
34
|
+
e.orderId.slice(0, 12),
|
|
35
|
+
"…"
|
|
36
|
+
]
|
|
37
|
+
}) : /* @__PURE__ */ b("span", {
|
|
38
|
+
className: "text-text-muted",
|
|
39
|
+
children: ", "
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "original",
|
|
44
|
+
header: "Original",
|
|
45
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
46
|
+
className: "tabular-nums",
|
|
47
|
+
children: [
|
|
48
|
+
e.originalAmount.toFixed(2),
|
|
49
|
+
" ",
|
|
50
|
+
e.currency
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: "discount",
|
|
56
|
+
header: "Discount",
|
|
57
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
58
|
+
className: "tabular-nums text-status-success-text font-medium",
|
|
59
|
+
children: [
|
|
60
|
+
"-",
|
|
61
|
+
e.discountValue.toFixed(2),
|
|
62
|
+
" ",
|
|
63
|
+
e.currency
|
|
64
|
+
]
|
|
65
|
+
})
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: "final",
|
|
69
|
+
header: "Final",
|
|
70
|
+
cell: (e) => /* @__PURE__ */ x("span", {
|
|
71
|
+
className: "tabular-nums font-medium",
|
|
72
|
+
children: [
|
|
73
|
+
e.finalAmount.toFixed(2),
|
|
74
|
+
" ",
|
|
75
|
+
e.currency
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: "usedAt",
|
|
81
|
+
header: "Used At",
|
|
82
|
+
cell: (e) => new Date(e.usedAt).toLocaleString()
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
function T({ status: e }) {
|
|
14
86
|
let { label: t, className: n } = {
|
|
15
87
|
[o.Active]: {
|
|
16
88
|
label: "Active",
|
|
@@ -37,7 +109,7 @@ function C({ status: e }) {
|
|
|
37
109
|
children: t
|
|
38
110
|
});
|
|
39
111
|
}
|
|
40
|
-
function
|
|
112
|
+
function E({ label: e, value: t }) {
|
|
41
113
|
return /* @__PURE__ */ x("div", {
|
|
42
114
|
className: "flex items-start gap-2 py-3 border-b border-border-subtle last:border-0",
|
|
43
115
|
children: [/* @__PURE__ */ b("span", {
|
|
@@ -49,29 +121,29 @@ function w({ label: e, value: t }) {
|
|
|
49
121
|
})]
|
|
50
122
|
});
|
|
51
123
|
}
|
|
52
|
-
var
|
|
53
|
-
let { t: o } = S(),
|
|
124
|
+
var D = () => {
|
|
125
|
+
let { t: o } = S(), D = (e, t) => {
|
|
54
126
|
let n = o(e);
|
|
55
127
|
return n === e ? t : n;
|
|
56
|
-
},
|
|
128
|
+
}, O = a(), k = n(), A = window.location.pathname.split("/").filter(Boolean).slice(-1)[0], [j, M] = c("details"), [N, P] = c(0), [F, { data: I, loading: L, error: R }] = r(), { data: z, loading: B } = i({
|
|
57
129
|
variables: {
|
|
58
|
-
couponId:
|
|
130
|
+
couponId: A,
|
|
59
131
|
limit: 20,
|
|
60
|
-
offset:
|
|
132
|
+
offset: N * 20
|
|
61
133
|
},
|
|
62
|
-
skip: !
|
|
134
|
+
skip: !A || j !== "usage"
|
|
63
135
|
});
|
|
64
136
|
if (s(() => {
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
if (
|
|
137
|
+
A && F({ variables: { id: A } });
|
|
138
|
+
}, [A, F]), !k.canManageDiscounts) return /* @__PURE__ */ b(e, { message: "You don't have permission to view coupon details." });
|
|
139
|
+
if (L) return /* @__PURE__ */ x("div", {
|
|
68
140
|
className: "p-8",
|
|
69
141
|
children: [/* @__PURE__ */ b(t, {
|
|
70
|
-
title:
|
|
142
|
+
title: D("billing.coupons.detailTitle", "Coupon Details"),
|
|
71
143
|
description: "Loading...",
|
|
72
144
|
actions: /* @__PURE__ */ x("button", {
|
|
73
145
|
type: "button",
|
|
74
|
-
onClick: () =>
|
|
146
|
+
onClick: () => O("/coupons"),
|
|
75
147
|
className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
|
|
76
148
|
children: [/* @__PURE__ */ b(l, { className: "size-4" }), "Back"]
|
|
77
149
|
})
|
|
@@ -80,43 +152,43 @@ var T = () => {
|
|
|
80
152
|
children: /* @__PURE__ */ b("div", { className: "size-8 animate-spin rounded-full border-4 border-action-primary-bg border-t-transparent" })
|
|
81
153
|
})]
|
|
82
154
|
});
|
|
83
|
-
if (
|
|
155
|
+
if (R || !I?.getCoupon) return /* @__PURE__ */ x("div", {
|
|
84
156
|
className: "p-8",
|
|
85
157
|
children: [/* @__PURE__ */ b(t, {
|
|
86
158
|
title: "Coupon Details",
|
|
87
159
|
description: "Coupon not found",
|
|
88
160
|
actions: /* @__PURE__ */ x("button", {
|
|
89
161
|
type: "button",
|
|
90
|
-
onClick: () =>
|
|
162
|
+
onClick: () => O("/coupons"),
|
|
91
163
|
className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
|
|
92
164
|
children: [/* @__PURE__ */ b(l, { className: "size-4" }), "Back"]
|
|
93
165
|
})
|
|
94
166
|
}), /* @__PURE__ */ b("div", {
|
|
95
167
|
className: "flex items-center justify-center h-64 text-status-error-text text-sm",
|
|
96
|
-
children:
|
|
168
|
+
children: R ? `Error: ${R.message}` : "Coupon not found"
|
|
97
169
|
})]
|
|
98
170
|
});
|
|
99
|
-
let
|
|
171
|
+
let V = I.getCoupon, H = V.maxTotalUses && V.maxTotalUses > 0 ? Math.round(V.currentUses / V.maxTotalUses * 100) : null, U = (e) => e ? new Date(e).toLocaleDateString(void 0, {
|
|
100
172
|
year: "numeric",
|
|
101
173
|
month: "short",
|
|
102
174
|
day: "numeric"
|
|
103
|
-
}) : null,
|
|
175
|
+
}) : null, W = () => V.type === "PERCENTAGE" ? `${V.value}%` : `${V.value}${V.currency ? ` ${V.currency}` : ""}`;
|
|
104
176
|
return /* @__PURE__ */ x("div", {
|
|
105
177
|
className: "p-8",
|
|
106
178
|
children: [
|
|
107
179
|
/* @__PURE__ */ b(t, {
|
|
108
|
-
title:
|
|
109
|
-
description:
|
|
180
|
+
title: V.name || V.code,
|
|
181
|
+
description: V.description || `Coupon code: ${V.code}`,
|
|
110
182
|
actions: /* @__PURE__ */ x("div", {
|
|
111
183
|
className: "flex items-center gap-3",
|
|
112
184
|
children: [/* @__PURE__ */ x("button", {
|
|
113
185
|
type: "button",
|
|
114
|
-
onClick: () =>
|
|
186
|
+
onClick: () => O("/coupons"),
|
|
115
187
|
className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
|
|
116
188
|
children: [/* @__PURE__ */ b(l, { className: "size-4" }), "Back"]
|
|
117
189
|
}), /* @__PURE__ */ x("button", {
|
|
118
190
|
type: "button",
|
|
119
|
-
onClick: () =>
|
|
191
|
+
onClick: () => O(`/coupons/${V.id}/edit`),
|
|
120
192
|
className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover flex items-center gap-2",
|
|
121
193
|
children: [/* @__PURE__ */ b(m, { className: "size-4" }), "Edit"]
|
|
122
194
|
})]
|
|
@@ -126,131 +198,44 @@ var T = () => {
|
|
|
126
198
|
className: "mt-6 border-b border-border-subtle flex gap-1",
|
|
127
199
|
children: ["details", "usage"].map((e) => /* @__PURE__ */ x("button", {
|
|
128
200
|
type: "button",
|
|
129
|
-
onClick: () =>
|
|
130
|
-
className: `flex items-center gap-2 px-4 py-2.5 text-sm font-medium border-b-2 -mb-px transition-colors ${
|
|
131
|
-
children: [b(e === "details" ? _ : h, { className: "size-4" }), e === "details" ? "Details" : `Usage History${
|
|
201
|
+
onClick: () => M(e),
|
|
202
|
+
className: `flex items-center gap-2 px-4 py-2.5 text-sm font-medium border-b-2 -mb-px transition-colors ${j === e ? "border-action-primary-bg text-text-primary" : "border-transparent text-text-muted hover:text-text-primary"}`,
|
|
203
|
+
children: [b(e === "details" ? _ : h, { className: "size-4" }), e === "details" ? "Details" : `Usage History${z ? ` (${z.getCouponUsageHistory.total})` : ""}`]
|
|
132
204
|
}, e))
|
|
133
205
|
}),
|
|
134
|
-
|
|
206
|
+
j === "usage" && /* @__PURE__ */ b("div", {
|
|
135
207
|
className: "mt-6 bg-bg-surface border border-border-subtle rounded-lg overflow-hidden",
|
|
136
|
-
children:
|
|
208
|
+
children: B ? /* @__PURE__ */ b("div", {
|
|
137
209
|
className: "flex items-center justify-center h-40",
|
|
138
210
|
children: /* @__PURE__ */ b("div", { className: "size-6 animate-spin rounded-full border-4 border-action-primary-bg border-t-transparent" })
|
|
139
|
-
}) :
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
className: "bg-bg-sunken/50 border-b border-border-subtle",
|
|
145
|
-
children: /* @__PURE__ */ x("tr", { children: [
|
|
146
|
-
/* @__PURE__ */ b("th", {
|
|
147
|
-
className: "text-left p-4 text-xs font-medium text-text-muted uppercase tracking-wide",
|
|
148
|
-
children: "User ID"
|
|
149
|
-
}),
|
|
150
|
-
/* @__PURE__ */ b("th", {
|
|
151
|
-
className: "text-left p-4 text-xs font-medium text-text-muted uppercase tracking-wide",
|
|
152
|
-
children: "Transaction"
|
|
153
|
-
}),
|
|
154
|
-
/* @__PURE__ */ b("th", {
|
|
155
|
-
className: "text-left p-4 text-xs font-medium text-text-muted uppercase tracking-wide",
|
|
156
|
-
children: "Original"
|
|
157
|
-
}),
|
|
158
|
-
/* @__PURE__ */ b("th", {
|
|
159
|
-
className: "text-left p-4 text-xs font-medium text-text-muted uppercase tracking-wide",
|
|
160
|
-
children: "Discount"
|
|
161
|
-
}),
|
|
162
|
-
/* @__PURE__ */ b("th", {
|
|
163
|
-
className: "text-left p-4 text-xs font-medium text-text-muted uppercase tracking-wide",
|
|
164
|
-
children: "Final"
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ b("th", {
|
|
167
|
-
className: "text-left p-4 text-xs font-medium text-text-muted uppercase tracking-wide",
|
|
168
|
-
children: "Used At"
|
|
169
|
-
})
|
|
170
|
-
] })
|
|
171
|
-
}), /* @__PURE__ */ b("tbody", {
|
|
172
|
-
className: "divide-y divide-border-subtle",
|
|
173
|
-
children: L.getCouponUsageHistory.usages.map((e) => /* @__PURE__ */ x("tr", {
|
|
174
|
-
className: "hover:bg-bg-sunken/30",
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ x("td", {
|
|
177
|
-
className: "p-4 text-sm text-text-primary font-mono",
|
|
178
|
-
children: [e.userId.slice(0, 12), "…"]
|
|
179
|
-
}),
|
|
180
|
-
/* @__PURE__ */ b("td", {
|
|
181
|
-
className: "p-4 text-sm",
|
|
182
|
-
children: e.transactionId ? /* @__PURE__ */ x("span", {
|
|
183
|
-
className: "font-mono text-xs text-text-link",
|
|
184
|
-
children: [e.transactionId.slice(0, 12), "…"]
|
|
185
|
-
}) : e.orderId ? /* @__PURE__ */ x("span", {
|
|
186
|
-
className: "text-xs text-text-muted",
|
|
187
|
-
children: [
|
|
188
|
-
"Order: ",
|
|
189
|
-
e.orderId.slice(0, 12),
|
|
190
|
-
"…"
|
|
191
|
-
]
|
|
192
|
-
}) : /* @__PURE__ */ b("span", {
|
|
193
|
-
className: "text-text-muted",
|
|
194
|
-
children: ", "
|
|
195
|
-
})
|
|
196
|
-
}),
|
|
197
|
-
/* @__PURE__ */ x("td", {
|
|
198
|
-
className: "p-4 text-sm text-text-primary",
|
|
199
|
-
children: [
|
|
200
|
-
e.originalAmount.toFixed(2),
|
|
201
|
-
" ",
|
|
202
|
-
e.currency
|
|
203
|
-
]
|
|
204
|
-
}),
|
|
205
|
-
/* @__PURE__ */ x("td", {
|
|
206
|
-
className: "p-4 text-sm text-status-success-text font-medium",
|
|
207
|
-
children: [
|
|
208
|
-
"-",
|
|
209
|
-
e.discountValue.toFixed(2),
|
|
210
|
-
" ",
|
|
211
|
-
e.currency
|
|
212
|
-
]
|
|
213
|
-
}),
|
|
214
|
-
/* @__PURE__ */ x("td", {
|
|
215
|
-
className: "p-4 text-sm text-text-primary font-medium",
|
|
216
|
-
children: [
|
|
217
|
-
e.finalAmount.toFixed(2),
|
|
218
|
-
" ",
|
|
219
|
-
e.currency
|
|
220
|
-
]
|
|
221
|
-
}),
|
|
222
|
-
/* @__PURE__ */ b("td", {
|
|
223
|
-
className: "p-4 text-sm text-text-muted",
|
|
224
|
-
children: new Date(e.usedAt).toLocaleString()
|
|
225
|
-
})
|
|
226
|
-
]
|
|
227
|
-
}, e.id))
|
|
228
|
-
})]
|
|
229
|
-
})
|
|
230
|
-
}), (L.getCouponUsageHistory.total ?? 0) > 20 && /* @__PURE__ */ x("div", {
|
|
211
|
+
}) : z?.getCouponUsageHistory.usages.length ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(C, {
|
|
212
|
+
data: z.getCouponUsageHistory.usages,
|
|
213
|
+
rowKey: (e) => e.id,
|
|
214
|
+
columns: w
|
|
215
|
+
}), (z.getCouponUsageHistory.total ?? 0) > 20 && /* @__PURE__ */ x("div", {
|
|
231
216
|
className: "flex items-center justify-between p-4 border-t border-border-subtle",
|
|
232
217
|
children: [/* @__PURE__ */ x("p", {
|
|
233
218
|
className: "text-sm text-text-muted",
|
|
234
219
|
children: [
|
|
235
|
-
|
|
220
|
+
N * 20 + 1,
|
|
236
221
|
"–",
|
|
237
|
-
Math.min((
|
|
222
|
+
Math.min((N + 1) * 20, z.getCouponUsageHistory.total),
|
|
238
223
|
" ",
|
|
239
224
|
"of ",
|
|
240
|
-
|
|
225
|
+
z.getCouponUsageHistory.total
|
|
241
226
|
]
|
|
242
227
|
}), /* @__PURE__ */ x("div", {
|
|
243
228
|
className: "flex items-center gap-2",
|
|
244
229
|
children: [/* @__PURE__ */ b("button", {
|
|
245
230
|
type: "button",
|
|
246
|
-
onClick: () =>
|
|
247
|
-
disabled:
|
|
231
|
+
onClick: () => P((e) => Math.max(0, e - 1)),
|
|
232
|
+
disabled: N === 0,
|
|
248
233
|
className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken disabled:opacity-40",
|
|
249
234
|
children: /* @__PURE__ */ b(f, { className: "size-4" })
|
|
250
235
|
}), /* @__PURE__ */ b("button", {
|
|
251
236
|
type: "button",
|
|
252
|
-
onClick: () =>
|
|
253
|
-
disabled: !
|
|
237
|
+
onClick: () => P((e) => e + 1),
|
|
238
|
+
disabled: !z.getCouponUsageHistory.hasMore,
|
|
254
239
|
className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken disabled:opacity-40",
|
|
255
240
|
children: /* @__PURE__ */ b(p, { className: "size-4" })
|
|
256
241
|
})]
|
|
@@ -260,7 +245,7 @@ var T = () => {
|
|
|
260
245
|
children: "No usage recorded for this coupon yet."
|
|
261
246
|
})
|
|
262
247
|
}),
|
|
263
|
-
|
|
248
|
+
j === "details" && /* @__PURE__ */ x("div", {
|
|
264
249
|
className: "mt-8 grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
265
250
|
children: [
|
|
266
251
|
/* @__PURE__ */ x("div", {
|
|
@@ -276,7 +261,7 @@ var T = () => {
|
|
|
276
261
|
})]
|
|
277
262
|
}), /* @__PURE__ */ b("p", {
|
|
278
263
|
className: "text-lg font-mono font-bold text-text-primary",
|
|
279
|
-
children:
|
|
264
|
+
children: V.code
|
|
280
265
|
})]
|
|
281
266
|
}),
|
|
282
267
|
/* @__PURE__ */ x("div", {
|
|
@@ -291,11 +276,11 @@ var T = () => {
|
|
|
291
276
|
}),
|
|
292
277
|
/* @__PURE__ */ b("p", {
|
|
293
278
|
className: "text-lg font-bold text-text-primary",
|
|
294
|
-
children:
|
|
279
|
+
children: W()
|
|
295
280
|
}),
|
|
296
281
|
/* @__PURE__ */ b("p", {
|
|
297
282
|
className: "text-xs text-text-muted capitalize",
|
|
298
|
-
children:
|
|
283
|
+
children: V.type.replace("_", " ").toLowerCase()
|
|
299
284
|
})
|
|
300
285
|
]
|
|
301
286
|
}),
|
|
@@ -311,13 +296,13 @@ var T = () => {
|
|
|
311
296
|
}),
|
|
312
297
|
/* @__PURE__ */ x("p", {
|
|
313
298
|
className: "text-lg font-bold text-text-primary",
|
|
314
|
-
children: [
|
|
299
|
+
children: [V.currentUses, V.maxTotalUses ? ` / ${V.maxTotalUses}` : ""]
|
|
315
300
|
}),
|
|
316
|
-
|
|
301
|
+
H !== null && /* @__PURE__ */ b("div", {
|
|
317
302
|
className: "mt-1.5 h-1.5 w-full bg-bg-sunken rounded-full overflow-hidden",
|
|
318
303
|
children: /* @__PURE__ */ b("div", {
|
|
319
304
|
className: "h-full bg-action-primary-bg rounded-full",
|
|
320
|
-
style: { width: `${Math.min(
|
|
305
|
+
style: { width: `${Math.min(H, 100)}%` }
|
|
321
306
|
})
|
|
322
307
|
})
|
|
323
308
|
]
|
|
@@ -334,11 +319,11 @@ var T = () => {
|
|
|
334
319
|
}),
|
|
335
320
|
/* @__PURE__ */ b("div", {
|
|
336
321
|
className: "mt-1",
|
|
337
|
-
children: /* @__PURE__ */ b(
|
|
322
|
+
children: /* @__PURE__ */ b(T, { status: V.status })
|
|
338
323
|
}),
|
|
339
|
-
|
|
324
|
+
V.validUntil && /* @__PURE__ */ x("p", {
|
|
340
325
|
className: "text-xs text-text-muted mt-1",
|
|
341
|
-
children: ["Expires ", V
|
|
326
|
+
children: ["Expires ", U(V.validUntil)]
|
|
342
327
|
})
|
|
343
328
|
]
|
|
344
329
|
})
|
|
@@ -353,36 +338,36 @@ var T = () => {
|
|
|
353
338
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
|
|
354
339
|
children: "Coupon Details"
|
|
355
340
|
}),
|
|
356
|
-
/* @__PURE__ */ b(
|
|
341
|
+
/* @__PURE__ */ b(E, {
|
|
357
342
|
label: "Code",
|
|
358
343
|
value: /* @__PURE__ */ b("span", {
|
|
359
344
|
className: "font-mono",
|
|
360
|
-
children:
|
|
345
|
+
children: V.code
|
|
361
346
|
})
|
|
362
347
|
}),
|
|
363
|
-
/* @__PURE__ */ b(
|
|
348
|
+
/* @__PURE__ */ b(E, {
|
|
364
349
|
label: "Name",
|
|
365
|
-
value:
|
|
350
|
+
value: V.name
|
|
366
351
|
}),
|
|
367
|
-
/* @__PURE__ */ b(
|
|
352
|
+
/* @__PURE__ */ b(E, {
|
|
368
353
|
label: "Description",
|
|
369
|
-
value:
|
|
354
|
+
value: V.description
|
|
370
355
|
}),
|
|
371
|
-
/* @__PURE__ */ b(
|
|
356
|
+
/* @__PURE__ */ b(E, {
|
|
372
357
|
label: "Type",
|
|
373
|
-
value:
|
|
358
|
+
value: V.type.replace("_", " ").toLowerCase()
|
|
374
359
|
}),
|
|
375
|
-
/* @__PURE__ */ b(
|
|
360
|
+
/* @__PURE__ */ b(E, {
|
|
376
361
|
label: "Value",
|
|
377
|
-
value:
|
|
362
|
+
value: W()
|
|
378
363
|
}),
|
|
379
|
-
/* @__PURE__ */ b(
|
|
364
|
+
/* @__PURE__ */ b(E, {
|
|
380
365
|
label: "Scope",
|
|
381
|
-
value:
|
|
366
|
+
value: V.scope
|
|
382
367
|
}),
|
|
383
|
-
/* @__PURE__ */ b(
|
|
368
|
+
/* @__PURE__ */ b(E, {
|
|
384
369
|
label: "Status",
|
|
385
|
-
value: /* @__PURE__ */ b(
|
|
370
|
+
value: /* @__PURE__ */ b(T, { status: V.status })
|
|
386
371
|
})
|
|
387
372
|
]
|
|
388
373
|
}), /* @__PURE__ */ x("div", {
|
|
@@ -392,32 +377,32 @@ var T = () => {
|
|
|
392
377
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
|
|
393
378
|
children: "Restrictions"
|
|
394
379
|
}),
|
|
395
|
-
/* @__PURE__ */ b(
|
|
380
|
+
/* @__PURE__ */ b(E, {
|
|
396
381
|
label: "Min Purchase Amount",
|
|
397
|
-
value:
|
|
382
|
+
value: V.minPurchaseAmount == null ? null : `${V.minPurchaseAmount}${V.currency ? ` ${V.currency}` : ""}`
|
|
398
383
|
}),
|
|
399
|
-
/* @__PURE__ */ b(
|
|
384
|
+
/* @__PURE__ */ b(E, {
|
|
400
385
|
label: "Max Discount Amount",
|
|
401
|
-
value:
|
|
386
|
+
value: V.maxDiscountAmount == null ? null : `${V.maxDiscountAmount}${V.currency ? ` ${V.currency}` : ""}`
|
|
402
387
|
}),
|
|
403
|
-
/* @__PURE__ */ b(
|
|
388
|
+
/* @__PURE__ */ b(E, {
|
|
404
389
|
label: "Max Uses Per User",
|
|
405
|
-
value:
|
|
390
|
+
value: V.maxUsesPerUser
|
|
406
391
|
}),
|
|
407
|
-
/* @__PURE__ */ b(
|
|
392
|
+
/* @__PURE__ */ b(E, {
|
|
408
393
|
label: "Restricted Users",
|
|
409
|
-
value:
|
|
394
|
+
value: V.restrictedToUserIds?.length ? /* @__PURE__ */ b("span", {
|
|
410
395
|
className: "font-mono text-xs break-all",
|
|
411
|
-
children:
|
|
396
|
+
children: V.restrictedToUserIds.join(", ")
|
|
412
397
|
}) : "No restrictions"
|
|
413
398
|
}),
|
|
414
|
-
/* @__PURE__ */ b(
|
|
399
|
+
/* @__PURE__ */ b(E, {
|
|
415
400
|
label: "Applicable Products",
|
|
416
|
-
value:
|
|
401
|
+
value: V.applicableProducts?.length ? V.applicableProducts.join(", ") : "All products"
|
|
417
402
|
}),
|
|
418
|
-
/* @__PURE__ */ b(
|
|
403
|
+
/* @__PURE__ */ b(E, {
|
|
419
404
|
label: "Excluded Products",
|
|
420
|
-
value:
|
|
405
|
+
value: V.excludedProducts?.length ? V.excludedProducts.join(", ") : "None"
|
|
421
406
|
})
|
|
422
407
|
]
|
|
423
408
|
})]
|
|
@@ -432,33 +417,33 @@ var T = () => {
|
|
|
432
417
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
|
|
433
418
|
children: "Validity"
|
|
434
419
|
}),
|
|
435
|
-
/* @__PURE__ */ b(
|
|
420
|
+
/* @__PURE__ */ b(E, {
|
|
436
421
|
label: "Valid From",
|
|
437
|
-
value: V
|
|
422
|
+
value: U(V.validFrom)
|
|
438
423
|
}),
|
|
439
|
-
/* @__PURE__ */ b(
|
|
424
|
+
/* @__PURE__ */ b(E, {
|
|
440
425
|
label: "Valid Until",
|
|
441
|
-
value: V
|
|
426
|
+
value: U(V.validUntil) ?? "No expiry"
|
|
442
427
|
})
|
|
443
428
|
]
|
|
444
429
|
}),
|
|
445
|
-
|
|
430
|
+
V.campaignId && /* @__PURE__ */ x("div", {
|
|
446
431
|
className: "bg-bg-surface border border-border-subtle rounded-lg p-6",
|
|
447
432
|
children: [
|
|
448
433
|
/* @__PURE__ */ b("h3", {
|
|
449
434
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
|
|
450
435
|
children: "Campaign"
|
|
451
436
|
}),
|
|
452
|
-
/* @__PURE__ */ b(
|
|
437
|
+
/* @__PURE__ */ b(E, {
|
|
453
438
|
label: "Campaign ID",
|
|
454
439
|
value: /* @__PURE__ */ b("span", {
|
|
455
440
|
className: "font-mono text-xs",
|
|
456
|
-
children:
|
|
441
|
+
children: V.campaignId
|
|
457
442
|
})
|
|
458
443
|
}),
|
|
459
|
-
/* @__PURE__ */ b(
|
|
444
|
+
/* @__PURE__ */ b(E, {
|
|
460
445
|
label: "Campaign Name",
|
|
461
|
-
value:
|
|
446
|
+
value: V.campaignName
|
|
462
447
|
})
|
|
463
448
|
]
|
|
464
449
|
}),
|
|
@@ -469,17 +454,17 @@ var T = () => {
|
|
|
469
454
|
className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
|
|
470
455
|
children: [/* @__PURE__ */ b(g, { className: "size-4 inline mr-1" }), "Audit"]
|
|
471
456
|
}),
|
|
472
|
-
/* @__PURE__ */ b(
|
|
457
|
+
/* @__PURE__ */ b(E, {
|
|
473
458
|
label: "Created",
|
|
474
|
-
value: V
|
|
459
|
+
value: U(V.createdAt)
|
|
475
460
|
}),
|
|
476
|
-
/* @__PURE__ */ b(
|
|
461
|
+
/* @__PURE__ */ b(E, {
|
|
477
462
|
label: "Last Updated",
|
|
478
|
-
value: V
|
|
463
|
+
value: U(V.updatedAt)
|
|
479
464
|
}),
|
|
480
|
-
/* @__PURE__ */ b(
|
|
465
|
+
/* @__PURE__ */ b(E, {
|
|
481
466
|
label: "Created By",
|
|
482
|
-
value:
|
|
467
|
+
value: V.createdBy ?? null
|
|
483
468
|
})
|
|
484
469
|
]
|
|
485
470
|
})
|
|
@@ -491,6 +476,6 @@ var T = () => {
|
|
|
491
476
|
});
|
|
492
477
|
};
|
|
493
478
|
//#endregion
|
|
494
|
-
export {
|
|
479
|
+
export { D as CouponDetailPage };
|
|
495
480
|
|
|
496
481
|
//# sourceMappingURL=CouponDetailPage.js.map
|