@burdenoff/microfe-atheletebridge 2026.1109.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.
Files changed (43) hide show
  1. package/dist/atheletebridge/AthleteBridgeRoutes.js +45 -21
  2. package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
  3. package/dist/atheletebridge/components/MemberCard.d.ts +7 -0
  4. package/dist/atheletebridge/components/MemberCard.js +45 -0
  5. package/dist/atheletebridge/components/MemberCard.js.map +1 -0
  6. package/dist/atheletebridge/components/StatusBadge.js +8 -0
  7. package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
  8. package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +15 -1
  9. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +63 -41
  10. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
  11. package/dist/atheletebridge/hooks/useAuditApi.d.ts +14 -0
  12. package/dist/atheletebridge/hooks/useAuditApi.js +38 -0
  13. package/dist/atheletebridge/hooks/useAuditApi.js.map +1 -0
  14. package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +15 -0
  15. package/dist/atheletebridge/hooks/useRegistrationApi.js +38 -19
  16. package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
  17. package/dist/atheletebridge/pages/audit/AuditLogPage.d.ts +11 -0
  18. package/dist/atheletebridge/pages/audit/AuditLogPage.js +277 -0
  19. package/dist/atheletebridge/pages/audit/AuditLogPage.js.map +1 -0
  20. package/dist/atheletebridge/pages/control/ClubControlPage.d.ts +11 -0
  21. package/dist/atheletebridge/pages/control/ClubControlPage.js +208 -0
  22. package/dist/atheletebridge/pages/control/ClubControlPage.js.map +1 -0
  23. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +126 -65
  24. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
  25. package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +366 -196
  26. package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
  27. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +243 -217
  28. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
  29. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +136 -83
  30. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
  31. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +173 -146
  32. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
  33. package/dist/atheletebridge/pages/sessions/SessionsCalendarPage.d.ts +11 -0
  34. package/dist/atheletebridge/pages/sessions/SessionsCalendarPage.js +259 -0
  35. package/dist/atheletebridge/pages/sessions/SessionsCalendarPage.js.map +1 -0
  36. package/dist/atheletebridge/pages/sessions/SessionsListPage.js +59 -47
  37. package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
  38. package/dist/atheletebridge/pages/teams/TeamDetailPage.js +110 -83
  39. package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
  40. package/dist/atheletebridge/types/audit.d.ts +47 -0
  41. package/dist/atheletebridge/types/index.d.ts +25 -0
  42. package/dist/atheletebridge/types/registration.d.ts +22 -1
  43. package/package.json +1 -1
