@composable-os/pack-memberships 0.1.0-beta.11 → 0.1.0-beta.13
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/blocks/memberships-mine/mine.d.ts +6 -4
- package/dist/blocks/memberships-mine/mine.js +66 -34
- package/dist/blocks/memberships-native-mine/mine-screen.d.ts +6 -2
- package/dist/blocks/memberships-native-mine/mine-screen.js +30 -6
- package/dist/blocks/memberships-passes/passes.d.ts +6 -1
- package/dist/blocks/memberships-passes/passes.js +75 -8
- package/dist/blocks/memberships-plans/plans.d.ts +6 -1
- package/dist/blocks/memberships-plans/plans.js +71 -6
- package/dist/blocks/memberships-staff-holdings/holdings.d.ts +9 -0
- package/dist/blocks/memberships-staff-holdings/holdings.js +15 -0
- package/dist/client/index.d.ts +338 -27
- package/dist/client/index.js +157 -6
- package/dist/index.d.ts +218 -20
- package/dist/index.js +173 -27
- package/dist/tools.d.ts +1 -4
- package/dist/tools.js +28 -20
- package/package.json +3 -3
package/dist/client/index.js
CHANGED
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
// are left: the host does (`sellable`, the one-trial rule, `onePerPerson`, `allowance.get`). The
|
|
7
7
|
// billing actions (subscribe, cancel, resume, change plan, the provider's portal, buying a pass)
|
|
8
8
|
// are the web's; a native block reads only (the block lint). Pausing is staff's (decision 10).
|
|
9
|
+
// Whether a member may cool off (stage 44 step 7) is the host's: a block asks, and never works
|
|
10
|
+
// the window out on the device.
|
|
9
11
|
// Whether a change is an upgrade (now, prorated) or a downgrade (next period) is the host's.
|
|
10
|
-
import { packHooks } from "@composable-os/client";
|
|
12
|
+
import { formatMinor, packHooks, } from "@composable-os/client";
|
|
11
13
|
export const PLAN = "memberships.plan";
|
|
12
14
|
export const MEMBERSHIP = "memberships.membership";
|
|
13
15
|
export const PASS = "memberships.pass";
|
|
16
|
+
export const PASSTYPE = "memberships.passtype";
|
|
14
17
|
// --- Display only ---------------------------------------------------------------------------------
|
|
15
18
|
/** A price as the host gave it, in its currency (`99.00 AUD`). Display only: never worked out. */
|
|
16
19
|
export function formatPrice(price, currency) {
|
|
@@ -153,6 +156,114 @@ export function changeRefusalWords(details) {
|
|
|
153
156
|
return "We could not change your plan.";
|
|
154
157
|
}
|
|
155
158
|
}
|
|
159
|
+
/** A price in minor units as the host gave it (`1999` AUD is `$19.99`). Display only. */
|
|
160
|
+
export { formatMinor };
|
|
161
|
+
/** A `YYYY-MM-DD` day as a reader sees it (`3 Dec 2026`), never shifted by the reader's zone. */
|
|
162
|
+
export function localDay(date) {
|
|
163
|
+
if (!date || !/^\d{4}-\d{2}-\d{2}$/.test(date))
|
|
164
|
+
return "";
|
|
165
|
+
const at = new Date(`${date}T00:00:00Z`);
|
|
166
|
+
return Number.isNaN(at.getTime())
|
|
167
|
+
? ""
|
|
168
|
+
: at.toLocaleDateString(undefined, {
|
|
169
|
+
day: "numeric",
|
|
170
|
+
month: "short",
|
|
171
|
+
year: "numeric",
|
|
172
|
+
timeZone: "UTC",
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The words beside the cancel button while the host offers cooling off: "You can cancel for a
|
|
177
|
+
* full refund until 3 Dec 2026". Null when it is not offered. Display only: the window is the
|
|
178
|
+
* host's (`subscription.coolingOff`), never worked out here.
|
|
179
|
+
*/
|
|
180
|
+
export function coolingOffWords(status) {
|
|
181
|
+
if (!status?.offered)
|
|
182
|
+
return null;
|
|
183
|
+
return `You can cancel for a full refund until the end of ${localDay(status.until)}.`;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Why a member who might have expected it cannot cool off, in words: the period has passed, or
|
|
187
|
+
* they cooled off before. Null otherwise (no cooling off on the plan or for them, or a free trial,
|
|
188
|
+
* where the ordinary cancel ends it at no charge). Display only, from the host's `why`.
|
|
189
|
+
*/
|
|
190
|
+
export function coolingOffClosedWords(status) {
|
|
191
|
+
if (!status || status.offered || status.coolOff)
|
|
192
|
+
return null;
|
|
193
|
+
if (status.why === "window_passed") {
|
|
194
|
+
return `The cooling-off period ended at the end of ${localDay(status.until)}.`;
|
|
195
|
+
}
|
|
196
|
+
if (status.why === "used") {
|
|
197
|
+
return "Cooling off has been used for this member before: it is once per member.";
|
|
198
|
+
}
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Where a cooling off asked for has got, in words, from the host's record. Null when none was
|
|
203
|
+
* asked.
|
|
204
|
+
*/
|
|
205
|
+
export function coolOffProgressWords(status,
|
|
206
|
+
/** Name the amounts (the web); the app, which shows no money, leaves them out. */
|
|
207
|
+
{ amounts = true } = {}) {
|
|
208
|
+
const c = status?.coolOff;
|
|
209
|
+
if (!c || !status)
|
|
210
|
+
return null;
|
|
211
|
+
const sum = (n) => (amounts ? ` of ${formatMinor(n, status.currency)}` : "");
|
|
212
|
+
const money = sum(c.state === "ended" ? c.paid - c.refunded : status.refund);
|
|
213
|
+
const told = c.staffTold ? " The business has been told." : "";
|
|
214
|
+
if (c.state === "lapsed") {
|
|
215
|
+
return c.lapsedBecause === "used"
|
|
216
|
+
? "Cooling off has been used for this member before: this one did not count. Ask the business about any refund."
|
|
217
|
+
: "Your cooling off did not end the membership in time, so it lapsed: you can cancel it as usual. Ask the business about any refund.";
|
|
218
|
+
}
|
|
219
|
+
if (c.state === "asked") {
|
|
220
|
+
const until = ` If it has not ended by ${day(c.deadline)}, it lapses and you can cancel it as usual.`;
|
|
221
|
+
if (c.asked === "refused") {
|
|
222
|
+
return c.askAgain
|
|
223
|
+
? `Ending it in the cooling-off period did not go through: ask again.${told}${until}`
|
|
224
|
+
: `Ending it in the cooling-off period did not go through.${told}${until}`;
|
|
225
|
+
}
|
|
226
|
+
if (c.asked === "pending") {
|
|
227
|
+
return `You asked to end it in the cooling-off period: it waits for the business to confirm.${until}`;
|
|
228
|
+
}
|
|
229
|
+
return c.asked === "unknown" || c.asked === null
|
|
230
|
+
? `You asked to end it in the cooling-off period. We have not heard back from the payment provider yet.${told}${until}`
|
|
231
|
+
: "You asked to end it in the cooling-off period. It shows as ended here once the payment provider confirms.";
|
|
232
|
+
}
|
|
233
|
+
switch (c.refunds) {
|
|
234
|
+
case "refunded":
|
|
235
|
+
return `Ended in the cooling-off period: refunded${amounts ? ` (${formatMinor(c.refunded, status.currency)})` : ""}.`;
|
|
236
|
+
case "held":
|
|
237
|
+
return `Ended in the cooling-off period. A refund${money} is owed; the business will contact you about it.`;
|
|
238
|
+
default:
|
|
239
|
+
return `Ended in the cooling-off period. A full refund${money} is owed: the business approves it, then it goes back to how you paid.`;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/** What a payer is told when the host refuses cooling off (its `reason`). Display only. */
|
|
243
|
+
export function coolOffRefusalWords(details) {
|
|
244
|
+
if (details?.rule === "provider_refused") {
|
|
245
|
+
return "The payment provider did not end your membership, so nothing changed. Try again.";
|
|
246
|
+
}
|
|
247
|
+
switch (details?.reason) {
|
|
248
|
+
case "window_passed":
|
|
249
|
+
return "The cooling-off period has ended. You can still cancel at the end of the period.";
|
|
250
|
+
case "used":
|
|
251
|
+
return "Cooling off has been used for this member before: it is once per member.";
|
|
252
|
+
case "waiting":
|
|
253
|
+
return "Ending your membership waits for the business to confirm: there is nothing to ask again until then.";
|
|
254
|
+
case "nothing_paid":
|
|
255
|
+
return "Nothing has been paid yet: cancel instead, and it ends with the free time at no charge.";
|
|
256
|
+
case "continuation":
|
|
257
|
+
return "Cooling off is for new members: this membership was not started as a new one here.";
|
|
258
|
+
case "off":
|
|
259
|
+
case "not_covered":
|
|
260
|
+
return "This membership has no cooling-off period.";
|
|
261
|
+
case "ended":
|
|
262
|
+
return "This membership has ended.";
|
|
263
|
+
default:
|
|
264
|
+
return "We could not end your membership just now. Try again.";
|
|
265
|
+
}
|
|
266
|
+
}
|
|
156
267
|
/** Whether a subscription is still the payer's to cancel, resume or pay (not ended). */
|
|
157
268
|
export const isLive = (sub) => sub.state !== "ended" && sub.state !== "expired";
|
|
158
269
|
/** What a member is told when the host refuses a pass (its `rule` and `reason`). Display only. */
|
|
@@ -184,9 +295,11 @@ export const MEMBERSHIPS_HOOKS_CALL = {
|
|
|
184
295
|
usePassTypes: ["x.memberships.passTypes"],
|
|
185
296
|
useBuyPass: ["x.memberships.buy", "order.checkout"],
|
|
186
297
|
useMine: ["x.memberships.mine"],
|
|
298
|
+
useFamily: ["me.family"],
|
|
187
299
|
useHoldings: ["x.memberships.holdings"],
|
|
188
300
|
useGivePass: ["x.memberships.givePass"],
|
|
189
301
|
useVoidPass: ["x.memberships.voidPass"],
|
|
302
|
+
useStaffPassTypes: ["record.list"],
|
|
190
303
|
// A membership's billing (stage 32a's flows). Every action is the web's: a native block may
|
|
191
304
|
// read the subscription only (the block lint).
|
|
192
305
|
useSubscribe: ["subscription.start"],
|
|
@@ -200,6 +313,10 @@ export const MEMBERSHIPS_HOOKS_CALL = {
|
|
|
200
313
|
usePauseSubscription: ["subscription.pause"],
|
|
201
314
|
useUnpauseSubscription: ["subscription.unpause"],
|
|
202
315
|
useSubscriptionsOf: ["subscription.list"],
|
|
316
|
+
// Stage 44 step 7 (ADR 0647): what the host says of cooling off (read anywhere), and ending a
|
|
317
|
+
// membership in it (web only, like every billing action).
|
|
318
|
+
useCoolingOff: ["subscription.coolingOff"],
|
|
319
|
+
useCoolOff: ["subscription.coolOff"],
|
|
203
320
|
};
|
|
204
321
|
/**
|
|
205
322
|
* Hooks for a React or React Native app:
|
|
@@ -220,16 +337,36 @@ function allMembershipsHooks(react, api) {
|
|
|
220
337
|
usePassTypes() {
|
|
221
338
|
return useQuery(api.query("x.memberships.passTypes", {}));
|
|
222
339
|
},
|
|
340
|
+
/**
|
|
341
|
+
* Staff: every pass type, by title, for giving one by hand (stage 47). The staff client's
|
|
342
|
+
* record read; a customer's client cannot back it.
|
|
343
|
+
*/
|
|
344
|
+
useStaffPassTypes() {
|
|
345
|
+
return useQuery(api.query("record.list", {
|
|
346
|
+
object: PASSTYPE,
|
|
347
|
+
sort: { field: "title", direction: "asc" },
|
|
348
|
+
limit: 100,
|
|
349
|
+
}));
|
|
350
|
+
},
|
|
223
351
|
/** Start an order for a pass; then `checkout` it on the provider's page (web only). */
|
|
224
352
|
useBuyPass() {
|
|
225
353
|
return {
|
|
226
|
-
|
|
354
|
+
// A visitor's agreements (a name typed, a signature, health answers) go in this call:
|
|
355
|
+
// not kept in the app's cache once it is over (stage 44).
|
|
356
|
+
start: useMutation({ ...api.mutation("x.memberships.buy"), gcTime: 0 }),
|
|
227
357
|
checkout: useMutation(api.mutation("order.checkout")),
|
|
228
358
|
};
|
|
229
359
|
},
|
|
230
|
-
/**
|
|
231
|
-
|
|
232
|
-
|
|
360
|
+
/**
|
|
361
|
+
* The signed-in member's memberships and passes, with the host's count of what is left; with
|
|
362
|
+
* a child's id (from `useFamily`), that child's, where the host shows them to a guardian.
|
|
363
|
+
*/
|
|
364
|
+
useMine(personId) {
|
|
365
|
+
return useQuery(api.query("x.memberships.mine", personId ? { personId } : {}));
|
|
366
|
+
},
|
|
367
|
+
/** Who the member acts for: themselves and the children the gym linked to them. */
|
|
368
|
+
useFamily() {
|
|
369
|
+
return useQuery(api.query("me.family", {}));
|
|
233
370
|
},
|
|
234
371
|
/** Staff: one person's memberships and passes. */
|
|
235
372
|
useHoldings(personId) {
|
|
@@ -245,7 +382,8 @@ function allMembershipsHooks(react, api) {
|
|
|
245
382
|
},
|
|
246
383
|
/** Start a membership: the host opens the provider's page (web only); the trial is the host's. */
|
|
247
384
|
useSubscribe() {
|
|
248
|
-
|
|
385
|
+
// A guest's agreements go in this call: not kept in the app's cache after it (stage 44).
|
|
386
|
+
return useMutation({ ...api.mutation("subscription.start"), gcTime: 0 });
|
|
249
387
|
},
|
|
250
388
|
/** The signed-in payer's own membership subscriptions, newest first. */
|
|
251
389
|
useMySubscriptions() {
|
|
@@ -281,6 +419,19 @@ function allMembershipsHooks(react, api) {
|
|
|
281
419
|
useUnpauseSubscription() {
|
|
282
420
|
return useMutation(api.mutation("subscription.unpause"));
|
|
283
421
|
},
|
|
422
|
+
/**
|
|
423
|
+
* Whether each of these subscriptions may be ended in its cooling-off period, and how far one
|
|
424
|
+
* asked for has got. The host decides; a block shows the button only when `offered`.
|
|
425
|
+
*/
|
|
426
|
+
useCoolingOff(ids) {
|
|
427
|
+
const list = [...ids].slice(0, 20);
|
|
428
|
+
const query = api.query("subscription.coolingOff", { ids: list });
|
|
429
|
+
return useQuery({ ...query, enabled: list.length > 0 });
|
|
430
|
+
},
|
|
431
|
+
/** End their own membership in its cooling-off period, for a full refund (web only). */
|
|
432
|
+
useCoolOff() {
|
|
433
|
+
return useMutation(api.mutation("subscription.coolOff"));
|
|
434
|
+
},
|
|
284
435
|
/** Staff: the membership subscriptions one person holds. */
|
|
285
436
|
useSubscriptionsOf(personId) {
|
|
286
437
|
return useQuery(api.query("subscription.list", {
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
4
4
|
readonly contractVersion: 1;
|
|
5
5
|
readonly label: "Memberships";
|
|
6
6
|
readonly description: string;
|
|
7
|
-
readonly requires: readonly ["programs"];
|
|
7
|
+
readonly requires: readonly ["programs", "bookings"];
|
|
8
8
|
readonly permissions: {
|
|
9
9
|
readonly read: ["person", "programs.classtype"];
|
|
10
|
-
readonly operations: ["public.list", "
|
|
10
|
+
readonly operations: ["public.list", "allowance.list", "order.start", "me.family"];
|
|
11
11
|
readonly modules: ["ops"];
|
|
12
12
|
};
|
|
13
13
|
readonly objects: {
|
|
@@ -53,6 +53,24 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
53
53
|
label: string;
|
|
54
54
|
}[];
|
|
55
55
|
};
|
|
56
|
+
readonly covers: {
|
|
57
|
+
readonly readOnly?: boolean | undefined;
|
|
58
|
+
readonly type: "multiSelect";
|
|
59
|
+
readonly label: "Pays for";
|
|
60
|
+
readonly options: {
|
|
61
|
+
value: string;
|
|
62
|
+
label: string;
|
|
63
|
+
}[];
|
|
64
|
+
readonly description: "Classes, one-to-one sessions (Bookings' appointments), or both. Empty: classes only.";
|
|
65
|
+
};
|
|
66
|
+
readonly services: {
|
|
67
|
+
readonly readOnly?: boolean | undefined;
|
|
68
|
+
readonly type: "relation";
|
|
69
|
+
readonly label: "Services";
|
|
70
|
+
readonly to: "bookings.service";
|
|
71
|
+
readonly many: true;
|
|
72
|
+
readonly description: "The one-to-one sessions it pays for, when it pays for sessions. Empty: every one.";
|
|
73
|
+
};
|
|
56
74
|
readonly classTypes: {
|
|
57
75
|
readonly readOnly?: boolean | undefined;
|
|
58
76
|
readonly type: "relation";
|
|
@@ -121,13 +139,10 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
121
139
|
readonly label: "Per";
|
|
122
140
|
readonly required: true;
|
|
123
141
|
readonly default: "week";
|
|
124
|
-
readonly options:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
readonly value: "month";
|
|
129
|
-
readonly label: "A month";
|
|
130
|
-
}];
|
|
142
|
+
readonly options: {
|
|
143
|
+
value: string;
|
|
144
|
+
label: string;
|
|
145
|
+
}[];
|
|
131
146
|
};
|
|
132
147
|
};
|
|
133
148
|
readonly public: {
|
|
@@ -140,7 +155,14 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
140
155
|
readonly sellable: {
|
|
141
156
|
readonly price: "price";
|
|
142
157
|
readonly tax: {
|
|
143
|
-
|
|
158
|
+
code: string;
|
|
159
|
+
};
|
|
160
|
+
readonly finance: {
|
|
161
|
+
readonly category: {
|
|
162
|
+
readonly key: "memberships";
|
|
163
|
+
readonly label: "Memberships";
|
|
164
|
+
};
|
|
165
|
+
readonly earned: "over_period";
|
|
144
166
|
};
|
|
145
167
|
readonly recurring: {
|
|
146
168
|
readonly interval: "month";
|
|
@@ -149,6 +171,9 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
149
171
|
readonly minDays: "pauseMinDays";
|
|
150
172
|
readonly maxDays: "pauseMaxDays";
|
|
151
173
|
};
|
|
174
|
+
readonly coolingOff: {
|
|
175
|
+
readonly setting: "coolingOffDays";
|
|
176
|
+
};
|
|
152
177
|
readonly grants: {
|
|
153
178
|
readonly object: "membership";
|
|
154
179
|
readonly set: {
|
|
@@ -159,6 +184,8 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
159
184
|
readonly title: "item.title";
|
|
160
185
|
readonly uses: "item.uses";
|
|
161
186
|
readonly per: "item.per";
|
|
187
|
+
readonly covers: "item.covers";
|
|
188
|
+
readonly services: "item.services";
|
|
162
189
|
readonly classTypes: "item.classTypes";
|
|
163
190
|
readonly weekdays: "item.weekdays";
|
|
164
191
|
readonly fromMinute: "item.fromMinute";
|
|
@@ -177,6 +204,12 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
177
204
|
};
|
|
178
205
|
};
|
|
179
206
|
};
|
|
207
|
+
readonly agreements: {
|
|
208
|
+
readonly inlineStep: true;
|
|
209
|
+
readonly point: string;
|
|
210
|
+
readonly label: string;
|
|
211
|
+
readonly suggests: ("terms" | "waiver" | "health" | "guardian")[];
|
|
212
|
+
};
|
|
180
213
|
};
|
|
181
214
|
readonly membership: {
|
|
182
215
|
readonly label: "Membership";
|
|
@@ -222,6 +255,24 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
222
255
|
readonly label: "Ended";
|
|
223
256
|
}];
|
|
224
257
|
};
|
|
258
|
+
readonly covers: {
|
|
259
|
+
readonly readOnly?: boolean | undefined;
|
|
260
|
+
readonly type: "multiSelect";
|
|
261
|
+
readonly label: "Pays for";
|
|
262
|
+
readonly options: {
|
|
263
|
+
value: string;
|
|
264
|
+
label: string;
|
|
265
|
+
}[];
|
|
266
|
+
readonly description: "Classes, one-to-one sessions (Bookings' appointments), or both. Empty: classes only.";
|
|
267
|
+
};
|
|
268
|
+
readonly services: {
|
|
269
|
+
readonly readOnly?: boolean | undefined;
|
|
270
|
+
readonly type: "relation";
|
|
271
|
+
readonly label: "Services";
|
|
272
|
+
readonly to: "bookings.service";
|
|
273
|
+
readonly many: true;
|
|
274
|
+
readonly description: "The one-to-one sessions it pays for, when it pays for sessions. Empty: every one.";
|
|
275
|
+
};
|
|
225
276
|
readonly classTypes: {
|
|
226
277
|
readonly readOnly?: boolean | undefined;
|
|
227
278
|
readonly type: "relation";
|
|
@@ -296,13 +347,10 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
296
347
|
readonly type: "select";
|
|
297
348
|
readonly label: "Per";
|
|
298
349
|
readonly readOnly: true;
|
|
299
|
-
readonly options:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
readonly value: "month";
|
|
304
|
-
readonly label: "A month";
|
|
305
|
-
}];
|
|
350
|
+
readonly options: {
|
|
351
|
+
value: string;
|
|
352
|
+
label: string;
|
|
353
|
+
}[];
|
|
306
354
|
};
|
|
307
355
|
};
|
|
308
356
|
readonly states: {
|
|
@@ -339,22 +387,31 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
339
387
|
readonly spendsOn: {
|
|
340
388
|
object: string;
|
|
341
389
|
when: ({
|
|
390
|
+
value: string;
|
|
391
|
+
in: string;
|
|
392
|
+
field?: undefined;
|
|
393
|
+
atLeast?: undefined;
|
|
394
|
+
below?: undefined;
|
|
395
|
+
} | {
|
|
342
396
|
field: string;
|
|
343
397
|
in: string;
|
|
398
|
+
value?: undefined;
|
|
344
399
|
atLeast?: undefined;
|
|
345
400
|
below?: undefined;
|
|
346
401
|
} | {
|
|
347
402
|
field: string;
|
|
348
403
|
atLeast: string;
|
|
404
|
+
value?: undefined;
|
|
349
405
|
in?: undefined;
|
|
350
406
|
below?: undefined;
|
|
351
407
|
} | {
|
|
352
408
|
field: string;
|
|
353
409
|
below: string;
|
|
410
|
+
value?: undefined;
|
|
354
411
|
in?: undefined;
|
|
355
412
|
atLeast?: undefined;
|
|
356
413
|
})[];
|
|
357
|
-
};
|
|
414
|
+
}[];
|
|
358
415
|
};
|
|
359
416
|
};
|
|
360
417
|
readonly timelineLinks: readonly ["person"];
|
|
@@ -383,6 +440,24 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
383
440
|
label: string;
|
|
384
441
|
}[];
|
|
385
442
|
};
|
|
443
|
+
readonly covers: {
|
|
444
|
+
readonly readOnly?: boolean | undefined;
|
|
445
|
+
readonly type: "multiSelect";
|
|
446
|
+
readonly label: "Pays for";
|
|
447
|
+
readonly options: {
|
|
448
|
+
value: string;
|
|
449
|
+
label: string;
|
|
450
|
+
}[];
|
|
451
|
+
readonly description: "Classes, one-to-one sessions (Bookings' appointments), or both. Empty: classes only.";
|
|
452
|
+
};
|
|
453
|
+
readonly services: {
|
|
454
|
+
readonly readOnly?: boolean | undefined;
|
|
455
|
+
readonly type: "relation";
|
|
456
|
+
readonly label: "Services";
|
|
457
|
+
readonly to: "bookings.service";
|
|
458
|
+
readonly many: true;
|
|
459
|
+
readonly description: "The one-to-one sessions it pays for, when it pays for sessions. Empty: every one.";
|
|
460
|
+
};
|
|
386
461
|
readonly classTypes: {
|
|
387
462
|
readonly readOnly?: boolean | undefined;
|
|
388
463
|
readonly type: "relation";
|
|
@@ -464,7 +539,7 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
464
539
|
readonly sellable: {
|
|
465
540
|
readonly price: "price";
|
|
466
541
|
readonly tax: {
|
|
467
|
-
|
|
542
|
+
code: string;
|
|
468
543
|
};
|
|
469
544
|
readonly grants: {
|
|
470
545
|
readonly object: "pass";
|
|
@@ -474,6 +549,8 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
474
549
|
readonly title: "line.title";
|
|
475
550
|
readonly order: "order";
|
|
476
551
|
readonly uses: "item.uses";
|
|
552
|
+
readonly covers: "item.covers";
|
|
553
|
+
readonly services: "item.services";
|
|
477
554
|
readonly classTypes: "item.classTypes";
|
|
478
555
|
readonly weekdays: "item.weekdays";
|
|
479
556
|
readonly fromMinute: "item.fromMinute";
|
|
@@ -487,6 +564,19 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
487
564
|
};
|
|
488
565
|
};
|
|
489
566
|
readonly onePerPerson: "onePerPerson";
|
|
567
|
+
readonly finance: {
|
|
568
|
+
readonly category: {
|
|
569
|
+
readonly key: "passes";
|
|
570
|
+
readonly label: "Class passes";
|
|
571
|
+
};
|
|
572
|
+
readonly earned: "per_use";
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
readonly agreements: {
|
|
576
|
+
readonly inlineStep: true;
|
|
577
|
+
readonly point: string;
|
|
578
|
+
readonly label: string;
|
|
579
|
+
readonly suggests: ("terms" | "waiver" | "health" | "guardian")[];
|
|
490
580
|
};
|
|
491
581
|
};
|
|
492
582
|
readonly pass: {
|
|
@@ -538,6 +628,24 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
538
628
|
readonly label: "Void";
|
|
539
629
|
}];
|
|
540
630
|
};
|
|
631
|
+
readonly covers: {
|
|
632
|
+
readonly readOnly?: boolean | undefined;
|
|
633
|
+
readonly type: "multiSelect";
|
|
634
|
+
readonly label: "Pays for";
|
|
635
|
+
readonly options: {
|
|
636
|
+
value: string;
|
|
637
|
+
label: string;
|
|
638
|
+
}[];
|
|
639
|
+
readonly description: "Classes, one-to-one sessions (Bookings' appointments), or both. Empty: classes only.";
|
|
640
|
+
};
|
|
641
|
+
readonly services: {
|
|
642
|
+
readonly readOnly?: boolean | undefined;
|
|
643
|
+
readonly type: "relation";
|
|
644
|
+
readonly label: "Services";
|
|
645
|
+
readonly to: "bookings.service";
|
|
646
|
+
readonly many: true;
|
|
647
|
+
readonly description: "The one-to-one sessions it pays for, when it pays for sessions. Empty: every one.";
|
|
648
|
+
};
|
|
541
649
|
readonly classTypes: {
|
|
542
650
|
readonly readOnly?: boolean | undefined;
|
|
543
651
|
readonly type: "relation";
|
|
@@ -613,6 +721,14 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
613
721
|
readonly final: true;
|
|
614
722
|
}];
|
|
615
723
|
};
|
|
724
|
+
readonly agreements: {
|
|
725
|
+
readonly enter: readonly ["active"];
|
|
726
|
+
readonly person: "person";
|
|
727
|
+
readonly inlineStep: true;
|
|
728
|
+
readonly point: string;
|
|
729
|
+
readonly label: string;
|
|
730
|
+
readonly suggests: ("terms" | "waiver" | "health" | "guardian")[];
|
|
731
|
+
};
|
|
616
732
|
readonly customer: {
|
|
617
733
|
readonly field: "person";
|
|
618
734
|
readonly guardians: {};
|
|
@@ -630,22 +746,31 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
630
746
|
readonly spendsOn: {
|
|
631
747
|
object: string;
|
|
632
748
|
when: ({
|
|
749
|
+
value: string;
|
|
750
|
+
in: string;
|
|
751
|
+
field?: undefined;
|
|
752
|
+
atLeast?: undefined;
|
|
753
|
+
below?: undefined;
|
|
754
|
+
} | {
|
|
633
755
|
field: string;
|
|
634
756
|
in: string;
|
|
757
|
+
value?: undefined;
|
|
635
758
|
atLeast?: undefined;
|
|
636
759
|
below?: undefined;
|
|
637
760
|
} | {
|
|
638
761
|
field: string;
|
|
639
762
|
atLeast: string;
|
|
763
|
+
value?: undefined;
|
|
640
764
|
in?: undefined;
|
|
641
765
|
below?: undefined;
|
|
642
766
|
} | {
|
|
643
767
|
field: string;
|
|
644
768
|
below: string;
|
|
769
|
+
value?: undefined;
|
|
645
770
|
in?: undefined;
|
|
646
771
|
atLeast?: undefined;
|
|
647
772
|
})[];
|
|
648
|
-
};
|
|
773
|
+
}[];
|
|
649
774
|
};
|
|
650
775
|
};
|
|
651
776
|
readonly timelineLinks: readonly ["person"];
|
|
@@ -823,6 +948,51 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
823
948
|
};
|
|
824
949
|
};
|
|
825
950
|
readonly grantable: readonly ["memberships:passes"];
|
|
951
|
+
readonly journeySignals: {
|
|
952
|
+
readonly started: {
|
|
953
|
+
readonly label: "Membership started";
|
|
954
|
+
readonly description: "A membership begins, on trial or paid.";
|
|
955
|
+
readonly object: "membership";
|
|
956
|
+
};
|
|
957
|
+
readonly joined: {
|
|
958
|
+
readonly label: "Joined after a trial";
|
|
959
|
+
readonly description: "A trial becomes a paid membership.";
|
|
960
|
+
readonly object: "membership";
|
|
961
|
+
readonly enters: readonly ["active"];
|
|
962
|
+
readonly from: readonly ["trialing"];
|
|
963
|
+
readonly created: false;
|
|
964
|
+
};
|
|
965
|
+
readonly ended: {
|
|
966
|
+
readonly label: "Membership ended";
|
|
967
|
+
readonly description: "A membership ends.";
|
|
968
|
+
readonly object: "membership";
|
|
969
|
+
readonly enters: readonly ["ended"];
|
|
970
|
+
};
|
|
971
|
+
readonly trialEnded: {
|
|
972
|
+
readonly label: "Trial ended without joining";
|
|
973
|
+
readonly description: "A trial stops without becoming a paid membership.";
|
|
974
|
+
readonly object: "membership";
|
|
975
|
+
readonly enters: readonly ["past_due", "unpaid", "paused", "ended"];
|
|
976
|
+
readonly from: readonly ["trialing"];
|
|
977
|
+
readonly created: false;
|
|
978
|
+
};
|
|
979
|
+
readonly passStarted: {
|
|
980
|
+
readonly label: "Pass started";
|
|
981
|
+
readonly description: "A member gets a pass: bought, or given by staff.";
|
|
982
|
+
readonly object: "pass";
|
|
983
|
+
};
|
|
984
|
+
};
|
|
985
|
+
readonly settings: {
|
|
986
|
+
readonly coolingOffDays: {
|
|
987
|
+
readonly type: "number";
|
|
988
|
+
readonly label: "Cooling-off period (days)";
|
|
989
|
+
readonly description: string;
|
|
990
|
+
readonly default: 0;
|
|
991
|
+
readonly min: 0;
|
|
992
|
+
readonly max: 30;
|
|
993
|
+
readonly personApproves: true;
|
|
994
|
+
};
|
|
995
|
+
};
|
|
826
996
|
readonly tools: {
|
|
827
997
|
readonly plans: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
828
998
|
plans: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -864,6 +1034,7 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
864
1034
|
readonly buy: import("@composable-os/sdk").ToolSpec<import("zod").ZodObject<{
|
|
865
1035
|
passTypeId: import("zod").ZodString;
|
|
866
1036
|
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1037
|
+
agreements: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
|
|
867
1038
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
868
1039
|
id: import("zod").ZodString;
|
|
869
1040
|
state: import("zod").ZodString;
|
|
@@ -959,5 +1130,32 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
959
1130
|
readonly dashboards: {
|
|
960
1131
|
memberships: import("@composable-os/sdk").DashboardDeclaration;
|
|
961
1132
|
};
|
|
1133
|
+
readonly screens: {
|
|
1134
|
+
readonly holdings: {
|
|
1135
|
+
readonly label: "Memberships";
|
|
1136
|
+
readonly block: "memberships-staff-holdings";
|
|
1137
|
+
readonly export: "PersonMemberships";
|
|
1138
|
+
readonly opens: readonly ["holdings", "givePass"];
|
|
1139
|
+
readonly record: {
|
|
1140
|
+
readonly object: "person";
|
|
1141
|
+
readonly as: "personId";
|
|
1142
|
+
};
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
readonly portal: {
|
|
1146
|
+
readonly memberships: {
|
|
1147
|
+
readonly label: "Memberships and passes";
|
|
1148
|
+
readonly web: {
|
|
1149
|
+
readonly block: "memberships-mine";
|
|
1150
|
+
readonly export: "MyMemberships";
|
|
1151
|
+
};
|
|
1152
|
+
readonly native: {
|
|
1153
|
+
readonly block: "memberships-native-mine";
|
|
1154
|
+
readonly export: "MyMembershipsScreen";
|
|
1155
|
+
};
|
|
1156
|
+
readonly order: 20;
|
|
1157
|
+
readonly has: readonly ["memberships.membership", "memberships.pass"];
|
|
1158
|
+
};
|
|
1159
|
+
};
|
|
962
1160
|
}>;
|
|
963
1161
|
export default _default;
|