@burdenoff/microfe-atheletebridge 2026.1107.1 → 2026.1109.1
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/AthleteBridgeRoot.d.ts +0 -2
- package/dist/atheletebridge/AthleteBridgeRoot.js +10 -7
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.d.ts +0 -2
- package/dist/atheletebridge/AthleteBridgeRoutes.js +1 -2
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/admin/AdminDashboardPage.d.ts +0 -2
- package/dist/atheletebridge/admin/AdminDashboardPage.js +96 -97
- package/dist/atheletebridge/admin/AdminDashboardPage.js.map +1 -1
- package/dist/atheletebridge/admin/AdminRoot.d.ts +0 -2
- package/dist/atheletebridge/admin/AdminRoot.js +2 -3
- package/dist/atheletebridge/admin/AdminRoot.js.map +1 -1
- package/dist/atheletebridge/admin/index.d.ts +0 -1
- package/dist/atheletebridge/admin/index.js +3 -2
- package/dist/atheletebridge/components/AthleteSelect.d.ts +1 -2
- package/dist/atheletebridge/components/AthleteSelect.js +8 -9
- package/dist/atheletebridge/components/AthleteSelect.js.map +1 -1
- package/dist/atheletebridge/components/Crest.d.ts +0 -2
- package/dist/atheletebridge/components/Crest.js +1 -2
- package/dist/atheletebridge/components/Crest.js.map +1 -1
- package/dist/atheletebridge/components/CursorPager.d.ts +0 -2
- package/dist/atheletebridge/components/CursorPager.js +1 -2
- package/dist/atheletebridge/components/CursorPager.js.map +1 -1
- package/dist/atheletebridge/components/DrillVideoLink.d.ts +1 -2
- package/dist/atheletebridge/components/DrillVideoLink.js +1 -2
- package/dist/atheletebridge/components/DrillVideoLink.js.map +1 -1
- package/dist/atheletebridge/components/EmptyState.d.ts +0 -2
- package/dist/atheletebridge/components/EmptyState.js +1 -2
- package/dist/atheletebridge/components/EmptyState.js.map +1 -1
- package/dist/atheletebridge/components/FilterSelect.d.ts +1 -2
- package/dist/atheletebridge/components/FilterSelect.js +1 -2
- package/dist/atheletebridge/components/FilterSelect.js.map +1 -1
- package/dist/atheletebridge/components/FixtureCard.d.ts +0 -2
- package/dist/atheletebridge/components/FixtureCard.js +1 -2
- package/dist/atheletebridge/components/FixtureCard.js.map +1 -1
- package/dist/atheletebridge/components/LoadingState.d.ts +0 -2
- package/dist/atheletebridge/components/LoadingState.js +7 -8
- package/dist/atheletebridge/components/LoadingState.js.map +1 -1
- package/dist/atheletebridge/components/MatchupRow.d.ts +0 -2
- package/dist/atheletebridge/components/MatchupRow.js +29 -30
- package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
- package/dist/atheletebridge/components/MetricsCard.d.ts +0 -2
- package/dist/atheletebridge/components/MetricsCard.js +7 -8
- package/dist/atheletebridge/components/MetricsCard.js.map +1 -1
- package/dist/atheletebridge/components/PageLayout.d.ts +0 -2
- package/dist/atheletebridge/components/PageLayout.js +1 -2
- package/dist/atheletebridge/components/PageLayout.js.map +1 -1
- package/dist/atheletebridge/components/ProgramCard.d.ts +0 -2
- package/dist/atheletebridge/components/ProgramCard.js +9 -10
- package/dist/atheletebridge/components/ProgramCard.js.map +1 -1
- package/dist/atheletebridge/components/RouteAnalytics.d.ts +0 -1
- package/dist/atheletebridge/components/RouteAnalytics.js +1 -2
- package/dist/atheletebridge/components/RouteAnalytics.js.map +1 -1
- package/dist/atheletebridge/components/Scoreboard.d.ts +0 -2
- package/dist/atheletebridge/components/Scoreboard.js +59 -60
- package/dist/atheletebridge/components/Scoreboard.js.map +1 -1
- package/dist/atheletebridge/components/SessionCard.d.ts +0 -2
- package/dist/atheletebridge/components/SessionCard.js +7 -8
- package/dist/atheletebridge/components/SessionCard.js.map +1 -1
- package/dist/atheletebridge/components/SessionStatusTimeline.d.ts +0 -2
- package/dist/atheletebridge/components/SessionStatusTimeline.js +11 -12
- package/dist/atheletebridge/components/SessionStatusTimeline.js.map +1 -1
- package/dist/atheletebridge/components/StatusBadge.d.ts +0 -2
- package/dist/atheletebridge/components/StatusBadge.js +2 -3
- package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
- package/dist/atheletebridge/components/TeamCard.d.ts +0 -2
- package/dist/atheletebridge/components/TeamCard.js +11 -12
- package/dist/atheletebridge/components/TeamCard.js.map +1 -1
- package/dist/atheletebridge/components/ToastViewport.d.ts +1 -2
- package/dist/atheletebridge/components/ToastViewport.js +1 -2
- package/dist/atheletebridge/components/ToastViewport.js.map +1 -1
- package/dist/atheletebridge/components/UserAvatar.d.ts +0 -2
- package/dist/atheletebridge/components/UserAvatar.js +1 -2
- package/dist/atheletebridge/components/UserAvatar.js.map +1 -1
- package/dist/atheletebridge/components/UserSearchSelect.d.ts +1 -2
- package/dist/atheletebridge/components/UserSearchSelect.js +11 -12
- package/dist/atheletebridge/components/UserSearchSelect.js.map +1 -1
- package/dist/atheletebridge/components/ai/AgentRunFeed.d.ts +1 -3
- package/dist/atheletebridge/components/ai/AgentRunFeed.js +30 -31
- package/dist/atheletebridge/components/ai/AgentRunFeed.js.map +1 -1
- package/dist/atheletebridge/components/ai/AiErrorNotice.d.ts +1 -2
- package/dist/atheletebridge/components/ai/AiErrorNotice.js +13 -14
- package/dist/atheletebridge/components/ai/AiErrorNotice.js.map +1 -1
- package/dist/atheletebridge/components/ai/AiModelPicker.d.ts +1 -2
- package/dist/atheletebridge/components/ai/AiModelPicker.js +10 -11
- package/dist/atheletebridge/components/ai/AiModelPicker.js.map +1 -1
- package/dist/atheletebridge/components/ai/DecisionCard.d.ts +1 -3
- package/dist/atheletebridge/components/ai/DecisionCard.js +106 -115
- package/dist/atheletebridge/components/ai/DecisionCard.js.map +1 -1
- package/dist/atheletebridge/components/ai/RunDecisionPanel.d.ts +1 -2
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js +59 -72
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js.map +1 -1
- package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts +1 -2
- package/dist/atheletebridge/components/ai/SubjectDecisions.js +6 -7
- package/dist/atheletebridge/components/ai/SubjectDecisions.js.map +1 -1
- package/dist/atheletebridge/components/ai/assessment.d.ts +0 -2
- package/dist/atheletebridge/components/ai/assessment.js +1 -2
- package/dist/atheletebridge/components/ai/assessment.js.map +1 -1
- package/dist/atheletebridge/components/ai/index.d.ts +0 -1
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.d.ts +1 -2
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.js +13 -14
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.js.map +1 -1
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.d.ts +1 -2
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.js +10 -11
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.js.map +1 -1
- package/dist/atheletebridge/components/domain.d.ts +0 -2
- package/dist/atheletebridge/components/domain.js +5 -3
- package/dist/atheletebridge/components/domain.js.map +1 -1
- package/dist/atheletebridge/components/form.d.ts +0 -2
- package/dist/atheletebridge/components/form.js +1 -2
- package/dist/atheletebridge/components/form.js.map +1 -1
- package/dist/atheletebridge/components/index.d.ts +0 -1
- package/dist/atheletebridge/components/registration/OnlineCheckout.d.ts +9 -0
- package/dist/atheletebridge/components/registration/OnlineCheckout.js +101 -0
- package/dist/atheletebridge/components/registration/OnlineCheckout.js.map +1 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.d.ts +2 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.js +149 -0
- package/dist/atheletebridge/components/registration/OnlinePaymentsCard.js.map +1 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts +0 -2
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js +1 -2
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js.map +1 -1
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts +0 -2
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +3 -4
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -1
- package/dist/atheletebridge/components/registration/entryRules.d.ts +0 -2
- package/dist/atheletebridge/components/registration/entryRules.js +2 -3
- package/dist/atheletebridge/components/registration/entryRules.js.map +1 -1
- package/dist/atheletebridge/components/viz/AvatarStack.d.ts +1 -3
- package/dist/atheletebridge/components/viz/BarChart.d.ts +1 -3
- package/dist/atheletebridge/components/viz/BarChart.js +18 -19
- package/dist/atheletebridge/components/viz/BarChart.js.map +1 -1
- package/dist/atheletebridge/components/viz/DonutChart.d.ts +1 -3
- package/dist/atheletebridge/components/viz/DonutChart.js +13 -14
- package/dist/atheletebridge/components/viz/DonutChart.js.map +1 -1
- package/dist/atheletebridge/components/viz/LineChart.d.ts +1 -3
- package/dist/atheletebridge/components/viz/LineChart.js +16 -17
- package/dist/atheletebridge/components/viz/LineChart.js.map +1 -1
- package/dist/atheletebridge/components/viz/ProgressRing.d.ts +1 -3
- package/dist/atheletebridge/components/viz/ProgressRing.js +0 -3
- package/dist/atheletebridge/components/viz/RatingStars.d.ts +1 -2
- package/dist/atheletebridge/components/viz/RatingStars.js +1 -2
- package/dist/atheletebridge/components/viz/RatingStars.js.map +1 -1
- package/dist/atheletebridge/components/viz/Sparkline.d.ts +1 -2
- package/dist/atheletebridge/components/viz/Sparkline.js +12 -11
- package/dist/atheletebridge/components/viz/Sparkline.js.map +1 -1
- package/dist/atheletebridge/components/viz/StatCard.d.ts +1 -3
- package/dist/atheletebridge/components/viz/StatCard.js +1 -2
- package/dist/atheletebridge/components/viz/StatCard.js.map +1 -1
- package/dist/atheletebridge/components/viz/StepProgress.d.ts +1 -2
- package/dist/atheletebridge/components/viz/Timeline.d.ts +1 -3
- package/dist/atheletebridge/components/viz/Timeline.js +1 -2
- package/dist/atheletebridge/components/viz/Timeline.js.map +1 -1
- package/dist/atheletebridge/components/viz/index.d.ts +0 -1
- package/dist/atheletebridge/components/viz/index.js +9 -8
- package/dist/atheletebridge/components/viz/lib/Avatar.d.ts +1 -2
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.d.ts +1 -3
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.js +13 -8
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.d.ts +1 -3
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.js +1 -2
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/format.d.ts +0 -1
- package/dist/atheletebridge/components/viz/lib/format.js +1 -2
- package/dist/atheletebridge/components/viz/lib/format.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/geometry.d.ts +0 -1
- package/dist/atheletebridge/components/viz/lib/geometry.js +1 -2
- package/dist/atheletebridge/components/viz/lib/geometry.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/hooks.d.ts +0 -2
- package/dist/atheletebridge/components/viz/lib/hooks.js +1 -2
- package/dist/atheletebridge/components/viz/lib/hooks.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/palette.d.ts +0 -1
- package/dist/atheletebridge/components/viz/lib/palette.js +1 -2
- package/dist/atheletebridge/components/viz/lib/palette.js.map +1 -1
- package/dist/atheletebridge/components/viz/lib/types.d.ts +0 -2
- package/dist/atheletebridge/context/AthleteBridgeContext.d.ts +0 -2
- package/dist/atheletebridge/context/AthleteBridgeContext.js +3 -3
- package/dist/atheletebridge/context/AthleteBridgeContext.js.map +1 -1
- package/dist/atheletebridge/context/index.d.ts +0 -1
- package/dist/atheletebridge/context/index.js +1 -1
- package/dist/atheletebridge/hooks/index.d.ts +0 -1
- package/dist/atheletebridge/hooks/index.js +3 -2
- package/dist/atheletebridge/hooks/useAthleteBridgeAnalytics.d.ts +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +23 -25
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +129 -112
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgePageView.d.ts +0 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +26 -11
- package/dist/atheletebridge/hooks/useRegistrationApi.js +77 -35
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
- package/dist/atheletebridge/hooks/useScheduledTimeGate.d.ts +0 -1
- package/dist/atheletebridge/hooks/useScheduledTimeGate.js +2 -7
- package/dist/atheletebridge/hooks/useScheduledTimeGate.js.map +1 -1
- package/dist/atheletebridge/i18n.d.ts +0 -1
- package/dist/atheletebridge/i18n.js +1 -2
- package/dist/atheletebridge/i18n.js.map +1 -1
- package/dist/atheletebridge/index.d.ts +0 -1
- package/dist/atheletebridge/index.js +9 -8
- package/dist/atheletebridge/pages/DashboardPage.d.ts +1 -2
- package/dist/atheletebridge/pages/DashboardPage.js +28 -29
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/StandingsPage.d.ts +1 -2
- package/dist/atheletebridge/pages/StandingsPage.js +23 -24
- package/dist/atheletebridge/pages/StandingsPage.js.map +1 -1
- package/dist/atheletebridge/pages/ai/AiOperationsPage.d.ts +1 -2
- package/dist/atheletebridge/pages/ai/AiOperationsPage.js +11 -12
- package/dist/atheletebridge/pages/ai/AiOperationsPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts +1 -2
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +39 -40
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.d.ts +1 -2
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +135 -136
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +166 -173
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js +42 -51
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js +39 -40
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.d.ts +0 -2
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js +157 -165
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.d.ts +1 -2
- package/dist/atheletebridge/pages/performance/PerformancePage.js +229 -239
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +58 -59
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js +42 -39
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js +40 -41
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts +4 -3
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +79 -73
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js +22 -28
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +92 -95
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +68 -68
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +84 -85
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js +63 -62
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts +1 -2
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +189 -187
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +76 -80
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js +44 -47
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +19 -20
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts +1 -2
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +220 -227
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.d.ts +1 -2
- package/dist/atheletebridge/pages/teams/TeamFormPage.js +70 -67
- package/dist/atheletebridge/pages/teams/TeamFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.d.ts +1 -2
- package/dist/atheletebridge/pages/teams/TeamsListPage.js +30 -31
- package/dist/atheletebridge/pages/teams/TeamsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.d.ts +1 -2
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js +27 -28
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js.map +1 -1
- package/dist/atheletebridge/store/atheletebridgeStore.d.ts +1 -3
- package/dist/atheletebridge/store/atheletebridgeStore.js +1 -2
- package/dist/atheletebridge/store/atheletebridgeStore.js.map +1 -1
- package/dist/atheletebridge/store/index.d.ts +0 -1
- package/dist/atheletebridge/store/index.js +1 -1
- package/dist/atheletebridge/types/assistant.d.ts +0 -1
- package/dist/atheletebridge/types/index.d.ts +0 -2
- package/dist/atheletebridge/types/registration.d.ts +38 -2
- package/dist/atheletebridge/utils/aiDecision.d.ts +0 -2
- package/dist/atheletebridge/utils/aiDecision.js +3 -4
- package/dist/atheletebridge/utils/aiDecision.js.map +1 -1
- package/dist/atheletebridge/utils/cn.d.ts +0 -2
- package/dist/atheletebridge/utils/cn.js +2 -3
- package/dist/atheletebridge/utils/cn.js.map +1 -1
- package/dist/atheletebridge/utils/datetime.d.ts +0 -1
- package/dist/atheletebridge/utils/datetime.js +1 -2
- package/dist/atheletebridge/utils/datetime.js.map +1 -1
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts +0 -2
- package/dist/atheletebridge/utils/fixtureCapabilities.js +2 -3
- package/dist/atheletebridge/utils/fixtureCapabilities.js.map +1 -1
- package/dist/atheletebridge/utils/fixtureLifecycle.d.ts +0 -2
- package/dist/atheletebridge/utils/fixtureLifecycle.js +1 -2
- package/dist/atheletebridge/utils/fixtureLifecycle.js.map +1 -1
- package/dist/atheletebridge/utils/formatters.d.ts +0 -1
- package/dist/atheletebridge/utils/formatters.js +1 -2
- package/dist/atheletebridge/utils/formatters.js.map +1 -1
- package/dist/atheletebridge/utils/identity.d.ts +0 -1
- package/dist/atheletebridge/utils/identity.js +2 -3
- package/dist/atheletebridge/utils/identity.js.map +1 -1
- package/dist/atheletebridge/utils/index.d.ts +0 -1
- package/dist/atheletebridge/utils/money.d.ts +0 -1
- package/dist/atheletebridge/utils/money.js +2 -3
- package/dist/atheletebridge/utils/money.js.map +1 -1
- package/dist/atheletebridge/utils/navigation.d.ts +0 -1
- package/dist/atheletebridge/utils/navigation.js +1 -2
- package/dist/atheletebridge/utils/navigation.js.map +1 -1
- package/dist/atheletebridge/utils/onlineCheckout.d.ts +67 -0
- package/dist/atheletebridge/utils/onlineCheckout.js +60 -0
- package/dist/atheletebridge/utils/onlineCheckout.js.map +1 -0
- package/dist/atheletebridge/utils/pageContext.d.ts +0 -1
- package/dist/atheletebridge/utils/pageContext.js +3 -4
- package/dist/atheletebridge/utils/pageContext.js.map +1 -1
- package/dist/atheletebridge/utils/recordResult.d.ts +0 -2
- package/dist/atheletebridge/utils/recordResult.js +21 -23
- package/dist/atheletebridge/utils/recordResult.js.map +1 -1
- package/dist/atheletebridge/utils/registration.d.ts +0 -1
- package/dist/atheletebridge/utils/registration.js +1 -2
- package/dist/atheletebridge/utils/registration.js.map +1 -1
- package/dist/atheletebridge/utils/timeAgo.d.ts +0 -1
- package/dist/atheletebridge/utils/timeAgo.js +12 -13
- package/dist/atheletebridge/utils/timeAgo.js.map +1 -1
- package/dist/atheletebridge/utils/url.d.ts +0 -1
- package/dist/atheletebridge/utils/url.js +1 -2
- package/dist/atheletebridge/utils/url.js.map +1 -1
- package/dist/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +6164 -1927
- package/dist/generated/wspace-operations.d.ts +130 -31
- package/dist/generated/wspace-types.d.ts +60800 -3446
- package/dist/index.d.ts +0 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/services/createSandboxAssistantTransport.d.ts +0 -1
- package/dist/services/createSandboxAssistantTransport.js +1 -2
- package/dist/services/createSandboxAssistantTransport.js.map +1 -1
- package/package.json +71 -53
- package/dist/atheletebridge/AthleteBridgeRoot.d.ts.map +0 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.d.ts.map +0 -1
- package/dist/atheletebridge/admin/AdminDashboardPage.d.ts.map +0 -1
- package/dist/atheletebridge/admin/AdminRoot.d.ts.map +0 -1
- package/dist/atheletebridge/admin/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/AthleteSelect.d.ts.map +0 -1
- package/dist/atheletebridge/components/Crest.d.ts.map +0 -1
- package/dist/atheletebridge/components/CursorPager.d.ts.map +0 -1
- package/dist/atheletebridge/components/DrillVideoLink.d.ts.map +0 -1
- package/dist/atheletebridge/components/EmptyState.d.ts.map +0 -1
- package/dist/atheletebridge/components/FilterSelect.d.ts.map +0 -1
- package/dist/atheletebridge/components/FixtureCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/LoadingState.d.ts.map +0 -1
- package/dist/atheletebridge/components/MatchupRow.d.ts.map +0 -1
- package/dist/atheletebridge/components/MetricsCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/PageLayout.d.ts.map +0 -1
- package/dist/atheletebridge/components/ProgramCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/RouteAnalytics.d.ts.map +0 -1
- package/dist/atheletebridge/components/Scoreboard.d.ts.map +0 -1
- package/dist/atheletebridge/components/SessionCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/SessionStatusTimeline.d.ts.map +0 -1
- package/dist/atheletebridge/components/StatusBadge.d.ts.map +0 -1
- package/dist/atheletebridge/components/TeamCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/ToastViewport.d.ts.map +0 -1
- package/dist/atheletebridge/components/UserAvatar.d.ts.map +0 -1
- package/dist/atheletebridge/components/UserSearchSelect.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/AgentRunFeed.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/AiErrorNotice.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/AiModelPicker.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/DecisionCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/RunDecisionPanel.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/assessment.d.ts.map +0 -1
- package/dist/atheletebridge/components/ai/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/availability/AvailabilityRosterPanel.d.ts.map +0 -1
- package/dist/atheletebridge/components/availability/AvailabilityRsvpControl.d.ts.map +0 -1
- package/dist/atheletebridge/components/domain.d.ts.map +0 -1
- package/dist/atheletebridge/components/form.d.ts.map +0 -1
- package/dist/atheletebridge/components/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts.map +0 -1
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts.map +0 -1
- package/dist/atheletebridge/components/registration/entryRules.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/AvatarStack.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/BarChart.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/DonutChart.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/LineChart.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/ProgressRing.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/ProgressRing.js.map +0 -1
- package/dist/atheletebridge/components/viz/RatingStars.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/Sparkline.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/StatCard.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/StepProgress.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/Timeline.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/index.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/Avatar.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/format.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/geometry.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/hooks.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/palette.d.ts.map +0 -1
- package/dist/atheletebridge/components/viz/lib/types.d.ts.map +0 -1
- package/dist/atheletebridge/context/AthleteBridgeContext.d.ts.map +0 -1
- package/dist/atheletebridge/context/index.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/index.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeAnalytics.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useAthleteBridgePageView.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts.map +0 -1
- package/dist/atheletebridge/hooks/useScheduledTimeGate.d.ts.map +0 -1
- package/dist/atheletebridge/i18n.d.ts.map +0 -1
- package/dist/atheletebridge/index.d.ts.map +0 -1
- package/dist/atheletebridge/pages/DashboardPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/StandingsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/ai/AiOperationsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/programs/ProgramFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.d.ts.map +0 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.d.ts.map +0 -1
- package/dist/atheletebridge/store/atheletebridgeStore.d.ts.map +0 -1
- package/dist/atheletebridge/store/index.d.ts.map +0 -1
- package/dist/atheletebridge/types/assistant.d.ts.map +0 -1
- package/dist/atheletebridge/types/index.d.ts.map +0 -1
- package/dist/atheletebridge/types/registration.d.ts.map +0 -1
- package/dist/atheletebridge/utils/aiDecision.d.ts.map +0 -1
- package/dist/atheletebridge/utils/cn.d.ts.map +0 -1
- package/dist/atheletebridge/utils/datetime.d.ts.map +0 -1
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts.map +0 -1
- package/dist/atheletebridge/utils/fixtureLifecycle.d.ts.map +0 -1
- package/dist/atheletebridge/utils/formatters.d.ts.map +0 -1
- package/dist/atheletebridge/utils/identity.d.ts.map +0 -1
- package/dist/atheletebridge/utils/index.d.ts.map +0 -1
- package/dist/atheletebridge/utils/money.d.ts.map +0 -1
- package/dist/atheletebridge/utils/navigation.d.ts.map +0 -1
- package/dist/atheletebridge/utils/pageContext.d.ts.map +0 -1
- package/dist/atheletebridge/utils/recordResult.d.ts.map +0 -1
- package/dist/atheletebridge/utils/registration.d.ts.map +0 -1
- package/dist/atheletebridge/utils/timeAgo.d.ts.map +0 -1
- package/dist/atheletebridge/utils/url.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/services/createSandboxAssistantTransport.d.ts.map +0 -1
|
@@ -2,22 +2,22 @@ import { useAthleteBridge as e } from "../context/AthleteBridgeContext.js";
|
|
|
2
2
|
import "../context/index.js";
|
|
3
3
|
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
7
|
id workspaceId title description season teamId programId slug status currency
|
|
8
8
|
opensAt closesAt maxSubmissions waiverText publishedAt closedAt isOpen
|
|
9
9
|
submissionCount createdAt updatedAt
|
|
10
10
|
fields { ${o} }
|
|
11
11
|
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 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 = `
|
|
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
13
|
id slug title description season currency opensAt closesAt waiverText isOpen
|
|
14
14
|
spotsRemaining
|
|
15
15
|
fields { ${o} }
|
|
16
16
|
fees { ${s} }
|
|
17
|
-
`, p = "\n id formId formTitle formSlug participantName status paymentStatus amountDue\n amountPaid amountOutstanding currency submittedAt\n", m = () => {
|
|
17
|
+
`, p = "\n id formId formTitle formSlug participantName status paymentStatus amountDue\n amountPaid amountOutstanding currency onlinePaymentAvailable submittedAt\n", m = "\n provider accountId chargesEnabled payoutsEnabled detailsSubmitted lastSyncedAt createdAt\n", h = () => {
|
|
18
18
|
let e = i();
|
|
19
19
|
return () => e.invalidateQueries({ queryKey: a });
|
|
20
|
-
},
|
|
20
|
+
}, g = (n = {}) => {
|
|
21
21
|
let { apiGatewayUrl: i, workspaceId: o } = e();
|
|
22
22
|
return r({
|
|
23
23
|
queryKey: [
|
|
@@ -33,7 +33,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
33
33
|
}
|
|
34
34
|
}`, { ...n }, i)).athListRegistrationForms
|
|
35
35
|
});
|
|
36
|
-
},
|
|
36
|
+
}, _ = (n) => {
|
|
37
37
|
let { apiGatewayUrl: i, workspaceId: o } = e();
|
|
38
38
|
return r({
|
|
39
39
|
queryKey: [
|
|
@@ -45,16 +45,16 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
45
45
|
queryFn: async () => (await t(`query AthRegistrationForm($id: ID!) { athRegistrationForm(id: $id) { ${c} } }`, { id: n }, i)).athRegistrationForm,
|
|
46
46
|
enabled: !!n
|
|
47
47
|
});
|
|
48
|
-
},
|
|
49
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
48
|
+
}, v = () => {
|
|
49
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
50
50
|
return n({
|
|
51
51
|
mutationFn: async (e) => (await t(`mutation AthCreateRegistrationForm($input: AthCreateRegistrationFormInput!) {
|
|
52
52
|
athCreateRegistrationForm(input: $input) { ${c} }
|
|
53
53
|
}`, { input: e }, r)).athCreateRegistrationForm,
|
|
54
54
|
onSuccess: () => void i()
|
|
55
55
|
});
|
|
56
|
-
},
|
|
57
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
56
|
+
}, y = () => {
|
|
57
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
58
58
|
return n({
|
|
59
59
|
mutationFn: async ({ id: e, input: n }) => (await t(`mutation AthUpdateRegistrationForm($id: ID!, $input: AthUpdateRegistrationFormInput!) {
|
|
60
60
|
athUpdateRegistrationForm(id: $id, input: $input) { ${c} }
|
|
@@ -64,7 +64,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
64
64
|
}, r)).athUpdateRegistrationForm,
|
|
65
65
|
onSuccess: () => void i()
|
|
66
66
|
});
|
|
67
|
-
},
|
|
67
|
+
}, b = {
|
|
68
68
|
publish: {
|
|
69
69
|
field: "athPublishRegistrationForm",
|
|
70
70
|
selection: `{ ${c} }`
|
|
@@ -77,16 +77,16 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
77
77
|
field: "athArchiveRegistrationForm",
|
|
78
78
|
selection: ""
|
|
79
79
|
}
|
|
80
|
-
},
|
|
81
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
80
|
+
}, x = () => {
|
|
81
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
82
82
|
return n({
|
|
83
83
|
mutationFn: async ({ id: e, action: n }) => {
|
|
84
|
-
let { field: i, selection: a } =
|
|
84
|
+
let { field: i, selection: a } = b[n];
|
|
85
85
|
return await t(`mutation AthRegistrationFormLifecycle($id: ID!) { ${i}(id: $id) ${a} }`, { id: e }, r), n;
|
|
86
86
|
},
|
|
87
87
|
onSuccess: () => void i()
|
|
88
88
|
});
|
|
89
|
-
},
|
|
89
|
+
}, S = (n, i = !0) => {
|
|
90
90
|
let { apiGatewayUrl: o, workspaceId: s } = e();
|
|
91
91
|
return r({
|
|
92
92
|
queryKey: [
|
|
@@ -113,7 +113,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
113
113
|
}`, { ...n }, o)).athListRegistrationSubmissions,
|
|
114
114
|
enabled: i
|
|
115
115
|
});
|
|
116
|
-
},
|
|
116
|
+
}, C = (n) => {
|
|
117
117
|
let { apiGatewayUrl: i, workspaceId: o } = e();
|
|
118
118
|
return r({
|
|
119
119
|
queryKey: [
|
|
@@ -127,16 +127,16 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
127
127
|
}`, { id: n }, i)).athRegistrationSubmission,
|
|
128
128
|
enabled: !!n
|
|
129
129
|
});
|
|
130
|
-
},
|
|
131
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
130
|
+
}, w = () => {
|
|
131
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
132
132
|
return n({
|
|
133
133
|
mutationFn: async (e) => (await t(`mutation AthRecordRegistration($input: AthRecordRegistrationInput!) {
|
|
134
134
|
athRecordRegistration(input: $input) { ${l} }
|
|
135
135
|
}`, { input: e }, r)).athRecordRegistration,
|
|
136
136
|
onSuccess: () => void i()
|
|
137
137
|
});
|
|
138
|
-
},
|
|
139
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
138
|
+
}, T = () => {
|
|
139
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
140
140
|
return n({
|
|
141
141
|
mutationFn: async ({ id: e, decision: n, notes: i }) => (await t(`mutation AthReviewRegistrationSubmission($id: ID!, $input: AthReviewRegistrationInput!) {
|
|
142
142
|
athReviewRegistrationSubmission(id: $id, input: $input) { ${l} }
|
|
@@ -149,7 +149,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
149
149
|
}, r)).athReviewRegistrationSubmission,
|
|
150
150
|
onSuccess: () => void i()
|
|
151
151
|
});
|
|
152
|
-
},
|
|
152
|
+
}, E = (n) => {
|
|
153
153
|
let { apiGatewayUrl: i, workspaceId: o } = e();
|
|
154
154
|
return r({
|
|
155
155
|
queryKey: [
|
|
@@ -164,7 +164,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
164
164
|
enabled: !!n,
|
|
165
165
|
retry: !1
|
|
166
166
|
});
|
|
167
|
-
},
|
|
167
|
+
}, D = (n) => {
|
|
168
168
|
let { apiGatewayUrl: i, workspaceId: o } = e();
|
|
169
169
|
return r({
|
|
170
170
|
queryKey: [
|
|
@@ -178,16 +178,16 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
178
178
|
}`, { formId: n ?? null }, i)).athRegistrationPaymentSummary,
|
|
179
179
|
retry: !1
|
|
180
180
|
});
|
|
181
|
-
},
|
|
182
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
181
|
+
}, O = () => {
|
|
182
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
183
183
|
return n({
|
|
184
184
|
mutationFn: async (e) => (await t(`mutation AthRecordRegistrationPayment($input: AthRecordRegistrationPaymentInput!) {
|
|
185
185
|
athRecordRegistrationPayment(input: $input) { ${u} }
|
|
186
186
|
}`, { input: e }, r)).athRecordRegistrationPayment,
|
|
187
187
|
onSuccess: () => void i()
|
|
188
188
|
});
|
|
189
|
-
},
|
|
190
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
189
|
+
}, k = () => {
|
|
190
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
191
191
|
return n({
|
|
192
192
|
mutationFn: async ({ id: e, reason: n }) => (await t(`mutation AthVoidRegistrationPayment($id: ID!, $reason: String!) {
|
|
193
193
|
athVoidRegistrationPayment(id: $id, reason: $reason) { ${u} }
|
|
@@ -197,8 +197,8 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
197
197
|
}, r)).athVoidRegistrationPayment,
|
|
198
198
|
onSuccess: () => void i()
|
|
199
199
|
});
|
|
200
|
-
},
|
|
201
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
200
|
+
}, A = () => {
|
|
201
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
202
202
|
return n({
|
|
203
203
|
mutationFn: async ({ id: e, amount: n, reason: i }) => (await t(`mutation AthRefundRegistrationPayment($id: ID!, $input: AthRefundRegistrationPaymentInput!) {
|
|
204
204
|
athRefundRegistrationPayment(id: $id, input: $input) { ${u} }
|
|
@@ -211,7 +211,39 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
211
211
|
}, r)).athRefundRegistrationPayment,
|
|
212
212
|
onSuccess: () => void i()
|
|
213
213
|
});
|
|
214
|
-
},
|
|
214
|
+
}, j = () => {
|
|
215
|
+
let { apiGatewayUrl: n, workspaceId: i } = e();
|
|
216
|
+
return r({
|
|
217
|
+
queryKey: [
|
|
218
|
+
...a,
|
|
219
|
+
i ?? null,
|
|
220
|
+
"online-payments"
|
|
221
|
+
],
|
|
222
|
+
queryFn: async () => (await t(`query AthOnlinePaymentsStatus {
|
|
223
|
+
athOnlinePaymentsStatus {
|
|
224
|
+
processorConfigured testMode onlineCheckoutAvailable
|
|
225
|
+
account { ${m} }
|
|
226
|
+
}
|
|
227
|
+
}`, {}, n)).athOnlinePaymentsStatus,
|
|
228
|
+
retry: !1
|
|
229
|
+
});
|
|
230
|
+
}, M = () => {
|
|
231
|
+
let { apiGatewayUrl: r } = e();
|
|
232
|
+
return n({ mutationFn: async (e) => (await t(`mutation AthConnectPaymentAccount($input: AthConnectPaymentAccountInput!) {
|
|
233
|
+
athConnectPaymentAccount(input: $input) {
|
|
234
|
+
url expiresAt
|
|
235
|
+
account { ${m} }
|
|
236
|
+
}
|
|
237
|
+
}`, { input: e }, r)).athConnectPaymentAccount });
|
|
238
|
+
}, N = () => {
|
|
239
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
240
|
+
return n({
|
|
241
|
+
mutationFn: async () => (await t(`mutation AthRefreshPaymentAccount {
|
|
242
|
+
athRefreshPaymentAccount { ${m} }
|
|
243
|
+
}`, {}, r)).athRefreshPaymentAccount,
|
|
244
|
+
onSuccess: () => void i()
|
|
245
|
+
});
|
|
246
|
+
}, P = (n) => {
|
|
215
247
|
let { apiGatewayUrl: i } = e();
|
|
216
248
|
return r({
|
|
217
249
|
queryKey: [
|
|
@@ -224,8 +256,8 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
224
256
|
}`, { slug: n }, i)).athRegistrationFormBySlug,
|
|
225
257
|
enabled: !!n
|
|
226
258
|
});
|
|
227
|
-
},
|
|
228
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
259
|
+
}, F = () => {
|
|
260
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
229
261
|
return n({
|
|
230
262
|
mutationFn: async ({ slug: e, input: n }) => (await t(`mutation AthSubmitRegistration($slug: String!, $input: AthSubmitRegistrationInput!) {
|
|
231
263
|
athSubmitRegistration(slug: $slug, input: $input) { ${p} }
|
|
@@ -235,7 +267,7 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
235
267
|
}, r)).athSubmitRegistration,
|
|
236
268
|
onSuccess: () => void i()
|
|
237
269
|
});
|
|
238
|
-
},
|
|
270
|
+
}, I = (n) => {
|
|
239
271
|
let { apiGatewayUrl: i } = e();
|
|
240
272
|
return r({
|
|
241
273
|
queryKey: [
|
|
@@ -250,16 +282,26 @@ var a = ["atheletebridge", "registration"], o = "id key label fieldType required
|
|
|
250
282
|
}
|
|
251
283
|
}`, { pagination: n ?? null }, i)).athMyRegistrations
|
|
252
284
|
});
|
|
253
|
-
},
|
|
254
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
285
|
+
}, L = () => {
|
|
286
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
255
287
|
return n({
|
|
256
288
|
mutationFn: async (e) => (await t(`mutation AthWithdrawMyRegistration($id: ID!) {
|
|
257
289
|
athWithdrawMyRegistration(id: $id) { ${p} }
|
|
258
290
|
}`, { id: e }, r)).athWithdrawMyRegistration,
|
|
259
291
|
onSuccess: () => void i()
|
|
260
292
|
});
|
|
293
|
+
}, R = () => {
|
|
294
|
+
let { apiGatewayUrl: r } = e();
|
|
295
|
+
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 = () => {
|
|
297
|
+
let { apiGatewayUrl: r } = e(), i = h();
|
|
298
|
+
return n({
|
|
299
|
+
mutationFn: async (e) => (await t(`mutation AthConfirmRegistrationCheckout($checkoutId: ID!) {
|
|
300
|
+
athConfirmRegistrationCheckout(checkoutId: $checkoutId) { ${p} }
|
|
301
|
+
}`, { checkoutId: e }, r)).athConfirmRegistrationCheckout,
|
|
302
|
+
onSuccess: () => void i()
|
|
303
|
+
});
|
|
261
304
|
};
|
|
262
|
-
|
|
263
|
-
export { _ as useCreateRegistrationForm, M as useMyRegistrations, A as usePublicRegistrationForm, C as useRecordRegistration, D as useRecordRegistrationPayment, k as useRefundRegistrationPayment, g as useRegistrationForm, b as useRegistrationFormLifecycle, h as useRegistrationForms, E as useRegistrationPaymentSummary, T as useRegistrationPayments, S as useRegistrationSubmission, x as useRegistrationSubmissions, w as useReviewRegistration, j as useSubmitRegistration, v as useUpdateRegistrationForm, O as useVoidRegistrationPayment, N as useWithdrawMyRegistration };
|
|
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 };
|
|
264
306
|
|
|
265
307
|
//# sourceMappingURL=useRegistrationApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRegistrationApi.js","names":[],"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 AthPublicRegistrationForm,\n AthRecordRegistrationInput,\n AthRecordRegistrationPaymentInput,\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 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 submittedAt\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// 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"],"mappings":";;;;;AA2CA,IAAM,IAAO,CAAC,kBAAkB,cAAc,GAExC,IAAe,6DACf,IAAa,+CAEb,IAAc;;;;aAIP,EAAa;WACf,EAAW;GAGhB,IAAoB,2YAQpB,IAAiB,gLAMjB,IAAiB,2MAMjB,IAAqB;;;aAGd,EAAa;WACf,EAAW;GAGhB,IAAyB,0IAMzB,UAAkC;CACtC,IAAM,IAAc,EAAe;CACnC,aAAa,EAAY,kBAAkB,EAAE,UAAU,EAAK,CAAC;AAC/D,GAYa,KAAwB,IAAmC,CAAC,MAAM;CAC7E,IAAM,EAAE,kBAAe,mBAAgB,EAAiB;CACxD,OAAO,EAAS;EACd,UAAU;GAAC,GAAG;GAAM,KAAe;GAAM;GAAS;EAAO;EACzD,SAAS,aAWA,MAVc,EACnB;;sBAEc,EAAY;;;YAI1B,EAAE,GAAG,EAAQ,GACb,CACF,GACc;CAElB,CAAC;AACH,GAEa,KAAuB,MAA2B;CAC7D,IAAM,EAAE,kBAAe,mBAAgB,EAAiB;CACxD,OAAO,EAAS;EACd,UAAU;GAAC,GAAG;GAAM,KAAe;GAAM;GAAQ;EAAE;EACnD,SAAS,aAMA,MALc,EACnB,wEAAwE,EAAY,OACpF,EAAE,MAAG,GACL,CACF,GACc;EAEhB,SAAS,EAAQ;CACnB,CAAC;AACH,GAEa,UAAkC;CAC7C,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAa,EAA0B;CAC7C,OAAO,EAAY;EACjB,YAAY,OAAO,OAQV,MAPc,EACnB;uDAC+C,EAAY;YAE3D,EAAE,SAAM,GACR,CACF,GACc;EAEhB,iBAAiB,KAAK,EAAW;CACnC,CAAC;AACH,GAEa,UAAkC;CAC7C,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAa,EAA0B;CAC7C,OAA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,EAAE,MAAG,GACL,CACF,GACc;EAEhB,iBAAiB,KAAK,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","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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CACF,EAAA,CACc;EAEhB,iBAAiB,KAAKI,EAAW;CACnC,CAAC;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,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/atheletebridge/hooks/useScheduledTimeGate.ts
|
|
3
3
|
var n = 2147483647;
|
|
4
4
|
function r(r) {
|
|
5
5
|
let i = r ? new Date(r).getTime() : NaN, [, a] = t(0);
|
|
@@ -7,18 +7,13 @@ function r(r) {
|
|
|
7
7
|
if (Number.isNaN(i) || i <= Date.now()) return;
|
|
8
8
|
let e, t = () => {
|
|
9
9
|
let r = i - Date.now();
|
|
10
|
-
|
|
11
|
-
a((e) => e + 1);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
e = setTimeout(t, Math.min(r, n));
|
|
10
|
+
r <= 0 ? a((e) => e + 1) : e = setTimeout(t, Math.min(r, n));
|
|
15
11
|
};
|
|
16
12
|
return t(), () => {
|
|
17
13
|
e !== void 0 && clearTimeout(e);
|
|
18
14
|
};
|
|
19
15
|
}, [i]), !Number.isNaN(i) && i <= Date.now();
|
|
20
16
|
}
|
|
21
|
-
//#endregion
|
|
22
17
|
export { r as useScheduledTimeGate };
|
|
23
18
|
|
|
24
19
|
//# sourceMappingURL=useScheduledTimeGate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduledTimeGate.js","names":[],"sources":["../../../src/atheletebridge/hooks/useScheduledTimeGate.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/** `setTimeout` saturates past this and would fire immediately instead. */\nconst MAX_TIMEOUT_MS = 2_147_483_647; // ~24.8 days\n\n/**\n * True once `scheduledAt` has passed — and it becomes true on screen at that\n * moment, without a refresh.\n *\n * Comparing against `Date.now()` during render alone goes stale: leave the page\n * open across the scheduled time and the gated action never appears. The server\n * enforces the same rule, so this is a UX concern only, but a user staring at a\n * hidden action has no way to tell \"not yet\" from \"broken\".\n *\n * A wait longer than one `setTimeout` can hold is re-armed in chunks rather\n * than clamped, so a fixture scheduled weeks ahead does not spin on a timer\n * that overflows.\n *\n * @param scheduledAt ISO timestamp, or nullish while the query has no row yet\n * @returns whether the scheduled time has passed\n */\nexport function useScheduledTimeGate(scheduledAt: string | null | undefined): boolean {\n const dueAt = scheduledAt ? new Date(scheduledAt).getTime() : Number.NaN;\n // Bumped exactly once, when the scheduled time arrives, to re-render.\n const [, setArrived] = useState(0);\n\n useEffect(() => {\n if (Number.isNaN(dueAt) || dueAt <= Date.now()) return;\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n const arm = (): void => {\n const remaining = dueAt - Date.now();\n if (remaining <= 0) {\n setArrived((n) => n + 1);\n return;\n }\n timer = setTimeout(arm, Math.min(remaining, MAX_TIMEOUT_MS));\n };\n arm();\n\n return () => {\n if (timer !== undefined) clearTimeout(timer);\n };\n }, [dueAt]);\n\n return !Number.isNaN(dueAt) && dueAt <= Date.now();\n}\n"],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"useScheduledTimeGate.js","names":["MAX_TIMEOUT_MS","useScheduledTimeGate","dueAt","scheduledAt","setArrived","useState","useEffect","timer","arm","remaining","n"],"sources":["../../../src/atheletebridge/hooks/useScheduledTimeGate.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/** `setTimeout` saturates past this and would fire immediately instead. */\nconst MAX_TIMEOUT_MS = 2_147_483_647; // ~24.8 days\n\n/**\n * True once `scheduledAt` has passed — and it becomes true on screen at that\n * moment, without a refresh.\n *\n * Comparing against `Date.now()` during render alone goes stale: leave the page\n * open across the scheduled time and the gated action never appears. The server\n * enforces the same rule, so this is a UX concern only, but a user staring at a\n * hidden action has no way to tell \"not yet\" from \"broken\".\n *\n * A wait longer than one `setTimeout` can hold is re-armed in chunks rather\n * than clamped, so a fixture scheduled weeks ahead does not spin on a timer\n * that overflows.\n *\n * @param scheduledAt ISO timestamp, or nullish while the query has no row yet\n * @returns whether the scheduled time has passed\n */\nexport function useScheduledTimeGate(scheduledAt: string | null | undefined): boolean {\n const dueAt = scheduledAt ? new Date(scheduledAt).getTime() : Number.NaN;\n // Bumped exactly once, when the scheduled time arrives, to re-render.\n const [, setArrived] = useState(0);\n\n useEffect(() => {\n if (Number.isNaN(dueAt) || dueAt <= Date.now()) return;\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n const arm = (): void => {\n const remaining = dueAt - Date.now();\n if (remaining <= 0) {\n setArrived((n) => n + 1);\n return;\n }\n timer = setTimeout(arm, Math.min(remaining, MAX_TIMEOUT_MS));\n };\n arm();\n\n return () => {\n if (timer !== undefined) clearTimeout(timer);\n };\n }, [dueAt]);\n\n return !Number.isNaN(dueAt) && dueAt <= Date.now();\n}\n"],"mappings":";;AAGA,IAAMA,IAAiB;AAkBvB,SAAgBC,EAAqB,GAAiD;CACpF,IAAMC,IAAQC,IAAc,IAAI,KAAKA,CAAW,CAAC,CAAC,QAAQ,IAAI,KAExD,GAAGC,KAAcC,EAAS,CAAC;CAqBjC,OAnBAC,QAAgB;EACd,IAAI,OAAO,MAAMJ,CAAK,KAAKA,KAAS,KAAK,IAAI,GAAG;EAEhD,IAAIK,GACEC,UAAkB;GACtB,IAAMC,IAAYP,IAAQ,KAAK,IAAI;GACnC,AAAIO,KAAa,IACfL,GAAY,MAAMM,IAAI,CAAC,IAGzB,IAAQ,WAAWF,GAAK,KAAK,IAAIC,GAAWT,CAAc,CAAC;EAC7D;EAGA,OAFAQ,EAAI,SAES;GACX,AAAID,MAAU,KAAA,KAAW,aAAaA,CAAK;EAC7C;CACF,GAAG,CAACL,CAAK,CAAC,GAEH,CAAC,OAAO,MAAMA,CAAK,KAAKA,KAAS,KAAK,IAAI;AACnD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as e } from "react";
|
|
2
2
|
import { useI18n as t } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
3
|
-
|
|
3
|
+
// src/atheletebridge/i18n.ts
|
|
4
4
|
function n() {
|
|
5
5
|
let { t: n } = t();
|
|
6
6
|
return e((e, t) => {
|
|
@@ -8,7 +8,6 @@ function n() {
|
|
|
8
8
|
return r === e ? t : r;
|
|
9
9
|
}, [n]);
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { n as useAbTranslate };
|
|
13
12
|
|
|
14
13
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":[],"sources":["../../src/atheletebridge/i18n.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\n/**\n * Translate function with a mandatory inline English fallback.\n *\n * `key` is the dotted translation key (e.g. `atheletebridge.pages.teams.title`);\n * `fallback` is the English copy to render when the key is not present in the\n * active locale. The fallback is NOT decoration — `scripts/extract-i18n-keys.ts`\n * in `atheletebridge-app` scans for `tr(key, fallback)` call sites and uses the\n * second argument as the English source string when it builds the i18n bundle.\n * A `tr()` call without a literal fallback extracts as a title-cased guess, so\n * always pass a real one, and always pass string literals (the AST scanner\n * cannot resolve variables).\n */\nexport type TranslateFn = (key: string, fallback: string) => string;\n\n/**\n * AthleteBridge's translate hook.\n *\n * Wraps the shell's `useI18n()` so that a missing key falls back to the inline\n * English string instead of rendering the raw key (which is what the shell's\n * bare `t()` does). Use this everywhere in this package rather than calling\n * `useI18n()` directly, so every product string is extractable.\n *\n * const tr = useAbTranslate();\n * <h1>{tr('atheletebridge.pages.standings.title', 'Standings')}</h1>\n */\nexport function useAbTranslate(): TranslateFn {\n const { t: translate } = useI18n();\n return useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n}\n"],"mappings":";;;AA4BA,
|
|
1
|
+
{"version":3,"file":"i18n.js","names":["useAbTranslate","translate","useI18n","useCallback","value","key","fallback"],"sources":["../../src/atheletebridge/i18n.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\n/**\n * Translate function with a mandatory inline English fallback.\n *\n * `key` is the dotted translation key (e.g. `atheletebridge.pages.teams.title`);\n * `fallback` is the English copy to render when the key is not present in the\n * active locale. The fallback is NOT decoration — `scripts/extract-i18n-keys.ts`\n * in `atheletebridge-app` scans for `tr(key, fallback)` call sites and uses the\n * second argument as the English source string when it builds the i18n bundle.\n * A `tr()` call without a literal fallback extracts as a title-cased guess, so\n * always pass a real one, and always pass string literals (the AST scanner\n * cannot resolve variables).\n */\nexport type TranslateFn = (key: string, fallback: string) => string;\n\n/**\n * AthleteBridge's translate hook.\n *\n * Wraps the shell's `useI18n()` so that a missing key falls back to the inline\n * English string instead of rendering the raw key (which is what the shell's\n * bare `t()` does). Use this everywhere in this package rather than calling\n * `useI18n()` directly, so every product string is extractable.\n *\n * const tr = useAbTranslate();\n * <h1>{tr('atheletebridge.pages.standings.title', 'Standings')}</h1>\n */\nexport function useAbTranslate(): TranslateFn {\n const { t: translate } = useI18n();\n return useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n}\n"],"mappings":";;;AA4BA,SAAgBA,IAA8B;CAC5C,IAAM,EAAE,GAAGC,MAAcC,EAAQ;CACjC,OAAOC,GACJ,GAAa,MAA6B;EACzC,IAAMC,IAAQH,EAAUI,CAAG;EAC3B,OAAOD,MAAUC,IAAMC,IAAWF;CACpC,GACA,CAACH,CAAS,CACZ;AACF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./context/AthleteBridgeContext.js";
|
|
2
|
-
import "./utils/cn.js";
|
|
3
|
-
import "./utils/formatters.js";
|
|
4
|
-
import "./
|
|
5
|
-
import "./AthleteBridgeRoot.js";
|
|
6
|
-
import "./admin/AdminDashboardPage.js";
|
|
7
|
-
import "./admin/AdminRoot.js";
|
|
1
|
+
import { AthleteBridgeProvider as e, useAthleteBridge as t } from "./context/AthleteBridgeContext.js";
|
|
2
|
+
import { cn as n } from "./utils/cn.js";
|
|
3
|
+
import { formatDate as r, formatDuration as i } from "./utils/formatters.js";
|
|
4
|
+
import { AthleteBridgeRoot as a } from "./AthleteBridgeRoot.js";
|
|
8
5
|
import "./admin/index.js";
|
|
9
|
-
import "./
|
|
6
|
+
import { AdminDashboardPage as o } from "./admin/AdminDashboardPage.js";
|
|
7
|
+
import { AdminRoot as s } from "./admin/AdminRoot.js";
|
|
8
|
+
import "./context/index.js";
|
|
9
|
+
import { useAthleteBridgeStore as c } from "./store/atheletebridgeStore.js";
|
|
10
10
|
import "./store/index.js";
|
|
11
|
+
export { o as AdminDashboardPage, s as AdminRoot, e as AthleteBridgeProvider, a as AthleteBridgeRoot, n as cn, r as formatDate, i as formatDuration, t as useAthleteBridge, c as useAthleteBridgeStore };
|
|
@@ -8,5 +8,4 @@
|
|
|
8
8
|
* crest-vs-crest upcoming-fixtures rail, and a real (derived) recent-activity
|
|
9
9
|
* timeline — every item mapped to a real record, nothing fabricated.
|
|
10
10
|
*/
|
|
11
|
-
export declare function DashboardPage(): import(
|
|
12
|
-
//# sourceMappingURL=DashboardPage.d.ts.map
|
|
11
|
+
export declare function DashboardPage(): import('react').JSX.Element;
|