@burdenoff/microfe-atheletebridge 2026.1110.1 → 2026.1110.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/atheletebridge/AthleteBridgeRoutes.js +22 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/StatusBadge.js +8 -0
- package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
- package/dist/atheletebridge/hooks/useAuditApi.d.ts +14 -0
- package/dist/atheletebridge/hooks/useAuditApi.js +38 -0
- package/dist/atheletebridge/hooks/useAuditApi.js.map +1 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +15 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.js +38 -19
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
- package/dist/atheletebridge/pages/audit/AuditLogPage.d.ts +11 -0
- package/dist/atheletebridge/pages/audit/AuditLogPage.js +277 -0
- package/dist/atheletebridge/pages/audit/AuditLogPage.js.map +1 -0
- package/dist/atheletebridge/pages/control/ClubControlPage.d.ts +11 -0
- package/dist/atheletebridge/pages/control/ClubControlPage.js +208 -0
- package/dist/atheletebridge/pages/control/ClubControlPage.js.map +1 -0
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +126 -65
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +243 -217
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +136 -83
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +173 -146
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/types/audit.d.ts +47 -0
- package/dist/atheletebridge/types/registration.d.ts +22 -1
- package/package.json +1 -1
|
@@ -3,20 +3,46 @@ import { ErrorState as t, LoadingState as n } from "../../components/LoadingStat
|
|
|
3
3
|
import { FormField as r, fieldInputClass as i } from "../../components/form.js";
|
|
4
4
|
import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
5
5
|
import { useAthleteBridge as o } from "../../context/AthleteBridgeContext.js";
|
|
6
|
-
import { useRecordRegistrationPayment as s, useRefundRegistrationPayment as c,
|
|
7
|
-
import { formatDate as
|
|
8
|
-
import { formatMoney as
|
|
9
|
-
import { canVoidPayment as
|
|
10
|
-
import { PAYMENT_METHODS as
|
|
11
|
-
import { useState as
|
|
12
|
-
import { AlertTriangle as
|
|
13
|
-
import { useParams as
|
|
14
|
-
import { jsx as
|
|
6
|
+
import { useRecordRegistrationPayment as s, useRefundRegistrationPayment as c, useRegistrationCheckIn as l, useRegistrationForm as u, useRegistrationPayments as d, useRegistrationSubmission as f, useReviewRegistration as p, useVoidRegistrationPayment as m } from "../../hooks/useRegistrationApi.js";
|
|
7
|
+
import { formatDate as h } from "../../utils/formatters.js";
|
|
8
|
+
import { formatMoney as g, minorToInput as _, parseMoney as v } from "../../utils/money.js";
|
|
9
|
+
import { canVoidPayment as y, paymentSourceLabel as b, providerLabel as x } from "../../utils/onlineCheckout.js";
|
|
10
|
+
import { PAYMENT_METHODS as S, paymentMethodLabel as C, rosterNotice as w } from "../../utils/registration.js";
|
|
11
|
+
import { useState as T } from "react";
|
|
12
|
+
import { AlertTriangle as E, ArrowLeft as D, Ban as O, Check as k, Loader2 as A, Plus as j, RotateCcw as M, Users as N, X as P } from "lucide-react";
|
|
13
|
+
import { useParams as F } from "react-router";
|
|
14
|
+
import { jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
15
15
|
// src/atheletebridge/pages/registrations/RegistrationSubmissionPage.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let t =
|
|
19
|
-
|
|
16
|
+
var R = "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50", z = "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50", B = (e, t) => e instanceof Error ? e.message : t;
|
|
17
|
+
function V({ submission: e }) {
|
|
18
|
+
let t = l(), n = e.checkInStatus === "CHECKED_IN";
|
|
19
|
+
return /* @__PURE__ */ L("div", {
|
|
20
|
+
className: "mt-4 border-t border-border-seam pt-3",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ I("h3", {
|
|
23
|
+
className: "mb-1 text-sm font-semibold text-text-primary",
|
|
24
|
+
children: "Tournament check-in"
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ I("p", {
|
|
27
|
+
className: "mb-3 text-xs text-text-secondary",
|
|
28
|
+
children: n ? `Checked in${e.checkedInAt ? ` ${h(e.checkedInAt)}` : ""}.` : e.status === "ACCEPTED" ? "Not checked in yet." : "Check-in unlocks once the registration is accepted."
|
|
29
|
+
}),
|
|
30
|
+
e.status === "ACCEPTED" && /* @__PURE__ */ I("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
disabled: t.isPending,
|
|
33
|
+
onClick: () => t.mutate({
|
|
34
|
+
id: e.id,
|
|
35
|
+
checkedIn: !n
|
|
36
|
+
}),
|
|
37
|
+
className: R,
|
|
38
|
+
children: n ? "Undo check-in" : "Check in"
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function H({ submission: e }) {
|
|
44
|
+
let t = p(), [n, a] = T(e.reviewNotes ?? ""), [o, s] = T(null);
|
|
45
|
+
if (e.status === "WITHDRAWN") return /* @__PURE__ */ I("p", {
|
|
20
46
|
className: "text-sm text-text-secondary",
|
|
21
47
|
children: "The family withdrew this registration."
|
|
22
48
|
});
|
|
@@ -29,17 +55,17 @@ function B({ submission: e }) {
|
|
|
29
55
|
notes: n.trim() || void 0
|
|
30
56
|
});
|
|
31
57
|
} catch (e) {
|
|
32
|
-
s(
|
|
58
|
+
s(B(e, "Could not save the decision."));
|
|
33
59
|
}
|
|
34
60
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ L("div", {
|
|
36
62
|
className: "space-y-3",
|
|
37
63
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ I(r, {
|
|
39
65
|
label: "Review notes",
|
|
40
66
|
htmlFor: "reviewNotes",
|
|
41
67
|
hint: "Visible to club staff only.",
|
|
42
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ I("textarea", {
|
|
43
69
|
id: "reviewNotes",
|
|
44
70
|
rows: 2,
|
|
45
71
|
className: i,
|
|
@@ -47,27 +73,27 @@ function B({ submission: e }) {
|
|
|
47
73
|
onChange: (e) => a(e.target.value)
|
|
48
74
|
})
|
|
49
75
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ L("div", {
|
|
51
77
|
className: "flex flex-wrap gap-2",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ L("button", {
|
|
53
79
|
type: "button",
|
|
54
|
-
className:
|
|
80
|
+
className: z,
|
|
55
81
|
disabled: t.isPending || e.status === "ACCEPTED",
|
|
56
82
|
onClick: () => void c("ACCEPT"),
|
|
57
|
-
children: [/* @__PURE__ */
|
|
58
|
-
}), /* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ I(k, { className: "h-4 w-4" }), " Accept"]
|
|
84
|
+
}), /* @__PURE__ */ L("button", {
|
|
59
85
|
type: "button",
|
|
60
|
-
className:
|
|
86
|
+
className: R,
|
|
61
87
|
disabled: t.isPending || e.status === "DECLINED",
|
|
62
88
|
onClick: () => void c("DECLINE"),
|
|
63
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ I(P, { className: "h-4 w-4" }), " Decline"]
|
|
64
90
|
})]
|
|
65
91
|
}),
|
|
66
|
-
e.reviewedAt && /* @__PURE__ */
|
|
92
|
+
e.reviewedAt && /* @__PURE__ */ L("p", {
|
|
67
93
|
className: "text-xs text-text-secondary",
|
|
68
|
-
children: ["Last reviewed ",
|
|
94
|
+
children: ["Last reviewed ", h(e.reviewedAt)]
|
|
69
95
|
}),
|
|
70
|
-
o && /* @__PURE__ */
|
|
96
|
+
o && /* @__PURE__ */ I("p", {
|
|
71
97
|
role: "alert",
|
|
72
98
|
className: "text-sm text-status-error-text",
|
|
73
99
|
children: o
|
|
@@ -75,39 +101,39 @@ function B({ submission: e }) {
|
|
|
75
101
|
]
|
|
76
102
|
});
|
|
77
103
|
}
|
|
78
|
-
function
|
|
79
|
-
let { navigateTo: n } = o(), r =
|
|
80
|
-
if (!r) return e.status !== "ACCEPTED" || e.rosterOutcome || !t ? null : /* @__PURE__ */
|
|
104
|
+
function U({ submission: e, formTeamId: t }) {
|
|
105
|
+
let { navigateTo: n } = o(), r = w(e);
|
|
106
|
+
if (!r) return e.status !== "ACCEPTED" || e.rosterOutcome || !t ? null : /* @__PURE__ */ I("button", {
|
|
81
107
|
type: "button",
|
|
82
|
-
className: `${
|
|
108
|
+
className: `${R} mt-4 w-full justify-center`,
|
|
83
109
|
onClick: () => n(`/teams/${t}`),
|
|
84
110
|
children: "Open the team roster to add this athlete"
|
|
85
111
|
});
|
|
86
112
|
let i = r.tone === "success";
|
|
87
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ L("div", {
|
|
88
114
|
role: "status",
|
|
89
115
|
"data-testid": "registration-roster-notice",
|
|
90
116
|
className: `mt-4 space-y-2 rounded-lg border p-3 text-sm ${i ? "border-status-success-border bg-status-success-bg-subtle text-status-success-text" : "border-status-warning-border bg-status-warning-bg-subtle text-status-warning-text"}`,
|
|
91
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ L("p", {
|
|
92
118
|
className: "flex items-start gap-2",
|
|
93
|
-
children: [
|
|
119
|
+
children: [I(i ? k : E, {
|
|
94
120
|
className: "mt-0.5 h-4 w-4 shrink-0",
|
|
95
121
|
"aria-hidden": "true"
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
-
}), r.teamId && /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ I("span", { children: r.message })]
|
|
123
|
+
}), r.teamId && /* @__PURE__ */ L("button", {
|
|
98
124
|
type: "button",
|
|
99
|
-
className: `${
|
|
125
|
+
className: `${R} w-full justify-center`,
|
|
100
126
|
onClick: () => n(`/teams/${r.teamId}`),
|
|
101
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ I(N, { className: "h-4 w-4" }), " Open the team roster"]
|
|
102
128
|
})]
|
|
103
129
|
});
|
|
104
130
|
}
|
|
105
|
-
function
|
|
106
|
-
let t = s(), [n, a] =
|
|
107
|
-
return /* @__PURE__ */
|
|
131
|
+
function W({ submission: e }) {
|
|
132
|
+
let t = s(), [n, a] = T(_(e.amountOutstanding, e.currency)), [o, c] = T("CASH"), [l, u] = T(""), [d, f] = T(null);
|
|
133
|
+
return /* @__PURE__ */ L("form", {
|
|
108
134
|
onSubmit: async (r) => {
|
|
109
135
|
r.preventDefault(), f(null);
|
|
110
|
-
let i =
|
|
136
|
+
let i = v(n, e.currency);
|
|
111
137
|
if (i === null || i <= 0) f("Enter the amount received.");
|
|
112
138
|
else try {
|
|
113
139
|
await t.mutateAsync({
|
|
@@ -117,16 +143,16 @@ function H({ submission: e }) {
|
|
|
117
143
|
reference: l.trim() || void 0
|
|
118
144
|
}), u("");
|
|
119
145
|
} catch (e) {
|
|
120
|
-
f(
|
|
146
|
+
f(B(e, "Could not record the payment."));
|
|
121
147
|
}
|
|
122
148
|
},
|
|
123
149
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-[9rem_12rem_1fr_auto]",
|
|
124
150
|
"aria-label": "Record a payment",
|
|
125
151
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ I(r, {
|
|
127
153
|
label: `Amount (${e.currency})`,
|
|
128
154
|
htmlFor: "paymentAmount",
|
|
129
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ I("input", {
|
|
130
156
|
id: "paymentAmount",
|
|
131
157
|
inputMode: "decimal",
|
|
132
158
|
className: i,
|
|
@@ -134,24 +160,24 @@ function H({ submission: e }) {
|
|
|
134
160
|
onChange: (e) => a(e.target.value)
|
|
135
161
|
})
|
|
136
162
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ I(r, {
|
|
138
164
|
label: "Method",
|
|
139
165
|
htmlFor: "paymentMethod",
|
|
140
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ I("select", {
|
|
141
167
|
id: "paymentMethod",
|
|
142
168
|
className: i,
|
|
143
169
|
value: o,
|
|
144
170
|
onChange: (e) => c(e.target.value),
|
|
145
|
-
children:
|
|
171
|
+
children: S.map((e) => /* @__PURE__ */ I("option", {
|
|
146
172
|
value: e,
|
|
147
|
-
children:
|
|
173
|
+
children: C(e)
|
|
148
174
|
}, e))
|
|
149
175
|
})
|
|
150
176
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ I(r, {
|
|
152
178
|
label: "Reference",
|
|
153
179
|
htmlFor: "paymentReference",
|
|
154
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ I("input", {
|
|
155
181
|
id: "paymentReference",
|
|
156
182
|
className: i,
|
|
157
183
|
value: l,
|
|
@@ -159,20 +185,20 @@ function H({ submission: e }) {
|
|
|
159
185
|
placeholder: "Receipt / bank / cheque no."
|
|
160
186
|
})
|
|
161
187
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ I("div", {
|
|
163
189
|
className: "flex items-end",
|
|
164
|
-
children: /* @__PURE__ */
|
|
190
|
+
children: /* @__PURE__ */ L("button", {
|
|
165
191
|
type: "submit",
|
|
166
|
-
className:
|
|
192
|
+
className: z,
|
|
167
193
|
disabled: t.isPending,
|
|
168
194
|
children: [
|
|
169
|
-
t.isPending ? /* @__PURE__ */
|
|
195
|
+
t.isPending ? /* @__PURE__ */ I(A, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ I(j, { className: "h-4 w-4" }),
|
|
170
196
|
" ",
|
|
171
197
|
"Record"
|
|
172
198
|
]
|
|
173
199
|
})
|
|
174
200
|
}),
|
|
175
|
-
d && /* @__PURE__ */
|
|
201
|
+
d && /* @__PURE__ */ I("p", {
|
|
176
202
|
role: "alert",
|
|
177
203
|
className: "text-sm text-status-error-text sm:col-span-4",
|
|
178
204
|
children: d
|
|
@@ -180,8 +206,8 @@ function H({ submission: e }) {
|
|
|
180
206
|
]
|
|
181
207
|
});
|
|
182
208
|
}
|
|
183
|
-
function
|
|
184
|
-
let t =
|
|
209
|
+
function G({ payment: e }) {
|
|
210
|
+
let t = m(), n = c(), [r, i] = T(null), o = e.amount - e.refundedAmount, s = async () => {
|
|
185
211
|
let n = window.prompt("Why is this payment being voided?");
|
|
186
212
|
if (n?.trim()) {
|
|
187
213
|
i(null);
|
|
@@ -191,22 +217,22 @@ function U({ payment: e }) {
|
|
|
191
217
|
reason: n.trim()
|
|
192
218
|
});
|
|
193
219
|
} catch (e) {
|
|
194
|
-
i(
|
|
220
|
+
i(B(e, "Could not void the payment."));
|
|
195
221
|
}
|
|
196
222
|
}
|
|
197
223
|
}, l = async () => {
|
|
198
|
-
let t = window.prompt(`Refund how much? (up to ${
|
|
224
|
+
let t = window.prompt(`Refund how much? (up to ${g(o, e.currency)})`, _(o, e.currency));
|
|
199
225
|
if (t === null) return;
|
|
200
|
-
let r =
|
|
226
|
+
let r = v(t, e.currency);
|
|
201
227
|
if (r === null || r <= 0) {
|
|
202
228
|
i("Enter a valid refund amount.");
|
|
203
229
|
return;
|
|
204
230
|
}
|
|
205
231
|
if (r > o) {
|
|
206
|
-
i(`You can refund at most ${
|
|
232
|
+
i(`You can refund at most ${g(o, e.currency)} of this payment.`);
|
|
207
233
|
return;
|
|
208
234
|
}
|
|
209
|
-
if (e.processor && !window.confirm(`This refunds ${
|
|
235
|
+
if (e.processor && !window.confirm(`This refunds ${g(r, e.currency)} to the payer's card through ${x(e.processor)}. Continue?`)) return;
|
|
210
236
|
let a = window.prompt("Reason for the refund?");
|
|
211
237
|
if (a?.trim()) {
|
|
212
238
|
i(null);
|
|
@@ -217,222 +243,223 @@ function U({ payment: e }) {
|
|
|
217
243
|
reason: a.trim()
|
|
218
244
|
});
|
|
219
245
|
} catch (e) {
|
|
220
|
-
i(
|
|
246
|
+
i(B(e, "Could not record the refund."));
|
|
221
247
|
}
|
|
222
248
|
}
|
|
223
249
|
}, u = t.isPending || n.isPending;
|
|
224
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ L("li", {
|
|
225
251
|
className: "space-y-1 px-4 py-3",
|
|
226
252
|
"data-testid": "registration-payment",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ L("div", {
|
|
228
254
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ L("span", {
|
|
230
256
|
className: "min-w-0",
|
|
231
257
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ L("span", {
|
|
233
259
|
className: "block text-sm font-medium tabular-nums text-text-primary",
|
|
234
|
-
children: [
|
|
260
|
+
children: [g(e.amount, e.currency), e.refundedAmount > 0 && /* @__PURE__ */ L("span", {
|
|
235
261
|
className: "ml-2 text-xs text-text-secondary",
|
|
236
|
-
children: ["refunded ",
|
|
262
|
+
children: ["refunded ", g(e.refundedAmount, e.currency)]
|
|
237
263
|
})]
|
|
238
264
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ L("span", {
|
|
240
266
|
className: "block text-xs text-text-secondary",
|
|
241
267
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ I("span", {
|
|
243
269
|
"data-testid": "payment-source",
|
|
244
|
-
children:
|
|
270
|
+
children: b(e)
|
|
245
271
|
}),
|
|
246
272
|
" ·",
|
|
247
273
|
" ",
|
|
248
|
-
|
|
274
|
+
h(e.receivedAt),
|
|
249
275
|
e.reference ? ` · ${e.reference}` : ""
|
|
250
276
|
]
|
|
251
277
|
}),
|
|
252
|
-
e.voidReason && /* @__PURE__ */
|
|
278
|
+
e.voidReason && /* @__PURE__ */ L("span", {
|
|
253
279
|
className: "block text-xs text-text-secondary",
|
|
254
280
|
children: ["Voided: ", e.voidReason]
|
|
255
281
|
}),
|
|
256
|
-
e.refundReason && /* @__PURE__ */
|
|
282
|
+
e.refundReason && /* @__PURE__ */ L("span", {
|
|
257
283
|
className: "block text-xs text-text-secondary",
|
|
258
284
|
children: ["Refund: ", e.refundReason]
|
|
259
285
|
})
|
|
260
286
|
]
|
|
261
|
-
}), /* @__PURE__ */
|
|
287
|
+
}), /* @__PURE__ */ L("span", {
|
|
262
288
|
className: "flex items-center gap-2",
|
|
263
289
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
e.status !== "VOIDED" && o > 0 && /* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ I(a, { status: e.status }),
|
|
291
|
+
e.status !== "VOIDED" && o > 0 && /* @__PURE__ */ L("button", {
|
|
266
292
|
type: "button",
|
|
267
|
-
className:
|
|
293
|
+
className: R,
|
|
268
294
|
disabled: u,
|
|
269
295
|
onClick: () => void l(),
|
|
270
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ I(M, { className: "h-4 w-4" }), " Refund"]
|
|
271
297
|
}),
|
|
272
|
-
|
|
298
|
+
y(e) && /* @__PURE__ */ L("button", {
|
|
273
299
|
type: "button",
|
|
274
|
-
className:
|
|
300
|
+
className: R,
|
|
275
301
|
disabled: u,
|
|
276
302
|
onClick: () => void s(),
|
|
277
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ I(O, { className: "h-4 w-4" }), " Void"]
|
|
278
304
|
})
|
|
279
305
|
]
|
|
280
306
|
})]
|
|
281
|
-
}), r && /* @__PURE__ */
|
|
307
|
+
}), r && /* @__PURE__ */ I("p", {
|
|
282
308
|
role: "alert",
|
|
283
309
|
className: "text-sm text-status-error-text",
|
|
284
310
|
children: r
|
|
285
311
|
})]
|
|
286
312
|
});
|
|
287
313
|
}
|
|
288
|
-
function
|
|
289
|
-
let t =
|
|
290
|
-
return t.isError ? null : /* @__PURE__ */
|
|
314
|
+
function K({ submission: e }) {
|
|
315
|
+
let t = d(e.id);
|
|
316
|
+
return t.isError ? null : /* @__PURE__ */ L("section", {
|
|
291
317
|
className: "space-y-4 rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
292
318
|
"aria-label": "Payments",
|
|
293
319
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ L("div", {
|
|
295
321
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
296
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
297
323
|
className: "text-base font-semibold text-text-primary",
|
|
298
324
|
children: "Payments"
|
|
299
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ L("span", {
|
|
300
326
|
className: "text-sm text-text-secondary",
|
|
301
327
|
children: [
|
|
302
328
|
"Paid",
|
|
303
329
|
" ",
|
|
304
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ I("strong", {
|
|
305
331
|
className: "tabular-nums text-text-primary",
|
|
306
|
-
children:
|
|
332
|
+
children: g(e.amountPaid, e.currency)
|
|
307
333
|
}),
|
|
308
334
|
" ",
|
|
309
335
|
"of ",
|
|
310
|
-
|
|
336
|
+
g(e.amountDue, e.currency),
|
|
311
337
|
" ·",
|
|
312
338
|
" ",
|
|
313
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ L("span", {
|
|
314
340
|
"data-testid": "submission-outstanding",
|
|
315
|
-
children: [
|
|
341
|
+
children: [g(e.amountOutstanding, e.currency), " outstanding"]
|
|
316
342
|
})
|
|
317
343
|
]
|
|
318
344
|
})]
|
|
319
345
|
}),
|
|
320
|
-
e.amountOutstanding > 0 && e.status !== "WITHDRAWN" && /* @__PURE__ */
|
|
321
|
-
t.isLoading ? /* @__PURE__ */
|
|
346
|
+
e.amountOutstanding > 0 && e.status !== "WITHDRAWN" && /* @__PURE__ */ I(W, { submission: e }, `${e.id}-${e.amountOutstanding}`),
|
|
347
|
+
t.isLoading ? /* @__PURE__ */ I(n, { label: "Loading payments…" }) : (t.data ?? []).length === 0 ? /* @__PURE__ */ I("p", {
|
|
322
348
|
className: "text-sm text-text-secondary",
|
|
323
349
|
children: "No payments recorded yet."
|
|
324
|
-
}) : /* @__PURE__ */
|
|
350
|
+
}) : /* @__PURE__ */ I("ul", {
|
|
325
351
|
className: "divide-y divide-border-seam rounded-lg border border-border-seam",
|
|
326
|
-
children: (t.data ?? []).map((e) => /* @__PURE__ */
|
|
352
|
+
children: (t.data ?? []).map((e) => /* @__PURE__ */ I(G, { payment: e }, e.id))
|
|
327
353
|
})
|
|
328
354
|
]
|
|
329
355
|
});
|
|
330
356
|
}
|
|
331
|
-
function
|
|
332
|
-
let { id: r, submissionId: i } =
|
|
333
|
-
if (c.isLoading) return /* @__PURE__ */
|
|
357
|
+
function q() {
|
|
358
|
+
let { id: r, submissionId: i } = F(), { navigateTo: s } = o(), c = f(i), l = u(r);
|
|
359
|
+
if (c.isLoading) return /* @__PURE__ */ I(e, {
|
|
334
360
|
title: "Registration",
|
|
335
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ I(n, { label: "Loading registration…" })
|
|
336
362
|
});
|
|
337
|
-
if (c.isError || !c.data) return /* @__PURE__ */
|
|
363
|
+
if (c.isError || !c.data) return /* @__PURE__ */ I(e, {
|
|
338
364
|
title: "Registration",
|
|
339
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ I(t, {
|
|
340
366
|
title: "Registration not found",
|
|
341
367
|
message: "This registration does not exist or you do not have access to it.",
|
|
342
368
|
onRetry: () => s(r ? `/registrations/${r}` : "/registrations")
|
|
343
369
|
})
|
|
344
370
|
});
|
|
345
|
-
let
|
|
346
|
-
return /* @__PURE__ */
|
|
347
|
-
title: /* @__PURE__ */
|
|
371
|
+
let d = c.data, p = l.data?.fields ?? [], m = l.data?.fees ?? [], _ = (e) => p.find((t) => t.key === e)?.label ?? e, v = [...p.map((e) => e.key).filter((e) => e in d.answers), ...Object.keys(d.answers).filter((e) => !p.some((t) => t.key === e))];
|
|
372
|
+
return /* @__PURE__ */ I(e, {
|
|
373
|
+
title: /* @__PURE__ */ L("span", {
|
|
348
374
|
className: "flex flex-wrap items-center gap-3",
|
|
349
375
|
children: [
|
|
350
|
-
|
|
376
|
+
d.participantName,
|
|
351
377
|
" ",
|
|
352
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ I(a, { status: d.status }),
|
|
353
379
|
" ",
|
|
354
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ I(a, { status: d.paymentStatus })
|
|
355
381
|
]
|
|
356
382
|
}),
|
|
357
|
-
description: `${
|
|
358
|
-
actions: /* @__PURE__ */
|
|
383
|
+
description: `${d.formTitle} · submitted ${h(d.submittedAt)} · ${d.source === "STAFF_ENTRY" ? "entered by staff" : "via share link"}`,
|
|
384
|
+
actions: /* @__PURE__ */ L("button", {
|
|
359
385
|
type: "button",
|
|
360
|
-
className:
|
|
361
|
-
onClick: () => s(`/registrations/${
|
|
362
|
-
children: [/* @__PURE__ */
|
|
386
|
+
className: R,
|
|
387
|
+
onClick: () => s(`/registrations/${d.formId}`),
|
|
388
|
+
children: [/* @__PURE__ */ I(D, { className: "h-4 w-4" }), " Back to form"]
|
|
363
389
|
}),
|
|
364
|
-
children: /* @__PURE__ */
|
|
390
|
+
children: /* @__PURE__ */ L("div", {
|
|
365
391
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[1fr_22rem]",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ L("div", {
|
|
367
393
|
className: "space-y-6",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */ L("section", {
|
|
369
395
|
className: "rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
370
396
|
"aria-label": "Answers",
|
|
371
397
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ I("h2", {
|
|
373
399
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
374
400
|
children: "Details"
|
|
375
401
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ L("dl", {
|
|
377
403
|
className: "grid grid-cols-1 gap-x-6 gap-y-3 text-sm sm:grid-cols-2",
|
|
378
404
|
children: [[
|
|
379
|
-
["Contact",
|
|
380
|
-
["Email",
|
|
381
|
-
["Phone",
|
|
382
|
-
["Waiver accepted",
|
|
383
|
-
].filter(([, e]) => e).map(([e, t]) => /* @__PURE__ */
|
|
405
|
+
["Contact", d.contactName],
|
|
406
|
+
["Email", d.contactEmail],
|
|
407
|
+
["Phone", d.contactPhone],
|
|
408
|
+
["Waiver accepted", d.waiverAcceptedAt ? h(d.waiverAcceptedAt) : null]
|
|
409
|
+
].filter(([, e]) => e).map(([e, t]) => /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
|
|
384
410
|
className: "text-xs text-text-secondary",
|
|
385
411
|
children: e
|
|
386
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ I("dd", {
|
|
387
413
|
className: "text-text-primary",
|
|
388
414
|
children: t
|
|
389
415
|
})] }, e)), v.map((e) => {
|
|
390
|
-
let t =
|
|
391
|
-
return /* @__PURE__ */
|
|
416
|
+
let t = d.answers[e];
|
|
417
|
+
return /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
|
|
392
418
|
className: "text-xs text-text-secondary",
|
|
393
419
|
children: _(e)
|
|
394
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ I("dd", {
|
|
395
421
|
className: "text-text-primary",
|
|
396
422
|
children: typeof t == "boolean" ? t ? "Yes" : "No" : String(t)
|
|
397
423
|
})] }, e);
|
|
398
424
|
})]
|
|
399
425
|
}),
|
|
400
|
-
|
|
426
|
+
m.length > 0 && /* @__PURE__ */ L("div", {
|
|
401
427
|
className: "mt-4 border-t border-border-seam pt-3",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ I("p", {
|
|
403
429
|
className: "mb-2 text-xs text-text-secondary",
|
|
404
430
|
children: "Fees"
|
|
405
|
-
}), /* @__PURE__ */
|
|
431
|
+
}), /* @__PURE__ */ I("ul", {
|
|
406
432
|
className: "space-y-1 text-sm",
|
|
407
|
-
children:
|
|
433
|
+
children: m.filter((e) => d.selectedFeeIds.includes(e.id)).map((e) => /* @__PURE__ */ L("li", {
|
|
408
434
|
className: "flex justify-between text-text-primary",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ I("span", { children: e.name }), /* @__PURE__ */ I("span", {
|
|
410
436
|
className: "tabular-nums",
|
|
411
|
-
children:
|
|
437
|
+
children: g(e.amount, d.currency)
|
|
412
438
|
})]
|
|
413
439
|
}, e.id))
|
|
414
440
|
})]
|
|
415
441
|
})
|
|
416
442
|
]
|
|
417
|
-
}), /* @__PURE__ */
|
|
418
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ I(K, { submission: d })]
|
|
444
|
+
}), /* @__PURE__ */ L("section", {
|
|
419
445
|
className: "h-fit rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
420
446
|
"aria-label": "Review",
|
|
421
447
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ I("h2", {
|
|
423
449
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
424
450
|
children: "Review"
|
|
425
451
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
submission:
|
|
429
|
-
formTeamId:
|
|
430
|
-
})
|
|
452
|
+
/* @__PURE__ */ I(H, { submission: d }, d.id),
|
|
453
|
+
/* @__PURE__ */ I(U, {
|
|
454
|
+
submission: d,
|
|
455
|
+
formTeamId: l.data?.teamId ?? null
|
|
456
|
+
}),
|
|
457
|
+
l.data?.fixtureId && /* @__PURE__ */ I(V, { submission: d }, `checkin-${d.id}`)
|
|
431
458
|
]
|
|
432
459
|
})]
|
|
433
460
|
})
|
|
434
461
|
});
|
|
435
462
|
}
|
|
436
|
-
export {
|
|
463
|
+
export { q as RegistrationSubmissionPage };
|
|
437
464
|
|
|
438
465
|
//# sourceMappingURL=RegistrationSubmissionPage.js.map
|