@@ -3,6 +3,8 @@ import { AthCreateRegistrationFormInput, AthMyRegistration, AthMyRegistrationCon
3
3
  export interface RegistrationFormFilters {
4
4
  status?: AthRegistrationFormStatus;
5
5
  season?: string;
6
+ /** Only forms taking sign-ups for this fixture (BOFF-5863). */
7
+ fixtureId?: string;
6
8
  pagination?: PaginationInput;
7
9
  }
8
10
  export declare const useRegistrationForms: (filters?: RegistrationFormFilters) => import('@tanstack/react-query').UseQueryResult<AthRegistrationFormConnection, Error>;
@@ -21,6 +23,10 @@ export interface RegistrationSubmissionFilters {
21
23
  formId?: string;
22
24
  status?: AthRegistrationSubmissionStatus;
23
25
  paymentStatus?: AthRegistrationPaymentStatus;
26
+ /** Only sign-ups for forms targeting this fixture (BOFF-5863). */
27
+ fixtureId?: string;
28
+ /** Filter by tournament check-in state (BOFF-5863). */
29
+ checkedIn?: boolean;
24
30
  pagination?: PaginationInput;
25
31
  }
26
32
  export declare const useRegistrationSubmissions: (filters: RegistrationSubmissionFilters, enabled?: boolean) => import('@tanstack/react-query').UseQueryResult<AthRegistrationSubmissionConnection, Error>;
@@ -31,6 +37,15 @@ export declare const useReviewRegistration: () => import('@tanstack/react-query'
31
37
  decision: AthRegistrationDecision;
32
38
  notes?: string;
33
39
  }, unknown>;
40
+ /**
41
+ * Check an accepted sign-up in at the fixture, or undo a check-in. Both
42
+ * mutations return the refreshed submission; `checkedIn` picks which one runs.
43
+ * The service is idempotent, so a double-tap is a re-read, never a duplicate.
44
+ */
45
+ export declare const useRegistrationCheckIn: () => import('@tanstack/react-query').UseMutationResult<AthRegistrationSubmission, Error, {
46
+ id: string;
47
+ checkedIn: boolean;
48
+ }, unknown>;
34
49
  export declare const useRegistrationPayments: (submissionId: string | undefined) => import('@tanstack/react-query').UseQueryResult<AthRegistrationPayment[], Error>;
35
50
  export declare const useRegistrationPaymentSummary: (formId?: string) => import('@tanstack/react-query').UseQueryResult<AthRegistrationPaymentSummary, Error>;
36
51
  export declare const useRecordRegistrationPayment: () => import('@tanstack/react-query').UseMutationResult<AthRegistrationPayment, Error, AthRecordRegistrationPaymentInput, unknown>;
@@ -4,12 +4,13 @@ import { athQuery as t } from "./useAthleteBridgeApi.js";
4
4
  import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
5
  // src/atheletebridge/hooks/useRegistrationApi.ts
6
6
  var a = ["atheletebridge", "registration"], o = "id key label fieldType required options helpText position", s = "id name description amount feeType position", c = `
7
- id workspaceId title description season teamId programId slug status currency
7
+ id workspaceId title description season teamId programId fixtureId slug status currency
8
8
  opensAt closesAt maxSubmissions waiverText publishedAt closedAt isOpen
9
9
  submissionCount createdAt updatedAt
10
+ fixture { id competition type status scheduledAt venue }
10
11
  fields { ${o} }
11
12
  fees { ${s} }
12
- `, l = "\n id workspaceId formId formTitle source submittedByUserId participantName\n participantUserId contactName contactEmail contactPhone answers selectedFeeIds\n status paymentStatus amountDue amountPaid amountOutstanding currency\n waiverAcceptedAt reviewNotes reviewedAt submittedAt createdAt updatedAt\n participantIsRegistrant rosterOutcome rosterMemberId rosterTeamId rosterTeamName\n", u = "\n id submissionId amount refundedAmount netAmount currency method processor status\n reference note receivedAt voidedAt voidReason refundedAt refundReason\n createdBy createdAt\n", d = "\n formId submissionCount acceptedCount notRequiredCount unpaidCount\n partiallyPaidCount paidCount refundedCount\n totals { currency amountDue amountCollected amountRefunded amountOutstanding }\n", f = `
13
+ `, l = "\n id workspaceId formId formTitle source submittedByUserId participantName\n participantUserId contactName contactEmail contactPhone answers selectedFeeIds\n status paymentStatus amountDue amountPaid amountOutstanding currency\n waiverAcceptedAt reviewNotes reviewedAt submittedAt createdAt updatedAt\n participantIsRegistrant rosterOutcome rosterMemberId rosterTeamId rosterTeamName\n checkInStatus checkedInAt checkedInBy\n", u = "\n id submissionId amount refundedAmount netAmount currency method processor status\n reference note receivedAt voidedAt voidReason refundedAt refundReason\n createdBy createdAt\n", d = "\n formId submissionCount acceptedCount notRequiredCount unpaidCount\n partiallyPaidCount paidCount refundedCount\n totals { currency amountDue amountCollected amountRefunded amountOutstanding }\n", f = `
13
14
  id slug title description season currency opensAt closesAt waiverText isOpen
14
15
  spotsRemaining
15
16
  fields { ${o} }
@@ -26,8 +27,13 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
26
27
  "forms",
27
28
  n
28
29
  ],
29
- queryFn: async () => (await t(`query AthListRegistrationForms($status: AthRegistrationFormStatus, $season: String, $pagination: PaginationInput) {
30
- athListRegistrationForms(status: $status, season: $season, pagination: $pagination) {
30
+ queryFn: async () => (await t(`query AthListRegistrationForms(
31
+ $status: AthRegistrationFormStatus
32
+ $season: String
33
+ $fixtureId: ID
34
+ $pagination: PaginationInput
35
+ ) {
36
+ athListRegistrationForms(status: $status, season: $season, fixtureId: $fixtureId, pagination: $pagination) {
31
37
  items { ${c} }
32
38
  pageInfo { cursor hasMore }
33
39
  }
@@ -99,12 +105,16 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
99
105
  $formId: ID
100
106
  $status: AthRegistrationSubmissionStatus
101
107
  $paymentStatus: AthRegistrationPaymentStatus
108
+ $fixtureId: ID
109
+ $checkedIn: Boolean
102
110
  $pagination: PaginationInput
103
111
  ) {
104
112
  athListRegistrationSubmissions(
105
113
  formId: $formId
106
114
  status: $status
107
115
  paymentStatus: $paymentStatus
116
+ fixtureId: $fixtureId
117
+ checkedIn: $checkedIn
108
118
  pagination: $pagination
109
119
  ) {
110
120
  items { ${l} }
@@ -149,7 +159,16 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
149
159
  }, r)).athReviewRegistrationSubmission,
150
160
  onSuccess: () => void i()
151
161
  });
152
- }, E = (n) => {
162
+ }, E = () => {
163
+ let { apiGatewayUrl: r } = e(), i = h();
164
+ return n({
165
+ mutationFn: async ({ id: e, checkedIn: n }) => {
166
+ let i = n ? "athCheckInRegistration" : "athUndoRegistrationCheckIn";
167
+ return (await t(`mutation AthRegistrationCheckIn($id: ID!) { ${i}(id: $id) { ${l} } }`, { id: e }, r))[i];
168
+ },
169
+ onSuccess: () => void i()
170
+ });
171
+ }, D = (n) => {
153
172
  let { apiGatewayUrl: i, workspaceId: o } = e();
154
173
  return r({
155
174
  queryKey: [
@@ -164,7 +183,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
164
183
  enabled: !!n,
165
184
  retry: !1
166
185
  });
167
- }, D = (n) => {
186
+ }, O = (n) => {
168
187
  let { apiGatewayUrl: i, workspaceId: o } = e();
169
188
  return r({
170
189
  queryKey: [
@@ -178,7 +197,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
178
197
  }`, { formId: n ?? null }, i)).athRegistrationPaymentSummary,
179
198
  retry: !1
180
199
  });
181
- }, O = () => {
200
+ }, k = () => {
182
201
  let { apiGatewayUrl: r } = e(), i = h();
183
202
  return n({
184
203
  mutationFn: async (e) => (await t(`mutation AthRecordRegistrationPayment($input: AthRecordRegistrationPaymentInput!) {
@@ -186,7 +205,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
186
205
  }`, { input: e }, r)).athRecordRegistrationPayment,
187
206
  onSuccess: () => void i()
188
207
  });
189
- }, k = () => {
208
+ }, A = () => {
190
209
  let { apiGatewayUrl: r } = e(), i = h();
191
210
  return n({
192
211
  mutationFn: async ({ id: e, reason: n }) => (await t(`mutation AthVoidRegistrationPayment($id: ID!, $reason: String!) {
@@ -197,7 +216,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
197
216
  }, r)).athVoidRegistrationPayment,
198
217
  onSuccess: () => void i()
199
218
  });
200
- }, A = () => {
219
+ }, j = () => {
201
220
  let { apiGatewayUrl: r } = e(), i = h();
202
221
  return n({
203
222
  mutationFn: async ({ id: e, amount: n, reason: i }) => (await t(`mutation AthRefundRegistrationPayment($id: ID!, $input: AthRefundRegistrationPaymentInput!) {
@@ -211,7 +230,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
211
230
  }, r)).athRefundRegistrationPayment,
212
231
  onSuccess: () => void i()
213
232
  });
214
- }, j = () => {
233
+ }, M = () => {
215
234
  let { apiGatewayUrl: n, workspaceId: i } = e();
216
235
  return r({
217
236
  queryKey: [
@@ -227,7 +246,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
227
246
  }`, {}, n)).athOnlinePaymentsStatus,
228
247
  retry: !1
229
248
  });
230
- }, M = () => {
249
+ }, N = () => {
231
250
  let { apiGatewayUrl: r } = e();
232
251
  return n({ mutationFn: async (e) => (await t(`mutation AthConnectPaymentAccount($input: AthConnectPaymentAccountInput!) {
233
252
  athConnectPaymentAccount(input: $input) {
@@ -235,7 +254,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
235
254
  account { ${m} }
236
255
  }
237
256
  }`, { input: e }, r)).athConnectPaymentAccount });
238
- }, N = () => {
257
+ }, P = () => {
239
258
  let { apiGatewayUrl: r } = e(), i = h();
240
259
  return n({
241
260
  mutationFn: async () => (await t(`mutation AthRefreshPaymentAccount {
@@ -243,7 +262,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
243
262
  }`, {}, r)).athRefreshPaymentAccount,
244
263
  onSuccess: () => void i()
245
264
  });
246
- }, P = (n) => {
265
+ }, F = (n) => {
247
266
  let { apiGatewayUrl: i } = e();
248
267
  return r({
249
268
  queryKey: [
@@ -256,7 +275,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
256
275
  }`, { slug: n }, i)).athRegistrationFormBySlug,
257
276
  enabled: !!n
258
277
  });
