-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph.ts
9210 lines (8653 loc) · 285 KB
/
graph.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
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
252
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import gql from "graphql-tag";
import { GraphQLClient } from "graphql-request";
import * as Dom from "graphql-request/dist/types.dom";
export type Maybe<T> = T | undefined;
export type Exact<T extends { [key: string]: unknown }> = {
[K in keyof T]: T[K];
};
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
[SubKey in K]?: Maybe<T[SubKey]>;
};
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
[SubKey in K]: Maybe<T[SubKey]>;
};
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
String: string;
Boolean: boolean;
Int: number;
Float: number;
/** Represents a set of geographical coordinates */
Coordinates: any;
/**
* The `Date` scalar type represents a timezone agnostic date, formatted as an
* ISO8601 date string, i.e. `YYYY-MM-DD`.
*/
Date: any;
/**
* The `DateTime` scalar type represents a datetime formatted as an ISO8601
* string.
*/
DateTime: any;
/**
* The `Interval` scalar type represents a time interval, formatted as an
* ISO8601 duration string.
*/
DurationInterval: any;
/**
* Email address validated as an RFC 5322 addr-spec.
*
* See <https://tools.ietf.org/html/rfc5322#section-3.4.1> for more details and
* <https://tools.ietf.org/html/rfc3696#section-3> for an informational summary.
*/
Email: any;
/**
* Represents an amount of money as an integer of the smallest currency unit.
*
* For example, 1 USD is `100` since the cent is the smallest currency unit.
* Similarly, 1 JPY is `1` because the Japanese yen is a zero-decimal currency.
* For more information, see the ISO 4217 standard.
*
* The applicable currency is specified separately.
*/
Money: any;
/**
* The `NaiveDateTime` scalar type represents a datetime formatted as an ISO 8601
* string, without an associated time zone.
*/
NaiveDateTime: any;
/**
* The PhoneNumber scalar type represents a phone number formatted following the E.164
* internationally recognized standard.
*/
PhoneNumber: any;
/**
* A String query is a text search made up of values and comparison operators.
*
* Supported value types:
*
* - Field name
* - String
* - Boolean
* - Number (float/int)
* - DateTime - formatted as an ISO 8601 string
*
* We also support 'IS NULL' and 'IS NOT NULL' operators.
*
* Examples:
*
* "startAt <= '2020-01-01T00:00:00'
*
* "quantity > 0"
*
* "categoryId IS NULL"
*
* Comparisons (<value> <op> <value>) can be combined through the 'AND' and 'OR' operators.
*
* Examples:
*
* "endAt < '2020-01-01T00:00:00' AND cancelled = true"
*
* Create precedence by surrounding comparisons with parenthesis.
*
* Note: Strings and field names are case sensitive.
*/
QueryString: any;
/**
* Represents a time zone as a tz database (a.k.a. tzdata, IANA, Olson) time zone
* name. See <https://en.wikipedia.org/wiki/Tz_database> for more information.
*/
Tz: any;
/** Represents an absolute URL as defined by RFC3986 */
Url: any;
};
export type AddCartCardPaymentMethodInput = {
/** ID of the cart */
id: Scalars["ID"];
/**
* Whether to automatically select this credit card as the payment method
* for the cart, false by default.
*/
select?: Maybe<Scalars["Boolean"]>;
/** Credit card token obtained from the Credit Card Tokenization endpoint. */
token: Scalars["ID"];
};
export type AddCartCardPaymentMethodPayload = {
__typename?: "AddCartCardPaymentMethodPayload";
cart: Cart;
};
export type AddCartOfferInput = {
/** ID of the cart */
id: Scalars["ID"];
/** The offer code identifier */
offerCode: Scalars["String"];
};
export type AddCartOfferPayload = {
__typename?: "AddCartOfferPayload";
cart: Cart;
offer: CartOffer;
};
export type AddCartSelectedBookableItemInput = {
/** ID of the cart. */
id: Scalars["ID"];
/**
* Optional discount code applied to the item. Invalid discount codes are
* ignored without an error, check `discountCode` on the selected item to see
* if the code was valid.
*/
itemDiscountCode?: Maybe<Scalars["String"]>;
/**
* Optional ID that identifies the guest this item is booked for. A null
* value indicates the cart owner, or current client.
*
* When finding available times for bookable items, it's assumed that two
* items having different guests can be booked simultaneously.
*/
itemGuestId?: Maybe<Scalars["ID"]>;
/** ID of the bookable item. */
itemId: Scalars["ID"];
/**
* Optional IDs of selected bookable item options. Note that the selections
* must conform to the option group requirements, e.g. limits on the number
* of options. Otherwise an error is returned.
*/
itemOptionIds?: Maybe<Array<Scalars["ID"]>>;
/** Optional ID of the selected bookable item staff variant. */
itemStaffVariantId?: Maybe<Scalars["ID"]>;
};
export type AddCartSelectedBookableItemPayload = {
__typename?: "AddCartSelectedBookableItemPayload";
cart: Cart;
};
export type AddCartSelectedGiftCardItemInput = {
/** ID of the cart. */
id: Scalars["ID"];
/** ID of the gift card item. */
itemId: Scalars["ID"];
/**
* Price applied to the gift card item. See cartAvailableGiftCardItem.minPrice
* and maxPrice for limits
*/
itemPrice: Scalars["Money"];
};
export type AddCartSelectedGiftCardItemPayload = {
__typename?: "AddCartSelectedGiftCardItemPayload";
cart: Cart;
};
export type AddCartSelectedPurchasableItemInput = {
/** ID of the cart. */
id: Scalars["ID"];
/**
* Optional discount code applied to the item. Invalid discount codes are
* ignored without an error, check `discountCode` on the selected item to see
* if the code was valid.
*/
itemDiscountCode?: Maybe<Scalars["String"]>;
/** ID of the purchasable item. */
itemId: Scalars["ID"];
};
export type AddCartSelectedPurchasableItemPayload = {
__typename?: "AddCartSelectedPurchasableItemPayload";
cart: Cart;
};
export type Address = {
__typename?: "Address";
city?: Maybe<Scalars["String"]>;
country?: Maybe<Scalars["String"]>;
line1?: Maybe<Scalars["String"]>;
line2?: Maybe<Scalars["String"]>;
province?: Maybe<Scalars["String"]>;
state?: Maybe<Scalars["String"]>;
zip?: Maybe<Scalars["String"]>;
};
export type AddressInput = {
city?: Maybe<Scalars["String"]>;
country?: Maybe<Scalars["String"]>;
line1?: Maybe<Scalars["String"]>;
line2?: Maybe<Scalars["String"]>;
name?: Maybe<Scalars["String"]>;
province?: Maybe<Scalars["String"]>;
state?: Maybe<Scalars["String"]>;
zip?: Maybe<Scalars["String"]>;
};
/** An Appointment */
export type Appointment = Node & {
__typename?: "Appointment";
/**
* Service options chosen with this appointment service and their true values,
* which may be changed from the option definition default values.
*
* The `AppointmentServiceOption` type doesn’t expose associated nodes; this
* is intentional and avoids duplicating data when querying grouped options.
* You should query the option groups through the `service` node instead and
* group the options based on IDs.
*/
appointmentServiceOptions: Array<AppointmentServiceOption>;
/** A collection of appointment services. */
appointmentServices: Array<AppointmentService>;
/** Links to allow direct addition of the appointment to different calendar platforms */
calendarLinks: CalendarLinks;
/** Whether or not the client can cancel this appointment */
cancellable: Scalars["Boolean"];
/** Information about the cancellation, if present */
cancellation?: Maybe<AppointmentCancellation>;
/** Boolean signifying if the appointment is cancelled or not */
cancelled: Scalars["Boolean"];
/** The client of the appointment */
client: Client;
/** The duration of the appointment for the client */
clientDuration: Scalars["Int"];
/** The id of the client of the appointment. */
clientId: Scalars["ID"];
/** Whether or not the client can confirm this appointment at this time */
confirmable: Scalars["Boolean"];
/** When the appointment was created (in Etc/UTC) */
createdAt: Scalars["DateTime"];
/** A collection of approved payment methods for the appointment. */
creditCards?: Maybe<Array<CreditCard>>;
/** Forms added to this appointment */
customForms: Array<CustomForm>;
/**
* The duration of the appointment
* @deprecated Use `clientDuration` instead.
*/
duration: Scalars["Int"];
/** End time for the appointment */
endAt: Scalars["DateTime"];
/** The ID of an object */
id: Scalars["ID"];
/** Whether or not the appointment is a group appointment */
isGroup: Scalars["Boolean"];
/** Whether or not the appointment is recurring */
isRecurring: Scalars["Boolean"];
/** The Location where this appointment was booked. */
location: Location;
/** The Id of the Location where this appointment was booked. */
locationId: Scalars["ID"];
/** Non reschedulable reason for this appointment will return null if it's reschedulable */
nonReschedulableReason?: Maybe<AppointmentNonReschedulableReason>;
/** Notes provided by the client during booking */
notes?: Maybe<Scalars["String"]>;
/** Custom forms templates which should be filled out */
pendingFormTemplates: Array<CustomFormTemplate>;
/** Whether or not the client can reschedule this appointment */
reschedulable: Scalars["Boolean"];
/** Start time for the appointment */
startAt: Scalars["DateTime"];
/** The state of the appointment. */
state: AppointmentState;
};
/** An Appointment */
export type AppointmentPendingFormTemplatesArgs = {
format?: Maybe<FormPresentationFormat>;
};
export type AppointmentAddTagsInput = {
cartId: Scalars["ID"];
id: Scalars["ID"];
tagIds: Array<Scalars["ID"]>;
};
export type AppointmentAddTagsPayload = {
__typename?: "AppointmentAddTagsPayload";
success: Scalars["Boolean"];
};
export type AppointmentCancellation = {
__typename?: "AppointmentCancellation";
/** Datetime the appointment was cancelled in UTC. */
cancelledAt: Scalars["DateTime"];
notes?: Maybe<Scalars["String"]>;
reason: AppointmentCancellationReason;
};
export enum AppointmentCancellationReason {
ClientCancel = "CLIENT_CANCEL",
ClientLateCancel = "CLIENT_LATE_CANCEL",
Merged = "MERGED",
Mistake = "MISTAKE",
NoShow = "NO_SHOW",
StaffCancel = "STAFF_CANCEL",
Voided = "VOIDED"
}
export type AppointmentConnection = {
__typename?: "AppointmentConnection";
edges?: Maybe<Array<Maybe<AppointmentEdge>>>;
pageInfo: PageInfo;
};
export type AppointmentEdge = {
__typename?: "AppointmentEdge";
cursor?: Maybe<Scalars["String"]>;
node?: Maybe<Appointment>;
};
export enum AppointmentNonReschedulableReason {
CancelledAppointment = "CANCELLED_APPOINTMENT",
GroupAppointment = "GROUP_APPOINTMENT",
OnlineBookingNotAllowed = "ONLINE_BOOKING_NOT_ALLOWED",
OutsideCancellationWindow = "OUTSIDE_CANCELLATION_WINDOW",
ServiceNotBookable = "SERVICE_NOT_BOOKABLE"
}
export type AppointmentRescheduleAvailableDatesInput = {
/** The ID of the appointment that needs to be rescheduled. */
appointmentId: Scalars["ID"];
/** The lower range (inclusive) of dates to search for appointment availability. */
searchRangeLower: Scalars["Date"];
/** The upper range (inclusive) of dates to search for appointment availability. */
searchRangeUpper: Scalars["Date"];
/**
* Optional time zone the matches should be converted to, e.g. the client's
* time zone. The search range dates are also interpreted using this. When
* null, the location's time zone is used.
*/
tz?: Maybe<Scalars["Tz"]>;
};
export type AppointmentRescheduleAvailableDatesPayload = {
__typename?: "AppointmentRescheduleAvailableDatesPayload";
availableDates: Array<AvailableRescheduleDate>;
};
export type AppointmentRescheduleAvailableTimesInput = {
/** The ID of the appointment that needs to be rescheduled. */
appointmentId: Scalars["ID"];
/** The date that should be searched for available times. */
date: Scalars["Date"];
/**
* Optional time zone the matches should be converted to, e.g. the client's
* time zone. When null, the location's time zone is used.
*/
tz?: Maybe<Scalars["Tz"]>;
};
export type AppointmentRescheduleAvailableTimesPayload = {
__typename?: "AppointmentRescheduleAvailableTimesPayload";
availableTimes: Array<AvailableRescheduleTime>;
};
export type AppointmentRescheduleInput = {
/** The ID of the appointment that needs to be rescheduled. */
appointmentId: Scalars["ID"];
/**
* The encoded data representing an available appointment slot (can be computed
* using the appointmentRescheduleAvailableTimes mutation).
*/
bookableTimeId: Scalars["ID"];
/**
* Creates a notification for the dashboard users to let them know that the appointment has
* been self-rescheduled by the client.
*/
sendNotification: Scalars["Boolean"];
};
export type AppointmentReschedulePayload = {
__typename?: "AppointmentReschedulePayload";
appointment: Appointment;
};
/** An AppointmentService */
export type AppointmentService = {
__typename?: "AppointmentService";
/** Duration for the entire service (including add-ons) */
duration: Scalars["Int"];
/** The ISO time at which the appointment service is completely finished. */
endAt: Scalars["DateTime"];
/** Price of the service, before any discounts or taxes are applied. */
price: Scalars["Money"];
/** The service. */
service: Service;
/** The id of the service. This may be null for time blockers. */
serviceId: Scalars["ID"];
/** The staff performing this service. */
staff: Staff;
/** The ID of the staff member associated with this service */
staffId: Scalars["ID"];
/** A boolean indicating whether the staff was specifically requested by the client. */
staffRequested: Scalars["Boolean"];
/** The ISO time at which the appointment service begins */
startAt: Scalars["DateTime"];
/** Length of time (in minutes) from the start of the appointment until this service begins. */
startTimeOffset: Scalars["Int"];
/** The total duration (in minutes) of this service */
totalDuration: Scalars["Int"];
};
/** An AppointmentServiceOption */
export type AppointmentServiceOption = Node & {
__typename?: "AppointmentServiceOption";
/** ID of the AppointmentService that this object relates to. */
appointmentServiceId: Scalars["ID"];
/** Minutes added to duration when selected. */
durationDelta: Scalars["Int"];
/** Minutes added to finish when selected. */
finishDurationDelta: Scalars["Int"];
/** The ID of an object */
id: Scalars["ID"];
/** Minutes added to the post service client time. */
postClientDurationDelta: Scalars["Int"];
/** Minutes added to the post service staff time. */
postStaffDurationDelta: Scalars["Int"];
/** Amount added to price when selected. */
priceDelta: Scalars["Int"];
/** ID of the ServiceOption that this object relates to. */
serviceOptionId: Scalars["ID"];
};
export type AppointmentSort = {
direction?: Maybe<AppointmentSortDirection>;
field?: Maybe<AppointmentSortField>;
};
export enum AppointmentSortDirection {
Asc = "ASC",
Desc = "DESC"
}
export enum AppointmentSortField {
StartAt = "START_AT"
}
export enum AppointmentState {
Active = "ACTIVE",
Arrived = "ARRIVED",
Booked = "BOOKED",
Cancelled = "CANCELLED",
Confirmed = "CONFIRMED",
Final = "FINAL"
}
export type AuthMethod = {
__typename?: "AuthMethod";
/** Auth method id */
id: Scalars["String"];
/** Auth method name */
label: Scalars["String"];
/** Auth method value */
value: Scalars["String"];
};
export type AvailableRescheduleDate = {
__typename?: "AvailableRescheduleDate";
/**
* Matched date for the booking.
*
* Note that this date may differ from the one at the location when a specific
* time zone is requested using the `tz` argument. The date uses the requested
* time zone, or the location's time zone when `tz` is null.
*/
date: Scalars["Date"];
};
export type AvailableRescheduleTime = {
__typename?: "AvailableRescheduleTime";
bookableTimeId: Scalars["ID"];
/** Matched start time for the booking. */
startTime: Scalars["DateTime"];
};
export type BaseBookableItem = {
__typename?: "BaseBookableItem";
/** The ID of the base bookable item */
itemId: Scalars["ID"];
/** Whether the current item has to use the same staff as the base item */
sameStaffVariantRequired: Scalars["Boolean"];
};
export type BookingQuestionOptionAnswerInput = {
optionId: Scalars["ID"];
};
/** The business */
export type Business = Node & {
__typename?: "Business";
/** A setting to let a business decide if a person with multiple client profiles can log in to one of their profiles */
allowLoginWithMultipleClients?: Maybe<Scalars["Boolean"]>;
/** The business logo */
avatar?: Maybe<Scalars["String"]>;
/** An optional URL to use to direct customers to a business's custom booking flow */
customBookingUrl?: Maybe<Scalars["String"]>;
/** The ID of an object */
id: Scalars["ID"];
insertedAt: Scalars["DateTime"];
/** Locations */
locations?: Maybe<LocationConnection>;
/** Flag for whether or not referral sources are managed by location */
manageReferralSourcesByLocation?: Maybe<Scalars["Boolean"]>;
/** Name of the business */
name: Scalars["String"];
onlineGiftCardSettings: OnlineGiftCardSettings;
/** The business's phone number. This could be an empty string. */
phoneNumber: Scalars["String"];
/** Client referral sources */
referralSources: Array<ReferralSource>;
/** The timezone associated with the business */
tz: Scalars["Tz"];
updatedAt: Scalars["DateTime"];
/** The business' website. This could be an empty string. */
website: Scalars["String"];
};
/** The business */
export type BusinessLocationsArgs = {
after?: Maybe<Scalars["String"]>;
before?: Maybe<Scalars["String"]>;
first?: Maybe<Scalars["Int"]>;
last?: Maybe<Scalars["Int"]>;
};
/** The business */
export type BusinessReferralSourcesArgs = {
categoryId?: Maybe<Scalars["ID"]>;
};
export type BusinessGiftCardDesign = {
__typename?: "BusinessGiftCardDesign";
design: GiftCardDesign;
id: Scalars["ID"];
selected: Scalars["Boolean"];
};
export type CalendarLinks = {
__typename?: "CalendarLinks";
/** A deep link to add the appointment directly to Google Calendar */
googleCalendar: Scalars["Url"];
/** A downloadable ICS file to use for native calendar applications */
icsDownload: Scalars["Url"];
/** A deep link to add the appointment directly to Microsoft Office 365 */
microsoftOffice: Scalars["Url"];
/** A deep link to add the appointment directly to Microsoft Outlook Online */
microsoftOutlook: Scalars["Url"];
/** A deep link to add the appointment directly to Yahoo Calendar */
yahooCalendar: Scalars["Url"];
};
export type CancelAppointmentInput = {
id: Scalars["ID"];
notes?: Maybe<Scalars["String"]>;
};
export type CancelAppointmentPayload = {
__typename?: "CancelAppointmentPayload";
appointment: Appointment;
};
export enum CardBrand {
Amex = "AMEX",
DinersClub = "DINERS_CLUB",
Discover = "DISCOVER",
Jcb = "JCB",
Mastercard = "MASTERCARD",
Visa = "VISA"
}
/** Represents a cart flow used for booking or purchasing things. */
export type Cart = Node & {
__typename?: "Cart";
/** Optional gratuity defined in advance for bookable items. */
advanceGratuity?: Maybe<CartAdvanceGratuity>;
/**
* Categories of items available to be checked out.
*
* Note that this list updates as the cart changes. For instance, some
* incompatible items may be disabled after others are added to the cart.
*
* Clients should retrieve this list again after mutations or make sure errors
* are handled when items cannot be added.
*/
availableCategories: Array<CartAvailableCategory>;
/**
* Finds one available item by its ID.
*
* Note that this item updates as the cart changes. For instance, incompatible
* items may be disabled after others are added to the cart. Clients should
* retrieve this item again after mutations or make sure errors are handled
* when items cannot be added.
*/
availableItem?: Maybe<CartAvailableItem>;
/**
* Payment methods available for this cart. Some methods may already be
* present, for instance when the current user is authenticated. Additional
* methods can be added using the `addCart...PaymentMethod` mutations.
*
* Note that not all of these payment methods can be used with every cart item.
* Subsets of supported payment methods are available through the item objects
* instead.
*/
availablePaymentMethods: Array<CartItemPaymentMethod>;
bookingQuestions: Array<CartBookingQuestion>;
/**
* Optional client information supplied when checking out on behalf of someone
* else than the current user.
*/
clientInformation?: Maybe<CartClientInformation>;
/** Optional message from the client to the business. */
clientMessage?: Maybe<Scalars["String"]>;
/**
* Timestamp of when the cart was completed.
*
* This field cannot be edited and once completed cannot be changed.
*/
completedAt?: Maybe<Scalars["DateTime"]>;
/**
* When the cart has reserved bookable items, the end time of the latest item.
* This value is `null` when there are no reservations.
*/
endTime?: Maybe<Scalars["NaiveDateTime"]>;
/** Current validation errors. */
errors: Array<CartError>;
/**
* When the cart has reserved bookable items, e.g. services with selected
* times, this is the timestamp when those reservations expire and must be
* renewed.
*
* This field is initially `null` when there are no reservations, and it's
* reset into the future when reservations are created or renewed.
*
* When reservations expire, the `CART_MISSING_ITEM_TIME` error is returned,
* and this timestamp will be in the past. To renew the reservations, call the
* `reserveCartBookableItems` mutation again.
*/
expiresAt?: Maybe<Scalars["DateTime"]>;
/** Features available to the cart. */
features: CartFeatures;
/** A list of guests added to the cart */
guests: Array<CartGuest>;
/** The ID of an object */
id: Scalars["ID"];
/** Timestamp when the cart was created. */
insertedAt: Scalars["DateTime"];
/** Location associated with the cart */
location?: Maybe<Location>;
/**
* A list of offers applied to the cart.
*
* Offers can be applied manually using `addCartOffer` and an offer code, but
* it's also possible for offers to be auto-applied. At this time auto-applied
* offers cannot be removed from the cart.
*/
offers: Array<CartOffer>;
/** Finds one selected item pending checkout by its ID. */
selectedItem?: Maybe<CartItem>;
/**
* All selected items pending checkout.
*
* Note that the ordering of this list is not stable, and may change depending
* on the current state of the cart.
*/
selectedItems: Array<CartItem>;
/**
* When the cart has reserved bookable items, the starting time of the earliest
* item. This value is `null` when there are no reservations.
*/
startTime?: Maybe<Scalars["NaiveDateTime"]>;
/**
* Selected starting time ID for the item, corresponds to the ID that was used
* to reserve the times. This value is `null` when there are no reservations.
*/
startTimeId?: Maybe<Scalars["ID"]>;
/** Summary of the cart, including e.g. line item totals. */
summary: CartSummary;
/** Timestamp when the cart was last updated. */
updatedAt: Scalars["DateTime"];
};
/** Represents a cart flow used for booking or purchasing things. */
export type CartAvailableItemArgs = {
id: Scalars["ID"];
};
/** Represents a cart flow used for booking or purchasing things. */
export type CartSelectedItemArgs = {
id: Scalars["ID"];
};
export type CartAddToWaitlistInput = {
/** ID of the cart. */
id: Scalars["ID"];
/** The preferred lower bound date and time of the bookable items. */
preferredTimeLower: Scalars["NaiveDateTime"];
/** The preferred upper bound date and time of the bookable items. */
preferredTimeUpper: Scalars["NaiveDateTime"];
/**
* Optional time zone the preferred times should be converted from, e.g. the client's
* time zone. If a timezone other than the default location's timezone was used when
* fetching bookable times, then that same timezone should be supplied in this mutation.
*/
tz?: Maybe<Scalars["Tz"]>;
};
export type CartAddToWaitlistPayload = {
__typename?: "CartAddToWaitlistPayload";
cart: Cart;
};
/** Gratuity set in advance for bookable items. */
export type CartAdvanceGratuity = {
__typename?: "CartAdvanceGratuity";
/** Fixed gratuity amount, has to be set if `percentage` is not set. */
fixed?: Maybe<Scalars["Money"]>;
/** Percentage gratuity amount, has to be set if `fixed` is not set. */
percentage?: Maybe<Scalars["Float"]>;
};
/** See `CartAdvanceGratuity`. */
export type CartAdvanceGratuityInput = {
fixed?: Maybe<Scalars["Money"]>;
percentage?: Maybe<Scalars["Float"]>;
};
export type CartAppointment = {
__typename?: "CartAppointment";
appointmentId: Scalars["ID"];
clientId: Scalars["ID"];
/** Whether an appointment belongs to the cart owner. */
forCartOwner: Scalars["Boolean"];
};
/** Item that can be booked through `addCartBookableItem`. */
export type CartAvailableBookableItem = CartAvailableItem & {
__typename?: "CartAvailableBookableItem";
/** Refer to the super type. */
description?: Maybe<Scalars["String"]>;
/** Refer to the super type. */
disabled: Scalars["Boolean"];
/** Refer to the super type. */
disabledDescription?: Maybe<Scalars["String"]>;
/** Refer to the super type. */
id: Scalars["ID"];
/**
* Displayed client duration in minutes.
* @deprecated Use `listDurationRange` instead.
*/
listDuration: Scalars["Int"];
/** Refer to the super type. */
listDurationRange: CartDurationRange;
/**
* Refer to the super type.
* @deprecated Use `listPriceRange` instead.
*/
listPrice: Scalars["Money"];
/** Refer to the super type. */
listPriceRange: CartPriceRange;
/**
* List of locations offering the selected bookable item.
*
* This is affected by:
*
* - Staff / staff role settings set for the services in the cart
* - The "Bookable online" option for a specific service/location pair
* - The "Enable online booking" option for a location
*
* Location has to be chosen before checking out the cart.
*
* Allows to be queried with an optional staffId to only return locations where the bookable item can be provided by selected staff.
*/
locationVariants: Array<CartAvailableBookableItemLocationVariant>;
/** Refer to the super type. */
name: Scalars["String"];
/**
* Groups of available options for modifying the booked service. These can be
* used to modify the booked item and may affect pricing and timing.
*/
optionGroups: Array<CartAvailableBookableItemOptionGroup>;
/**
* List of optional staff variants that can be chosen. Variants may have
* different pricing and timing.
*
* When there’s no preference, the first one available is assigned based on the
* selected time. The business can also enforce this, in which case this list
* is empty.
*/
staffVariants: Array<CartAvailableBookableItemStaffVariant>;
/**
* Whether duration varies per staff variant.
* @deprecated Use `listDurationRange` instead.
*/
variableDuration: Scalars["Boolean"];
/**
* Whether price varies per staff variant.
* @deprecated Use `listPriceRange` instead.
*/
variablePrice: Scalars["Boolean"];
};
/** Item that can be booked through `addCartBookableItem`. */
export type CartAvailableBookableItemLocationVariantsArgs = {
staffId?: Maybe<Scalars["ID"]>;
};
/** Location variant of a bookable item */
export type CartAvailableBookableItemLocationVariant = {
__typename?: "CartAvailableBookableItemLocationVariant";
location: Location;
};
/** Option of a bookable item that can be selected. */
export type CartAvailableBookableItemOption = {
__typename?: "CartAvailableBookableItemOption";
/** Short optional description. */
description?: Maybe<Scalars["String"]>;
/** Minutes added to duration when selected. */
durationDelta: Scalars["Int"];
/** Group ID of the option. */
groupId: Scalars["ID"];
/** ID of the option. */
id: Scalars["ID"];
/** Short human-readable name. */
name: Scalars["String"];
/** Amount added to price when selected. */
priceDelta: Scalars["Money"];
};
/**
* Option group of a bookable item with optional limits.
*
* Option groups have their own validation requirements which are validated when
* the bookable item is added. An error is returned if the selections don’t meet
* those requirements.
*/
export type CartAvailableBookableItemOptionGroup = {
__typename?: "CartAvailableBookableItemOptionGroup";
/** Short optional description. */
description?: Maybe<Scalars["String"]>;
/** ID of the option group. */
id: Scalars["ID"];
/** Optional maximum number of options that can be selected. */
maxLimit?: Maybe<Scalars["Int"]>;
/** Optional minimum number of options that must be selected. */
minLimit?: Maybe<Scalars["Int"]>;
/** Short human-readable name. */
name: Scalars["String"];
/** List of selectable options. */
options: Array<CartAvailableBookableItemOption>;
};
/** Staff variant of a bookable item. */
export type CartAvailableBookableItemStaffVariant = {
__typename?: "CartAvailableBookableItemStaffVariant";
/** Duration of the variant in minutes. */
duration: Scalars["Int"];
/** ID of the variant. */
id: Scalars["ID"];
/** Price of the variant before discounts and taxes. */
price: Scalars["Money"];
/** Staff member booked. */
staff: Staff;
};
/** Category of items that can be checked out. */
export type CartAvailableCategory = Node & {
__typename?: "CartAvailableCategory";
/**
* Items available to be checked out.
*
* Note that this list updates as the cart changes. For instance, incompatible
* items may be disabled after others are added to the cart. Clients should
* retrieve this list again after mutations or make sure errors are handled
* when items cannot be added.
*/
availableItems: Array<CartAvailableItem>;
/** Short optional description. */
description?: Maybe<Scalars["String"]>;
/** Whether the category should appear as disabled. */
disabled: Scalars["Boolean"];
/** Message detailing why `disabled` is set. Might not be available. */
disabledDescription?: Maybe<Scalars["String"]>;
/** The ID of an object */
id: Scalars["ID"];
/** Short human-readable name. */
name: Scalars["String"];
};
/** Gift card that can be purchased through `addCartSelectedGiftCardItem`. */
export type CartAvailableGiftCardItem = CartAvailableItem & {
__typename?: "CartAvailableGiftCardItem";
/** When true the user may enter a custom amount between the min and max price range. */
allowCustomAmounts: Scalars["Boolean"];
/** Refer to the super type. */
description?: Maybe<Scalars["String"]>;
/** Refer to the super type. */
disabled: Scalars["Boolean"];
/** Refer to the super type. */
disabledDescription?: Maybe<Scalars["String"]>;
/** The maximum available price for which to purchase the gift card. */
giftCardMax: Scalars["Money"];
/** The minimum available price for which to purchase the gift card. */
giftCardMin: Scalars["Money"];
/** Refer to the super type. */
id: Scalars["ID"];
/**
* Refer to the super type.
* @deprecated Use `listPriceRange` instead.
*/
listPrice: Scalars["Money"];
/** Refer to the super type. */
listPriceRange: CartPriceRange;
/** Refer to the super type. */
name: Scalars["String"];
/** The available preset prices for which to purchase the gift card. */
pricePresets: Array<Scalars["Money"]>;
};
/** Abstract available item that can be checked out. */
export type CartAvailableItem = {
/** Short optional description. */
description?: Maybe<Scalars["String"]>;
/** Whether the item should appear disabled or hidden. */
disabled: Scalars["Boolean"];
/** Message detailing why `disabled` is set. Might not be available. */
disabledDescription?: Maybe<Scalars["String"]>;
/** ID of the item. */
id: Scalars["ID"];
/**
* Displayed price of the item before tax.
* @deprecated Use `listPriceRange` instead.
*/
listPrice: Scalars["Money"];
/**
* Displayed price range of the item before tax.
*
* The final price may differ based on customizations made to the item before
* checking out. For instance, bookable items may have variants and options
* that can be chosen and affect the price.
*/
listPriceRange: CartPriceRange;
/** Short human-readable name. */
name: Scalars["String"];
};
/** Item that can be purchased through `addCartPurchasableItem`. */
export type CartAvailablePurchasableItem = CartAvailableItem & {
__typename?: "CartAvailablePurchasableItem";
/** Refer to the super type. */
description?: Maybe<Scalars["String"]>;
/** Refer to the super type. */
disabled: Scalars["Boolean"];
/** Refer to the super type. */
disabledDescription?: Maybe<Scalars["String"]>;
/** Refer to the super type. */
id: Scalars["ID"];
/**
* Refer to the super type.
* @deprecated Use `listPriceRange` instead.
*/
listPrice: Scalars["Money"];
/** Refer to the super type. */
listPriceRange: CartPriceRange;
/** Refer to the super type. */
name: Scalars["String"];
};
/** Available starting date for bookable items in a cart. */
export type CartBookableDate = {