@composable-os/pack-bookings 0.0.0-stage → 0.1.0-beta.11

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.
@@ -0,0 +1,2039 @@
1
+ import { type ClientHolding, type PackClient } from "@composable-os/client";
2
+ import type { z } from "@composable-os/sdk";
3
+ import type { book, bookFor, buy, cancel, cancelClass, cancelFor, classGet, classList, day, family, findPeople, leaveWaitlist, markAll, markAttended, markNoShow, mine, move, returnUse, roster, timetable, undoAttended } from "../tools.ts";
4
+ type Io<T extends {
5
+ input: z.ZodType;
6
+ output: z.ZodType;
7
+ }> = {
8
+ input: z.input<T["input"]>;
9
+ output: z.output<T["output"]>;
10
+ };
11
+ /** The operations this entry calls, as the generated client types them. */
12
+ export type BookingsOperations = {
13
+ "x.bookings.timetable": {
14
+ kind: "query";
15
+ } & Io<typeof timetable>;
16
+ "x.bookings.classGet": {
17
+ kind: "query";
18
+ } & Io<typeof classGet>;
19
+ "x.bookings.mine": {
20
+ kind: "query";
21
+ } & Io<typeof mine>;
22
+ "x.bookings.family": {
23
+ kind: "query";
24
+ } & Io<typeof family>;
25
+ "x.bookings.book": {
26
+ kind: "mutation";
27
+ } & Io<typeof book>;
28
+ "x.bookings.cancel": {
29
+ kind: "mutation";
30
+ } & Io<typeof cancel>;
31
+ "x.bookings.leaveWaitlist": {
32
+ kind: "mutation";
33
+ } & Io<typeof leaveWaitlist>;
34
+ "x.bookings.day": {
35
+ kind: "query";
36
+ } & Io<typeof day>;
37
+ "x.bookings.classList": {
38
+ kind: "query";
39
+ } & Io<typeof classList>;
40
+ "x.bookings.bookFor": {
41
+ kind: "mutation";
42
+ } & Io<typeof bookFor>;
43
+ "x.bookings.cancelFor": {
44
+ kind: "mutation";
45
+ } & Io<typeof cancelFor>;
46
+ "x.bookings.returnUse": {
47
+ kind: "mutation";
48
+ } & Io<typeof returnUse>;
49
+ "x.bookings.findPeople": {
50
+ kind: "query";
51
+ } & Io<typeof findPeople>;
52
+ "x.bookings.buy": {
53
+ kind: "mutation";
54
+ } & Io<typeof buy>;
55
+ "order.checkout": {
56
+ kind: "mutation";
57
+ input: {
58
+ id: string;
59
+ token?: string;
60
+ returnUrl: string;
61
+ };
62
+ output: {
63
+ url: string;
64
+ };
65
+ };
66
+ "x.bookings.roster": {
67
+ kind: "query";
68
+ } & Io<typeof roster>;
69
+ "x.bookings.markAttended": {
70
+ kind: "mutation";
71
+ } & Io<typeof markAttended>;
72
+ "x.bookings.undoAttended": {
73
+ kind: "mutation";
74
+ } & Io<typeof undoAttended>;
75
+ "x.bookings.markNoShow": {
76
+ kind: "mutation";
77
+ } & Io<typeof markNoShow>;
78
+ "x.bookings.markAll": {
79
+ kind: "mutation";
80
+ } & Io<typeof markAll>;
81
+ "x.bookings.move": {
82
+ kind: "mutation";
83
+ } & Io<typeof move>;
84
+ "x.bookings.cancelClass": {
85
+ kind: "mutation";
86
+ } & Io<typeof cancelClass>;
87
+ };
88
+ type Name = keyof BookingsOperations & string;
89
+ type In<N extends Name> = BookingsOperations[N]["input"];
90
+ type Out<N extends Name> = BookingsOperations[N]["output"];
91
+ export type Timetable = Out<"x.bookings.timetable">;
92
+ export type TimetableClass = Timetable["classes"][number];
93
+ export type MyBookings = Out<"x.bookings.mine">;
94
+ export type MyBooking = MyBookings["bookings"][number];
95
+ export type Family = Out<"x.bookings.family">;
96
+ export type FamilyPerson = Family["people"][number];
97
+ export type BookResult = Out<"x.bookings.book">;
98
+ export type CancelResult = Out<"x.bookings.cancel">;
99
+ export type DayView = Out<"x.bookings.day">;
100
+ export type ClassListView = Out<"x.bookings.classList">;
101
+ export type RosterView = Out<"x.bookings.roster">;
102
+ export type MarkResult = Out<"x.bookings.markAttended">;
103
+ export type BookForResult = Out<"x.bookings.bookFor">;
104
+ export type BuyResult = Out<"x.bookings.buy">;
105
+ export type FoundPeople = Out<"x.bookings.findPeople">;
106
+ /** The client of every operation this entry calls (ADR 0453). */
107
+ export type BookingsClient = PackClient<BookingsOperations>;
108
+ /** A class's start and end in its own zone ("Tue 3 Mar, 06:00–07:00"), for display. */
109
+ export declare function classTime(klass: {
110
+ startsAt: string | null;
111
+ endsAt: string | null;
112
+ timeZone: string | null;
113
+ }, locale?: string): string;
114
+ /** What a class's places say ("5 places left", "Full"), from the host's numbers. */
115
+ export declare function placesLabel(places: TimetableClass["places"]): string;
116
+ /** The message to show for a refusal the host gave (with when booking opens, if it said). */
117
+ export declare function refusalMessage(result: {
118
+ message: string;
119
+ opensAt: string | null;
120
+ reason: string;
121
+ }, zone: string | null, locale?: string): string;
122
+ /** An amount the host gave in the minor unit, as a buyer reads it: `25.00 AUD`. Display only. */
123
+ export declare function formatAmount(minor: number, currency: string): string;
124
+ /** The member's live booking of a class, if any (to show Cancel instead of Book). */
125
+ export declare function bookingFor(classId: string, bookings: readonly MyBooking[] | undefined): MyBooking | undefined;
126
+ /** The app's `useQuery`, as far as these hooks use it. */
127
+ export type UseQuery = <T>(options: {
128
+ queryKey: readonly unknown[];
129
+ queryFn: () => Promise<T>;
130
+ enabled?: boolean;
131
+ }) => {
132
+ data: T | undefined;
133
+ isPending: boolean;
134
+ error: unknown;
135
+ refetch?: () => unknown;
136
+ };
137
+ /** The app's `useMutation`, as far as these hooks use it. */
138
+ export type UseMutation = <I, O>(options: {
139
+ mutationKey: readonly unknown[];
140
+ mutationFn: (input: I) => Promise<O>;
141
+ }) => {
142
+ mutate(input: I): void;
143
+ mutateAsync(input: I): Promise<O>;
144
+ data: O | undefined;
145
+ isPending: boolean;
146
+ error: unknown;
147
+ };
148
+ /**
149
+ * The operations each hook calls (ADR 0453). A customer's client gets the member's hooks (the
150
+ * timetable, book, cancel, mine), the public's only the timetable and a class, the staff client
151
+ * all of them.
152
+ */
153
+ export declare const BOOKINGS_HOOKS_CALL: {
154
+ readonly useTimetable: readonly ["x.bookings.timetable"];
155
+ readonly useClass: readonly ["x.bookings.classGet"];
156
+ readonly useMyBookings: readonly ["x.bookings.mine"];
157
+ readonly useFamily: readonly ["x.bookings.family"];
158
+ readonly useBook: readonly ["x.bookings.book"];
159
+ readonly useCancel: readonly ["x.bookings.cancel"];
160
+ readonly useLeaveWaitlist: readonly ["x.bookings.leaveWaitlist"];
161
+ readonly useDay: readonly ["x.bookings.day"];
162
+ readonly useClassList: readonly ["x.bookings.classList"];
163
+ readonly useBookFor: readonly ["x.bookings.bookFor"];
164
+ readonly useCancelFor: readonly ["x.bookings.cancelFor"];
165
+ readonly useReturnUse: readonly ["x.bookings.returnUse"];
166
+ readonly useFindPeople: readonly ["x.bookings.findPeople"];
167
+ readonly useBuy: readonly ["x.bookings.buy", "order.checkout"];
168
+ readonly useRoster: readonly ["x.bookings.roster"];
169
+ readonly useMarkAttended: readonly ["x.bookings.markAttended"];
170
+ readonly useUndoAttended: readonly ["x.bookings.undoAttended"];
171
+ readonly useMarkNoShow: readonly ["x.bookings.markNoShow"];
172
+ readonly useMarkAll: readonly ["x.bookings.markAll"];
173
+ readonly useMove: readonly ["x.bookings.move"];
174
+ readonly useCancelClass: readonly ["x.bookings.cancelClass"];
175
+ };
176
+ /**
177
+ * Hooks for a React or React Native app:
178
+ * `const bookings = createBookingsHooks({ useQuery, useMutation }, api)`. `api` is any generated
179
+ * client: the customer's or the staff one. The hooks it cannot back are not there.
180
+ */
181
+ export declare function createBookingsHooks<C extends ClientHolding>(react: {
182
+ useQuery: UseQuery;
183
+ useMutation: UseMutation;
184
+ }, client: C): import("@composable-os/client").HooksFor<{
185
+ /** The timetable between two times (default: the next 7 days). */
186
+ useTimetable(input?: In<"x.bookings.timetable">): {
187
+ data: {
188
+ classes: {
189
+ id: string;
190
+ title: string | null;
191
+ classType: string | null;
192
+ startsAt: string | null;
193
+ endsAt: string | null;
194
+ timeZone: string | null;
195
+ room: {
196
+ id: string;
197
+ name: string | null;
198
+ } | null;
199
+ coach: ({
200
+ id: string;
201
+ name: string | null;
202
+ } & {
203
+ photo?: string | null | undefined;
204
+ }) | null;
205
+ notes: string | null;
206
+ places: {
207
+ status: "available" | "low" | "sold_out";
208
+ available?: number | null | undefined;
209
+ };
210
+ }[];
211
+ } | undefined;
212
+ isPending: boolean;
213
+ error: unknown;
214
+ refetch?: () => unknown;
215
+ };
216
+ /** One scheduled class. */
217
+ useClass(input: In<"x.bookings.classGet">): {
218
+ data: {
219
+ class: {
220
+ id: string;
221
+ title: string | null;
222
+ classType: string | null;
223
+ startsAt: string | null;
224
+ endsAt: string | null;
225
+ timeZone: string | null;
226
+ room: {
227
+ id: string;
228
+ name: string | null;
229
+ } | null;
230
+ coach: ({
231
+ id: string;
232
+ name: string | null;
233
+ } & {
234
+ photo?: string | null | undefined;
235
+ }) | null;
236
+ notes: string | null;
237
+ places: {
238
+ status: "available" | "low" | "sold_out";
239
+ available?: number | null | undefined;
240
+ };
241
+ };
242
+ } | undefined;
243
+ isPending: boolean;
244
+ error: unknown;
245
+ refetch?: () => unknown;
246
+ };
247
+ /** The signed-in member's own bookings, or (with personId) a child's linked to them. */
248
+ useMyBookings(input?: In<"x.bookings.mine">): {
249
+ data: {
250
+ bookings: {
251
+ id: string;
252
+ personId: string | null;
253
+ state: string | null;
254
+ position: number | null;
255
+ holderId: string | null;
256
+ dropInOrderId: string | null;
257
+ classId: string | null;
258
+ title: string | null;
259
+ startsAt: string | null;
260
+ endsAt: string | null;
261
+ timeZone: string | null;
262
+ classState: string | null;
263
+ coach: string | null;
264
+ room: string | null;
265
+ }[];
266
+ } | undefined;
267
+ isPending: boolean;
268
+ error: unknown;
269
+ refetch?: () => unknown;
270
+ };
271
+ /** Who the member may book for: themselves and the children staff linked to them. */
272
+ useFamily(): {
273
+ data: {
274
+ people: {
275
+ personId: string;
276
+ name: string;
277
+ self: boolean;
278
+ }[];
279
+ } | undefined;
280
+ isPending: boolean;
281
+ error: unknown;
282
+ refetch?: () => unknown;
283
+ };
284
+ /** Books the member into a class; the host answers booked, waiting (full) or why not. */
285
+ useBook(): {
286
+ mutate(input: {
287
+ classId: string;
288
+ forPersonId?: string | undefined;
289
+ holderId?: string | undefined;
290
+ waitlist?: boolean | undefined;
291
+ }): void;
292
+ mutateAsync(input: {
293
+ classId: string;
294
+ forPersonId?: string | undefined;
295
+ holderId?: string | undefined;
296
+ waitlist?: boolean | undefined;
297
+ }): Promise<{
298
+ result: "waiting";
299
+ bookingId: string;
300
+ classId: string;
301
+ position: number | null;
302
+ waiting: number | null;
303
+ message: string;
304
+ } | {
305
+ result: "refused";
306
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
307
+ message: string;
308
+ detail: string | null;
309
+ opensAt: string | null;
310
+ closesAt: string | null;
311
+ people?: {
312
+ id: string;
313
+ name: string;
314
+ reasons: string[];
315
+ }[] | undefined;
316
+ } | {
317
+ result: "booked";
318
+ bookingId: string;
319
+ classId: string;
320
+ holderId: string | null;
321
+ }>;
322
+ data: {
323
+ result: "waiting";
324
+ bookingId: string;
325
+ classId: string;
326
+ position: number | null;
327
+ waiting: number | null;
328
+ message: string;
329
+ } | {
330
+ result: "refused";
331
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
332
+ message: string;
333
+ detail: string | null;
334
+ opensAt: string | null;
335
+ closesAt: string | null;
336
+ people?: {
337
+ id: string;
338
+ name: string;
339
+ reasons: string[];
340
+ }[] | undefined;
341
+ } | {
342
+ result: "booked";
343
+ bookingId: string;
344
+ classId: string;
345
+ holderId: string | null;
346
+ } | undefined;
347
+ isPending: boolean;
348
+ error: unknown;
349
+ };
350
+ /** Cancels a booking: first the host's preview (in time or late), then with confirm. */
351
+ useCancel(): {
352
+ mutate(input: {
353
+ bookingId: string;
354
+ confirm?: boolean | undefined;
355
+ expect?: "cancelled" | "late_cancelled" | undefined;
356
+ }): void;
357
+ mutateAsync(input: {
358
+ bookingId: string;
359
+ confirm?: boolean | undefined;
360
+ expect?: "cancelled" | "late_cancelled" | undefined;
361
+ }): Promise<{
362
+ result: "refused";
363
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
364
+ message: string;
365
+ detail: string | null;
366
+ opensAt: string | null;
367
+ closesAt: string | null;
368
+ people?: {
369
+ id: string;
370
+ name: string;
371
+ reasons: string[];
372
+ }[] | undefined;
373
+ } | {
374
+ result: "cancelled" | "late_cancelled" | "preview";
375
+ state: "cancelled" | "late_cancelled";
376
+ late: boolean;
377
+ dropIn: boolean;
378
+ message: string;
379
+ }>;
380
+ data: {
381
+ result: "refused";
382
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
383
+ message: string;
384
+ detail: string | null;
385
+ opensAt: string | null;
386
+ closesAt: string | null;
387
+ people?: {
388
+ id: string;
389
+ name: string;
390
+ reasons: string[];
391
+ }[] | undefined;
392
+ } | {
393
+ result: "cancelled" | "late_cancelled" | "preview";
394
+ state: "cancelled" | "late_cancelled";
395
+ late: boolean;
396
+ dropIn: boolean;
397
+ message: string;
398
+ } | undefined;
399
+ isPending: boolean;
400
+ error: unknown;
401
+ };
402
+ /** Takes the member off a class's waitlist (a booking that is waiting). */
403
+ useLeaveWaitlist(): {
404
+ mutate(input: {
405
+ bookingId: string;
406
+ }): void;
407
+ mutateAsync(input: {
408
+ bookingId: string;
409
+ }): Promise<{
410
+ result: "refused";
411
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
412
+ message: string;
413
+ detail: string | null;
414
+ opensAt: string | null;
415
+ closesAt: string | null;
416
+ people?: {
417
+ id: string;
418
+ name: string;
419
+ reasons: string[];
420
+ }[] | undefined;
421
+ } | {
422
+ result: "left";
423
+ bookingId: string;
424
+ }>;
425
+ data: {
426
+ result: "refused";
427
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
428
+ message: string;
429
+ detail: string | null;
430
+ opensAt: string | null;
431
+ closesAt: string | null;
432
+ people?: {
433
+ id: string;
434
+ name: string;
435
+ reasons: string[];
436
+ }[] | undefined;
437
+ } | {
438
+ result: "left";
439
+ bookingId: string;
440
+ } | undefined;
441
+ isPending: boolean;
442
+ error: unknown;
443
+ };
444
+ /** Staff: one local date's classes. */
445
+ useDay(input: In<"x.bookings.day">): {
446
+ data: {
447
+ date: string;
448
+ classes: {
449
+ id: string;
450
+ title: string | null;
451
+ classType: {
452
+ id: string;
453
+ name: string | null;
454
+ } | null;
455
+ startsAt: string | null;
456
+ endsAt: string | null;
457
+ timeZone: string | null;
458
+ coach: string | null;
459
+ room: string | null;
460
+ places: number | null;
461
+ booked: number;
462
+ held: number;
463
+ available: number | null;
464
+ state: string | null;
465
+ staffOnly: boolean;
466
+ }[];
467
+ } | undefined;
468
+ isPending: boolean;
469
+ error: unknown;
470
+ refetch?: () => unknown;
471
+ };
472
+ /** Staff: a class's list. */
473
+ useClassList(input: In<"x.bookings.classList">): {
474
+ data: {
475
+ class: {
476
+ id: string;
477
+ title: string | null;
478
+ classType: {
479
+ id: string;
480
+ name: string | null;
481
+ } | null;
482
+ startsAt: string | null;
483
+ endsAt: string | null;
484
+ timeZone: string | null;
485
+ coach: string | null;
486
+ room: string | null;
487
+ places: number | null;
488
+ booked: number;
489
+ held: number;
490
+ available: number | null;
491
+ state: string | null;
492
+ staffOnly: boolean;
493
+ };
494
+ bookings: {
495
+ id: string;
496
+ person: {
497
+ id: string;
498
+ name: string | null;
499
+ } | null;
500
+ state: string | null;
501
+ paidAtDesk: boolean;
502
+ holderId: string | null;
503
+ bookedBy: string | null;
504
+ promotedAt: string | null;
505
+ passedOver: string | null;
506
+ }[];
507
+ } | undefined;
508
+ isPending: boolean;
509
+ error: unknown;
510
+ refetch?: () => unknown;
511
+ };
512
+ /** Staff: book anyone, a walk-in included. */
513
+ useBookFor(): {
514
+ mutate(input: {
515
+ classId: string;
516
+ personId?: string | undefined;
517
+ newPerson?: {
518
+ givenName: string;
519
+ familyName?: string | undefined;
520
+ email?: string | undefined;
521
+ } | undefined;
522
+ confirmNew?: boolean | undefined;
523
+ holderId?: string | undefined;
524
+ paidAtDesk?: boolean | undefined;
525
+ waitlist?: boolean | undefined;
526
+ note?: string | undefined;
527
+ }): void;
528
+ mutateAsync(input: {
529
+ classId: string;
530
+ personId?: string | undefined;
531
+ newPerson?: {
532
+ givenName: string;
533
+ familyName?: string | undefined;
534
+ email?: string | undefined;
535
+ } | undefined;
536
+ confirmNew?: boolean | undefined;
537
+ holderId?: string | undefined;
538
+ paidAtDesk?: boolean | undefined;
539
+ waitlist?: boolean | undefined;
540
+ note?: string | undefined;
541
+ }): Promise<{
542
+ result: "refused";
543
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
544
+ message: string;
545
+ detail: string | null;
546
+ opensAt: string | null;
547
+ closesAt: string | null;
548
+ people?: {
549
+ id: string;
550
+ name: string;
551
+ reasons: string[];
552
+ }[] | undefined;
553
+ } | {
554
+ result: "booked";
555
+ bookingId: string;
556
+ classId: string;
557
+ holderId: string | null;
558
+ personId: string;
559
+ } | {
560
+ result: "waiting";
561
+ bookingId: string;
562
+ classId: string;
563
+ position: number | null;
564
+ waiting: number | null;
565
+ message: string;
566
+ personId: string;
567
+ }>;
568
+ data: {
569
+ result: "refused";
570
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
571
+ message: string;
572
+ detail: string | null;
573
+ opensAt: string | null;
574
+ closesAt: string | null;
575
+ people?: {
576
+ id: string;
577
+ name: string;
578
+ reasons: string[];
579
+ }[] | undefined;
580
+ } | {
581
+ result: "booked";
582
+ bookingId: string;
583
+ classId: string;
584
+ holderId: string | null;
585
+ personId: string;
586
+ } | {
587
+ result: "waiting";
588
+ bookingId: string;
589
+ classId: string;
590
+ position: number | null;
591
+ waiting: number | null;
592
+ message: string;
593
+ personId: string;
594
+ } | undefined;
595
+ isPending: boolean;
596
+ error: unknown;
597
+ };
598
+ /** Staff: cancel a booking, in time or late by the host's clock. */
599
+ useCancelFor(): {
600
+ mutate(input: {
601
+ bookingId: string;
602
+ keepUse?: boolean | undefined;
603
+ note?: string | undefined;
604
+ }): void;
605
+ mutateAsync(input: {
606
+ bookingId: string;
607
+ keepUse?: boolean | undefined;
608
+ note?: string | undefined;
609
+ }): Promise<{
610
+ result: "refused";
611
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
612
+ message: string;
613
+ detail: string | null;
614
+ opensAt: string | null;
615
+ closesAt: string | null;
616
+ people?: {
617
+ id: string;
618
+ name: string;
619
+ reasons: string[];
620
+ }[] | undefined;
621
+ } | {
622
+ result: "cancelled" | "late_cancelled";
623
+ bookingId: string;
624
+ late: boolean;
625
+ }>;
626
+ data: {
627
+ result: "refused";
628
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
629
+ message: string;
630
+ detail: string | null;
631
+ opensAt: string | null;
632
+ closesAt: string | null;
633
+ people?: {
634
+ id: string;
635
+ name: string;
636
+ reasons: string[];
637
+ }[] | undefined;
638
+ } | {
639
+ result: "cancelled" | "late_cancelled";
640
+ bookingId: string;
641
+ late: boolean;
642
+ } | undefined;
643
+ isPending: boolean;
644
+ error: unknown;
645
+ };
646
+ /** A person on the staff: give a booking's use back after the late point (destructive). */
647
+ useReturnUse(): {
648
+ mutate(input: {
649
+ bookingId: string;
650
+ reason: string;
651
+ }): void;
652
+ mutateAsync(input: {
653
+ bookingId: string;
654
+ reason: string;
655
+ }): Promise<{
656
+ result: "refused";
657
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
658
+ message: string;
659
+ detail: string | null;
660
+ opensAt: string | null;
661
+ closesAt: string | null;
662
+ people?: {
663
+ id: string;
664
+ name: string;
665
+ reasons: string[];
666
+ }[] | undefined;
667
+ } | {
668
+ result: "excused";
669
+ bookingId: string;
670
+ late: false;
671
+ }>;
672
+ data: {
673
+ result: "refused";
674
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
675
+ message: string;
676
+ detail: string | null;
677
+ opensAt: string | null;
678
+ closesAt: string | null;
679
+ people?: {
680
+ id: string;
681
+ name: string;
682
+ reasons: string[];
683
+ }[] | undefined;
684
+ } | {
685
+ result: "excused";
686
+ bookingId: string;
687
+ late: false;
688
+ } | undefined;
689
+ isPending: boolean;
690
+ error: unknown;
691
+ };
692
+ /**
693
+ * Pay for one class (a drop-in, web only): `start` has the host hold the place and start the
694
+ * order; `checkout` opens the provider's page for it.
695
+ */
696
+ useBuy(): {
697
+ start: {
698
+ mutate(input: {
699
+ classId: string;
700
+ forPersonId?: string | undefined;
701
+ email?: string | undefined;
702
+ }): void;
703
+ mutateAsync(input: {
704
+ classId: string;
705
+ forPersonId?: string | undefined;
706
+ email?: string | undefined;
707
+ }): Promise<{
708
+ result: "refused";
709
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
710
+ message: string;
711
+ detail: string | null;
712
+ opensAt: string | null;
713
+ closesAt: string | null;
714
+ people?: {
715
+ id: string;
716
+ name: string;
717
+ reasons: string[];
718
+ }[] | undefined;
719
+ } | {
720
+ result: "pending";
721
+ bookingId: string;
722
+ classId: string;
723
+ orderId: string;
724
+ total: number;
725
+ currency: string;
726
+ expiresAt: string | null;
727
+ token: string | null;
728
+ }>;
729
+ data: {
730
+ result: "refused";
731
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
732
+ message: string;
733
+ detail: string | null;
734
+ opensAt: string | null;
735
+ closesAt: string | null;
736
+ people?: {
737
+ id: string;
738
+ name: string;
739
+ reasons: string[];
740
+ }[] | undefined;
741
+ } | {
742
+ result: "pending";
743
+ bookingId: string;
744
+ classId: string;
745
+ orderId: string;
746
+ total: number;
747
+ currency: string;
748
+ expiresAt: string | null;
749
+ token: string | null;
750
+ } | undefined;
751
+ isPending: boolean;
752
+ error: unknown;
753
+ };
754
+ checkout: {
755
+ mutate(input: {
756
+ id: string;
757
+ token?: string;
758
+ returnUrl: string;
759
+ }): void;
760
+ mutateAsync(input: {
761
+ id: string;
762
+ token?: string;
763
+ returnUrl: string;
764
+ }): Promise<{
765
+ url: string;
766
+ }>;
767
+ data: {
768
+ url: string;
769
+ } | undefined;
770
+ isPending: boolean;
771
+ error: unknown;
772
+ };
773
+ };
774
+ /** Staff: People on file matching a name or email (at least two letters). */
775
+ useFindPeople(input: In<"x.bookings.findPeople">): {
776
+ data: {
777
+ people: {
778
+ id: string;
779
+ name: string | null;
780
+ email: string | null;
781
+ }[];
782
+ } | undefined;
783
+ isPending: boolean;
784
+ error: unknown;
785
+ refetch?: () => unknown;
786
+ };
787
+ /** A coach or staff: a class's list with names and marks (nothing of what anyone paid). */
788
+ useRoster(input: In<"x.bookings.roster">): {
789
+ data: {
790
+ class: {
791
+ id: string;
792
+ title: string | null;
793
+ classType: {
794
+ id: string;
795
+ name: string | null;
796
+ } | null;
797
+ startsAt: string | null;
798
+ endsAt: string | null;
799
+ timeZone: string | null;
800
+ coach: string | null;
801
+ room: string | null;
802
+ places: number | null;
803
+ booked: number;
804
+ held: number;
805
+ available: number | null;
806
+ state: string | null;
807
+ staffOnly: boolean;
808
+ };
809
+ bookings: {
810
+ id: string;
811
+ person: {
812
+ id: string;
813
+ name: string | null;
814
+ } | null;
815
+ state: string | null;
816
+ markedAt: string | null;
817
+ markedBy: string | null;
818
+ promotedAt: string | null;
819
+ }[];
820
+ } | undefined;
821
+ isPending: boolean;
822
+ error: unknown;
823
+ refetch?: () => unknown;
824
+ };
825
+ /** A coach or staff: tick a name; the host says if someone ticked it first, and who. */
826
+ useMarkAttended(): {
827
+ mutate(input: {
828
+ bookingId: string;
829
+ }): void;
830
+ mutateAsync(input: {
831
+ bookingId: string;
832
+ }): Promise<{
833
+ result: "booked" | "attended" | "no_show";
834
+ bookingId: string;
835
+ message: string;
836
+ } | {
837
+ result: "already";
838
+ bookingId: string;
839
+ state: string | null;
840
+ markedAt: string | null;
841
+ markedBy: string | null;
842
+ message: string;
843
+ } | {
844
+ result: "refused";
845
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
846
+ state: string | null;
847
+ opensAt: string | null;
848
+ message: string;
849
+ }>;
850
+ data: {
851
+ result: "booked" | "attended" | "no_show";
852
+ bookingId: string;
853
+ message: string;
854
+ } | {
855
+ result: "already";
856
+ bookingId: string;
857
+ state: string | null;
858
+ markedAt: string | null;
859
+ markedBy: string | null;
860
+ message: string;
861
+ } | {
862
+ result: "refused";
863
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
864
+ state: string | null;
865
+ opensAt: string | null;
866
+ message: string;
867
+ } | undefined;
868
+ isPending: boolean;
869
+ error: unknown;
870
+ };
871
+ /** A coach or staff: untick a name ticked by mistake. */
872
+ useUndoAttended(): {
873
+ mutate(input: {
874
+ bookingId: string;
875
+ }): void;
876
+ mutateAsync(input: {
877
+ bookingId: string;
878
+ }): Promise<{
879
+ result: "booked" | "attended" | "no_show";
880
+ bookingId: string;
881
+ message: string;
882
+ } | {
883
+ result: "already";
884
+ bookingId: string;
885
+ state: string | null;
886
+ markedAt: string | null;
887
+ markedBy: string | null;
888
+ message: string;
889
+ } | {
890
+ result: "refused";
891
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
892
+ state: string | null;
893
+ opensAt: string | null;
894
+ message: string;
895
+ }>;
896
+ data: {
897
+ result: "booked" | "attended" | "no_show";
898
+ bookingId: string;
899
+ message: string;
900
+ } | {
901
+ result: "already";
902
+ bookingId: string;
903
+ state: string | null;
904
+ markedAt: string | null;
905
+ markedBy: string | null;
906
+ message: string;
907
+ } | {
908
+ result: "refused";
909
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
910
+ state: string | null;
911
+ opensAt: string | null;
912
+ message: string;
913
+ } | undefined;
914
+ isPending: boolean;
915
+ error: unknown;
916
+ };
917
+ /** A coach or staff: mark a name as not come, once the class has started. */
918
+ useMarkNoShow(): {
919
+ mutate(input: {
920
+ bookingId: string;
921
+ }): void;
922
+ mutateAsync(input: {
923
+ bookingId: string;
924
+ }): Promise<{
925
+ result: "booked" | "attended" | "no_show";
926
+ bookingId: string;
927
+ message: string;
928
+ } | {
929
+ result: "already";
930
+ bookingId: string;
931
+ state: string | null;
932
+ markedAt: string | null;
933
+ markedBy: string | null;
934
+ message: string;
935
+ } | {
936
+ result: "refused";
937
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
938
+ state: string | null;
939
+ opensAt: string | null;
940
+ message: string;
941
+ }>;
942
+ data: {
943
+ result: "booked" | "attended" | "no_show";
944
+ bookingId: string;
945
+ message: string;
946
+ } | {
947
+ result: "already";
948
+ bookingId: string;
949
+ state: string | null;
950
+ markedAt: string | null;
951
+ markedBy: string | null;
952
+ message: string;
953
+ } | {
954
+ result: "refused";
955
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
956
+ state: string | null;
957
+ opensAt: string | null;
958
+ message: string;
959
+ } | undefined;
960
+ isPending: boolean;
961
+ error: unknown;
962
+ };
963
+ /** A coach or staff: tick everyone still booked on a class. */
964
+ useMarkAll(): {
965
+ mutate(input: {
966
+ classId: string;
967
+ }): void;
968
+ mutateAsync(input: {
969
+ classId: string;
970
+ }): Promise<{
971
+ result: "refused";
972
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
973
+ state: string | null;
974
+ opensAt: string | null;
975
+ message: string;
976
+ } | {
977
+ result: "marked";
978
+ classId: string;
979
+ ticked: number;
980
+ already: number;
981
+ skipped: number;
982
+ }>;
983
+ data: {
984
+ result: "refused";
985
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
986
+ state: string | null;
987
+ opensAt: string | null;
988
+ message: string;
989
+ } | {
990
+ result: "marked";
991
+ classId: string;
992
+ ticked: number;
993
+ already: number;
994
+ skipped: number;
995
+ } | undefined;
996
+ isPending: boolean;
997
+ error: unknown;
998
+ };
999
+ /** Staff: move a booking to another class with its use (refused whole when it cannot). */
1000
+ useMove(): {
1001
+ mutate(input: {
1002
+ bookingId: string;
1003
+ toClassId: string;
1004
+ note?: string | undefined;
1005
+ }): void;
1006
+ mutateAsync(input: {
1007
+ bookingId: string;
1008
+ toClassId: string;
1009
+ note?: string | undefined;
1010
+ }): Promise<{
1011
+ result: "refused";
1012
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1013
+ message: string;
1014
+ detail: string | null;
1015
+ opensAt: string | null;
1016
+ closesAt: string | null;
1017
+ people?: {
1018
+ id: string;
1019
+ name: string;
1020
+ reasons: string[];
1021
+ }[] | undefined;
1022
+ } | {
1023
+ result: "moved";
1024
+ fromBookingId: string;
1025
+ bookingId: string;
1026
+ classId: string;
1027
+ holderId: string | null;
1028
+ } | {
1029
+ result: "refused";
1030
+ message: string;
1031
+ detail: string | null;
1032
+ opensAt: string | null;
1033
+ closesAt: string | null;
1034
+ reason: "not_booked" | "same_class" | "started";
1035
+ people?: {
1036
+ id: string;
1037
+ name: string;
1038
+ reasons: string[];
1039
+ }[] | undefined;
1040
+ }>;
1041
+ data: {
1042
+ result: "refused";
1043
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1044
+ message: string;
1045
+ detail: string | null;
1046
+ opensAt: string | null;
1047
+ closesAt: string | null;
1048
+ people?: {
1049
+ id: string;
1050
+ name: string;
1051
+ reasons: string[];
1052
+ }[] | undefined;
1053
+ } | {
1054
+ result: "moved";
1055
+ fromBookingId: string;
1056
+ bookingId: string;
1057
+ classId: string;
1058
+ holderId: string | null;
1059
+ } | {
1060
+ result: "refused";
1061
+ message: string;
1062
+ detail: string | null;
1063
+ opensAt: string | null;
1064
+ closesAt: string | null;
1065
+ reason: "not_booked" | "same_class" | "started";
1066
+ people?: {
1067
+ id: string;
1068
+ name: string;
1069
+ reasons: string[];
1070
+ }[] | undefined;
1071
+ } | undefined;
1072
+ isPending: boolean;
1073
+ error: unknown;
1074
+ };
1075
+ /** A person on the staff: cancel a class and its bookings (an AI's call waits for one). */
1076
+ useCancelClass(): {
1077
+ mutate(input: {
1078
+ classId: string;
1079
+ reason: string;
1080
+ }): void;
1081
+ mutateAsync(input: {
1082
+ classId: string;
1083
+ reason: string;
1084
+ }): Promise<{
1085
+ result: "cancelled";
1086
+ classId: string;
1087
+ bookingsCancelled: number;
1088
+ }>;
1089
+ data: {
1090
+ result: "cancelled";
1091
+ classId: string;
1092
+ bookingsCancelled: number;
1093
+ } | undefined;
1094
+ isPending: boolean;
1095
+ error: unknown;
1096
+ };
1097
+ }, {
1098
+ readonly useTimetable: readonly ["x.bookings.timetable"];
1099
+ readonly useClass: readonly ["x.bookings.classGet"];
1100
+ readonly useMyBookings: readonly ["x.bookings.mine"];
1101
+ readonly useFamily: readonly ["x.bookings.family"];
1102
+ readonly useBook: readonly ["x.bookings.book"];
1103
+ readonly useCancel: readonly ["x.bookings.cancel"];
1104
+ readonly useLeaveWaitlist: readonly ["x.bookings.leaveWaitlist"];
1105
+ readonly useDay: readonly ["x.bookings.day"];
1106
+ readonly useClassList: readonly ["x.bookings.classList"];
1107
+ readonly useBookFor: readonly ["x.bookings.bookFor"];
1108
+ readonly useCancelFor: readonly ["x.bookings.cancelFor"];
1109
+ readonly useReturnUse: readonly ["x.bookings.returnUse"];
1110
+ readonly useFindPeople: readonly ["x.bookings.findPeople"];
1111
+ readonly useBuy: readonly ["x.bookings.buy", "order.checkout"];
1112
+ readonly useRoster: readonly ["x.bookings.roster"];
1113
+ readonly useMarkAttended: readonly ["x.bookings.markAttended"];
1114
+ readonly useUndoAttended: readonly ["x.bookings.undoAttended"];
1115
+ readonly useMarkNoShow: readonly ["x.bookings.markNoShow"];
1116
+ readonly useMarkAll: readonly ["x.bookings.markAll"];
1117
+ readonly useMove: readonly ["x.bookings.move"];
1118
+ readonly useCancelClass: readonly ["x.bookings.cancelClass"];
1119
+ }, import("@composable-os/client").OperationsOf<C>>;
1120
+ declare function allBookingsHooks(react: {
1121
+ useQuery: UseQuery;
1122
+ useMutation: UseMutation;
1123
+ }, api: BookingsClient): {
1124
+ /** The timetable between two times (default: the next 7 days). */
1125
+ useTimetable(input?: In<"x.bookings.timetable">): {
1126
+ data: {
1127
+ classes: {
1128
+ id: string;
1129
+ title: string | null;
1130
+ classType: string | null;
1131
+ startsAt: string | null;
1132
+ endsAt: string | null;
1133
+ timeZone: string | null;
1134
+ room: {
1135
+ id: string;
1136
+ name: string | null;
1137
+ } | null;
1138
+ coach: ({
1139
+ id: string;
1140
+ name: string | null;
1141
+ } & {
1142
+ photo?: string | null | undefined;
1143
+ }) | null;
1144
+ notes: string | null;
1145
+ places: {
1146
+ status: "available" | "low" | "sold_out";
1147
+ available?: number | null | undefined;
1148
+ };
1149
+ }[];
1150
+ } | undefined;
1151
+ isPending: boolean;
1152
+ error: unknown;
1153
+ refetch?: () => unknown;
1154
+ };
1155
+ /** One scheduled class. */
1156
+ useClass(input: In<"x.bookings.classGet">): {
1157
+ data: {
1158
+ class: {
1159
+ id: string;
1160
+ title: string | null;
1161
+ classType: string | null;
1162
+ startsAt: string | null;
1163
+ endsAt: string | null;
1164
+ timeZone: string | null;
1165
+ room: {
1166
+ id: string;
1167
+ name: string | null;
1168
+ } | null;
1169
+ coach: ({
1170
+ id: string;
1171
+ name: string | null;
1172
+ } & {
1173
+ photo?: string | null | undefined;
1174
+ }) | null;
1175
+ notes: string | null;
1176
+ places: {
1177
+ status: "available" | "low" | "sold_out";
1178
+ available?: number | null | undefined;
1179
+ };
1180
+ };
1181
+ } | undefined;
1182
+ isPending: boolean;
1183
+ error: unknown;
1184
+ refetch?: () => unknown;
1185
+ };
1186
+ /** The signed-in member's own bookings, or (with personId) a child's linked to them. */
1187
+ useMyBookings(input?: In<"x.bookings.mine">): {
1188
+ data: {
1189
+ bookings: {
1190
+ id: string;
1191
+ personId: string | null;
1192
+ state: string | null;
1193
+ position: number | null;
1194
+ holderId: string | null;
1195
+ dropInOrderId: string | null;
1196
+ classId: string | null;
1197
+ title: string | null;
1198
+ startsAt: string | null;
1199
+ endsAt: string | null;
1200
+ timeZone: string | null;
1201
+ classState: string | null;
1202
+ coach: string | null;
1203
+ room: string | null;
1204
+ }[];
1205
+ } | undefined;
1206
+ isPending: boolean;
1207
+ error: unknown;
1208
+ refetch?: () => unknown;
1209
+ };
1210
+ /** Who the member may book for: themselves and the children staff linked to them. */
1211
+ useFamily(): {
1212
+ data: {
1213
+ people: {
1214
+ personId: string;
1215
+ name: string;
1216
+ self: boolean;
1217
+ }[];
1218
+ } | undefined;
1219
+ isPending: boolean;
1220
+ error: unknown;
1221
+ refetch?: () => unknown;
1222
+ };
1223
+ /** Books the member into a class; the host answers booked, waiting (full) or why not. */
1224
+ useBook(): {
1225
+ mutate(input: {
1226
+ classId: string;
1227
+ forPersonId?: string | undefined;
1228
+ holderId?: string | undefined;
1229
+ waitlist?: boolean | undefined;
1230
+ }): void;
1231
+ mutateAsync(input: {
1232
+ classId: string;
1233
+ forPersonId?: string | undefined;
1234
+ holderId?: string | undefined;
1235
+ waitlist?: boolean | undefined;
1236
+ }): Promise<{
1237
+ result: "waiting";
1238
+ bookingId: string;
1239
+ classId: string;
1240
+ position: number | null;
1241
+ waiting: number | null;
1242
+ message: string;
1243
+ } | {
1244
+ result: "refused";
1245
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1246
+ message: string;
1247
+ detail: string | null;
1248
+ opensAt: string | null;
1249
+ closesAt: string | null;
1250
+ people?: {
1251
+ id: string;
1252
+ name: string;
1253
+ reasons: string[];
1254
+ }[] | undefined;
1255
+ } | {
1256
+ result: "booked";
1257
+ bookingId: string;
1258
+ classId: string;
1259
+ holderId: string | null;
1260
+ }>;
1261
+ data: {
1262
+ result: "waiting";
1263
+ bookingId: string;
1264
+ classId: string;
1265
+ position: number | null;
1266
+ waiting: number | null;
1267
+ message: string;
1268
+ } | {
1269
+ result: "refused";
1270
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1271
+ message: string;
1272
+ detail: string | null;
1273
+ opensAt: string | null;
1274
+ closesAt: string | null;
1275
+ people?: {
1276
+ id: string;
1277
+ name: string;
1278
+ reasons: string[];
1279
+ }[] | undefined;
1280
+ } | {
1281
+ result: "booked";
1282
+ bookingId: string;
1283
+ classId: string;
1284
+ holderId: string | null;
1285
+ } | undefined;
1286
+ isPending: boolean;
1287
+ error: unknown;
1288
+ };
1289
+ /** Cancels a booking: first the host's preview (in time or late), then with confirm. */
1290
+ useCancel(): {
1291
+ mutate(input: {
1292
+ bookingId: string;
1293
+ confirm?: boolean | undefined;
1294
+ expect?: "cancelled" | "late_cancelled" | undefined;
1295
+ }): void;
1296
+ mutateAsync(input: {
1297
+ bookingId: string;
1298
+ confirm?: boolean | undefined;
1299
+ expect?: "cancelled" | "late_cancelled" | undefined;
1300
+ }): Promise<{
1301
+ result: "refused";
1302
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1303
+ message: string;
1304
+ detail: string | null;
1305
+ opensAt: string | null;
1306
+ closesAt: string | null;
1307
+ people?: {
1308
+ id: string;
1309
+ name: string;
1310
+ reasons: string[];
1311
+ }[] | undefined;
1312
+ } | {
1313
+ result: "cancelled" | "late_cancelled" | "preview";
1314
+ state: "cancelled" | "late_cancelled";
1315
+ late: boolean;
1316
+ dropIn: boolean;
1317
+ message: string;
1318
+ }>;
1319
+ data: {
1320
+ result: "refused";
1321
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1322
+ message: string;
1323
+ detail: string | null;
1324
+ opensAt: string | null;
1325
+ closesAt: string | null;
1326
+ people?: {
1327
+ id: string;
1328
+ name: string;
1329
+ reasons: string[];
1330
+ }[] | undefined;
1331
+ } | {
1332
+ result: "cancelled" | "late_cancelled" | "preview";
1333
+ state: "cancelled" | "late_cancelled";
1334
+ late: boolean;
1335
+ dropIn: boolean;
1336
+ message: string;
1337
+ } | undefined;
1338
+ isPending: boolean;
1339
+ error: unknown;
1340
+ };
1341
+ /** Takes the member off a class's waitlist (a booking that is waiting). */
1342
+ useLeaveWaitlist(): {
1343
+ mutate(input: {
1344
+ bookingId: string;
1345
+ }): void;
1346
+ mutateAsync(input: {
1347
+ bookingId: string;
1348
+ }): Promise<{
1349
+ result: "refused";
1350
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1351
+ message: string;
1352
+ detail: string | null;
1353
+ opensAt: string | null;
1354
+ closesAt: string | null;
1355
+ people?: {
1356
+ id: string;
1357
+ name: string;
1358
+ reasons: string[];
1359
+ }[] | undefined;
1360
+ } | {
1361
+ result: "left";
1362
+ bookingId: string;
1363
+ }>;
1364
+ data: {
1365
+ result: "refused";
1366
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1367
+ message: string;
1368
+ detail: string | null;
1369
+ opensAt: string | null;
1370
+ closesAt: string | null;
1371
+ people?: {
1372
+ id: string;
1373
+ name: string;
1374
+ reasons: string[];
1375
+ }[] | undefined;
1376
+ } | {
1377
+ result: "left";
1378
+ bookingId: string;
1379
+ } | undefined;
1380
+ isPending: boolean;
1381
+ error: unknown;
1382
+ };
1383
+ /** Staff: one local date's classes. */
1384
+ useDay(input: In<"x.bookings.day">): {
1385
+ data: {
1386
+ date: string;
1387
+ classes: {
1388
+ id: string;
1389
+ title: string | null;
1390
+ classType: {
1391
+ id: string;
1392
+ name: string | null;
1393
+ } | null;
1394
+ startsAt: string | null;
1395
+ endsAt: string | null;
1396
+ timeZone: string | null;
1397
+ coach: string | null;
1398
+ room: string | null;
1399
+ places: number | null;
1400
+ booked: number;
1401
+ held: number;
1402
+ available: number | null;
1403
+ state: string | null;
1404
+ staffOnly: boolean;
1405
+ }[];
1406
+ } | undefined;
1407
+ isPending: boolean;
1408
+ error: unknown;
1409
+ refetch?: () => unknown;
1410
+ };
1411
+ /** Staff: a class's list. */
1412
+ useClassList(input: In<"x.bookings.classList">): {
1413
+ data: {
1414
+ class: {
1415
+ id: string;
1416
+ title: string | null;
1417
+ classType: {
1418
+ id: string;
1419
+ name: string | null;
1420
+ } | null;
1421
+ startsAt: string | null;
1422
+ endsAt: string | null;
1423
+ timeZone: string | null;
1424
+ coach: string | null;
1425
+ room: string | null;
1426
+ places: number | null;
1427
+ booked: number;
1428
+ held: number;
1429
+ available: number | null;
1430
+ state: string | null;
1431
+ staffOnly: boolean;
1432
+ };
1433
+ bookings: {
1434
+ id: string;
1435
+ person: {
1436
+ id: string;
1437
+ name: string | null;
1438
+ } | null;
1439
+ state: string | null;
1440
+ paidAtDesk: boolean;
1441
+ holderId: string | null;
1442
+ bookedBy: string | null;
1443
+ promotedAt: string | null;
1444
+ passedOver: string | null;
1445
+ }[];
1446
+ } | undefined;
1447
+ isPending: boolean;
1448
+ error: unknown;
1449
+ refetch?: () => unknown;
1450
+ };
1451
+ /** Staff: book anyone, a walk-in included. */
1452
+ useBookFor(): {
1453
+ mutate(input: {
1454
+ classId: string;
1455
+ personId?: string | undefined;
1456
+ newPerson?: {
1457
+ givenName: string;
1458
+ familyName?: string | undefined;
1459
+ email?: string | undefined;
1460
+ } | undefined;
1461
+ confirmNew?: boolean | undefined;
1462
+ holderId?: string | undefined;
1463
+ paidAtDesk?: boolean | undefined;
1464
+ waitlist?: boolean | undefined;
1465
+ note?: string | undefined;
1466
+ }): void;
1467
+ mutateAsync(input: {
1468
+ classId: string;
1469
+ personId?: string | undefined;
1470
+ newPerson?: {
1471
+ givenName: string;
1472
+ familyName?: string | undefined;
1473
+ email?: string | undefined;
1474
+ } | undefined;
1475
+ confirmNew?: boolean | undefined;
1476
+ holderId?: string | undefined;
1477
+ paidAtDesk?: boolean | undefined;
1478
+ waitlist?: boolean | undefined;
1479
+ note?: string | undefined;
1480
+ }): Promise<{
1481
+ result: "refused";
1482
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1483
+ message: string;
1484
+ detail: string | null;
1485
+ opensAt: string | null;
1486
+ closesAt: string | null;
1487
+ people?: {
1488
+ id: string;
1489
+ name: string;
1490
+ reasons: string[];
1491
+ }[] | undefined;
1492
+ } | {
1493
+ result: "booked";
1494
+ bookingId: string;
1495
+ classId: string;
1496
+ holderId: string | null;
1497
+ personId: string;
1498
+ } | {
1499
+ result: "waiting";
1500
+ bookingId: string;
1501
+ classId: string;
1502
+ position: number | null;
1503
+ waiting: number | null;
1504
+ message: string;
1505
+ personId: string;
1506
+ }>;
1507
+ data: {
1508
+ result: "refused";
1509
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1510
+ message: string;
1511
+ detail: string | null;
1512
+ opensAt: string | null;
1513
+ closesAt: string | null;
1514
+ people?: {
1515
+ id: string;
1516
+ name: string;
1517
+ reasons: string[];
1518
+ }[] | undefined;
1519
+ } | {
1520
+ result: "booked";
1521
+ bookingId: string;
1522
+ classId: string;
1523
+ holderId: string | null;
1524
+ personId: string;
1525
+ } | {
1526
+ result: "waiting";
1527
+ bookingId: string;
1528
+ classId: string;
1529
+ position: number | null;
1530
+ waiting: number | null;
1531
+ message: string;
1532
+ personId: string;
1533
+ } | undefined;
1534
+ isPending: boolean;
1535
+ error: unknown;
1536
+ };
1537
+ /** Staff: cancel a booking, in time or late by the host's clock. */
1538
+ useCancelFor(): {
1539
+ mutate(input: {
1540
+ bookingId: string;
1541
+ keepUse?: boolean | undefined;
1542
+ note?: string | undefined;
1543
+ }): void;
1544
+ mutateAsync(input: {
1545
+ bookingId: string;
1546
+ keepUse?: boolean | undefined;
1547
+ note?: string | undefined;
1548
+ }): Promise<{
1549
+ result: "refused";
1550
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1551
+ message: string;
1552
+ detail: string | null;
1553
+ opensAt: string | null;
1554
+ closesAt: string | null;
1555
+ people?: {
1556
+ id: string;
1557
+ name: string;
1558
+ reasons: string[];
1559
+ }[] | undefined;
1560
+ } | {
1561
+ result: "cancelled" | "late_cancelled";
1562
+ bookingId: string;
1563
+ late: boolean;
1564
+ }>;
1565
+ data: {
1566
+ result: "refused";
1567
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1568
+ message: string;
1569
+ detail: string | null;
1570
+ opensAt: string | null;
1571
+ closesAt: string | null;
1572
+ people?: {
1573
+ id: string;
1574
+ name: string;
1575
+ reasons: string[];
1576
+ }[] | undefined;
1577
+ } | {
1578
+ result: "cancelled" | "late_cancelled";
1579
+ bookingId: string;
1580
+ late: boolean;
1581
+ } | undefined;
1582
+ isPending: boolean;
1583
+ error: unknown;
1584
+ };
1585
+ /** A person on the staff: give a booking's use back after the late point (destructive). */
1586
+ useReturnUse(): {
1587
+ mutate(input: {
1588
+ bookingId: string;
1589
+ reason: string;
1590
+ }): void;
1591
+ mutateAsync(input: {
1592
+ bookingId: string;
1593
+ reason: string;
1594
+ }): Promise<{
1595
+ result: "refused";
1596
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1597
+ message: string;
1598
+ detail: string | null;
1599
+ opensAt: string | null;
1600
+ closesAt: string | null;
1601
+ people?: {
1602
+ id: string;
1603
+ name: string;
1604
+ reasons: string[];
1605
+ }[] | undefined;
1606
+ } | {
1607
+ result: "excused";
1608
+ bookingId: string;
1609
+ late: false;
1610
+ }>;
1611
+ data: {
1612
+ result: "refused";
1613
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1614
+ message: string;
1615
+ detail: string | null;
1616
+ opensAt: string | null;
1617
+ closesAt: string | null;
1618
+ people?: {
1619
+ id: string;
1620
+ name: string;
1621
+ reasons: string[];
1622
+ }[] | undefined;
1623
+ } | {
1624
+ result: "excused";
1625
+ bookingId: string;
1626
+ late: false;
1627
+ } | undefined;
1628
+ isPending: boolean;
1629
+ error: unknown;
1630
+ };
1631
+ /**
1632
+ * Pay for one class (a drop-in, web only): `start` has the host hold the place and start the
1633
+ * order; `checkout` opens the provider's page for it.
1634
+ */
1635
+ useBuy(): {
1636
+ start: {
1637
+ mutate(input: {
1638
+ classId: string;
1639
+ forPersonId?: string | undefined;
1640
+ email?: string | undefined;
1641
+ }): void;
1642
+ mutateAsync(input: {
1643
+ classId: string;
1644
+ forPersonId?: string | undefined;
1645
+ email?: string | undefined;
1646
+ }): Promise<{
1647
+ result: "refused";
1648
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1649
+ message: string;
1650
+ detail: string | null;
1651
+ opensAt: string | null;
1652
+ closesAt: string | null;
1653
+ people?: {
1654
+ id: string;
1655
+ name: string;
1656
+ reasons: string[];
1657
+ }[] | undefined;
1658
+ } | {
1659
+ result: "pending";
1660
+ bookingId: string;
1661
+ classId: string;
1662
+ orderId: string;
1663
+ total: number;
1664
+ currency: string;
1665
+ expiresAt: string | null;
1666
+ token: string | null;
1667
+ }>;
1668
+ data: {
1669
+ result: "refused";
1670
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1671
+ message: string;
1672
+ detail: string | null;
1673
+ opensAt: string | null;
1674
+ closesAt: string | null;
1675
+ people?: {
1676
+ id: string;
1677
+ name: string;
1678
+ reasons: string[];
1679
+ }[] | undefined;
1680
+ } | {
1681
+ result: "pending";
1682
+ bookingId: string;
1683
+ classId: string;
1684
+ orderId: string;
1685
+ total: number;
1686
+ currency: string;
1687
+ expiresAt: string | null;
1688
+ token: string | null;
1689
+ } | undefined;
1690
+ isPending: boolean;
1691
+ error: unknown;
1692
+ };
1693
+ checkout: {
1694
+ mutate(input: {
1695
+ id: string;
1696
+ token?: string;
1697
+ returnUrl: string;
1698
+ }): void;
1699
+ mutateAsync(input: {
1700
+ id: string;
1701
+ token?: string;
1702
+ returnUrl: string;
1703
+ }): Promise<{
1704
+ url: string;
1705
+ }>;
1706
+ data: {
1707
+ url: string;
1708
+ } | undefined;
1709
+ isPending: boolean;
1710
+ error: unknown;
1711
+ };
1712
+ };
1713
+ /** Staff: People on file matching a name or email (at least two letters). */
1714
+ useFindPeople(input: In<"x.bookings.findPeople">): {
1715
+ data: {
1716
+ people: {
1717
+ id: string;
1718
+ name: string | null;
1719
+ email: string | null;
1720
+ }[];
1721
+ } | undefined;
1722
+ isPending: boolean;
1723
+ error: unknown;
1724
+ refetch?: () => unknown;
1725
+ };
1726
+ /** A coach or staff: a class's list with names and marks (nothing of what anyone paid). */
1727
+ useRoster(input: In<"x.bookings.roster">): {
1728
+ data: {
1729
+ class: {
1730
+ id: string;
1731
+ title: string | null;
1732
+ classType: {
1733
+ id: string;
1734
+ name: string | null;
1735
+ } | null;
1736
+ startsAt: string | null;
1737
+ endsAt: string | null;
1738
+ timeZone: string | null;
1739
+ coach: string | null;
1740
+ room: string | null;
1741
+ places: number | null;
1742
+ booked: number;
1743
+ held: number;
1744
+ available: number | null;
1745
+ state: string | null;
1746
+ staffOnly: boolean;
1747
+ };
1748
+ bookings: {
1749
+ id: string;
1750
+ person: {
1751
+ id: string;
1752
+ name: string | null;
1753
+ } | null;
1754
+ state: string | null;
1755
+ markedAt: string | null;
1756
+ markedBy: string | null;
1757
+ promotedAt: string | null;
1758
+ }[];
1759
+ } | undefined;
1760
+ isPending: boolean;
1761
+ error: unknown;
1762
+ refetch?: () => unknown;
1763
+ };
1764
+ /** A coach or staff: tick a name; the host says if someone ticked it first, and who. */
1765
+ useMarkAttended(): {
1766
+ mutate(input: {
1767
+ bookingId: string;
1768
+ }): void;
1769
+ mutateAsync(input: {
1770
+ bookingId: string;
1771
+ }): Promise<{
1772
+ result: "booked" | "attended" | "no_show";
1773
+ bookingId: string;
1774
+ message: string;
1775
+ } | {
1776
+ result: "already";
1777
+ bookingId: string;
1778
+ state: string | null;
1779
+ markedAt: string | null;
1780
+ markedBy: string | null;
1781
+ message: string;
1782
+ } | {
1783
+ result: "refused";
1784
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1785
+ state: string | null;
1786
+ opensAt: string | null;
1787
+ message: string;
1788
+ }>;
1789
+ data: {
1790
+ result: "booked" | "attended" | "no_show";
1791
+ bookingId: string;
1792
+ message: string;
1793
+ } | {
1794
+ result: "already";
1795
+ bookingId: string;
1796
+ state: string | null;
1797
+ markedAt: string | null;
1798
+ markedBy: string | null;
1799
+ message: string;
1800
+ } | {
1801
+ result: "refused";
1802
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1803
+ state: string | null;
1804
+ opensAt: string | null;
1805
+ message: string;
1806
+ } | undefined;
1807
+ isPending: boolean;
1808
+ error: unknown;
1809
+ };
1810
+ /** A coach or staff: untick a name ticked by mistake. */
1811
+ useUndoAttended(): {
1812
+ mutate(input: {
1813
+ bookingId: string;
1814
+ }): void;
1815
+ mutateAsync(input: {
1816
+ bookingId: string;
1817
+ }): Promise<{
1818
+ result: "booked" | "attended" | "no_show";
1819
+ bookingId: string;
1820
+ message: string;
1821
+ } | {
1822
+ result: "already";
1823
+ bookingId: string;
1824
+ state: string | null;
1825
+ markedAt: string | null;
1826
+ markedBy: string | null;
1827
+ message: string;
1828
+ } | {
1829
+ result: "refused";
1830
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1831
+ state: string | null;
1832
+ opensAt: string | null;
1833
+ message: string;
1834
+ }>;
1835
+ data: {
1836
+ result: "booked" | "attended" | "no_show";
1837
+ bookingId: string;
1838
+ message: string;
1839
+ } | {
1840
+ result: "already";
1841
+ bookingId: string;
1842
+ state: string | null;
1843
+ markedAt: string | null;
1844
+ markedBy: string | null;
1845
+ message: string;
1846
+ } | {
1847
+ result: "refused";
1848
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1849
+ state: string | null;
1850
+ opensAt: string | null;
1851
+ message: string;
1852
+ } | undefined;
1853
+ isPending: boolean;
1854
+ error: unknown;
1855
+ };
1856
+ /** A coach or staff: mark a name as not come, once the class has started. */
1857
+ useMarkNoShow(): {
1858
+ mutate(input: {
1859
+ bookingId: string;
1860
+ }): void;
1861
+ mutateAsync(input: {
1862
+ bookingId: string;
1863
+ }): Promise<{
1864
+ result: "booked" | "attended" | "no_show";
1865
+ bookingId: string;
1866
+ message: string;
1867
+ } | {
1868
+ result: "already";
1869
+ bookingId: string;
1870
+ state: string | null;
1871
+ markedAt: string | null;
1872
+ markedBy: string | null;
1873
+ message: string;
1874
+ } | {
1875
+ result: "refused";
1876
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1877
+ state: string | null;
1878
+ opensAt: string | null;
1879
+ message: string;
1880
+ }>;
1881
+ data: {
1882
+ result: "booked" | "attended" | "no_show";
1883
+ bookingId: string;
1884
+ message: string;
1885
+ } | {
1886
+ result: "already";
1887
+ bookingId: string;
1888
+ state: string | null;
1889
+ markedAt: string | null;
1890
+ markedBy: string | null;
1891
+ message: string;
1892
+ } | {
1893
+ result: "refused";
1894
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1895
+ state: string | null;
1896
+ opensAt: string | null;
1897
+ message: string;
1898
+ } | undefined;
1899
+ isPending: boolean;
1900
+ error: unknown;
1901
+ };
1902
+ /** A coach or staff: tick everyone still booked on a class. */
1903
+ useMarkAll(): {
1904
+ mutate(input: {
1905
+ classId: string;
1906
+ }): void;
1907
+ mutateAsync(input: {
1908
+ classId: string;
1909
+ }): Promise<{
1910
+ result: "refused";
1911
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1912
+ state: string | null;
1913
+ opensAt: string | null;
1914
+ message: string;
1915
+ } | {
1916
+ result: "marked";
1917
+ classId: string;
1918
+ ticked: number;
1919
+ already: number;
1920
+ skipped: number;
1921
+ }>;
1922
+ data: {
1923
+ result: "refused";
1924
+ reason: "not_found" | "changed" | "not_started" | "not_booked";
1925
+ state: string | null;
1926
+ opensAt: string | null;
1927
+ message: string;
1928
+ } | {
1929
+ result: "marked";
1930
+ classId: string;
1931
+ ticked: number;
1932
+ already: number;
1933
+ skipped: number;
1934
+ } | undefined;
1935
+ isPending: boolean;
1936
+ error: unknown;
1937
+ };
1938
+ /** Staff: move a booking to another class with its use (refused whole when it cannot). */
1939
+ useMove(): {
1940
+ mutate(input: {
1941
+ bookingId: string;
1942
+ toClassId: string;
1943
+ note?: string | undefined;
1944
+ }): void;
1945
+ mutateAsync(input: {
1946
+ bookingId: string;
1947
+ toClassId: string;
1948
+ note?: string | undefined;
1949
+ }): Promise<{
1950
+ result: "refused";
1951
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1952
+ message: string;
1953
+ detail: string | null;
1954
+ opensAt: string | null;
1955
+ closesAt: string | null;
1956
+ people?: {
1957
+ id: string;
1958
+ name: string;
1959
+ reasons: string[];
1960
+ }[] | undefined;
1961
+ } | {
1962
+ result: "moved";
1963
+ fromBookingId: string;
1964
+ bookingId: string;
1965
+ classId: string;
1966
+ holderId: string | null;
1967
+ } | {
1968
+ result: "refused";
1969
+ message: string;
1970
+ detail: string | null;
1971
+ opensAt: string | null;
1972
+ closesAt: string | null;
1973
+ reason: "not_booked" | "same_class" | "started";
1974
+ people?: {
1975
+ id: string;
1976
+ name: string;
1977
+ reasons: string[];
1978
+ }[] | undefined;
1979
+ }>;
1980
+ data: {
1981
+ result: "refused";
1982
+ reason: "not_open" | "closed" | "staff_only" | "no_use" | "already_booked" | "full" | "too_late" | "not_found" | "changed" | "not_running" | "person_exists" | "possible_duplicates" | "waitlist_closed" | "no_drop_in" | "ask_desk" | "try_later";
1983
+ message: string;
1984
+ detail: string | null;
1985
+ opensAt: string | null;
1986
+ closesAt: string | null;
1987
+ people?: {
1988
+ id: string;
1989
+ name: string;
1990
+ reasons: string[];
1991
+ }[] | undefined;
1992
+ } | {
1993
+ result: "moved";
1994
+ fromBookingId: string;
1995
+ bookingId: string;
1996
+ classId: string;
1997
+ holderId: string | null;
1998
+ } | {
1999
+ result: "refused";
2000
+ message: string;
2001
+ detail: string | null;
2002
+ opensAt: string | null;
2003
+ closesAt: string | null;
2004
+ reason: "not_booked" | "same_class" | "started";
2005
+ people?: {
2006
+ id: string;
2007
+ name: string;
2008
+ reasons: string[];
2009
+ }[] | undefined;
2010
+ } | undefined;
2011
+ isPending: boolean;
2012
+ error: unknown;
2013
+ };
2014
+ /** A person on the staff: cancel a class and its bookings (an AI's call waits for one). */
2015
+ useCancelClass(): {
2016
+ mutate(input: {
2017
+ classId: string;
2018
+ reason: string;
2019
+ }): void;
2020
+ mutateAsync(input: {
2021
+ classId: string;
2022
+ reason: string;
2023
+ }): Promise<{
2024
+ result: "cancelled";
2025
+ classId: string;
2026
+ bookingsCancelled: number;
2027
+ }>;
2028
+ data: {
2029
+ result: "cancelled";
2030
+ classId: string;
2031
+ bookingsCancelled: number;
2032
+ } | undefined;
2033
+ isPending: boolean;
2034
+ error: unknown;
2035
+ };
2036
+ };
2037
+ /** Every hook of this entry. A block takes the ones it calls: `Pick<BookingsHooks, "useBook">`. */
2038
+ export type BookingsHooks = ReturnType<typeof allBookingsHooks>;
2039
+ export {};