@burdenoff/microfe-atheletebridge 2026.1031.2 → 2026.1102.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.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoot.js +63 -47
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.d.ts.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.js +62 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/StatusBadge.d.ts.map +1 -1
- package/dist/atheletebridge/components/StatusBadge.js +13 -1
- package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts +6 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js +104 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js.map +1 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts +15 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +236 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -0
- package/dist/atheletebridge/components/registration/entryRules.d.ts +23 -0
- package/dist/atheletebridge/components/registration/entryRules.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/entryRules.js +29 -0
- package/dist/atheletebridge/components/registration/entryRules.js.map +1 -0
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +6 -2
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +297 -281
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +54 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts.map +1 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.js +265 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -0
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +123 -416
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts +10 -0
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +89 -0
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts +10 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js +94 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts +11 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +160 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts +10 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +602 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts +9 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +317 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts +9 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js +127 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts +11 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +411 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -0
- package/dist/atheletebridge/types/registration.d.ts +220 -0
- package/dist/atheletebridge/types/registration.d.ts.map +1 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts +19 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts.map +1 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.js +21 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.js.map +1 -0
- package/dist/atheletebridge/utils/money.d.ts +22 -0
- package/dist/atheletebridge/utils/money.d.ts.map +1 -0
- package/dist/atheletebridge/utils/money.js +38 -0
- package/dist/atheletebridge/utils/money.js.map +1 -0
- package/dist/atheletebridge/utils/registration.d.ts +17 -0
- package/dist/atheletebridge/utils/registration.d.ts.map +1 -0
- package/dist/atheletebridge/utils/registration.js +25 -0
- package/dist/atheletebridge/utils/registration.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { AthPageInfo } from './index';
|
|
2
|
+
|
|
3
|
+
export type AthRegistrationFormStatus = 'DRAFT' | 'PUBLISHED' | 'CLOSED' | 'ARCHIVED';
|
|
4
|
+
export type AthRegistrationFieldType = 'SHORT_TEXT' | 'LONG_TEXT' | 'EMAIL' | 'PHONE' | 'NUMBER' | 'DATE' | 'SELECT' | 'CHECKBOX';
|
|
5
|
+
export type AthRegistrationFeeType = 'REQUIRED' | 'OPTIONAL';
|
|
6
|
+
export type AthRegistrationSource = 'SELF_SERVICE' | 'STAFF_ENTRY';
|
|
7
|
+
export type AthRegistrationSubmissionStatus = 'SUBMITTED' | 'ACCEPTED' | 'DECLINED' | 'WITHDRAWN';
|
|
8
|
+
export type AthRegistrationPaymentStatus = 'NOT_REQUIRED' | 'UNPAID' | 'PARTIALLY_PAID' | 'PAID' | 'REFUNDED';
|
|
9
|
+
export type AthRegistrationPaymentMethod = 'CASH' | 'BANK_TRANSFER' | 'CARD_TERMINAL' | 'CHEQUE' | 'ONLINE' | 'OTHER';
|
|
10
|
+
export type AthRegistrationPaymentRecordStatus = 'RECORDED' | 'REFUNDED' | 'VOIDED';
|
|
11
|
+
export type AthRegistrationDecision = 'ACCEPT' | 'DECLINE';
|
|
12
|
+
export type AthRegistrationAnswerValue = string | number | boolean;
|
|
13
|
+
export interface AthRegistrationField {
|
|
14
|
+
id: string;
|
|
15
|
+
key: string;
|
|
16
|
+
label: string;
|
|
17
|
+
fieldType: AthRegistrationFieldType;
|
|
18
|
+
required: boolean;
|
|
19
|
+
options: string[];
|
|
20
|
+
helpText: string | null;
|
|
21
|
+
position: number;
|
|
22
|
+
}
|
|
23
|
+
export interface AthRegistrationFee {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description: string | null;
|
|
27
|
+
amount: number;
|
|
28
|
+
feeType: AthRegistrationFeeType;
|
|
29
|
+
position: number;
|
|
30
|
+
}
|
|
31
|
+
export interface AthRegistrationForm {
|
|
32
|
+
id: string;
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
title: string;
|
|
35
|
+
description: string | null;
|
|
36
|
+
season: string | null;
|
|
37
|
+
teamId: string | null;
|
|
38
|
+
programId: string | null;
|
|
39
|
+
slug: string;
|
|
40
|
+
status: AthRegistrationFormStatus;
|
|
41
|
+
currency: string;
|
|
42
|
+
opensAt: string | null;
|
|
43
|
+
closesAt: string | null;
|
|
44
|
+
maxSubmissions: number | null;
|
|
45
|
+
waiverText: string | null;
|
|
46
|
+
publishedAt: string | null;
|
|
47
|
+
closedAt: string | null;
|
|
48
|
+
isOpen: boolean;
|
|
49
|
+
submissionCount: number;
|
|
50
|
+
fields: AthRegistrationField[];
|
|
51
|
+
fees: AthRegistrationFee[];
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
}
|
|
55
|
+
export interface AthRegistrationFormConnection {
|
|
56
|
+
items: AthRegistrationForm[];
|
|
57
|
+
pageInfo: AthPageInfo;
|
|
58
|
+
}
|
|
59
|
+
export interface AthRegistrationSubmission {
|
|
60
|
+
id: string;
|
|
61
|
+
workspaceId: string;
|
|
62
|
+
formId: string;
|
|
63
|
+
formTitle: string;
|
|
64
|
+
source: AthRegistrationSource;
|
|
65
|
+
submittedByUserId: string | null;
|
|
66
|
+
participantName: string;
|
|
67
|
+
participantUserId: string | null;
|
|
68
|
+
contactName: string | null;
|
|
69
|
+
contactEmail: string | null;
|
|
70
|
+
contactPhone: string | null;
|
|
71
|
+
answers: Record<string, AthRegistrationAnswerValue>;
|
|
72
|
+
selectedFeeIds: string[];
|
|
73
|
+
status: AthRegistrationSubmissionStatus;
|
|
74
|
+
paymentStatus: AthRegistrationPaymentStatus;
|
|
75
|
+
amountDue: number;
|
|
76
|
+
amountPaid: number;
|
|
77
|
+
amountOutstanding: number;
|
|
78
|
+
currency: string;
|
|
79
|
+
waiverAcceptedAt: string | null;
|
|
80
|
+
reviewNotes: string | null;
|
|
81
|
+
reviewedAt: string | null;
|
|
82
|
+
submittedAt: string;
|
|
83
|
+
createdAt: string;
|
|
84
|
+
updatedAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface AthRegistrationSubmissionConnection {
|
|
87
|
+
items: AthRegistrationSubmission[];
|
|
88
|
+
pageInfo: AthPageInfo;
|
|
89
|
+
}
|
|
90
|
+
export interface AthRegistrationPayment {
|
|
91
|
+
id: string;
|
|
92
|
+
submissionId: string;
|
|
93
|
+
amount: number;
|
|
94
|
+
refundedAmount: number;
|
|
95
|
+
netAmount: number;
|
|
96
|
+
currency: string;
|
|
97
|
+
method: AthRegistrationPaymentMethod;
|
|
98
|
+
status: AthRegistrationPaymentRecordStatus;
|
|
99
|
+
reference: string | null;
|
|
100
|
+
note: string | null;
|
|
101
|
+
receivedAt: string;
|
|
102
|
+
voidedAt: string | null;
|
|
103
|
+
voidReason: string | null;
|
|
104
|
+
refundedAt: string | null;
|
|
105
|
+
refundReason: string | null;
|
|
106
|
+
createdBy: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
}
|
|
109
|
+
export interface AthRegistrationCurrencyTotal {
|
|
110
|
+
currency: string;
|
|
111
|
+
amountDue: number;
|
|
112
|
+
amountCollected: number;
|
|
113
|
+
amountRefunded: number;
|
|
114
|
+
amountOutstanding: number;
|
|
115
|
+
}
|
|
116
|
+
export interface AthRegistrationPaymentSummary {
|
|
117
|
+
formId: string | null;
|
|
118
|
+
submissionCount: number;
|
|
119
|
+
acceptedCount: number;
|
|
120
|
+
notRequiredCount: number;
|
|
121
|
+
unpaidCount: number;
|
|
122
|
+
partiallyPaidCount: number;
|
|
123
|
+
paidCount: number;
|
|
124
|
+
refundedCount: number;
|
|
125
|
+
totals: AthRegistrationCurrencyTotal[];
|
|
126
|
+
}
|
|
127
|
+
export interface AthPublicRegistrationForm {
|
|
128
|
+
id: string;
|
|
129
|
+
slug: string;
|
|
130
|
+
title: string;
|
|
131
|
+
description: string | null;
|
|
132
|
+
season: string | null;
|
|
133
|
+
currency: string;
|
|
134
|
+
opensAt: string | null;
|
|
135
|
+
closesAt: string | null;
|
|
136
|
+
waiverText: string | null;
|
|
137
|
+
isOpen: boolean;
|
|
138
|
+
spotsRemaining: number | null;
|
|
139
|
+
fields: AthRegistrationField[];
|
|
140
|
+
fees: AthRegistrationFee[];
|
|
141
|
+
}
|
|
142
|
+
export interface AthMyRegistration {
|
|
143
|
+
id: string;
|
|
144
|
+
formId: string;
|
|
145
|
+
formTitle: string;
|
|
146
|
+
formSlug: string;
|
|
147
|
+
participantName: string;
|
|
148
|
+
status: AthRegistrationSubmissionStatus;
|
|
149
|
+
paymentStatus: AthRegistrationPaymentStatus;
|
|
150
|
+
amountDue: number;
|
|
151
|
+
amountPaid: number;
|
|
152
|
+
amountOutstanding: number;
|
|
153
|
+
currency: string;
|
|
154
|
+
submittedAt: string;
|
|
155
|
+
}
|
|
156
|
+
export interface AthMyRegistrationConnection {
|
|
157
|
+
items: AthMyRegistration[];
|
|
158
|
+
pageInfo: AthPageInfo;
|
|
159
|
+
}
|
|
160
|
+
export interface AthRegistrationFieldInput {
|
|
161
|
+
key: string;
|
|
162
|
+
label: string;
|
|
163
|
+
fieldType: AthRegistrationFieldType;
|
|
164
|
+
required: boolean;
|
|
165
|
+
options?: string[];
|
|
166
|
+
helpText?: string;
|
|
167
|
+
}
|
|
168
|
+
export interface AthRegistrationFeeInput {
|
|
169
|
+
name: string;
|
|
170
|
+
description?: string;
|
|
171
|
+
amount: number;
|
|
172
|
+
feeType: AthRegistrationFeeType;
|
|
173
|
+
}
|
|
174
|
+
export interface AthCreateRegistrationFormInput {
|
|
175
|
+
title: string;
|
|
176
|
+
description?: string;
|
|
177
|
+
season?: string;
|
|
178
|
+
teamId?: string;
|
|
179
|
+
programId?: string;
|
|
180
|
+
slug?: string;
|
|
181
|
+
currency?: string;
|
|
182
|
+
opensAt?: string;
|
|
183
|
+
closesAt?: string;
|
|
184
|
+
maxSubmissions?: number;
|
|
185
|
+
waiverText?: string;
|
|
186
|
+
fields?: AthRegistrationFieldInput[];
|
|
187
|
+
fees?: AthRegistrationFeeInput[];
|
|
188
|
+
}
|
|
189
|
+
export type AthUpdateRegistrationFormInput = Omit<Partial<AthCreateRegistrationFormInput>, 'slug' | 'description' | 'season' | 'teamId' | 'programId' | 'opensAt' | 'closesAt' | 'maxSubmissions' | 'waiverText'> & {
|
|
190
|
+
description?: string | null;
|
|
191
|
+
season?: string | null;
|
|
192
|
+
teamId?: string | null;
|
|
193
|
+
programId?: string | null;
|
|
194
|
+
opensAt?: string | null;
|
|
195
|
+
closesAt?: string | null;
|
|
196
|
+
maxSubmissions?: number | null;
|
|
197
|
+
waiverText?: string | null;
|
|
198
|
+
};
|
|
199
|
+
export interface AthRegistrationEntryInput {
|
|
200
|
+
participantName: string;
|
|
201
|
+
contactName?: string;
|
|
202
|
+
contactEmail?: string;
|
|
203
|
+
contactPhone?: string;
|
|
204
|
+
answers?: Record<string, AthRegistrationAnswerValue>;
|
|
205
|
+
selectedFeeIds?: string[];
|
|
206
|
+
waiverAccepted?: boolean;
|
|
207
|
+
}
|
|
208
|
+
export interface AthRecordRegistrationInput extends AthRegistrationEntryInput {
|
|
209
|
+
formId: string;
|
|
210
|
+
participantUserId?: string;
|
|
211
|
+
}
|
|
212
|
+
export interface AthRecordRegistrationPaymentInput {
|
|
213
|
+
submissionId: string;
|
|
214
|
+
amount: number;
|
|
215
|
+
method: AthRegistrationPaymentMethod;
|
|
216
|
+
reference?: string;
|
|
217
|
+
note?: string;
|
|
218
|
+
receivedAt?: string;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../../src/atheletebridge/types/registration.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AACtF,MAAM,MAAM,wBAAwB,GAClC,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC7F,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,UAAU,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG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../types';
|
|
2
|
+
|
|
3
|
+
/** `extraTime*Score` / `penalty*Score` on AthFixture and AthRecordResultInput. */
|
|
4
|
+
export declare const FIXTURE_KNOCKOUT_SCORES_LIVE = false;
|
|
5
|
+
/** `cricketScorecard` on AthFixture and AthRecordResultInput. */
|
|
6
|
+
export declare const FIXTURE_CRICKET_SCORECARD_LIVE = false;
|
|
7
|
+
/**
|
|
8
|
+
* The optional part of a fixture selection, built from the flags above.
|
|
9
|
+
* `cricketScorecardSelection` is the scorecard's own sub-selection.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fixtureOutcomeSelection(cricketScorecardSelection: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Fill the fields that were not selected with `null`, so a reader that checks
|
|
14
|
+
* `!== null` never mistakes an absent value for a recorded one.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeFixture<T extends Partial<AthFixture>>(fixture: T): T;
|
|
17
|
+
/** `normalizeFixture` over a nullable value. */
|
|
18
|
+
export declare function normalizeFixtureOrNull<T extends Partial<AthFixture>>(fixture: T | null): T | null;
|
|
19
|
+
//# sourceMappingURL=fixtureCapabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtureCapabilities.d.ts","sourceRoot":"","sources":["../../../src/atheletebridge/utils/fixtureCapabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,kFAAkF;AAClF,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAElD,iEAAiE;AACjE,eAAO,MAAM,8BAA8B,QAAQ,CAAC;AASpD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,yBAAyB,EAAE,MAAM,GAAG,MAAM,CAMjF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAS7E;AAED,gDAAgD;AAChD,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAEjG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/atheletebridge/utils/fixtureCapabilities.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return [].join("\n");
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return {
|
|
7
|
+
...e,
|
|
8
|
+
extraTimeHomeScore: e.extraTimeHomeScore ?? null,
|
|
9
|
+
extraTimeAwayScore: e.extraTimeAwayScore ?? null,
|
|
10
|
+
penaltyHomeScore: e.penaltyHomeScore ?? null,
|
|
11
|
+
penaltyAwayScore: e.penaltyAwayScore ?? null,
|
|
12
|
+
cricketScorecard: e.cricketScorecard ?? null
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function n(e) {
|
|
16
|
+
return e ? t(e) : null;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { e as fixtureOutcomeSelection, t as normalizeFixture, n as normalizeFixtureOrNull };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=fixtureCapabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtureCapabilities.js","names":[],"sources":["../../../src/atheletebridge/utils/fixtureCapabilities.ts"],"sourcesContent":["/**\n * Fixture fields the deployed backend can serve.\n * @module atheletebridge/utils/fixtureCapabilities\n *\n * The knockout-outcome scores (BOFF-7640: extra time and penalties) and the\n * cricket scorecard (BOFF-7644) shipped in this MFE before the matching\n * `wspace-atheletebridge-svc` changes (svc PRs #9 and #10, still in review).\n * The gateway validates every operation against the composed supergraph, so\n * selecting a field the subgraph does not publish fails the WHOLE operation\n * with GRAPHQL_VALIDATION_FAILED. In production that took down the fixture\n * list, the fixture detail page and the team detail page (\"Team not found\").\n *\n * Until the backend publishes those fields, they are left out of every\n * selection and normalised to `null`, which every reader already treats as\n * \"not recorded\". The UI for entering them stays hidden for the same reason.\n * Flip the matching flag once the svc release that adds the field is live in\n * both alpha and production.\n */\n\nimport type { AthFixture } from '../types';\n\n/** `extraTime*Score` / `penalty*Score` on AthFixture and AthRecordResultInput. */\nexport const FIXTURE_KNOCKOUT_SCORES_LIVE = false;\n\n/** `cricketScorecard` on AthFixture and AthRecordResultInput. */\nexport const FIXTURE_CRICKET_SCORECARD_LIVE = false;\n\nconst KNOCKOUT_SCORE_FIELDS = [\n 'extraTimeHomeScore',\n 'extraTimeAwayScore',\n 'penaltyHomeScore',\n 'penaltyAwayScore',\n] as const;\n\n/**\n * The optional part of a fixture selection, built from the flags above.\n * `cricketScorecardSelection` is the scorecard's own sub-selection.\n */\nexport function fixtureOutcomeSelection(cricketScorecardSelection: string): string {\n const parts: string[] = [];\n if (FIXTURE_KNOCKOUT_SCORES_LIVE) parts.push(KNOCKOUT_SCORE_FIELDS.join(' '));\n if (FIXTURE_CRICKET_SCORECARD_LIVE)\n parts.push(`cricketScorecard { ${cricketScorecardSelection} }`);\n return parts.join('\\n');\n}\n\n/**\n * Fill the fields that were not selected with `null`, so a reader that checks\n * `!== null` never mistakes an absent value for a recorded one.\n */\nexport function normalizeFixture<T extends Partial<AthFixture>>(fixture: T): T {\n return {\n ...fixture,\n extraTimeHomeScore: fixture.extraTimeHomeScore ?? null,\n extraTimeAwayScore: fixture.extraTimeAwayScore ?? null,\n penaltyHomeScore: fixture.penaltyHomeScore ?? null,\n penaltyAwayScore: fixture.penaltyAwayScore ?? null,\n cricketScorecard: fixture.cricketScorecard ?? null,\n };\n}\n\n/** `normalizeFixture` over a nullable value. */\nexport function normalizeFixtureOrNull<T extends Partial<AthFixture>>(fixture: T | null): T | null {\n return fixture ? normalizeFixture(fixture) : null;\n}\n"],"mappings":";AAsCA,SAAgB,EAAwB,GAA2C;CAKjF,OAAO,CAAA,EAAM,KAAK,IAAI;AACxB;AAMA,SAAgB,EAAgD,GAAe;CAC7E,OAAO;EACL,GAAG;EACH,oBAAoB,EAAQ,sBAAsB;EAClD,oBAAoB,EAAQ,sBAAsB;EAClD,kBAAkB,EAAQ,oBAAoB;EAC9C,kBAAkB,EAAQ,oBAAoB;EAC9C,kBAAkB,EAAQ,oBAAoB;CAChD;AACF;AAGA,SAAgB,EAAsD,GAA6B;CACjG,OAAO,IAAU,EAAiB,CAAO,IAAI;AAC/C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Money helpers for registration fees (BOFF-4135).
|
|
3
|
+
*
|
|
4
|
+
* The API carries every amount as an integer in minor units of an ISO 4217
|
|
5
|
+
* currency. These helpers convert between that and what people type / read,
|
|
6
|
+
* using the currency's own minor-unit exponent (JPY has none, KWD has three).
|
|
7
|
+
*
|
|
8
|
+
* @module atheletebridge/utils/money
|
|
9
|
+
*/
|
|
10
|
+
/** Number of minor-unit digits for a currency (2 for USD/INR, 0 for JPY). */
|
|
11
|
+
export declare function currencyExponent(currency: string): number;
|
|
12
|
+
/** Format minor units for display, e.g. `formatMoney(12550, 'USD')` → `$125.50`. */
|
|
13
|
+
export declare function formatMoney(minor: number, currency: string, locale?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Parse a typed amount (e.g. `"125.50"`, `"1,250"`) into minor units.
|
|
16
|
+
* Returns null for anything that is not a non-negative amount with at most the
|
|
17
|
+
* currency's number of decimals — never silently rounds.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseMoney(input: string, currency: string): number | null;
|
|
20
|
+
/** Render minor units as an editable decimal string (no symbol). */
|
|
21
|
+
export declare function minorToInput(minor: number, currency: string): string;
|
|
22
|
+
//# sourceMappingURL=money.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../src/atheletebridge/utils/money.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CASzD;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAQpF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASzE;AAED,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/atheletebridge/utils/money.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
try {
|
|
4
|
+
return new Intl.NumberFormat("en", {
|
|
5
|
+
style: "currency",
|
|
6
|
+
currency: e
|
|
7
|
+
}).resolvedOptions().maximumFractionDigits ?? 2;
|
|
8
|
+
} catch {
|
|
9
|
+
return 2;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function t(t, n, r) {
|
|
13
|
+
let i = e(n), a = t / 10 ** i;
|
|
14
|
+
try {
|
|
15
|
+
return new Intl.NumberFormat(r, {
|
|
16
|
+
style: "currency",
|
|
17
|
+
currency: n
|
|
18
|
+
}).format(a);
|
|
19
|
+
} catch {
|
|
20
|
+
return `${a.toFixed(i)} ${n}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function n(t, n) {
|
|
24
|
+
let r = t.trim().replace(/[,\s]/g, "");
|
|
25
|
+
if (r === "") return null;
|
|
26
|
+
let i = e(n);
|
|
27
|
+
if (!(i > 0 ? RegExp(`^\\d+(\\.\\d{1,${i}})?$`) : /^\d+$/).test(r)) return null;
|
|
28
|
+
let [a = "0", o = ""] = r.split("."), s = Number(a) * 10 ** i + Number(o.padEnd(i, "0") || "0");
|
|
29
|
+
return Number.isSafeInteger(s) ? s : null;
|
|
30
|
+
}
|
|
31
|
+
function r(t, n) {
|
|
32
|
+
let r = e(n);
|
|
33
|
+
return (t / 10 ** r).toFixed(r);
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { t as formatMoney, r as minorToInput, n as parseMoney };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=money.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.js","names":[],"sources":["../../../src/atheletebridge/utils/money.ts"],"sourcesContent":["/**\n * Money helpers for registration fees (BOFF-4135).\n *\n * The API carries every amount as an integer in minor units of an ISO 4217\n * currency. These helpers convert between that and what people type / read,\n * using the currency's own minor-unit exponent (JPY has none, KWD has three).\n *\n * @module atheletebridge/utils/money\n */\n\n/** Number of minor-unit digits for a currency (2 for USD/INR, 0 for JPY). */\nexport function currencyExponent(currency: string): number {\n try {\n return (\n new Intl.NumberFormat('en', { style: 'currency', currency }).resolvedOptions()\n .maximumFractionDigits ?? 2\n );\n } catch {\n return 2;\n }\n}\n\n/** Format minor units for display, e.g. `formatMoney(12550, 'USD')` → `$125.50`. */\nexport function formatMoney(minor: number, currency: string, locale?: string): string {\n const exponent = currencyExponent(currency);\n const major = minor / 10 ** exponent;\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(major);\n } catch {\n return `${major.toFixed(exponent)} ${currency}`;\n }\n}\n\n/**\n * Parse a typed amount (e.g. `\"125.50\"`, `\"1,250\"`) into minor units.\n * Returns null for anything that is not a non-negative amount with at most the\n * currency's number of decimals — never silently rounds.\n */\nexport function parseMoney(input: string, currency: string): number | null {\n const cleaned = input.trim().replace(/[,\\s]/g, '');\n if (cleaned === '') return null;\n const exponent = currencyExponent(currency);\n const pattern = exponent > 0 ? new RegExp(`^\\\\d+(\\\\.\\\\d{1,${exponent}})?$`) : /^\\d+$/;\n if (!pattern.test(cleaned)) return null;\n const [whole = '0', fraction = ''] = cleaned.split('.');\n const minor = Number(whole) * 10 ** exponent + Number(fraction.padEnd(exponent, '0') || '0');\n return Number.isSafeInteger(minor) ? minor : null;\n}\n\n/** Render minor units as an editable decimal string (no symbol). */\nexport function minorToInput(minor: number, currency: string): string {\n const exponent = currencyExponent(currency);\n return (minor / 10 ** exponent).toFixed(exponent);\n}\n"],"mappings":";AAWA,SAAgB,EAAiB,GAA0B;CACzD,IAAI;EACF,OACE,IAAI,KAAK,aAAa,MAAM;GAAE,OAAO;GAAY;EAAS,CAAC,EAAE,gBAAgB,EAC1E,yBAAyB;CAEhC,QAAQ;EACN,OAAO;CACT;AACF;AAGA,SAAgB,EAAY,GAAe,GAAkB,GAAyB;CACpF,IAAM,IAAW,EAAiB,CAAQ,GACpC,IAAQ,IAAQ,MAAM;CAC5B,IAAI;EACF,OAAO,IAAI,KAAK,aAAa,GAAQ;GAAE,OAAO;GAAY;EAAS,CAAC,EAAE,OAAO,CAAK;CACpF,QAAQ;EACN,OAAO,GAAG,EAAM,QAAQ,CAAQ,EAAE,GAAG;CACvC;AACF;AAOA,SAAgB,EAAW,GAAe,GAAiC;CACzE,IAAM,IAAU,EAAM,KAAK,EAAE,QAAQ,UAAU,EAAE;CACjD,IAAI,MAAY,IAAI,OAAO;CAC3B,IAAM,IAAW,EAAiB,CAAQ;CAE1C,IAAI,EADY,IAAW,IAAQ,OAAO,kBAAkB,EAAS,KAAK,IAAI,SACjE,KAAK,CAAO,GAAG,OAAO;CACnC,IAAM,CAAC,IAAQ,KAAK,IAAW,MAAM,EAAQ,MAAM,GAAG,GAChD,IAAQ,OAAO,CAAK,IAAI,MAAM,IAAW,OAAO,EAAS,OAAO,GAAU,GAAG,KAAK,GAAG;CAC3F,OAAO,OAAO,cAAc,CAAK,IAAI,IAAQ;AAC/C;AAGA,SAAgB,EAAa,GAAe,GAA0B;CACpE,IAAM,IAAW,EAAiB,CAAQ;CAC1C,QAAQ,IAAQ,MAAM,GAAU,QAAQ,CAAQ;AAClD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registration helpers (BOFF-4135).
|
|
3
|
+
* @module atheletebridge/utils/registration
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Derive a stable question key from its label, matching the server's key rule
|
|
7
|
+
* (`^[a-z][a-z0-9._-]{0,79}$`) and de-duplicating against keys already used.
|
|
8
|
+
*/
|
|
9
|
+
export declare function keyFromLabel(label: string, taken: ReadonlySet<string>): string;
|
|
10
|
+
/**
|
|
11
|
+
* Absolute share link for a form slug. The family opens it inside their own
|
|
12
|
+
* AthleteBridge app (any workspace) — the slug alone identifies the form.
|
|
13
|
+
*/
|
|
14
|
+
export declare function registrationShareUrl(origin: string, basePath: string, slug: string): string;
|
|
15
|
+
export declare function paymentMethodLabel(method: string): string;
|
|
16
|
+
export declare const PAYMENT_METHODS: string[];
|
|
17
|
+
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../../src/atheletebridge/utils/registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAc9E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG3F;AAWD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,eAAO,MAAM,eAAe,UAAqC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/atheletebridge/utils/registration.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = e.toLowerCase().normalize("NFKD").replace(/\p{M}/gu, "").split(/[^a-z0-9]+/).filter(Boolean).join("_").replace(/^[^a-z]+/, "").slice(0, 60) || "question", r = n;
|
|
4
|
+
for (let e = 2; t.has(r); e++) r = `${n}_${e}`;
|
|
5
|
+
return r;
|
|
6
|
+
}
|
|
7
|
+
function t(e, t, n) {
|
|
8
|
+
return `${e}${t === "/" ? "" : t.replace(/\/$/, "")}/register/${encodeURIComponent(n)}`;
|
|
9
|
+
}
|
|
10
|
+
var n = {
|
|
11
|
+
CASH: "Cash",
|
|
12
|
+
BANK_TRANSFER: "Bank transfer",
|
|
13
|
+
CARD_TERMINAL: "Card (terminal)",
|
|
14
|
+
CHEQUE: "Cheque",
|
|
15
|
+
ONLINE: "Online",
|
|
16
|
+
OTHER: "Other"
|
|
17
|
+
};
|
|
18
|
+
function r(e) {
|
|
19
|
+
return n[e] ?? e;
|
|
20
|
+
}
|
|
21
|
+
var i = Object.keys(n);
|
|
22
|
+
//#endregion
|
|
23
|
+
export { i as PAYMENT_METHODS, e as keyFromLabel, r as paymentMethodLabel, t as registrationShareUrl };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=registration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.js","names":[],"sources":["../../../src/atheletebridge/utils/registration.ts"],"sourcesContent":["/**\n * Registration helpers (BOFF-4135).\n * @module atheletebridge/utils/registration\n */\n\n/**\n * Derive a stable question key from its label, matching the server's key rule\n * (`^[a-z][a-z0-9._-]{0,79}$`) and de-duplicating against keys already used.\n */\nexport function keyFromLabel(label: string, taken: ReadonlySet<string>): string {\n const base =\n label\n .toLowerCase()\n .normalize('NFKD')\n .replace(/\\p{M}/gu, '')\n .split(/[^a-z0-9]+/)\n .filter(Boolean)\n .join('_')\n .replace(/^[^a-z]+/, '')\n .slice(0, 60) || 'question';\n let key = base;\n for (let n = 2; taken.has(key); n++) key = `${base}_${n}`;\n return key;\n}\n\n/**\n * Absolute share link for a form slug. The family opens it inside their own\n * AthleteBridge app (any workspace) — the slug alone identifies the form.\n */\nexport function registrationShareUrl(origin: string, basePath: string, slug: string): string {\n const base = basePath === '/' ? '' : basePath.replace(/\\/$/, '');\n return `${origin}${base}/register/${encodeURIComponent(slug)}`;\n}\n\nconst PAYMENT_METHOD_LABELS: Record<string, string> = {\n CASH: 'Cash',\n BANK_TRANSFER: 'Bank transfer',\n CARD_TERMINAL: 'Card (terminal)',\n CHEQUE: 'Cheque',\n ONLINE: 'Online',\n OTHER: 'Other',\n};\n\nexport function paymentMethodLabel(method: string): string {\n return PAYMENT_METHOD_LABELS[method] ?? method;\n}\n\nexport const PAYMENT_METHODS = Object.keys(PAYMENT_METHOD_LABELS);\n"],"mappings":";AASA,SAAgB,EAAa,GAAe,GAAoC;CAC9E,IAAM,IACJ,EACG,YAAY,EACZ,UAAU,MAAM,EAChB,QAAQ,WAAW,EAAE,EACrB,MAAM,YAAY,EAClB,OAAO,OAAO,EACd,KAAK,GAAG,EACR,QAAQ,YAAY,EAAE,EACtB,MAAM,GAAG,EAAE,KAAK,YACjB,IAAM;CACV,KAAK,IAAI,IAAI,GAAG,EAAM,IAAI,CAAG,GAAG,KAAK,IAAM,GAAG,EAAK,GAAG;CACtD,OAAO;AACT;AAMA,SAAgB,EAAqB,GAAgB,GAAkB,GAAsB;CAE3F,OAAO,GAAG,IADG,MAAa,MAAM,KAAK,EAAS,QAAQ,OAAO,EAAE,EACvC,YAAY,mBAAmB,CAAI;AAC7D;AAEA,IAAM,IAAgD;CACpD,MAAM;CACN,eAAe;CACf,eAAe;CACf,QAAQ;CACR,QAAQ;CACR,OAAO;AACT;AAEA,SAAgB,EAAmB,GAAwB;CACzD,OAAO,EAAsB,MAAW;AAC1C;AAEA,IAAa,IAAkB,OAAO,KAAK,CAAqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-atheletebridge",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1102.1",
|
|
4
4
|
"description": "Burdenoff AthleteBridge Microfrontend - Sports, coaching & training platform for teams, fixtures, programs, sessions and athlete performance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|