@composable-os/pack-bookings 0.1.0-beta.15 → 0.1.0-beta.16
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/automations.js +2 -2
- package/dist/dashboards.js +2 -2
- package/dist/index.d.ts +109 -92
- package/dist/index.js +95 -78
- package/dist/tools.js +2 -3
- package/package.json +5 -5
package/dist/automations.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { defineAutomation, } from "@composable-os/sdk";
|
|
18
18
|
const CLASS = "bookings.class";
|
|
19
19
|
const BOOKING = "bookings.booking";
|
|
20
|
-
const CLASS_TYPE = "
|
|
20
|
+
const CLASS_TYPE = "bookings.classtype";
|
|
21
21
|
/**
|
|
22
22
|
* The email-send connection the host sends from: a person binds it to each automation, which is
|
|
23
23
|
* their consent to the pack's mail going out from that address.
|
|
@@ -200,7 +200,7 @@ async function cutOff(ctx, cls) {
|
|
|
200
200
|
const type = await ctx.ops
|
|
201
201
|
.call("record.get", { object: CLASS_TYPE, id: cls.classType })
|
|
202
202
|
.catch(() => null);
|
|
203
|
-
const own = type?.values
|
|
203
|
+
const own = type?.values.promotionMinutes;
|
|
204
204
|
if (typeof own === "number")
|
|
205
205
|
minutes = own;
|
|
206
206
|
}
|
package/dist/dashboards.js
CHANGED
|
@@ -65,7 +65,7 @@ WHERE ${IN_PERIOD}`,
|
|
|
65
65
|
sql: `SELECT t.id AS type_id, coalesce(t.name, 'No class type') AS type,
|
|
66
66
|
sum(CASE WHEN b.state = 'attended' THEN 1 ELSE 0 END) AS came,
|
|
67
67
|
sum(CASE WHEN ${HELD} THEN 1 ELSE 0 END) AS booked
|
|
68
|
-
${BOOKINGS.replace("WHERE", "LEFT JOIN
|
|
68
|
+
${BOOKINGS.replace("WHERE", "LEFT JOIN rec_x_bookings_classtype t ON t.id = c.class_type WHERE")}
|
|
69
69
|
GROUP BY t.id, t.name ORDER BY came DESC, type LIMIT 20`,
|
|
70
70
|
mapping: { x: "type", y: ["came", "booked"] },
|
|
71
71
|
layout: { w: 6, h: 2 },
|
|
@@ -111,7 +111,7 @@ ${BOOKINGS} GROUP BY month ORDER BY month`,
|
|
|
111
111
|
description: "Bookings that joined a waiting list, and how many were moved in from it, per class type.",
|
|
112
112
|
sql: `SELECT coalesce(t.name, 'No class type') AS type, count(*) AS joined,
|
|
113
113
|
sum(CASE WHEN b.promoted_at IS NOT NULL THEN 1 ELSE 0 END) AS got_in
|
|
114
|
-
${BOOKINGS.replace("WHERE", "LEFT JOIN
|
|
114
|
+
${BOOKINGS.replace("WHERE", "LEFT JOIN rec_x_bookings_classtype t ON t.id = c.class_type WHERE")} AND ${WAITED}
|
|
115
115
|
GROUP BY t.id, t.name ORDER BY joined DESC, type LIMIT 20`,
|
|
116
116
|
mapping: { columns: ["type", "joined", "got_in"] },
|
|
117
117
|
layout: { w: 6, h: 2 },
|
package/dist/index.d.ts
CHANGED
|
@@ -4,101 +4,118 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
4
4
|
readonly contractVersion: 1;
|
|
5
5
|
readonly label: "Bookings";
|
|
6
6
|
readonly description: string;
|
|
7
|
-
readonly requires: readonly ["programs"];
|
|
8
7
|
readonly permissions: {
|
|
9
|
-
readonly read: ["person"
|
|
8
|
+
readonly read: ["person"];
|
|
10
9
|
readonly write: ["person"];
|
|
11
10
|
readonly operations: ["order.startHeld", "public.list", "public.get", "capacity.get", "duplicate.check", "waitlist.position", "me.family", "person.link.list", "order.get", "extensionSettings.list", "notification.send", "agreement.listHealthNotes", "staffing.free", "staffing.week"];
|
|
12
11
|
readonly modules: ["ops", "routine-mail", "email-send", "storage"];
|
|
13
12
|
};
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
readonly
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
readonly
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
readonly
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
readonly
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
readonly
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
readonly
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
13
|
+
readonly objects: {
|
|
14
|
+
readonly classtype: {
|
|
15
|
+
readonly label: "Class type";
|
|
16
|
+
readonly plural: "Class types";
|
|
17
|
+
readonly icon: "users";
|
|
18
|
+
readonly titleField: "name";
|
|
19
|
+
readonly description: string;
|
|
20
|
+
readonly navigation: "settings";
|
|
21
|
+
readonly signedIn: {
|
|
22
|
+
readonly read: readonly ["name", "order"];
|
|
23
|
+
};
|
|
24
|
+
readonly fields: {
|
|
25
|
+
readonly name: {
|
|
26
|
+
readonly type: "text";
|
|
27
|
+
readonly label: "Name";
|
|
28
|
+
readonly required: true;
|
|
29
|
+
};
|
|
30
|
+
readonly order: {
|
|
31
|
+
readonly type: "number";
|
|
32
|
+
readonly label: "Order";
|
|
33
|
+
};
|
|
34
|
+
readonly colour: {
|
|
35
|
+
readonly type: "text";
|
|
36
|
+
readonly label: "Colour";
|
|
37
|
+
readonly description: "How its classes show on the timetable, e.g. #2f6fed.";
|
|
38
|
+
};
|
|
39
|
+
readonly opensDays: {
|
|
40
|
+
readonly type: "number";
|
|
41
|
+
readonly label: "Booking opens (days before)";
|
|
42
|
+
readonly description: string;
|
|
43
|
+
readonly min: 0;
|
|
44
|
+
readonly max: 365;
|
|
45
|
+
readonly step: 1;
|
|
46
|
+
readonly personApproves: true;
|
|
47
|
+
};
|
|
48
|
+
readonly closesMinutes: {
|
|
49
|
+
type: "number";
|
|
50
|
+
label: string;
|
|
51
|
+
description: string;
|
|
52
|
+
min: number;
|
|
53
|
+
max: number;
|
|
54
|
+
step: number;
|
|
55
|
+
personApproves: boolean;
|
|
56
|
+
};
|
|
57
|
+
readonly lateMinutes: {
|
|
58
|
+
type: "number";
|
|
59
|
+
label: string;
|
|
60
|
+
description: string;
|
|
61
|
+
min: number;
|
|
62
|
+
max: number;
|
|
63
|
+
step: number;
|
|
64
|
+
personApproves: boolean;
|
|
65
|
+
};
|
|
66
|
+
readonly promotionMinutes: {
|
|
67
|
+
type: "number";
|
|
68
|
+
label: string;
|
|
69
|
+
description: string;
|
|
70
|
+
min: number;
|
|
71
|
+
max: number;
|
|
72
|
+
step: number;
|
|
73
|
+
personApproves: boolean;
|
|
74
|
+
};
|
|
75
|
+
readonly reminderMinutes: {
|
|
76
|
+
readonly max: 2880;
|
|
77
|
+
readonly type: "number";
|
|
78
|
+
readonly label: string;
|
|
79
|
+
readonly description: string;
|
|
80
|
+
readonly min: number;
|
|
81
|
+
readonly step: number;
|
|
82
|
+
readonly personApproves: boolean;
|
|
83
|
+
};
|
|
84
|
+
readonly dropInPrice: {
|
|
85
|
+
readonly type: "number";
|
|
86
|
+
readonly label: "Drop-in price";
|
|
87
|
+
readonly description: string;
|
|
88
|
+
readonly min: 0;
|
|
89
|
+
readonly max: 100000;
|
|
90
|
+
readonly step: 0.01;
|
|
91
|
+
readonly personApproves: true;
|
|
92
|
+
};
|
|
93
|
+
readonly staffOnly: {
|
|
94
|
+
readonly type: "boolean";
|
|
95
|
+
readonly label: "Booked by staff only";
|
|
96
|
+
readonly description: "Members cannot book its classes themselves; staff book them in.";
|
|
97
|
+
readonly personApproves: true;
|
|
98
|
+
};
|
|
99
|
+
readonly rosterBeforeMinutes: {
|
|
100
|
+
readonly type: "number";
|
|
101
|
+
readonly label: "Set-up minutes (pay)";
|
|
102
|
+
readonly description: string;
|
|
103
|
+
readonly min: 0;
|
|
104
|
+
readonly max: 240;
|
|
105
|
+
readonly step: 1;
|
|
106
|
+
readonly personApproves: true;
|
|
107
|
+
};
|
|
108
|
+
readonly rosterAfterMinutes: {
|
|
109
|
+
readonly type: "number";
|
|
110
|
+
readonly label: "Pack-down minutes (pay)";
|
|
111
|
+
readonly description: string;
|
|
112
|
+
readonly min: 0;
|
|
113
|
+
readonly max: 240;
|
|
114
|
+
readonly step: 1;
|
|
115
|
+
readonly personApproves: true;
|
|
116
|
+
};
|
|
98
117
|
};
|
|
99
118
|
};
|
|
100
|
-
};
|
|
101
|
-
readonly objects: {
|
|
102
119
|
readonly room: {
|
|
103
120
|
readonly label: "Room";
|
|
104
121
|
readonly plural: "Rooms";
|
|
@@ -192,7 +209,7 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
192
209
|
readonly classType: {
|
|
193
210
|
readonly type: "relation";
|
|
194
211
|
readonly label: "Class type";
|
|
195
|
-
readonly to: "
|
|
212
|
+
readonly to: "bookings.classtype";
|
|
196
213
|
readonly required: true;
|
|
197
214
|
};
|
|
198
215
|
readonly weekdays: {
|
|
@@ -309,7 +326,7 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
309
326
|
};
|
|
310
327
|
readonly horizonDays: 57;
|
|
311
328
|
readonly horizonAtLeast: {
|
|
312
|
-
readonly object: "
|
|
329
|
+
readonly object: "classtype";
|
|
313
330
|
readonly field: "opensDays";
|
|
314
331
|
};
|
|
315
332
|
};
|
|
@@ -341,7 +358,7 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
341
358
|
readonly classType: {
|
|
342
359
|
readonly type: "relation";
|
|
343
360
|
readonly label: "Class type";
|
|
344
|
-
readonly to: "
|
|
361
|
+
readonly to: "bookings.classtype";
|
|
345
362
|
readonly required: true;
|
|
346
363
|
};
|
|
347
364
|
readonly startsAt: {
|
|
@@ -556,7 +573,7 @@ declare const _default: import("@composable-os/sdk").Extension<{
|
|
|
556
573
|
readonly classType: {
|
|
557
574
|
readonly type: "relation";
|
|
558
575
|
readonly label: "Class type";
|
|
559
|
-
readonly to: "
|
|
576
|
+
readonly to: "bookings.classtype";
|
|
560
577
|
readonly readOnly: true;
|
|
561
578
|
readonly description: "The class's type, copied by the host: what a membership's limits read.";
|
|
562
579
|
};
|
package/dist/index.js
CHANGED
|
@@ -178,13 +178,10 @@ export default defineExtension({
|
|
|
178
178
|
contractVersion: 1,
|
|
179
179
|
label: "Bookings",
|
|
180
180
|
description: "A timetable of classes made from weekly series, rooms and coaches, and the bookings members " +
|
|
181
|
-
"make and cancel within the gym's rules
|
|
182
|
-
// The class type is Programs' (spec 31): the host installs Bookings only beside Programs.
|
|
183
|
-
requires: ["programs"],
|
|
181
|
+
"make and cancel within the gym's rules, by class type.",
|
|
184
182
|
permissions: {
|
|
185
183
|
// person.get / person.createWith: a booking's person on a class list, and a walk-in staff book.
|
|
186
|
-
|
|
187
|
-
read: ["person", "programs.classtype"],
|
|
184
|
+
read: ["person"],
|
|
188
185
|
write: ["person"],
|
|
189
186
|
// record.*, my.* and state.resolve are not listed: they are granted by object (Bookings'
|
|
190
187
|
// own, and the read and write lists above), and a listed one would reach every object.
|
|
@@ -222,78 +219,93 @@ export default defineExtension({
|
|
|
222
219
|
],
|
|
223
220
|
modules: ["ops", "routine-mail", "email-send", "storage"],
|
|
224
221
|
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
222
|
+
objects: {
|
|
223
|
+
// A kind of class (stage 78, ADR 0980): what a series and its classes are of, how it shows,
|
|
224
|
+
// and its booking rules when they differ from the organisation's (Settings → Extensions →
|
|
225
|
+
// Bookings; empty: the organisation's). It was Programs' object, with these rules added onto
|
|
226
|
+
// it by Bookings; it is Bookings' own so that Bookings installs without Programs. Programs,
|
|
227
|
+
// a domain pack, relates its class programs to it.
|
|
228
|
+
classtype: {
|
|
229
|
+
label: "Class type",
|
|
230
|
+
plural: "Class types",
|
|
231
|
+
icon: "users",
|
|
232
|
+
titleField: "name",
|
|
233
|
+
description: "A kind of class (Strength, Yoga, Kids): what a series and its classes are of, with its " +
|
|
234
|
+
"booking rules when they differ from the organisation's.",
|
|
235
|
+
navigation: "settings",
|
|
236
|
+
// Every signed-in member reads a class type's name and order (a class program assigned to
|
|
237
|
+
// it, a member's timetable); its rules are read through the class by the host.
|
|
238
|
+
signedIn: { read: ["name", "order"] },
|
|
239
|
+
fields: {
|
|
240
|
+
name: { type: "text", label: "Name", required: true },
|
|
241
|
+
order: { type: "number", label: "Order" },
|
|
242
|
+
colour: {
|
|
243
|
+
type: "text",
|
|
244
|
+
label: "Colour",
|
|
245
|
+
description: "How its classes show on the timetable, e.g. #2f6fed.",
|
|
246
|
+
},
|
|
247
|
+
opensDays: {
|
|
248
|
+
type: "number",
|
|
249
|
+
label: "Booking opens (days before)",
|
|
250
|
+
description: "Members may book this many days before a class, at the same time of day. Empty: the " +
|
|
251
|
+
"organisation's setting.",
|
|
252
|
+
min: 0,
|
|
253
|
+
max: 365,
|
|
254
|
+
step: 1,
|
|
255
|
+
personApproves: true,
|
|
256
|
+
},
|
|
257
|
+
closesMinutes: minutes("Booking closes (minutes before)", "Members may book until this many minutes before a class starts (0: until it starts). " +
|
|
252
258
|
"Empty: the organisation's setting."),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
259
|
+
lateMinutes: minutes("Late cancel from (minutes before)", "A cancel this close to the start or closer is late and keeps the class it used. Empty: " +
|
|
260
|
+
"the organisation's setting."),
|
|
261
|
+
promotionMinutes: minutes("Waitlist stops (minutes before)", "Nobody is moved in from the waitlist after this: a place freed later goes to whoever " +
|
|
262
|
+
"books first. Empty: the organisation's setting."),
|
|
263
|
+
reminderMinutes: {
|
|
264
|
+
...minutes("Reminder (minutes before)", "When members booked into a class are emailed a reminder, at most two days before. " +
|
|
265
|
+
"Empty: the organisation's setting."),
|
|
266
|
+
// At most two days: the reminder's minute scan reads the classes this far ahead (ADR 0570).
|
|
267
|
+
max: 2_880,
|
|
268
|
+
},
|
|
269
|
+
dropInPrice: {
|
|
270
|
+
type: "number",
|
|
271
|
+
label: "Drop-in price",
|
|
272
|
+
description: "What one class costs someone paying for it on the website, in the organisation's " +
|
|
273
|
+
"currency. Empty: the organisation's setting; empty there too, no drop-ins.",
|
|
274
|
+
min: 0,
|
|
275
|
+
max: 100_000,
|
|
276
|
+
step: 0.01,
|
|
277
|
+
personApproves: true,
|
|
278
|
+
},
|
|
279
|
+
staffOnly: {
|
|
280
|
+
type: "boolean",
|
|
281
|
+
label: "Booked by staff only",
|
|
282
|
+
description: "Members cannot book its classes themselves; staff book them in.",
|
|
283
|
+
personApproves: true,
|
|
284
|
+
},
|
|
285
|
+
// Preparation and pack-down (stage 45 decision 19, ADR 0627): minutes added to the coach's
|
|
286
|
+
// pay hours for each class of this type. Pay only: they never make two classes clash.
|
|
287
|
+
rosterBeforeMinutes: {
|
|
288
|
+
type: "number",
|
|
289
|
+
label: "Set-up minutes (pay)",
|
|
290
|
+
description: "Minutes before each class counted in its coach's pay hours (set-up). Empty: none. " +
|
|
291
|
+
"They never stop a coach taking the class before.",
|
|
292
|
+
min: 0,
|
|
293
|
+
max: 240,
|
|
294
|
+
step: 1,
|
|
295
|
+
personApproves: true,
|
|
296
|
+
},
|
|
297
|
+
rosterAfterMinutes: {
|
|
298
|
+
type: "number",
|
|
299
|
+
label: "Pack-down minutes (pay)",
|
|
300
|
+
description: "Minutes after each class counted in its coach's pay hours (pack-down). Empty: none. " +
|
|
301
|
+
"They never stop a coach taking the class after.",
|
|
302
|
+
min: 0,
|
|
303
|
+
max: 240,
|
|
304
|
+
step: 1,
|
|
305
|
+
personApproves: true,
|
|
306
|
+
},
|
|
293
307
|
},
|
|
294
308
|
},
|
|
295
|
-
},
|
|
296
|
-
objects: {
|
|
297
309
|
room: {
|
|
298
310
|
label: "Room",
|
|
299
311
|
plural: "Rooms",
|
|
@@ -361,7 +373,7 @@ export default defineExtension({
|
|
|
361
373
|
classType: {
|
|
362
374
|
type: "relation",
|
|
363
375
|
label: "Class type",
|
|
364
|
-
to: "
|
|
376
|
+
to: "bookings.classtype",
|
|
365
377
|
required: true,
|
|
366
378
|
},
|
|
367
379
|
weekdays: { type: "multiSelect", label: "Weekdays", options: WEEKDAYS, required: true },
|
|
@@ -428,7 +440,7 @@ export default defineExtension({
|
|
|
428
440
|
// when its booking opens, so one day more (as horizonAtLeast adds for a class type's).
|
|
429
441
|
horizonDays: 57,
|
|
430
442
|
// Never less than the longest window a class type opens booking (ADR 0500, 0505).
|
|
431
|
-
horizonAtLeast: { object: "
|
|
443
|
+
horizonAtLeast: { object: "classtype", field: "opensDays" },
|
|
432
444
|
},
|
|
433
445
|
indexes: [["state"], ["classType"]],
|
|
434
446
|
},
|
|
@@ -454,7 +466,7 @@ export default defineExtension({
|
|
|
454
466
|
classType: {
|
|
455
467
|
type: "relation",
|
|
456
468
|
label: "Class type",
|
|
457
|
-
to: "
|
|
469
|
+
to: "bookings.classtype",
|
|
458
470
|
required: true,
|
|
459
471
|
},
|
|
460
472
|
startsAt: { type: "datetime", label: "Starts", required: true },
|
|
@@ -608,10 +620,15 @@ export default defineExtension({
|
|
|
608
620
|
description: "The membership or pass the booking spent a use of (its id). Left empty, the host " +
|
|
609
621
|
"chooses the one whose use would lapse first.",
|
|
610
622
|
},
|
|
623
|
+
// Read-only does a second thing: routine mail's tie to the run's record ignores a read-only
|
|
624
|
+
// relation (ADRs 0590 and 0980), so two bookings sharing only a class type never tie. The
|
|
625
|
+
// tie that matters is `class` (the place-free mail goes about another booking of the same
|
|
626
|
+
// class); marking `class` read-only would silently refuse that mail
|
|
627
|
+
// (apps/runner/test/routine-mail.test.ts).
|
|
611
628
|
classType: {
|
|
612
629
|
type: "relation",
|
|
613
630
|
label: "Class type",
|
|
614
|
-
to: "
|
|
631
|
+
to: "bookings.classtype",
|
|
615
632
|
readOnly: true,
|
|
616
633
|
description: "The class's type, copied by the host: what a membership's limits read.",
|
|
617
634
|
},
|
package/dist/tools.js
CHANGED
|
@@ -8,7 +8,7 @@ const CLASS = "bookings.class";
|
|
|
8
8
|
const BOOKING = "bookings.booking";
|
|
9
9
|
const COACH = "bookings.coach";
|
|
10
10
|
const ROOM = "bookings.room";
|
|
11
|
-
const CLASS_TYPE = "
|
|
11
|
+
const CLASS_TYPE = "bookings.classtype";
|
|
12
12
|
const text = (value) => value === null || value === undefined || value === "" ? null : String(value);
|
|
13
13
|
const num = (value) => typeof value === "number" ? value : value == null || value === "" ? null : Number(value);
|
|
14
14
|
const flag = (value) => value === true || value === 1 || value === "1";
|
|
@@ -1077,8 +1077,7 @@ async function staffClasses(ctx, classes) {
|
|
|
1077
1077
|
held: num(v.held) ?? 0,
|
|
1078
1078
|
available: num(v.available),
|
|
1079
1079
|
state: text(v.state),
|
|
1080
|
-
|
|
1081
|
-
staffOnly: flag(type?.["bookings.staffOnly"] ?? type?.staffOnly),
|
|
1080
|
+
staffOnly: flag(type?.staffOnly),
|
|
1082
1081
|
};
|
|
1083
1082
|
});
|
|
1084
1083
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composable-os/pack-bookings",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.16",
|
|
4
4
|
"license": "FSL-1.1-ALv2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"access": "public",
|
|
13
13
|
"provenance": true
|
|
14
14
|
},
|
|
15
|
-
"description": "Bookings: a gym's or studio's timetable (weekly series that make dated classes in local time), rooms, coaches, closures, and the bookings members make and cancel within the class type's rules, spending a membership's or pass's use (stage 31a).
|
|
15
|
+
"description": "Bookings: a gym's or studio's timetable (weekly series that make dated classes in local time), rooms, coaches, closures, and the bookings members make and cancel within the class type's rules, spending a membership's or pass's use (stage 31a). Its class types are its own (stage 78). Installed in every deployment of a product that lists it. Bundled as source into cos-runner.",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"composableOs": {
|
|
30
30
|
"optional": true,
|
|
31
31
|
"label": "Bookings",
|
|
32
|
-
"description": "A timetable of classes made from weekly series, booked and cancelled by members on the web and in the app within the gym's rules.
|
|
32
|
+
"description": "A timetable of classes made from weekly series, booked and cancelled by members on the web and in the app within the gym's rules."
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@composable-os/client": "0.1.0-beta.
|
|
36
|
-
"@composable-os/sdk": "0.1.0-beta.
|
|
35
|
+
"@composable-os/client": "0.1.0-beta.16",
|
|
36
|
+
"@composable-os/sdk": "0.1.0-beta.16"
|
|
37
37
|
}
|
|
38
38
|
}
|