259
- }, F = () => {
278
+ }, I = () => {
260
279
  let { apiGatewayUrl: r } = e(), i = h();
261
280
  return n({
262
281
  mutationFn: async ({ slug: e, input: n }) => (await t(`mutation AthSubmitRegistration($slug: String!, $input: AthSubmitRegistrationInput!) {
@@ -267,7 +286,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
267
286
  }, r)).athSubmitRegistration,
268
287
  onSuccess: () => void i()
269
288
  });
270
- }, I = (n) => {
289
+ }, L = (n) => {
271
290
  let { apiGatewayUrl: i } = e();
272
291
  return r({
273
292
  queryKey: [
@@ -282,7 +301,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
282
301
  }
283
302
  }`, { pagination: n ?? null }, i)).athMyRegistrations
284
303
  });
285
- }, L = () => {
304
+ }, R = () => {
286
305
  let { apiGatewayUrl: r } = e(), i = h();
287
306
  return n({
288
307
  mutationFn: async (e) => (await t(`mutation AthWithdrawMyRegistration($id: ID!) {
@@ -290,10 +309,10 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
290
309
  }`, { id: e }, r)).athWithdrawMyRegistration,
291
310
  onSuccess: () => void i()
292
311
  });
293
- }, R = () => {
312
+ }, z = () => {
294
313
  let { apiGatewayUrl: r } = e();
295
314
  return n({ mutationFn: async (e) => (await t("mutation AthStartRegistrationCheckout($input: AthStartRegistrationCheckoutInput!) {\n athStartRegistrationCheckout(input: $input) { checkoutId url amount currency expiresAt }\n }", { input: e }, r)).athStartRegistrationCheckout });
296
- }, z = () => {
315
+ }, B = () => {
297
316
  let { apiGatewayUrl: r } = e(), i = h();
298
317
  return n({
299
318
  mutationFn: async (e) => (await t(`mutation AthConfirmRegistrationCheckout($checkoutId: ID!) {
@@ -302,6 +321,6 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
302
321
  onSuccess: () => void i()
303
322
  });
304
323
  };
305
- export { z as useConfirmRegistrationCheckout, M as useConnectPaymentAccount, v as useCreateRegistrationForm, I as useMyRegistrations, j as useOnlinePaymentsStatus, P as usePublicRegistrationForm, w as useRecordRegistration, O as useRecordRegistrationPayment, N as useRefreshPaymentAccount, A as useRefundRegistrationPayment, _ as useRegistrationForm, x as useRegistrationFormLifecycle, g as useRegistrationForms, D as useRegistrationPaymentSummary, E as useRegistrationPayments, C as useRegistrationSubmission, S as useRegistrationSubmissions, T as useReviewRegistration, R as useStartRegistrationCheckout, F as useSubmitRegistration, y as useUpdateRegistrationForm, k as useVoidRegistrationPayment, L as useWithdrawMyRegistration };
324
+ export { B as useConfirmRegistrationCheckout, N as useConnectPaymentAccount, v as useCreateRegistrationForm, L as useMyRegistrations, M as useOnlinePaymentsStatus, F as usePublicRegistrationForm, w as useRecordRegistration, k as useRecordRegistrationPayment, P as useRefreshPaymentAccount, j as useRefundRegistrationPayment, E as useRegistrationCheckIn, _ as useRegistrationForm, x as useRegistrationFormLifecycle, g as useRegistrationForms, O as useRegistrationPaymentSummary, D as useRegistrationPayments, C as useRegistrationSubmission, S as useRegistrationSubmissions, T as useReviewRegistration, z as useStartRegistrationCheckout, I as useSubmitRegistration, y as useUpdateRegistrationForm, A as useVoidRegistrationPayment, R as useWithdrawMyRegistration };
306
325
 
307
326
  //# sourceMappingURL=useRegistrationApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRegistrationApi.js","names":["ROOT","FIELD_FIELDS","FEE_FIELDS","FORM_FIELDS","SUBMISSION_FIELDS","PAYMENT_FIELDS","SUMMARY_FIELDS","PUBLIC_FORM_FIELDS","MY_REGISTRATION_FIELDS","PAYMENT_ACCOUNT_FIELDS","useInvalidateRegistration","queryClient","useQueryClient","useRegistrationForms","useAthleteBridge","useQuery","workspaceId","filters","athQuery","apiGatewayUrl","useRegistrationForm","id","useCreateRegistrationForm","invalidate","useMutation","useUpdateRegistrationForm","LIFECYCLE_MUTATIONS","useRegistrationFormLifecycle","action","field","selection","useRegistrationSubmissions","useRegistrationSubmission","useRecordRegistration","useReviewRegistration","useRegistrationPayments","submissionId","useRegistrationPaymentSummary","formId","useRecordRegistrationPayment","useVoidRegistrationPayment","useRefundRegistrationPayment","useOnlinePaymentsStatus","useConnectPaymentAccount","useRefreshPaymentAccount","usePublicRegistrationForm","slug","useSubmitRegistration","useMyRegistrations","pagination","useWithdrawMyRegistration","useStartRegistrationCheckout","useConfirmRegistrationCheckout"],"sources":["../../../src/atheletebridge/hooks/useRegistrationApi.ts"],"sourcesContent":["/**\n * Club registration & payments API hooks (BOFF-4135).\n *\n * react-query wrappers over the `wspace-atheletebridge-svc` registration\n * module, reached through the workspace gateway like every other hook in this\n * package. Staff hooks are gated by `atheletebridge-registration` /\n * `atheletebridge-registration-payment`; the family-facing hooks\n * (`usePublicRegistrationForm`, `useSubmitRegistration`, `useMyRegistrations`,\n * `useWithdrawMyRegistration`) are self-scoped and work for any signed-in user.\n *\n * @module atheletebridge/hooks/registration\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useAthleteBridge } from '../context';\nimport type { PaginationInput } from '../types';\nimport type {\n AthCreateRegistrationFormInput,\n AthMyRegistration,\n AthMyRegistrationConnection,\n AthOnlinePaymentsStatus,\n AthPaymentAccount,\n AthPaymentAccountLink,\n AthPublicRegistrationForm,\n AthRecordRegistrationInput,\n AthRecordRegistrationPaymentInput,\n AthRegistrationCheckoutSession,\n AthRegistrationDecision,\n AthRegistrationForm,\n AthRegistrationFormConnection,\n AthRegistrationFormStatus,\n AthRegistrationPayment,\n AthRegistrationPaymentStatus,\n AthRegistrationPaymentSummary,\n AthRegistrationSubmission,\n AthRegistrationSubmissionConnection,\n AthRegistrationSubmissionStatus,\n AthSubmitRegistrationInput,\n AthUpdateRegistrationFormInput,\n} from '../types/registration';\nimport { athQuery } from './useAthleteBridgeApi';\n\n// Workspace-scoped reads put the active workspace right after ROOT: the\n// QueryClient outlives a workspace switch, and one club's registrations or\n// ledger must never be served from cache to another club. Invalidating ROOT\n// still clears every workspace's entries.\nconst ROOT = ['atheletebridge', 'registration'] as const;\n\nconst FIELD_FIELDS = `id key label fieldType required options helpText position`;\nconst FEE_FIELDS = `id name description amount feeType position`;\n\nconst FORM_FIELDS = `\n id workspaceId title description season teamId programId slug status currency\n opensAt closesAt maxSubmissions waiverText publishedAt closedAt isOpen\n submissionCount createdAt updatedAt\n fields { ${FIELD_FIELDS} }\n fees { ${FEE_FIELDS} }\n`;\n\nconst SUBMISSION_FIELDS = `\n id workspaceId formId formTitle source submittedByUserId participantName\n participantUserId contactName contactEmail contactPhone answers selectedFeeIds\n status paymentStatus amountDue amountPaid amountOutstanding currency\n waiverAcceptedAt reviewNotes reviewedAt submittedAt createdAt updatedAt\n participantIsRegistrant rosterOutcome rosterMemberId rosterTeamId rosterTeamName\n`;\n\nconst PAYMENT_FIELDS = `\n id submissionId amount refundedAmount netAmount currency method processor status\n reference note receivedAt voidedAt voidReason refundedAt refundReason\n createdBy createdAt\n`;\n\nconst SUMMARY_FIELDS = `\n formId submissionCount acceptedCount notRequiredCount unpaidCount\n partiallyPaidCount paidCount refundedCount\n totals { currency amountDue amountCollected amountRefunded amountOutstanding }\n`;\n\nconst PUBLIC_FORM_FIELDS = `\n id slug title description season currency opensAt closesAt waiverText isOpen\n spotsRemaining\n fields { ${FIELD_FIELDS} }\n fees { ${FEE_FIELDS} }\n`;\n\nconst MY_REGISTRATION_FIELDS = `\n id formId formTitle formSlug participantName status paymentStatus amountDue\n amountPaid amountOutstanding currency onlinePaymentAvailable submittedAt\n`;\n\nconst PAYMENT_ACCOUNT_FIELDS = `\n provider accountId chargesEnabled payoutsEnabled detailsSubmitted lastSyncedAt createdAt\n`;\n\n/** Every registration read is invalidated together after any write. */\nconst useInvalidateRegistration = () => {\n const queryClient = useQueryClient();\n return () => queryClient.invalidateQueries({ queryKey: ROOT });\n};\n\n// ============================================================================\n// Forms (staff)\n// ============================================================================\n\nexport interface RegistrationFormFilters {\n status?: AthRegistrationFormStatus;\n season?: string;\n pagination?: PaginationInput;\n}\n\nexport const useRegistrationForms = (filters: RegistrationFormFilters = {}) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'forms', filters],\n queryFn: async () => {\n const result = await athQuery<{ athListRegistrationForms: AthRegistrationFormConnection }>(\n `query AthListRegistrationForms($status: AthRegistrationFormStatus, $season: String, $pagination: PaginationInput) {\n athListRegistrationForms(status: $status, season: $season, pagination: $pagination) {\n items { ${FORM_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { ...filters },\n apiGatewayUrl\n );\n return result.athListRegistrationForms;\n },\n });\n};\n\nexport const useRegistrationForm = (id: string | undefined) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'form', id],\n queryFn: async () => {\n const result = await athQuery<{ athRegistrationForm: AthRegistrationForm | null }>(\n `query AthRegistrationForm($id: ID!) { athRegistrationForm(id: $id) { ${FORM_FIELDS} } }`,\n { id },\n apiGatewayUrl\n );\n return result.athRegistrationForm;\n },\n enabled: Boolean(id),\n });\n};\n\nexport const useCreateRegistrationForm = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (input: AthCreateRegistrationFormInput) => {\n const result = await athQuery<{ athCreateRegistrationForm: AthRegistrationForm }>(\n `mutation AthCreateRegistrationForm($input: AthCreateRegistrationFormInput!) {\n athCreateRegistrationForm(input: $input) { ${FORM_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athCreateRegistrationForm;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useUpdateRegistrationForm = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, input }: { id: string; input: AthUpdateRegistrationFormInput }) => {\n const result = await athQuery<{ athUpdateRegistrationForm: AthRegistrationForm }>(\n `mutation AthUpdateRegistrationForm($id: ID!, $input: AthUpdateRegistrationFormInput!) {\n athUpdateRegistrationForm(id: $id, input: $input) { ${FORM_FIELDS} }\n }`,\n { id, input },\n apiGatewayUrl\n );\n return result.athUpdateRegistrationForm;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport type RegistrationFormLifecycleAction = 'publish' | 'close' | 'archive';\n\nconst LIFECYCLE_MUTATIONS: Record<\n RegistrationFormLifecycleAction,\n { field: string; selection: string }\n> = {\n publish: { field: 'athPublishRegistrationForm', selection: `{ ${FORM_FIELDS} }` },\n close: { field: 'athCloseRegistrationForm', selection: `{ ${FORM_FIELDS} }` },\n archive: { field: 'athArchiveRegistrationForm', selection: '' },\n};\n\nexport const useRegistrationFormLifecycle = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, action }: { id: string; action: RegistrationFormLifecycleAction }) => {\n const { field, selection } = LIFECYCLE_MUTATIONS[action];\n await athQuery<Record<string, unknown>>(\n `mutation AthRegistrationFormLifecycle($id: ID!) { ${field}(id: $id) ${selection} }`,\n { id },\n apiGatewayUrl\n );\n return action;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Submissions (staff)\n// ============================================================================\n\nexport interface RegistrationSubmissionFilters {\n formId?: string;\n status?: AthRegistrationSubmissionStatus;\n paymentStatus?: AthRegistrationPaymentStatus;\n pagination?: PaginationInput;\n}\n\nexport const useRegistrationSubmissions = (\n filters: RegistrationSubmissionFilters,\n enabled = true\n) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'submissions', filters],\n queryFn: async () => {\n const result = await athQuery<{\n athListRegistrationSubmissions: AthRegistrationSubmissionConnection;\n }>(\n `query AthListRegistrationSubmissions(\n $formId: ID\n $status: AthRegistrationSubmissionStatus\n $paymentStatus: AthRegistrationPaymentStatus\n $pagination: PaginationInput\n ) {\n athListRegistrationSubmissions(\n formId: $formId\n status: $status\n paymentStatus: $paymentStatus\n pagination: $pagination\n ) {\n items { ${SUBMISSION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { ...filters },\n apiGatewayUrl\n );\n return result.athListRegistrationSubmissions;\n },\n enabled,\n });\n};\n\nexport const useRegistrationSubmission = (id: string | undefined) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'submission', id],\n queryFn: async () => {\n const result = await athQuery<{\n athRegistrationSubmission: AthRegistrationSubmission | null;\n }>(\n `query AthRegistrationSubmission($id: ID!) {\n athRegistrationSubmission(id: $id) { ${SUBMISSION_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.athRegistrationSubmission;\n },\n enabled: Boolean(id),\n });\n};\n\nexport const useRecordRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (input: AthRecordRegistrationInput) => {\n const result = await athQuery<{ athRecordRegistration: AthRegistrationSubmission }>(\n `mutation AthRecordRegistration($input: AthRecordRegistrationInput!) {\n athRecordRegistration(input: $input) { ${SUBMISSION_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athRecordRegistration;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useReviewRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({\n id,\n decision,\n notes,\n }: {\n id: string;\n decision: AthRegistrationDecision;\n notes?: string;\n }) => {\n const result = await athQuery<{ athReviewRegistrationSubmission: AthRegistrationSubmission }>(\n `mutation AthReviewRegistrationSubmission($id: ID!, $input: AthReviewRegistrationInput!) {\n athReviewRegistrationSubmission(id: $id, input: $input) { ${SUBMISSION_FIELDS} }\n }`,\n { id, input: { decision, notes } },\n apiGatewayUrl\n );\n return result.athReviewRegistrationSubmission;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Payments (staff)\n// ============================================================================\n\nexport const useRegistrationPayments = (submissionId: string | undefined) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'payments', submissionId],\n queryFn: async () => {\n const result = await athQuery<{ athListRegistrationPayments: AthRegistrationPayment[] }>(\n `query AthListRegistrationPayments($submissionId: ID!) {\n athListRegistrationPayments(submissionId: $submissionId) { ${PAYMENT_FIELDS} }\n }`,\n { submissionId },\n apiGatewayUrl\n );\n return result.athListRegistrationPayments;\n },\n enabled: Boolean(submissionId),\n retry: false,\n });\n};\n\nexport const useRegistrationPaymentSummary = (formId?: string) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'summary', formId ?? null],\n queryFn: async () => {\n const result = await athQuery<{\n athRegistrationPaymentSummary: AthRegistrationPaymentSummary;\n }>(\n `query AthRegistrationPaymentSummary($formId: ID) {\n athRegistrationPaymentSummary(formId: $formId) { ${SUMMARY_FIELDS} }\n }`,\n { formId: formId ?? null },\n apiGatewayUrl\n );\n return result.athRegistrationPaymentSummary;\n },\n // A coach can read submissions without the payment ledger; a FORBIDDEN\n // here just hides the money panel, so never retry it.\n retry: false,\n });\n};\n\nexport const useRecordRegistrationPayment = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (input: AthRecordRegistrationPaymentInput) => {\n const result = await athQuery<{ athRecordRegistrationPayment: AthRegistrationPayment }>(\n `mutation AthRecordRegistrationPayment($input: AthRecordRegistrationPaymentInput!) {\n athRecordRegistrationPayment(input: $input) { ${PAYMENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athRecordRegistrationPayment;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useVoidRegistrationPayment = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, reason }: { id: string; reason: string }) => {\n const result = await athQuery<{ athVoidRegistrationPayment: AthRegistrationPayment }>(\n `mutation AthVoidRegistrationPayment($id: ID!, $reason: String!) {\n athVoidRegistrationPayment(id: $id, reason: $reason) { ${PAYMENT_FIELDS} }\n }`,\n { id, reason },\n apiGatewayUrl\n );\n return result.athVoidRegistrationPayment;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useRefundRegistrationPayment = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, amount, reason }: { id: string; amount: number; reason: string }) => {\n const result = await athQuery<{ athRefundRegistrationPayment: AthRegistrationPayment }>(\n `mutation AthRefundRegistrationPayment($id: ID!, $input: AthRefundRegistrationPaymentInput!) {\n athRefundRegistrationPayment(id: $id, input: $input) { ${PAYMENT_FIELDS} }\n }`,\n { id, input: { amount, reason } },\n apiGatewayUrl\n );\n return result.athRefundRegistrationPayment;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Online payments setup (staff, BOFF-10902)\n// ============================================================================\n\nexport const useOnlinePaymentsStatus = () => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'online-payments'],\n queryFn: async () => {\n const result = await athQuery<{ athOnlinePaymentsStatus: AthOnlinePaymentsStatus }>(\n `query AthOnlinePaymentsStatus {\n athOnlinePaymentsStatus {\n processorConfigured testMode onlineCheckoutAvailable\n account { ${PAYMENT_ACCOUNT_FIELDS} }\n }\n }`,\n {},\n apiGatewayUrl\n );\n return result.athOnlinePaymentsStatus;\n },\n // Staff without payment-ledger access get FORBIDDEN: hide the card, never retry.\n retry: false,\n });\n};\n\n/**\n * Create (first call) or resume the club's processor onboarding. Resolves to\n * the hosted onboarding link; the caller redirects the browser to it.\n */\nexport const useConnectPaymentAccount = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useMutation({\n mutationFn: async (input: { returnUrl: string; email?: string }) => {\n const result = await athQuery<{ athConnectPaymentAccount: AthPaymentAccountLink }>(\n `mutation AthConnectPaymentAccount($input: AthConnectPaymentAccountInput!) {\n athConnectPaymentAccount(input: $input) {\n url expiresAt\n account { ${PAYMENT_ACCOUNT_FIELDS} }\n }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athConnectPaymentAccount;\n },\n });\n};\n\nexport const useRefreshPaymentAccount = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async () => {\n const result = await athQuery<{ athRefreshPaymentAccount: AthPaymentAccount }>(\n `mutation AthRefreshPaymentAccount {\n athRefreshPaymentAccount { ${PAYMENT_ACCOUNT_FIELDS} }\n }`,\n {},\n apiGatewayUrl\n );\n return result.athRefreshPaymentAccount;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Family-facing (self-scoped)\n// ============================================================================\n\nexport const usePublicRegistrationForm = (slug: string | undefined) => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, 'public', slug],\n queryFn: async () => {\n const result = await athQuery<{\n athRegistrationFormBySlug: AthPublicRegistrationForm | null;\n }>(\n `query AthRegistrationFormBySlug($slug: String!) {\n athRegistrationFormBySlug(slug: $slug) { ${PUBLIC_FORM_FIELDS} }\n }`,\n { slug },\n apiGatewayUrl\n );\n return result.athRegistrationFormBySlug;\n },\n enabled: Boolean(slug),\n });\n};\n\nexport const useSubmitRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ slug, input }: { slug: string; input: AthSubmitRegistrationInput }) => {\n const result = await athQuery<{ athSubmitRegistration: AthMyRegistration }>(\n `mutation AthSubmitRegistration($slug: String!, $input: AthSubmitRegistrationInput!) {\n athSubmitRegistration(slug: $slug, input: $input) { ${MY_REGISTRATION_FIELDS} }\n }`,\n { slug, input },\n apiGatewayUrl\n );\n return result.athSubmitRegistration;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useMyRegistrations = (pagination?: PaginationInput) => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, 'mine', pagination ?? null],\n queryFn: async () => {\n const result = await athQuery<{ athMyRegistrations: AthMyRegistrationConnection }>(\n `query AthMyRegistrations($pagination: PaginationInput) {\n athMyRegistrations(pagination: $pagination) {\n items { ${MY_REGISTRATION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { pagination: pagination ?? null },\n apiGatewayUrl\n );\n return result.athMyRegistrations;\n },\n });\n};\n\nexport const useWithdrawMyRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await athQuery<{ athWithdrawMyRegistration: AthMyRegistration }>(\n `mutation AthWithdrawMyRegistration($id: ID!) {\n athWithdrawMyRegistration(id: $id) { ${MY_REGISTRATION_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.athWithdrawMyRegistration;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Online checkout (family-facing, self-scoped, BOFF-10902)\n// ============================================================================\n\n/** Open a processor checkout for the outstanding balance of one of your registrations. */\nexport const useStartRegistrationCheckout = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useMutation({\n mutationFn: async (input: { submissionId: string; returnUrl: string }) => {\n const result = await athQuery<{\n athStartRegistrationCheckout: AthRegistrationCheckoutSession;\n }>(\n `mutation AthStartRegistrationCheckout($input: AthStartRegistrationCheckoutInput!) {\n athStartRegistrationCheckout(input: $input) { checkoutId url amount currency expiresAt }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athStartRegistrationCheckout;\n },\n });\n};\n\n/** Settle a checkout after the processor sends the family back (the server re-reads it). */\nexport const useConfirmRegistrationCheckout = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (checkoutId: string) => {\n const result = await athQuery<{ athConfirmRegistrationCheckout: AthMyRegistration }>(\n `mutation AthConfirmRegistrationCheckout($checkoutId: ID!) {\n athConfirmRegistrationCheckout(checkoutId: $checkoutId) { ${MY_REGISTRATION_FIELDS} }\n }`,\n { checkoutId },\n apiGatewayUrl\n );\n return result.athConfirmRegistrationCheckout;\n },\n onSuccess: () => void invalidate(),\n });\n};\n"],"mappings":";;;;;AA+CA,IAAMA,IAAO,CAAC,kBAAkB,cAAc,GAExCC,IAAe,6DACfC,IAAa,+CAEbC,IAAc;;;;aAIPF,EAAa;WACfC,EAAW;GAGhBE,IAAoB,2YAQpBC,IAAiB,0LAMjBC,IAAiB,2MAMjBC,IAAqB;;;aAGdN,EAAa;WACfC,EAAW;GAGhBM,IAAyB,iKAKzBC,IAAyB,kGAKzBC,UAAkC;CACtC,IAAMC,IAAcC,EAAe;CACnC,aAAaD,EAAY,kBAAkB,EAAE,UAAUX,EAAK,CAAC;AAC/D,GAYaa,KAAwB,IAAmC,CAAC,MAAM;CAC7E,IAAM,EAAE,kBAAe,mBAAgBC,EAAiB;CACxD,OAAOC,EAAS;EACd,UAAU;GAAC,GAAGf;GAAMgB,KAAe;GA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;AACH,GAEayB,KAAsB,MAAiC;CAClE,IAAM,EAAE,qBAAkBlC,EAAiB;CAC3C,OAAOC,EAAS;EACd,UAAU;GAAC,GAAGf;GAAM;GAAQiD,KAAc;EAAI;EAC9C,SAAS,aAWA,MAVc/B,EACnB;;sBAEcV,EAAuB;;;YAIrC,EAAE,YAAYyC,KAAc,KAAK,GACjC9B,CACF,EAAA,CACc;CAElB,CAAC;AACH,GAEa+B,UAAkC;CAC7C,IAAM,EAAE,qBAAkBpC,EAAiB,GACrCS,IAAab,EAA0B;CAC7C,OAAOc,EAAY;EACjB,YAAY,OAAO,OAQV,MAPcN,EACnB;iDACyCV,EAAuB;YAEhE,EAAE,MAAG,GACLW,CACF,EAAA,CACc;EAEhB,iBAAiB,KAAKI,EAAW;CACnC,CAAC;AACH,GAOa4B,UAAqC;CAChD,IAAM,EAAE,qBAAkBrC,EAAiB;CAC3C,OAAOU,EAAY,EACjB,YAAY,OAAO,OAUV,MATcN,EAGnB,sMAGA,EAAE,SAAM,GACRC,CACF,EAAA,CACc,6BAElB,CAAC;AACH,GAGaiC,UAAuC;CAClD,IAAM,EAAE,qBAAkBtC,EAAiB,GACrCS,IAAab,EAA0B;CAC7C,OAAOc,EAAY;EACjB,YAAY,OAAO,OAQV,MAPcN,EACnB;sEAC8DV,EAAuB;YAErF,EAAE,cAAW,GACbW,CACF,EAAA,CACc;EAEhB,iBAAiB,KAAKI,EAAW;CACnC,CAAC;AACH"}
1
+ {"version":3,"file":"useRegistrationApi.js","names":["ROOT","FIELD_FIELDS","FEE_FIELDS","FORM_FIELDS","SUBMISSION_FIELDS","PAYMENT_FIELDS","SUMMARY_FIELDS","PUBLIC_FORM_FIELDS","MY_REGISTRATION_FIELDS","PAYMENT_ACCOUNT_FIELDS","useInvalidateRegistration","queryClient","useQueryClient","useRegistrationForms","useAthleteBridge","useQuery","workspaceId","filters","athQuery","apiGatewayUrl","useRegistrationForm","id","useCreateRegistrationForm","invalidate","useMutation","useUpdateRegistrationForm","LIFECYCLE_MUTATIONS","useRegistrationFormLifecycle","action","field","selection","useRegistrationSubmissions","useRegistrationSubmission","useRecordRegistration","useReviewRegistration","useRegistrationCheckIn","checkedIn","useRegistrationPayments","submissionId","useRegistrationPaymentSummary","formId","useRecordRegistrationPayment","useVoidRegistrationPayment","useRefundRegistrationPayment","useOnlinePaymentsStatus","useConnectPaymentAccount","useRefreshPaymentAccount","usePublicRegistrationForm","slug","useSubmitRegistration","useMyRegistrations","pagination","useWithdrawMyRegistration","useStartRegistrationCheckout","useConfirmRegistrationCheckout"],"sources":["../../../src/atheletebridge/hooks/useRegistrationApi.ts"],"sourcesContent":["/**\n * Club registration & payments API hooks (BOFF-4135).\n *\n * react-query wrappers over the `wspace-atheletebridge-svc` registration\n * module, reached through the workspace gateway like every other hook in this\n * package. Staff hooks are gated by `atheletebridge-registration` /\n * `atheletebridge-registration-payment`; the family-facing hooks\n * (`usePublicRegistrationForm`, `useSubmitRegistration`, `useMyRegistrations`,\n * `useWithdrawMyRegistration`) are self-scoped and work for any signed-in user.\n *\n * @module atheletebridge/hooks/registration\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useAthleteBridge } from '../context';\nimport type { PaginationInput } from '../types';\nimport type {\n AthCreateRegistrationFormInput,\n AthMyRegistration,\n AthMyRegistrationConnection,\n AthOnlinePaymentsStatus,\n AthPaymentAccount,\n AthPaymentAccountLink,\n AthPublicRegistrationForm,\n AthRecordRegistrationInput,\n AthRecordRegistrationPaymentInput,\n AthRegistrationCheckoutSession,\n AthRegistrationDecision,\n AthRegistrationForm,\n AthRegistrationFormConnection,\n AthRegistrationFormStatus,\n AthRegistrationPayment,\n AthRegistrationPaymentStatus,\n AthRegistrationPaymentSummary,\n AthRegistrationSubmission,\n AthRegistrationSubmissionConnection,\n AthRegistrationSubmissionStatus,\n AthSubmitRegistrationInput,\n AthUpdateRegistrationFormInput,\n} from '../types/registration';\nimport { athQuery } from './useAthleteBridgeApi';\n\n// Workspace-scoped reads put the active workspace right after ROOT: the\n// QueryClient outlives a workspace switch, and one club's registrations or\n// ledger must never be served from cache to another club. Invalidating ROOT\n// still clears every workspace's entries.\nconst ROOT = ['atheletebridge', 'registration'] as const;\n\nconst FIELD_FIELDS = `id key label fieldType required options helpText position`;\nconst FEE_FIELDS = `id name description amount feeType position`;\n\nconst FORM_FIELDS = `\n id workspaceId title description season teamId programId fixtureId slug status currency\n opensAt closesAt maxSubmissions waiverText publishedAt closedAt isOpen\n submissionCount createdAt updatedAt\n fixture { id competition type status scheduledAt venue }\n fields { ${FIELD_FIELDS} }\n fees { ${FEE_FIELDS} }\n`;\n\nconst SUBMISSION_FIELDS = `\n id workspaceId formId formTitle source submittedByUserId participantName\n participantUserId contactName contactEmail contactPhone answers selectedFeeIds\n status paymentStatus amountDue amountPaid amountOutstanding currency\n waiverAcceptedAt reviewNotes reviewedAt submittedAt createdAt updatedAt\n participantIsRegistrant rosterOutcome rosterMemberId rosterTeamId rosterTeamName\n checkInStatus checkedInAt checkedInBy\n`;\n\nconst PAYMENT_FIELDS = `\n id submissionId amount refundedAmount netAmount currency method processor status\n reference note receivedAt voidedAt voidReason refundedAt refundReason\n createdBy createdAt\n`;\n\nconst SUMMARY_FIELDS = `\n formId submissionCount acceptedCount notRequiredCount unpaidCount\n partiallyPaidCount paidCount refundedCount\n totals { currency amountDue amountCollected amountRefunded amountOutstanding }\n`;\n\nconst PUBLIC_FORM_FIELDS = `\n id slug title description season currency opensAt closesAt waiverText isOpen\n spotsRemaining\n fields { ${FIELD_FIELDS} }\n fees { ${FEE_FIELDS} }\n`;\n\nconst MY_REGISTRATION_FIELDS = `\n id formId formTitle formSlug participantName status paymentStatus amountDue\n amountPaid amountOutstanding currency onlinePaymentAvailable submittedAt\n`;\n\nconst PAYMENT_ACCOUNT_FIELDS = `\n provider accountId chargesEnabled payoutsEnabled detailsSubmitted lastSyncedAt createdAt\n`;\n\n/** Every registration read is invalidated together after any write. */\nconst useInvalidateRegistration = () => {\n const queryClient = useQueryClient();\n return () => queryClient.invalidateQueries({ queryKey: ROOT });\n};\n\n// ============================================================================\n// Forms (staff)\n// ============================================================================\n\nexport interface RegistrationFormFilters {\n status?: AthRegistrationFormStatus;\n season?: string;\n /** Only forms taking sign-ups for this fixture (BOFF-5863). */\n fixtureId?: string;\n pagination?: PaginationInput;\n}\n\nexport const useRegistrationForms = (filters: RegistrationFormFilters = {}) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'forms', filters],\n queryFn: async () => {\n const result = await athQuery<{ athListRegistrationForms: AthRegistrationFormConnection }>(\n `query AthListRegistrationForms(\n $status: AthRegistrationFormStatus\n $season: String\n $fixtureId: ID\n $pagination: PaginationInput\n ) {\n athListRegistrationForms(status: $status, season: $season, fixtureId: $fixtureId, pagination: $pagination) {\n items { ${FORM_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { ...filters },\n apiGatewayUrl\n );\n return result.athListRegistrationForms;\n },\n });\n};\n\nexport const useRegistrationForm = (id: string | undefined) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'form', id],\n queryFn: async () => {\n const result = await athQuery<{ athRegistrationForm: AthRegistrationForm | null }>(\n `query AthRegistrationForm($id: ID!) { athRegistrationForm(id: $id) { ${FORM_FIELDS} } }`,\n { id },\n apiGatewayUrl\n );\n return result.athRegistrationForm;\n },\n enabled: Boolean(id),\n });\n};\n\nexport const useCreateRegistrationForm = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (input: AthCreateRegistrationFormInput) => {\n const result = await athQuery<{ athCreateRegistrationForm: AthRegistrationForm }>(\n `mutation AthCreateRegistrationForm($input: AthCreateRegistrationFormInput!) {\n athCreateRegistrationForm(input: $input) { ${FORM_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athCreateRegistrationForm;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useUpdateRegistrationForm = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, input }: { id: string; input: AthUpdateRegistrationFormInput }) => {\n const result = await athQuery<{ athUpdateRegistrationForm: AthRegistrationForm }>(\n `mutation AthUpdateRegistrationForm($id: ID!, $input: AthUpdateRegistrationFormInput!) {\n athUpdateRegistrationForm(id: $id, input: $input) { ${FORM_FIELDS} }\n }`,\n { id, input },\n apiGatewayUrl\n );\n return result.athUpdateRegistrationForm;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport type RegistrationFormLifecycleAction = 'publish' | 'close' | 'archive';\n\nconst LIFECYCLE_MUTATIONS: Record<\n RegistrationFormLifecycleAction,\n { field: string; selection: string }\n> = {\n publish: { field: 'athPublishRegistrationForm', selection: `{ ${FORM_FIELDS} }` },\n close: { field: 'athCloseRegistrationForm', selection: `{ ${FORM_FIELDS} }` },\n archive: { field: 'athArchiveRegistrationForm', selection: '' },\n};\n\nexport const useRegistrationFormLifecycle = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, action }: { id: string; action: RegistrationFormLifecycleAction }) => {\n const { field, selection } = LIFECYCLE_MUTATIONS[action];\n await athQuery<Record<string, unknown>>(\n `mutation AthRegistrationFormLifecycle($id: ID!) { ${field}(id: $id) ${selection} }`,\n { id },\n apiGatewayUrl\n );\n return action;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Submissions (staff)\n// ============================================================================\n\nexport interface RegistrationSubmissionFilters {\n formId?: string;\n status?: AthRegistrationSubmissionStatus;\n paymentStatus?: AthRegistrationPaymentStatus;\n /** Only sign-ups for forms targeting this fixture (BOFF-5863). */\n fixtureId?: string;\n /** Filter by tournament check-in state (BOFF-5863). */\n checkedIn?: boolean;\n pagination?: PaginationInput;\n}\n\nexport const useRegistrationSubmissions = (\n filters: RegistrationSubmissionFilters,\n enabled = true\n) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'submissions', filters],\n queryFn: async () => {\n const result = await athQuery<{\n athListRegistrationSubmissions: AthRegistrationSubmissionConnection;\n }>(\n `query AthListRegistrationSubmissions(\n $formId: ID\n $status: AthRegistrationSubmissionStatus\n $paymentStatus: AthRegistrationPaymentStatus\n $fixtureId: ID\n $checkedIn: Boolean\n $pagination: PaginationInput\n ) {\n athListRegistrationSubmissions(\n formId: $formId\n status: $status\n paymentStatus: $paymentStatus\n fixtureId: $fixtureId\n checkedIn: $checkedIn\n pagination: $pagination\n ) {\n items { ${SUBMISSION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { ...filters },\n apiGatewayUrl\n );\n return result.athListRegistrationSubmissions;\n },\n enabled,\n });\n};\n\nexport const useRegistrationSubmission = (id: string | undefined) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'submission', id],\n queryFn: async () => {\n const result = await athQuery<{\n athRegistrationSubmission: AthRegistrationSubmission | null;\n }>(\n `query AthRegistrationSubmission($id: ID!) {\n athRegistrationSubmission(id: $id) { ${SUBMISSION_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.athRegistrationSubmission;\n },\n enabled: Boolean(id),\n });\n};\n\nexport const useRecordRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (input: AthRecordRegistrationInput) => {\n const result = await athQuery<{ athRecordRegistration: AthRegistrationSubmission }>(\n `mutation AthRecordRegistration($input: AthRecordRegistrationInput!) {\n athRecordRegistration(input: $input) { ${SUBMISSION_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athRecordRegistration;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useReviewRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({\n id,\n decision,\n notes,\n }: {\n id: string;\n decision: AthRegistrationDecision;\n notes?: string;\n }) => {\n const result = await athQuery<{ athReviewRegistrationSubmission: AthRegistrationSubmission }>(\n `mutation AthReviewRegistrationSubmission($id: ID!, $input: AthReviewRegistrationInput!) {\n athReviewRegistrationSubmission(id: $id, input: $input) { ${SUBMISSION_FIELDS} }\n }`,\n { id, input: { decision, notes } },\n apiGatewayUrl\n );\n return result.athReviewRegistrationSubmission;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Tournament check-in (BOFF-5863)\n// ============================================================================\n\n/**\n * Check an accepted sign-up in at the fixture, or undo a check-in. Both\n * mutations return the refreshed submission; `checkedIn` picks which one runs.\n * The service is idempotent, so a double-tap is a re-read, never a duplicate.\n */\nexport const useRegistrationCheckIn = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, checkedIn }: { id: string; checkedIn: boolean }) => {\n const field = checkedIn ? 'athCheckInRegistration' : 'athUndoRegistrationCheckIn';\n const result = await athQuery<{ [key: string]: AthRegistrationSubmission }>(\n `mutation AthRegistrationCheckIn($id: ID!) { ${field}(id: $id) { ${SUBMISSION_FIELDS} } }`,\n { id },\n apiGatewayUrl\n );\n return result[field];\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Payments (staff)\n// ============================================================================\n\nexport const useRegistrationPayments = (submissionId: string | undefined) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'payments', submissionId],\n queryFn: async () => {\n const result = await athQuery<{ athListRegistrationPayments: AthRegistrationPayment[] }>(\n `query AthListRegistrationPayments($submissionId: ID!) {\n athListRegistrationPayments(submissionId: $submissionId) { ${PAYMENT_FIELDS} }\n }`,\n { submissionId },\n apiGatewayUrl\n );\n return result.athListRegistrationPayments;\n },\n enabled: Boolean(submissionId),\n retry: false,\n });\n};\n\nexport const useRegistrationPaymentSummary = (formId?: string) => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'summary', formId ?? null],\n queryFn: async () => {\n const result = await athQuery<{\n athRegistrationPaymentSummary: AthRegistrationPaymentSummary;\n }>(\n `query AthRegistrationPaymentSummary($formId: ID) {\n athRegistrationPaymentSummary(formId: $formId) { ${SUMMARY_FIELDS} }\n }`,\n { formId: formId ?? null },\n apiGatewayUrl\n );\n return result.athRegistrationPaymentSummary;\n },\n // A coach can read submissions without the payment ledger; a FORBIDDEN\n // here just hides the money panel, so never retry it.\n retry: false,\n });\n};\n\nexport const useRecordRegistrationPayment = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (input: AthRecordRegistrationPaymentInput) => {\n const result = await athQuery<{ athRecordRegistrationPayment: AthRegistrationPayment }>(\n `mutation AthRecordRegistrationPayment($input: AthRecordRegistrationPaymentInput!) {\n athRecordRegistrationPayment(input: $input) { ${PAYMENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athRecordRegistrationPayment;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useVoidRegistrationPayment = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, reason }: { id: string; reason: string }) => {\n const result = await athQuery<{ athVoidRegistrationPayment: AthRegistrationPayment }>(\n `mutation AthVoidRegistrationPayment($id: ID!, $reason: String!) {\n athVoidRegistrationPayment(id: $id, reason: $reason) { ${PAYMENT_FIELDS} }\n }`,\n { id, reason },\n apiGatewayUrl\n );\n return result.athVoidRegistrationPayment;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useRefundRegistrationPayment = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ id, amount, reason }: { id: string; amount: number; reason: string }) => {\n const result = await athQuery<{ athRefundRegistrationPayment: AthRegistrationPayment }>(\n `mutation AthRefundRegistrationPayment($id: ID!, $input: AthRefundRegistrationPaymentInput!) {\n athRefundRegistrationPayment(id: $id, input: $input) { ${PAYMENT_FIELDS} }\n }`,\n { id, input: { amount, reason } },\n apiGatewayUrl\n );\n return result.athRefundRegistrationPayment;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Online payments setup (staff, BOFF-10902)\n// ============================================================================\n\nexport const useOnlinePaymentsStatus = () => {\n const { apiGatewayUrl, workspaceId } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, workspaceId ?? null, 'online-payments'],\n queryFn: async () => {\n const result = await athQuery<{ athOnlinePaymentsStatus: AthOnlinePaymentsStatus }>(\n `query AthOnlinePaymentsStatus {\n athOnlinePaymentsStatus {\n processorConfigured testMode onlineCheckoutAvailable\n account { ${PAYMENT_ACCOUNT_FIELDS} }\n }\n }`,\n {},\n apiGatewayUrl\n );\n return result.athOnlinePaymentsStatus;\n },\n // Staff without payment-ledger access get FORBIDDEN: hide the card, never retry.\n retry: false,\n });\n};\n\n/**\n * Create (first call) or resume the club's processor onboarding. Resolves to\n * the hosted onboarding link; the caller redirects the browser to it.\n */\nexport const useConnectPaymentAccount = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useMutation({\n mutationFn: async (input: { returnUrl: string; email?: string }) => {\n const result = await athQuery<{ athConnectPaymentAccount: AthPaymentAccountLink }>(\n `mutation AthConnectPaymentAccount($input: AthConnectPaymentAccountInput!) {\n athConnectPaymentAccount(input: $input) {\n url expiresAt\n account { ${PAYMENT_ACCOUNT_FIELDS} }\n }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athConnectPaymentAccount;\n },\n });\n};\n\nexport const useRefreshPaymentAccount = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async () => {\n const result = await athQuery<{ athRefreshPaymentAccount: AthPaymentAccount }>(\n `mutation AthRefreshPaymentAccount {\n athRefreshPaymentAccount { ${PAYMENT_ACCOUNT_FIELDS} }\n }`,\n {},\n apiGatewayUrl\n );\n return result.athRefreshPaymentAccount;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Family-facing (self-scoped)\n// ============================================================================\n\nexport const usePublicRegistrationForm = (slug: string | undefined) => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, 'public', slug],\n queryFn: async () => {\n const result = await athQuery<{\n athRegistrationFormBySlug: AthPublicRegistrationForm | null;\n }>(\n `query AthRegistrationFormBySlug($slug: String!) {\n athRegistrationFormBySlug(slug: $slug) { ${PUBLIC_FORM_FIELDS} }\n }`,\n { slug },\n apiGatewayUrl\n );\n return result.athRegistrationFormBySlug;\n },\n enabled: Boolean(slug),\n });\n};\n\nexport const useSubmitRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async ({ slug, input }: { slug: string; input: AthSubmitRegistrationInput }) => {\n const result = await athQuery<{ athSubmitRegistration: AthMyRegistration }>(\n `mutation AthSubmitRegistration($slug: String!, $input: AthSubmitRegistrationInput!) {\n athSubmitRegistration(slug: $slug, input: $input) { ${MY_REGISTRATION_FIELDS} }\n }`,\n { slug, input },\n apiGatewayUrl\n );\n return result.athSubmitRegistration;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\nexport const useMyRegistrations = (pagination?: PaginationInput) => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useQuery({\n queryKey: [...ROOT, 'mine', pagination ?? null],\n queryFn: async () => {\n const result = await athQuery<{ athMyRegistrations: AthMyRegistrationConnection }>(\n `query AthMyRegistrations($pagination: PaginationInput) {\n athMyRegistrations(pagination: $pagination) {\n items { ${MY_REGISTRATION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { pagination: pagination ?? null },\n apiGatewayUrl\n );\n return result.athMyRegistrations;\n },\n });\n};\n\nexport const useWithdrawMyRegistration = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await athQuery<{ athWithdrawMyRegistration: AthMyRegistration }>(\n `mutation AthWithdrawMyRegistration($id: ID!) {\n athWithdrawMyRegistration(id: $id) { ${MY_REGISTRATION_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.athWithdrawMyRegistration;\n },\n onSuccess: () => void invalidate(),\n });\n};\n\n// ============================================================================\n// Online checkout (family-facing, self-scoped, BOFF-10902)\n// ============================================================================\n\n/** Open a processor checkout for the outstanding balance of one of your registrations. */\nexport const useStartRegistrationCheckout = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n return useMutation({\n mutationFn: async (input: { submissionId: string; returnUrl: string }) => {\n const result = await athQuery<{\n athStartRegistrationCheckout: AthRegistrationCheckoutSession;\n }>(\n `mutation AthStartRegistrationCheckout($input: AthStartRegistrationCheckoutInput!) {\n athStartRegistrationCheckout(input: $input) { checkoutId url amount currency expiresAt }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.athStartRegistrationCheckout;\n },\n });\n};\n\n/** Settle a checkout after the processor sends the family back (the server re-reads it). */\nexport const useConfirmRegistrationCheckout = () => {\n const { apiGatewayUrl } = useAthleteBridge();\n const invalidate = useInvalidateRegistration();\n return useMutation({\n mutationFn: async (checkoutId: string) => {\n const result = await athQuery<{ athConfirmRegistrationCheckout: AthMyRegistration }>(\n `mutation AthConfirmRegistrationCheckout($checkoutId: ID!) {\n athConfirmRegistrationCheckout(checkoutId: $checkoutId) { ${MY_REGISTRATION_FIELDS} }\n }`,\n { checkoutId },\n apiGatewayUrl\n );\n return result.athConfirmRegistrationCheckout;\n },\n onSuccess: () => void invalidate(),\n });\n};\n"],"mappings":";;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AAG,GACLW,CACF,EAAA,CACc;EAEhB,iBAAiB,KAAKI,EAAW;CACnC,CAAC;AACH,GAOa8B,UAAqC;CAChD,IAAM,EAAE,qBAAkBvC,EAAiB;CAC3C,OAAOU,EAAY,EACjB,YAAY,OAAO,OAUV,MATcN,EAGnB,sMAGA,EAAE,SAAM,GACRC,CACF,EAAA,CACc,6BAElB,CAAC;AACH,GAGamC,UAAuC;CAClD,IAAM,EAAE,qBAAkBxC,EAAiB,GACrCS,IAAab,EAA0B;CAC7C,OAAOc,EAAY;EACjB,YAAY,OAAO,OAQV,MAPcN,EACnB;sEAC8DV,EAAuB;YAErF,EAAE,cAAW,GACbW,CACF,EAAA,CACc;EAEhB,iBAAiB,KAAKI,EAAW;CACnC,CAAC;AACH"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Audit log (BOFF-5863)
3
+ * @module atheletebridge/pages/audit
4
+ *
5
+ * The canonical, append-only AthleteBridge audit trail for workspace admins:
6
+ * filter by action / resource / actor / date / free text, page through the
7
+ * newest events, and export the matching rows as CSV or JSON. Rows are
8
+ * written by the service's audit consumer from the domain event stream, so
9
+ * everything shown here actually happened — there is nothing to edit.
10
+ */
11
+ export declare function AuditLogPage(): import('react').JSX.Element;