@composable-os/pack-ticketing 0.0.0-stage → 0.1.0-beta.8

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,799 @@
1
+ import { type ClientHolding, type PackClient } from "@composable-os/client";
2
+ import type { z } from "@composable-os/sdk";
3
+ import type { checkIn, eventsOnSale, myTickets, orderStart, undoCheckIn } 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
+ /** An order as the host shows it to its buyer (order.get, order.view), as far as this uses it. */
12
+ export interface BuyerOrder {
13
+ id: string;
14
+ state: "pending" | "part_paid" | "paid" | "cancelled" | "expired" | "refunded";
15
+ currency: string;
16
+ total: number;
17
+ paid: number;
18
+ balance: number;
19
+ pay: "full" | "deposit";
20
+ deposit: number | null;
21
+ balanceDueAt: string | null;
22
+ expiresAt: string | null;
23
+ lines: {
24
+ id: string;
25
+ title: string;
26
+ quantity: number;
27
+ unitPrice: number;
28
+ total: number;
29
+ }[];
30
+ }
31
+ /** The operations this entry calls, as the generated client types them. */
32
+ export type TicketingOperations = {
33
+ "x.ticketing.eventsOnSale": {
34
+ kind: "query";
35
+ } & Io<typeof eventsOnSale>;
36
+ "x.ticketing.myTickets": {
37
+ kind: "query";
38
+ } & Io<typeof myTickets>;
39
+ "x.ticketing.orderStart": {
40
+ kind: "mutation";
41
+ } & Io<typeof orderStart>;
42
+ "x.ticketing.checkIn": {
43
+ kind: "mutation";
44
+ } & Io<typeof checkIn>;
45
+ "x.ticketing.undoCheckIn": {
46
+ kind: "mutation";
47
+ } & Io<typeof undoCheckIn>;
48
+ "order.get": {
49
+ kind: "query";
50
+ input: {
51
+ id: string;
52
+ };
53
+ output: BuyerOrder;
54
+ };
55
+ "order.view": {
56
+ kind: "query";
57
+ input: {
58
+ id: string;
59
+ token: string;
60
+ };
61
+ output: BuyerOrder;
62
+ };
63
+ "order.checkout": {
64
+ kind: "mutation";
65
+ input: {
66
+ id: string;
67
+ token?: string;
68
+ returnUrl: string;
69
+ amount?: number;
70
+ };
71
+ output: {
72
+ url: string;
73
+ amount: number;
74
+ };
75
+ };
76
+ };
77
+ type Name = keyof TicketingOperations & string;
78
+ type In<N extends Name> = TicketingOperations[N]["input"];
79
+ type Out<N extends Name> = TicketingOperations[N]["output"];
80
+ export type EventsOnSale = Out<"x.ticketing.eventsOnSale">;
81
+ export type EventOnSale = EventsOnSale["events"][number];
82
+ export type TicketTypeOnSale = EventOnSale["ticketTypes"][number];
83
+ export type MyTickets = Out<"x.ticketing.myTickets">;
84
+ export type CheckInResult = Out<"x.ticketing.checkIn">;
85
+ export type StartedOrder = Out<"x.ticketing.orderStart">;
86
+ /**
87
+ * The client of every operation this entry calls. The hooks are written against it; the client an
88
+ * app passes may hold fewer (a customer's, the door role's), and then gets only the hooks it can
89
+ * back (ADR 0453).
90
+ */
91
+ export type TicketingClient = PackClient<TicketingOperations>;
92
+ /**
93
+ * How many decimal places `currency` has (2 for AUD, 0 for JPY), for display. The currency is
94
+ * always the host's, from the data (a ticket type's `currency`, an order's): never the app's.
95
+ */
96
+ export declare function currencyDigits(currency: string | null | undefined): number;
97
+ /** An amount in the minor unit as the buyer reads it: `450.00 AUD`. Display only. */
98
+ export declare function formatMoney(minor: number, currency: string | null): string;
99
+ /** A ticket type's price (major unit, as the record holds it) as the buyer reads it. */
100
+ export declare function formatPrice(price: number | null, currency: string | null): string;
101
+ /** The viewer's own time zone, as their device reports it. */
102
+ export declare function viewerTimeZone(): string;
103
+ /**
104
+ * When an event starts (or ends, with `at: "endsAt"`), as a buyer or holder reads it: the day and
105
+ * time in the event's own zone (ADR 0460), never the device's, so a camp in Bangkok reads as
106
+ * Bangkok's time on a phone in Sydney. When the event's zone is not the viewer's, the zone is
107
+ * said (`… (Bangkok time)`). Display only.
108
+ */
109
+ export declare function eventTime(event: {
110
+ startsAt: string | null;
111
+ endsAt?: string | null;
112
+ timeZone: string | null;
113
+ }, options?: {
114
+ at?: "startsAt" | "endsAt";
115
+ viewer?: string;
116
+ locale?: string;
117
+ }): string;
118
+ /** The day an event starts on in its own zone (`2027-03-01`), for grouping or a calendar. */
119
+ export declare function eventDay(event: {
120
+ startsAt: string | null;
121
+ timeZone: string | null;
122
+ }): string;
123
+ /** The currency an event's prices are in, as the host gave it with its ticket types. */
124
+ export declare function eventCurrency(event: EventOnSale): string | null;
125
+ /**
126
+ * An amount a buyer typed (`120`, `120.50`) in the minor unit of `currency`, or null when it is
127
+ * not one. The host decides whether it may be charged (at least the set minimum, at most the
128
+ * balance).
129
+ */
130
+ export declare function minorFromInput(text: string, currency?: string | null): number | null;
131
+ /** What the picker shows of a ticket type's places: "Sold out", "Only 3 left", or nothing. */
132
+ export declare function availabilityLabel(availability: TicketTypeOnSale["availability"]): string | null;
133
+ /** Quantities chosen, by ticket type id. */
134
+ export type Quantities = Readonly<Record<string, number>>;
135
+ /** The lines `orderStart` takes, from what was chosen. */
136
+ export declare function pickerLines(quantities: Quantities): {
137
+ ticketTypeId: string;
138
+ quantity: number;
139
+ }[];
140
+ /**
141
+ * A preview of the order, in the minor unit, from the prices the host published: what to show
142
+ * while choosing. The host prices the order when it starts; show its total after that.
143
+ */
144
+ export declare function estimate(event: EventOnSale, quantities: Quantities): {
145
+ full: number;
146
+ deposit: number | null;
147
+ currency: string | null;
148
+ };
149
+ /** The most the picker offers of one type: its declared most per order, or 10 as the host does. */
150
+ export declare function pickerMax(type: TicketTypeOnSale): number;
151
+ /** What the confirmation page says about an order, from its real state. */
152
+ export declare function orderStatus(order: BuyerOrder): {
153
+ kind: "waiting" | "paid" | "part_paid" | "closed";
154
+ title: string;
155
+ /** True while the page should keep asking: the provider's word has not arrived yet. */
156
+ waiting: boolean;
157
+ };
158
+ /** The app's `useQuery`, as far as these hooks use it. */
159
+ export type UseQuery = <T>(options: {
160
+ queryKey: readonly unknown[];
161
+ queryFn: () => Promise<T>;
162
+ /** Asked again every this many ms while it returns a number (TanStack's refetchInterval). */
163
+ refetchInterval?: ((query: {
164
+ state: {
165
+ data: T | undefined;
166
+ };
167
+ }) => number | false) | number | false;
168
+ enabled?: boolean;
169
+ }) => {
170
+ data: T | undefined;
171
+ isPending: boolean;
172
+ error: unknown;
173
+ };
174
+ /** The app's `useMutation`, as far as these hooks use it. */
175
+ export type UseMutation = <I, O>(options: {
176
+ mutationKey: readonly unknown[];
177
+ mutationFn: (input: I) => Promise<O>;
178
+ }) => {
179
+ mutate(input: I): void;
180
+ mutateAsync(input: I): Promise<O>;
181
+ data: O | undefined;
182
+ isPending: boolean;
183
+ error: unknown;
184
+ };
185
+ /** The app's `useState`. */
186
+ export type UseState = <T>(initial: T) => [T, (next: T | ((previous: T) => T)) => void];
187
+ /** How often the confirmation page asks again while an order is pending. */
188
+ export declare const WAITING_POLL_MS = 2000;
189
+ /**
190
+ * The operations each hook calls (ADR 0453). A client gets the hooks whose operations it holds:
191
+ * the door role's client gets `useCheckIn`, `useUndoCheckIn` and `useTicketPicker`, a customer's
192
+ * client the buying hooks, the staff client all of them.
193
+ */
194
+ export declare const TICKETING_HOOKS_CALL: {
195
+ readonly useEventsOnSale: readonly ["x.ticketing.eventsOnSale"];
196
+ readonly useTicketPicker: readonly [];
197
+ readonly useStartOrder: readonly ["x.ticketing.orderStart"];
198
+ readonly useCheckout: readonly ["order.checkout"];
199
+ readonly useOrder: readonly ["order.view", "order.get"];
200
+ readonly useMyTickets: readonly ["x.ticketing.myTickets"];
201
+ readonly useCheckIn: readonly ["x.ticketing.checkIn"];
202
+ readonly useUndoCheckIn: readonly ["x.ticketing.undoCheckIn"];
203
+ };
204
+ /**
205
+ * Hooks for a React or React Native app:
206
+ * `const ticketing = createTicketingHooks({ useQuery, useMutation, useState }, api)`. `api` is any
207
+ * generated client: the customer's, a pack role's (`roles/ticketing.door.ts`) or the staff one.
208
+ * The hooks it cannot back are not there, and calling one does not compile.
209
+ */
210
+ export declare function createTicketingHooks<C extends ClientHolding>(react: {
211
+ useQuery: UseQuery;
212
+ useMutation: UseMutation;
213
+ useState: UseState;
214
+ }, client: C): import("@composable-os/client").HooksFor<{
215
+ /** The events on sale (or one), with their ticket types and places. */
216
+ useEventsOnSale(input?: In<"x.ticketing.eventsOnSale">): {
217
+ data: {
218
+ events: {
219
+ id: string;
220
+ name: string | null;
221
+ startsAt: string | null;
222
+ endsAt: string | null;
223
+ timeZone: string | null;
224
+ venue: string | null;
225
+ description: string | null;
226
+ image: string | null;
227
+ availability: {
228
+ status: "available" | "low" | "sold_out";
229
+ available?: number | null | undefined;
230
+ };
231
+ ticketTypes: {
232
+ id: string;
233
+ name: string | null;
234
+ description: string | null;
235
+ price: number | null;
236
+ currency: string | null;
237
+ onSaleFrom: string | null;
238
+ onSaleUntil: string | null;
239
+ maxPerOrder: number | null;
240
+ deposit: number | null;
241
+ balanceDue: string | null;
242
+ availability: {
243
+ status: "available" | "low" | "sold_out";
244
+ available?: number | null | undefined;
245
+ };
246
+ }[];
247
+ }[];
248
+ } | undefined;
249
+ isPending: boolean;
250
+ error: unknown;
251
+ };
252
+ /** Quantities for one event's ticket types, the lines to start with and the preview. */
253
+ useTicketPicker(event: EventOnSale | undefined): {
254
+ quantities: Readonly<Record<string, number>>;
255
+ set: (ticketTypeId: string, quantity: number) => void;
256
+ lines: {
257
+ ticketTypeId: string;
258
+ quantity: number;
259
+ }[];
260
+ estimate: {
261
+ full: number;
262
+ deposit: number | null;
263
+ currency: string | null;
264
+ };
265
+ empty: boolean;
266
+ max: (type: TicketTypeOnSale) => number;
267
+ clear: () => void;
268
+ };
269
+ /** Starts the order through the host, which prices it and holds the places. */
270
+ useStartOrder(): {
271
+ mutate(input: {
272
+ lines: {
273
+ ticketTypeId: string;
274
+ quantity?: number | undefined;
275
+ }[];
276
+ pay?: "deposit" | "full" | undefined;
277
+ email?: string | undefined;
278
+ }): void;
279
+ mutateAsync(input: {
280
+ lines: {
281
+ ticketTypeId: string;
282
+ quantity?: number | undefined;
283
+ }[];
284
+ pay?: "deposit" | "full" | undefined;
285
+ email?: string | undefined;
286
+ }): Promise<{
287
+ id: string;
288
+ state: string;
289
+ currency: string;
290
+ total: number;
291
+ paid: number;
292
+ balance: number;
293
+ pay: string;
294
+ deposit: number | null;
295
+ balanceDueAt: string | null;
296
+ expiresAt: string | null;
297
+ lines: {
298
+ id: string;
299
+ ticketTypeId: string;
300
+ title: string;
301
+ quantity: number;
302
+ unitPrice: number;
303
+ total: number;
304
+ }[];
305
+ token: string | null;
306
+ }>;
307
+ data: {
308
+ id: string;
309
+ state: string;
310
+ currency: string;
311
+ total: number;
312
+ paid: number;
313
+ balance: number;
314
+ pay: string;
315
+ deposit: number | null;
316
+ balanceDueAt: string | null;
317
+ expiresAt: string | null;
318
+ lines: {
319
+ id: string;
320
+ ticketTypeId: string;
321
+ title: string;
322
+ quantity: number;
323
+ unitPrice: number;
324
+ total: number;
325
+ }[];
326
+ token: string | null;
327
+ } | undefined;
328
+ isPending: boolean;
329
+ error: unknown;
330
+ };
331
+ /** Opens the payment provider's page for an order (the first payment, or a balance). */
332
+ useCheckout(): {
333
+ mutate(input: {
334
+ id: string;
335
+ token?: string;
336
+ returnUrl: string;
337
+ amount?: number;
338
+ }): void;
339
+ mutateAsync(input: {
340
+ id: string;
341
+ token?: string;
342
+ returnUrl: string;
343
+ amount?: number;
344
+ }): Promise<{
345
+ url: string;
346
+ amount: number;
347
+ }>;
348
+ data: {
349
+ url: string;
350
+ amount: number;
351
+ } | undefined;
352
+ isPending: boolean;
353
+ error: unknown;
354
+ };
355
+ /** One order as its buyer sees it, asked again while it is waiting for the provider. */
356
+ useOrder(order: {
357
+ id: string;
358
+ token?: string | null;
359
+ } | null): {
360
+ data: BuyerOrder | undefined;
361
+ isPending: boolean;
362
+ error: unknown;
363
+ };
364
+ /** The signed-in customer's own tickets. */
365
+ useMyTickets(input?: In<"x.ticketing.myTickets">): {
366
+ data: {
367
+ items: {
368
+ id: string;
369
+ event: string | null;
370
+ ticketType: string | null;
371
+ code: string | null;
372
+ state: string | null;
373
+ eventName: string | null;
374
+ startsAt: string | null;
375
+ endsAt: string | null;
376
+ timeZone: string | null;
377
+ venue: string | null;
378
+ eventStatus: string | null;
379
+ ticketTypeName: string | null;
380
+ }[];
381
+ nextCursor: string | null;
382
+ } | undefined;
383
+ isPending: boolean;
384
+ error: unknown;
385
+ };
386
+ /** Checks a ticket in by its code (staff, or a door account). */
387
+ useCheckIn(): {
388
+ mutate(input: {
389
+ code: string;
390
+ }): void;
391
+ mutateAsync(input: {
392
+ code: string;
393
+ }): Promise<{
394
+ result: "void" | "unknown" | "accepted" | "already_used";
395
+ accepted: boolean;
396
+ message: string;
397
+ ticket: {
398
+ id: string;
399
+ name: string | null;
400
+ event: string | null;
401
+ ticketType: string | null;
402
+ holder: {
403
+ id: string;
404
+ name: string | null;
405
+ } | null;
406
+ state: string | null;
407
+ usedAt: string | null;
408
+ usedBy: {
409
+ id: string;
410
+ name: string | null;
411
+ } | null;
412
+ } | null;
413
+ balanceOwing: {
414
+ amount: number;
415
+ currency: string;
416
+ dueAt: string | null;
417
+ } | null;
418
+ }>;
419
+ data: {
420
+ result: "void" | "unknown" | "accepted" | "already_used";
421
+ accepted: boolean;
422
+ message: string;
423
+ ticket: {
424
+ id: string;
425
+ name: string | null;
426
+ event: string | null;
427
+ ticketType: string | null;
428
+ holder: {
429
+ id: string;
430
+ name: string | null;
431
+ } | null;
432
+ state: string | null;
433
+ usedAt: string | null;
434
+ usedBy: {
435
+ id: string;
436
+ name: string | null;
437
+ } | null;
438
+ } | null;
439
+ balanceOwing: {
440
+ amount: number;
441
+ currency: string;
442
+ dueAt: string | null;
443
+ } | null;
444
+ } | undefined;
445
+ isPending: boolean;
446
+ error: unknown;
447
+ };
448
+ /** Undoes a check-in made by mistake. */
449
+ useUndoCheckIn(): {
450
+ mutate(input: {
451
+ ticketId: string;
452
+ }): void;
453
+ mutateAsync(input: {
454
+ ticketId: string;
455
+ }): Promise<{
456
+ undone: boolean;
457
+ message: string;
458
+ ticket: {
459
+ id: string;
460
+ name: string | null;
461
+ event: string | null;
462
+ ticketType: string | null;
463
+ holder: {
464
+ id: string;
465
+ name: string | null;
466
+ } | null;
467
+ state: string | null;
468
+ usedAt: string | null;
469
+ usedBy: {
470
+ id: string;
471
+ name: string | null;
472
+ } | null;
473
+ };
474
+ }>;
475
+ data: {
476
+ undone: boolean;
477
+ message: string;
478
+ ticket: {
479
+ id: string;
480
+ name: string | null;
481
+ event: string | null;
482
+ ticketType: string | null;
483
+ holder: {
484
+ id: string;
485
+ name: string | null;
486
+ } | null;
487
+ state: string | null;
488
+ usedAt: string | null;
489
+ usedBy: {
490
+ id: string;
491
+ name: string | null;
492
+ } | null;
493
+ };
494
+ } | undefined;
495
+ isPending: boolean;
496
+ error: unknown;
497
+ };
498
+ }, {
499
+ readonly useEventsOnSale: readonly ["x.ticketing.eventsOnSale"];
500
+ readonly useTicketPicker: readonly [];
501
+ readonly useStartOrder: readonly ["x.ticketing.orderStart"];
502
+ readonly useCheckout: readonly ["order.checkout"];
503
+ readonly useOrder: readonly ["order.view", "order.get"];
504
+ readonly useMyTickets: readonly ["x.ticketing.myTickets"];
505
+ readonly useCheckIn: readonly ["x.ticketing.checkIn"];
506
+ readonly useUndoCheckIn: readonly ["x.ticketing.undoCheckIn"];
507
+ }, import("@composable-os/client").OperationsOf<C>>;
508
+ declare function allTicketingHooks(react: {
509
+ useQuery: UseQuery;
510
+ useMutation: UseMutation;
511
+ useState: UseState;
512
+ }, api: TicketingClient): {
513
+ /** The events on sale (or one), with their ticket types and places. */
514
+ useEventsOnSale(input?: In<"x.ticketing.eventsOnSale">): {
515
+ data: {
516
+ events: {
517
+ id: string;
518
+ name: string | null;
519
+ startsAt: string | null;
520
+ endsAt: string | null;
521
+ timeZone: string | null;
522
+ venue: string | null;
523
+ description: string | null;
524
+ image: string | null;
525
+ availability: {
526
+ status: "available" | "low" | "sold_out";
527
+ available?: number | null | undefined;
528
+ };
529
+ ticketTypes: {
530
+ id: string;
531
+ name: string | null;
532
+ description: string | null;
533
+ price: number | null;
534
+ currency: string | null;
535
+ onSaleFrom: string | null;
536
+ onSaleUntil: string | null;
537
+ maxPerOrder: number | null;
538
+ deposit: number | null;
539
+ balanceDue: string | null;
540
+ availability: {
541
+ status: "available" | "low" | "sold_out";
542
+ available?: number | null | undefined;
543
+ };
544
+ }[];
545
+ }[];
546
+ } | undefined;
547
+ isPending: boolean;
548
+ error: unknown;
549
+ };
550
+ /** Quantities for one event's ticket types, the lines to start with and the preview. */
551
+ useTicketPicker(event: EventOnSale | undefined): {
552
+ quantities: Readonly<Record<string, number>>;
553
+ set: (ticketTypeId: string, quantity: number) => void;
554
+ lines: {
555
+ ticketTypeId: string;
556
+ quantity: number;
557
+ }[];
558
+ estimate: {
559
+ full: number;
560
+ deposit: number | null;
561
+ currency: string | null;
562
+ };
563
+ empty: boolean;
564
+ max: (type: TicketTypeOnSale) => number;
565
+ clear: () => void;
566
+ };
567
+ /** Starts the order through the host, which prices it and holds the places. */
568
+ useStartOrder(): {
569
+ mutate(input: {
570
+ lines: {
571
+ ticketTypeId: string;
572
+ quantity?: number | undefined;
573
+ }[];
574
+ pay?: "deposit" | "full" | undefined;
575
+ email?: string | undefined;
576
+ }): void;
577
+ mutateAsync(input: {
578
+ lines: {
579
+ ticketTypeId: string;
580
+ quantity?: number | undefined;
581
+ }[];
582
+ pay?: "deposit" | "full" | undefined;
583
+ email?: string | undefined;
584
+ }): Promise<{
585
+ id: string;
586
+ state: string;
587
+ currency: string;
588
+ total: number;
589
+ paid: number;
590
+ balance: number;
591
+ pay: string;
592
+ deposit: number | null;
593
+ balanceDueAt: string | null;
594
+ expiresAt: string | null;
595
+ lines: {
596
+ id: string;
597
+ ticketTypeId: string;
598
+ title: string;
599
+ quantity: number;
600
+ unitPrice: number;
601
+ total: number;
602
+ }[];
603
+ token: string | null;
604
+ }>;
605
+ data: {
606
+ id: string;
607
+ state: string;
608
+ currency: string;
609
+ total: number;
610
+ paid: number;
611
+ balance: number;
612
+ pay: string;
613
+ deposit: number | null;
614
+ balanceDueAt: string | null;
615
+ expiresAt: string | null;
616
+ lines: {
617
+ id: string;
618
+ ticketTypeId: string;
619
+ title: string;
620
+ quantity: number;
621
+ unitPrice: number;
622
+ total: number;
623
+ }[];
624
+ token: string | null;
625
+ } | undefined;
626
+ isPending: boolean;
627
+ error: unknown;
628
+ };
629
+ /** Opens the payment provider's page for an order (the first payment, or a balance). */
630
+ useCheckout(): {
631
+ mutate(input: {
632
+ id: string;
633
+ token?: string;
634
+ returnUrl: string;
635
+ amount?: number;
636
+ }): void;
637
+ mutateAsync(input: {
638
+ id: string;
639
+ token?: string;
640
+ returnUrl: string;
641
+ amount?: number;
642
+ }): Promise<{
643
+ url: string;
644
+ amount: number;
645
+ }>;
646
+ data: {
647
+ url: string;
648
+ amount: number;
649
+ } | undefined;
650
+ isPending: boolean;
651
+ error: unknown;
652
+ };
653
+ /** One order as its buyer sees it, asked again while it is waiting for the provider. */
654
+ useOrder(order: {
655
+ id: string;
656
+ token?: string | null;
657
+ } | null): {
658
+ data: BuyerOrder | undefined;
659
+ isPending: boolean;
660
+ error: unknown;
661
+ };
662
+ /** The signed-in customer's own tickets. */
663
+ useMyTickets(input?: In<"x.ticketing.myTickets">): {
664
+ data: {
665
+ items: {
666
+ id: string;
667
+ event: string | null;
668
+ ticketType: string | null;
669
+ code: string | null;
670
+ state: string | null;
671
+ eventName: string | null;
672
+ startsAt: string | null;
673
+ endsAt: string | null;
674
+ timeZone: string | null;
675
+ venue: string | null;
676
+ eventStatus: string | null;
677
+ ticketTypeName: string | null;
678
+ }[];
679
+ nextCursor: string | null;
680
+ } | undefined;
681
+ isPending: boolean;
682
+ error: unknown;
683
+ };
684
+ /** Checks a ticket in by its code (staff, or a door account). */
685
+ useCheckIn(): {
686
+ mutate(input: {
687
+ code: string;
688
+ }): void;
689
+ mutateAsync(input: {
690
+ code: string;
691
+ }): Promise<{
692
+ result: "void" | "unknown" | "accepted" | "already_used";
693
+ accepted: boolean;
694
+ message: string;
695
+ ticket: {
696
+ id: string;
697
+ name: string | null;
698
+ event: string | null;
699
+ ticketType: string | null;
700
+ holder: {
701
+ id: string;
702
+ name: string | null;
703
+ } | null;
704
+ state: string | null;
705
+ usedAt: string | null;
706
+ usedBy: {
707
+ id: string;
708
+ name: string | null;
709
+ } | null;
710
+ } | null;
711
+ balanceOwing: {
712
+ amount: number;
713
+ currency: string;
714
+ dueAt: string | null;
715
+ } | null;
716
+ }>;
717
+ data: {
718
+ result: "void" | "unknown" | "accepted" | "already_used";
719
+ accepted: boolean;
720
+ message: string;
721
+ ticket: {
722
+ id: string;
723
+ name: string | null;
724
+ event: string | null;
725
+ ticketType: string | null;
726
+ holder: {
727
+ id: string;
728
+ name: string | null;
729
+ } | null;
730
+ state: string | null;
731
+ usedAt: string | null;
732
+ usedBy: {
733
+ id: string;
734
+ name: string | null;
735
+ } | null;
736
+ } | null;
737
+ balanceOwing: {
738
+ amount: number;
739
+ currency: string;
740
+ dueAt: string | null;
741
+ } | null;
742
+ } | undefined;
743
+ isPending: boolean;
744
+ error: unknown;
745
+ };
746
+ /** Undoes a check-in made by mistake. */
747
+ useUndoCheckIn(): {
748
+ mutate(input: {
749
+ ticketId: string;
750
+ }): void;
751
+ mutateAsync(input: {
752
+ ticketId: string;
753
+ }): Promise<{
754
+ undone: boolean;
755
+ message: string;
756
+ ticket: {
757
+ id: string;
758
+ name: string | null;
759
+ event: string | null;
760
+ ticketType: string | null;
761
+ holder: {
762
+ id: string;
763
+ name: string | null;
764
+ } | null;
765
+ state: string | null;
766
+ usedAt: string | null;
767
+ usedBy: {
768
+ id: string;
769
+ name: string | null;
770
+ } | null;
771
+ };
772
+ }>;
773
+ data: {
774
+ undone: boolean;
775
+ message: string;
776
+ ticket: {
777
+ id: string;
778
+ name: string | null;
779
+ event: string | null;
780
+ ticketType: string | null;
781
+ holder: {
782
+ id: string;
783
+ name: string | null;
784
+ } | null;
785
+ state: string | null;
786
+ usedAt: string | null;
787
+ usedBy: {
788
+ id: string;
789
+ name: string | null;
790
+ } | null;
791
+ };
792
+ } | undefined;
793
+ isPending: boolean;
794
+ error: unknown;
795
+ };
796
+ };
797
+ /** Every hook of this entry, as a client of all its operations gets them. A block takes the ones it calls: `Pick<TicketingHooks, "useCheckIn">`. */
798
+ export type TicketingHooks = ReturnType<typeof allTicketingHooks>;
799
+ export {};