-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
847 lines (802 loc) · 32.7 KB
/
Copy pathtypes.go
File metadata and controls
847 lines (802 loc) · 32.7 KB
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
package toast
import "time"
type Token struct {
TokenType string `json:"tokenType"`
Scope string `json:"scope"`
ExpiresIn int `json:"expiresIn"`
AccessToken string `json:"accessToken"`
IDToken string `json:"idToken"`
RefreshToken string `json:"refreshToken"`
expiry time.Time
}
func (t Token) IsExpired() bool {
return time.Now().After(t.expiry)
}
type Orders []Order
type Order struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
RevenueCenter RevenueCenter `json:"revenueCenter"`
Server struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"server"`
LastModifiedDevice struct {
ID string `json:"id"`
} `json:"lastModifiedDevice"`
Source string `json:"source"`
VoidDate DateTime `json:"voidDate"`
Duration *int `json:"duration"` // switched to pointer
DisplayNumber string `json:"displayNumber"`
BusinessDate Date `json:"businessDate"`
PaidDate DateTime `json:"paidDate"`
RestaurantService struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"restaurantService"`
Voided *bool `json:"voided"` // switched to pointer
EstimatedFulfillmentDate DateTime `json:"estimatedFulfillmentDate"`
Table struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"table"`
RequiredPrepTime string `json:"requiredPrepTime"`
ApprovalStatus string `json:"approvalStatus"`
DeliveryInfo struct {
Address1 string `json:"address1"`
Address2 string `json:"address2"`
City string `json:"city"`
AdministrativeArea string `json:"administrativeArea"`
State string `json:"state"`
ZipCode string `json:"zipCode"`
Country string `json:"country"`
Latitude *float64 `json:"latitude"` // switched to pointer
Longitude *float64 `json:"longitude"` // switched to pointer
Notes string `json:"notes"`
DeliveredDate DateTime `json:"deliveredDate"`
DispatchedDate DateTime `json:"dispatchedDate"`
DeliveryEmployee struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"deliveryEmployee"`
DeliveryState string `json:"deliveryState"`
} `json:"deliveryInfo"`
ServiceArea struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"serviceArea"`
CurbsidePickupInfo struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
TransportColor string `json:"transportColor"`
TransportDescription string `json:"transportDescription"`
Notes string `json:"notes"`
} `json:"curbsidePickupInfo"`
NumberOfGuests *int `json:"numberOfGuests"` // switched to pointer
DeliveryServiceInfo struct {
DriverName string `json:"driverName"`
DriverPhoneNumber string `json:"driverPhoneNumber"`
EntityType string `json:"entityType"`
GUID string `json:"guid"`
OriginalQuotedDeliveryDate DateTime `json:"originalQuotedDeliveryDate"`
ProviderID string `json:"providerId"`
ProviderInfo string `json:"providerInfo"`
ProviderName string `json:"providerName"`
} `json:"deliveryServiceInfo"`
DiningOption DiningOption `json:"diningOption"`
OpenedDate DateTime `json:"openedDate"`
VoidBusinessDate Date `json:"voidBusinessDate"`
Checks []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
DisplayNumber string `json:"displayNumber"`
Duration *int `json:"duration"` // switched to pointer
Payments Payments `json:"payments"`
AppliedDiscounts AppliedDiscounts `json:"appliedDiscounts"`
LastModifiedDevice struct {
ID string `json:"id"`
} `json:"lastModifiedDevice"`
VoidDate DateTime `json:"voidDate"`
PaidDate DateTime `json:"paidDate"`
AppliedLoyaltyInfo struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
LoyaltyIdentifier string `json:"loyaltyIdentifier"`
MaskedLoyaltyIdentifier string `json:"maskedLoyaltyIdentifier"`
Vendor string `json:"vendor"`
AccrualFamilyGuid string `json:"accrualFamilyGuid"`
AccrualText string `json:"accrualText"`
} `json:"appliedLoyaltyInfo"`
Voided *bool `json:"voided"` // switched to pointer
PaymentStatus string `json:"paymentStatus"`
Amount *float64 `json:"amount"` // switched to pointer
TabName string `json:"tabName"`
TaxExempt *bool `json:"taxExempt"` // switched to pointer
OpenedBy struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"openedBy"`
OpenedDate DateTime `json:"openedDate"`
TotalAmount *float64 `json:"totalAmount"` // switched to pointer
Selections []struct {
Selection
Modifiers []Selection `json:"modifiers"`
} `json:"selections"`
VoidBusinessDate Date `json:"voidBusinessDate"`
CreatedDate DateTime `json:"createdDate"`
Deleted *bool `json:"deleted"` // switched to pointer
CreatedDevice struct {
ID string `json:"id"`
} `json:"createdDevice"`
ClosedDate DateTime `json:"closedDate"`
DeletedDate DateTime `json:"deletedDate"`
ModifiedDate DateTime `json:"modifiedDate"`
TaxAmount *float64 `json:"taxAmount"` // switched to pointer
AppliedServiceCharges AppliedServiceCharges `json:"appliedServiceCharges"`
Customer struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Phone string `json:"phone"`
PhoneCountryCode string `json:"phoneCountryCode"`
Email string `json:"email"`
} `json:"customer"`
} `json:"checks"`
Deleted *bool `json:"deleted"` // switched to pointer
CreatedDevice struct {
ID string `json:"id"`
} `json:"createdDevice"`
CreatedDate DateTime `json:"createdDate"`
ClosedDate DateTime `json:"closedDate"`
DeletedDate DateTime `json:"deletedDate"`
ModifiedDate DateTime `json:"modifiedDate"`
PromisedDate DateTime `json:"promisedDate"`
ChannelGUID string `json:"channelGuid"`
PricingFeatures []string `json:"pricingFeatures"`
AppliedPackagingInfo struct {
AppliedPackagingItems []struct {
EntityType string `json:"entityType"`
GUID string `json:"guid"`
GuestDisplayName string `json:"guestDisplayName"`
Inclusion string `json:"inclusion"`
ItemConfigId string `json:"itemConfigId"`
ItemTypes []string `json:"itemTypes"`
} `json:"appliedPackagingItems"`
EntityType string `json:"entityType"`
GUID string `json:"guid"`
} `json:"appliedPackagingInfo"`
ExcessFood *bool `json:"excessFood"` // switched to pointer
CreatedInTestMode *bool `json:"createdInTestMode"` // switched to pointer
}
type Restaurants []Restaurant
type Restaurant struct {
GUID string `json:"guid"`
General struct {
Name string `json:"name"`
LocationName string `json:"locationName"`
LocationCode interface{} `json:"locationCode"`
Description string `json:"description"`
TimeZone string `json:"timeZone"`
CloseoutHour int `json:"closeoutHour"`
ManagementGroupGUID string `json:"managementGroupGuid"`
} `json:"general"`
Urls struct {
Website interface{} `json:"website"`
Facebook interface{} `json:"facebook"`
Twitter string `json:"twitter"`
OrderOnline string `json:"orderOnline"`
PurchaseGiftCard string `json:"purchaseGiftCard"`
CheckGiftCard string `json:"checkGiftCard"`
} `json:"urls"`
Location struct {
Address1 string `json:"address1"`
Address2 string `json:"address2"`
City string `json:"city"`
StateCode string `json:"stateCode"`
ZipCode string `json:"zipCode"`
Country string `json:"country"`
Phone string `json:"phone"`
Latitude int `json:"latitude"`
Longitude int `json:"longitude"`
} `json:"location"`
Schedules struct {
DaySchedules struct {
Num600000000314630485 struct {
ScheduleName string `json:"scheduleName"`
Services interface{} `json:"services"`
OpenTime string `json:"openTime"`
CloseTime string `json:"closeTime"`
} `json:"600000000314630485"`
} `json:"daySchedules"`
WeekSchedule struct {
Monday string `json:"monday"`
Tuesday string `json:"tuesday"`
Wednesday string `json:"wednesday"`
Thursday string `json:"thursday"`
Friday string `json:"friday"`
Saturday string `json:"saturday"`
Sunday string `json:"sunday"`
} `json:"weekSchedule"`
} `json:"schedules"`
Delivery struct {
Enabled bool `json:"enabled"`
Minimum interface{} `json:"minimum"`
Area interface{} `json:"area"`
} `json:"delivery"`
OnlineOrdering struct {
Enabled bool `json:"enabled"`
Scheduling bool `json:"scheduling"`
SpecialRequests bool `json:"specialRequests"`
SpecialRequestsMessage string `json:"specialRequestsMessage"`
PaymentOptions struct {
Delivery struct {
Cash bool `json:"cash"`
CcSameDay bool `json:"ccSameDay"`
CcFuture bool `json:"ccFuture"`
} `json:"delivery"`
Takeout struct {
Cash bool `json:"cash"`
CcSameDay bool `json:"ccSameDay"`
CcFuture bool `json:"ccFuture"`
CcInStore bool `json:"ccInStore"`
} `json:"takeout"`
CcTip bool `json:"ccTip"`
} `json:"paymentOptions"`
} `json:"onlineOrdering"`
PrepTimes struct {
DeliveryPrepTime int `json:"deliveryPrepTime"`
DeliveryTimeAfterOpen int `json:"deliveryTimeAfterOpen"`
DeliveryTimeBeforeClose int `json:"deliveryTimeBeforeClose"`
TakeoutPrepTime int `json:"takeoutPrepTime"`
TakeoutTimeAfterOpen int `json:"takeoutTimeAfterOpen"`
TakeoutTimeBeforeClose int `json:"takeoutTimeBeforeClose"`
TakeoutThrottlingTime int `json:"takeoutThrottlingTime"`
DeliveryThrottlingTime int `json:"deliveryThrottlingTime"`
} `json:"prepTimes"`
}
type MenuGroups []MenuGroup
type MenuGroup struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
Parent struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"parent"`
Images []struct {
URL string `json:"url"`
} `json:"images"`
Visibility string `json:"visibility"`
UnitOfMeasure string `json:"unitOfMeasure"`
OptionGroups []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"optionGroups"`
Menu struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"menu"`
InheritUnitOfMeasure bool `json:"inheritUnitOfMeasure"`
Subgroups []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"subgroups"`
InheritOptionGroups bool `json:"inheritOptionGroups"`
OrderableOnline string `json:"orderableOnline"`
Name string `json:"name"`
Items []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"items"`
}
type ModifierGroups []ModifierGroup
type ModifierGroup struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
Name string `json:"name"`
Options []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"options"`
MinSelections int `json:"minSelections"`
MaxSelections int `json:"maxSelections"`
}
type MenuItems []MenuItem
type MenuItem struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
Images []struct {
URL string `json:"url"`
} `json:"images"`
Visibility string `json:"visibility"`
UnitOfMeasure string `json:"unitOfMeasure"`
OptionGroups []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"optionGroups"`
Calories int `json:"calories"`
Type string `json:"type"`
InheritUnitOfMeasure bool `json:"inheritUnitOfMeasure"`
InheritOptionGroups bool `json:"inheritOptionGroups"`
OrderableOnline string `json:"orderableOnline"`
Name string `json:"name"`
Plu string `json:"plu"`
Sku string `json:"sku"`
}
type Discounts []Discount
type Discount struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
Amount float64 `json:"amount"`
SelectionType string `json:"selectionType"`
NonExclusive bool `json:"nonExclusive"`
Percentage float64 `json:"percentage"`
Name string `json:"name"`
Active bool `json:"active"`
ItemPickingPriority string `json:"itemPickingPriority"`
Type string `json:"type"`
FixedTotal interface{} `json:"fixedTotal"`
}
type SalesCategories []SalesCategory
type SalesCategory struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
Name string `json:"name"`
ExternalID string `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
}
type DiningOptions []DiningOption
type DiningOption struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
Name string `json:"name"` // not in the API documentation
Curbside bool `json:"curbside"` // not in the API documentation
Behavior string `json:"behavior"` // not in the API documentation
}
type Employees []Employee
type Employee struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
V2EmployeeGUID string `json:"v2EmployeeGuid"`
LastName string `json:"lastName"`
WageOverrides []struct {
Wage float64 `json:"wage"`
JobReference struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"jobReference"`
} `json:"wageOverrides"`
PhoneNumberCountryCode string `json:"phoneNumberCountryCode"`
FirstName string `json:"firstName"`
ChosenName string `json:"chosenName"`
CreatedDate string `json:"createdDate"`
PhoneNumber interface{} `json:"phoneNumber"`
Deleted bool `json:"deleted"`
DeletedDate string `json:"deletedDate"`
JobReferences []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"jobReferences"`
ModifiedDate string `json:"modifiedDate"`
ExternalEmployeeID string `json:"externalEmployeeId"`
Email string `json:"email"`
}
type PostEmployee struct {
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId,omitempty"`
V2EmployeeGUID string `json:"v2EmployeeGuid,omitempty"`
LastName string `json:"lastName,omitempty"`
WageOverrides []struct {
Wage float64 `json:"wage,omitempty"`
JobReference struct {
GUID string `json:"guid,omitempty"`
EntityType string `json:"entityType,omitempty"`
ExternalID interface{} `json:"externalId,omitempty"`
} `json:"jobReference,omitempty"`
} `json:"wageOverrides,omitempty"`
PhoneNumberCountryCode string `json:"phoneNumberCountryCode,omitempty"`
FirstName string `json:"firstName,omitempty"`
ChosenName string `json:"chosenName,omitempty"`
CreatedDate string `json:"createdDate,omitempty"`
PhoneNumber interface{} `json:"phoneNumber,omitempty"`
JobReferences []struct {
GUID string `json:"guid,omitempty"`
EntityType string `json:"entityType,omitempty"`
ExternalID interface{} `json:"externalId,omitempty"`
} `json:"jobReferences,omitempty"`
ModifiedDate string `json:"modifiedDate,omitempty"`
ExternalEmployeeID string `json:"externalEmployeeId,omitempty"`
Email string `json:"email"`
}
type PatchEmployee struct {
FirstName string `json:"firstName,omitempty"`
ChosenName string `json:"chosenName,omitempty"`
LastName string `json:"lastName,omitempty"`
ExternalEmployeeID string `json:"externalEmployeeId,omitempty"`
PassCode string `json:"passCode,omitempty"`
}
type RevenueCenters []RevenueCenter
type RevenueCenter struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
Name string `json:"name"` // not in the API documentation
Description string `json:"description"` // not in the API documentation
ExternalID string `json:"externalId"`
}
type AlternativePaymentTypes []AlternativePaymentType
type AlternativePaymentType struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
Name string `json:"name"`
}
type TaxRates []TaxRate
type TaxRate struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
IsDefault bool `json:"isDefault"`
ConditionalTaxRates []interface{} `json:"conditionalTaxRates"`
TaxTable []interface{} `json:"taxTable"`
Rate float64 `json:"rate"`
RoundingType string `json:"roundingType"`
Name string `json:"name"`
Type string `json:"type"`
}
type Selection struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
Deferred *bool `json:"deferred"` // switched to pointer
PreDiscountPrice *float64 `json:"preDiscountPrice"` // switched to pointer
VoidReason struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"voidReason"`
OptionGroup struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
} `json:"optionGroup"`
DisplayName string `json:"displayName"`
AppliedDiscounts AppliedDiscounts `json:"appliedDiscounts"`
SeatNumber *int `json:"seatNumber"` // switched to pointer
VoidDate DateTime `json:"voidDate"`
FulfillmentStatus string `json:"fulfillmentStatus"`
OptionGroupPricingMode string `json:"optionGroupPricingMode"`
SalesCategory struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
} `json:"salesCategory"` // used to be SalesCategory but is actually a reference to SalesCategory (only name is missing)
SelectionType string `json:"selectionType"`
Price *float64 `json:"price"` // switched to pointer
Voided *bool `json:"voided"` // switched to pointer
AppliedTaxes AppliedTaxes `json:"appliedTaxes"`
StoredValueTransactionID interface{} `json:"storedValueTransactionId"` // not in the API documentation
ItemGroup struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
} `json:"itemGroup"`
Item struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
} `json:"item"`
TaxInclusion string `json:"taxInclusion"`
Quantity *float64 `json:"quantity"` // switched to pointer
ReceiptLinePrice *float64 `json:"receiptLinePrice"` // switched to pointer
UnitOfMeasure string `json:"unitOfMeasure"`
RefundDetails RefundDetails `json:"refundDetails"`
ToastGiftCard interface{} `json:"toastGiftCard"` // not in the API documentation
Tax *float64 `json:"tax"` // switched to pointer
DiningOption struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"diningOption"`
VoidBusinessDate Date `json:"voidBusinessDate"`
CreatedDate DateTime `json:"createdDate"`
PreModifier struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
} `json:"preModifier"`
ModifiedDate DateTime `json:"modifiedDate"`
ExternalPriceAmount *float64 `json:"externalPriceAmount"` // switched to pointer
SplitOrigin struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
} `json:"splitOrigin"`
OpenPriceAmount *float64 `json:"openPriceAmount"` // switched to pointer
}
type AppliedDiscounts []AppliedDiscount
type AppliedDiscount struct {
AppliedDiscountReason struct {
Comment string `json:"comment"`
Description string `json:"description"`
Name string `json:"name"`
DiscountReason struct {
EntityType string `json:"entityType"`
GUID string `json:"guid"`
} `json:"discountReason"`
} `json:"appliedDiscountReason"`
AppliedPromoCode string `json:"appliedPromoCode"`
Approver struct {
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
GUID string `json:"guid"`
} `json:"approver"`
ComboItems []struct {
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
GUID string `json:"guid"`
} `json:"comboItems"`
Discount struct {
EntityType string `json:"entityType"`
GUID string `json:"guid"`
} `json:"discount"`
DiscountAmount *float64 `json:"discountAmount"` // switched to pointer
DiscountPercent *float64 `json:"discountPercent"` // switched to pointer
DiscountType string `json:"discountType"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
GUID string `json:"guid"`
LoyaltyDetails struct {
Vendor string `json:"vendor"`
ReferenceID string `json:"referenceId"`
} `json:"loyaltyDetails"`
Name string `json:"name"`
NonTaxDiscountAmount *float64 `json:"nonTaxDiscountAmount"` // switched to pointer
ProcessingState string `json:"processingState"`
Triggers []struct {
Quantity *float64 `json:"quantity"` // switched to pointer
Selection struct {
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
GUID string `json:"guid"`
} `json:"selection"`
} `json:"triggers"`
}
type AppliedTaxes []AppliedTax
type AppliedTax struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
TaxRate struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
} `json:"taxRate"`
Rate *float64 `json:"rate"` // switched to pointer
Name string `json:"name"`
TaxAmount *float64 `json:"taxAmount"` // switched to pointer
Type string `json:"type"`
FacilitatorCollectAndRemitTax *bool `json:"facilitatorCollectAndRemitTax"` // switched to pointer
Jurisdiction string `json:"jurisdiction"`
JurisdictionType string `json:"jurisdictionType"`
DisplayName string `json:"displayName"`
}
type RefundDetails struct { // used to be share for both RefundDetails and Refund
RefundAmount *float64 `json:"refundAmount"` // switched to pointer
// RefundBusinessDate Date `json:"refundBusinessDate"`
// RefundDate DateTime `json:"refundDate"`
// RefundStrategy string `json:"refundStrategy"`
RefundTransaction struct {
EntityType string `json:"entityType"`
GUID string `json:"guid"`
} `json:"refundTransaction"`
// TipRefundAmount float64 `json:"tipRefundAmount"`
TaxRefundAmount *float64 `json:"taxRefundAmount"` // switched to pointer
}
type Refund struct {
RefundAmount *float64 `json:"refundAmount"` // switched to pointer
RefundBusinessDate Date `json:"refundBusinessDate"`
RefundDate DateTime `json:"refundDate"`
RefundTransaction struct {
EntityType string `json:"entityType"`
GUID string `json:"guid"`
} `json:"refundTransaction"`
TipRefundAmount *float64 `json:"tipRefundAmount"` // switched to pointer
}
type AppliedServiceCharges []AppliedServiceCharge
type AppliedServiceCharge struct {
AppliedTaxes AppliedTaxes `json:"appliedTaxes"`
ChargeAmount *float64 `json:"chargeAmount"` // switched to pointer
ChargeType string `json:"chargeType"`
Delivery *bool `json:"delivery"` // switched to pointer
Destination string `json:"destination"` // not in the API documentation
DineIn *bool `json:"dineIn"` // switched to pointer
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
Gratuity *bool `json:"gratuity"` // switched to pointer
GUID string `json:"guid"`
Name string `json:"name"`
PaymentGUID interface{} `json:"paymentGuid"`
RefundDetails RefundDetails `json:"refundDetails"`
ServiceCharge struct {
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
GUID string `json:"guid"`
} `json:"serviceCharge"`
ServiceChargeCalculation string `json:"serviceChargeCalculation"`
ServiceChargeCategory string `json:"serviceChargeCategory"`
Takeout *bool `json:"takeout"` // switched to pointer
Taxable *bool `json:"taxable"` // switched to pointer
}
type TimeEntries []TimeEntry
type TimeEntry struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
CreatedDate DateTime `json:"createdDate"`
ModifiedDate DateTime `json:"modifiedDate"`
DeletedDate DateTime `json:"deletedDate"`
Deleted bool `json:"deleted"`
JobReference struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"jobReference"`
EmployeeReference struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"employeeReference"`
ShiftReference struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"shiftReference"`
InDate DateTime `json:"inDate"`
OutDate DateTime `json:"outDate"`
AutoClockedOut bool `json:"autoClockedOut"`
BusinessDate Date `json:"businessDate"`
RegularHours float64 `json:"regularHours"`
OvertimeHours float64 `json:"overtimeHours"`
HourlyWage float64 `json:"hourlyWage"`
Breaks []struct {
GUID string `json:"guid"`
BreakType struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
} `json:"breakType"`
Paid bool `json:"paid"`
InDate DateTime `json:"inDate"`
OutDate DateTime `json:"outDate"`
Missed bool `json:"missed"`
AuditResponse bool `json:"auditResponse"`
} `json:"breaks"`
DeclaredCashTips float64 `json:"declaredCashTips"`
NonCashTips float64 `json:"nonCashTips"`
CashGratuityServiceCharges float64 `json:"cashGratuityServiceCharges"`
NonCashGratuityServiceCharges float64 `json:"nonCashGratuityServiceCharges"`
TipsWithheld float64 `json:"tipsWithheld"`
NonCashSales float64 `json:"nonCashSales"`
CashSales float64 `json:"cashSales"`
}
type MenuItemInventories []MenuItemInventory
type MenuItemInventory struct {
GUID string `json:"guid"`
ItemGUIDValidity string `json:"itemGuidValidity"`
MultiLocationID string `json:"multiLocationId"`
Quantity *float64 `json:"quantity"`
Status string `json:"status"`
VersionID string `json:"versionId"`
}
type MenuOptionGroups []MenuOptionGroup
type MenuOptionGroup struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
MaxSelections int `json:"maxSelections"`
MinSelections int `json:"minSelections"`
Name string `json:"name"`
Options []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"options"`
}
type VoidSaleReasons []VoidSaleReason
type VoidSaleReason struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
Name string `json:"name"`
}
type Payments []Payment
type Payment struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
OriginalProcessingFee *float64 `json:"originalProcessingFee"` // switched to pointer
Server struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"server"`
CashDrawer struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"cashDrawer"`
LastModifiedDevice struct {
ID string `json:"id"`
} `json:"lastModifiedDevice"`
RefundStatus string `json:"refundStatus"`
IsProcessedOffline any `json:"isProcessedOffline"` // not in the API documentation
Type string `json:"type"`
VoidInfo struct {
VoidUser struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"voidUser"`
VoidApprover struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"voidApprover"`
VoidDate DateTime `json:"voidDate"`
VoidBusinessDate Date `json:"voidBusinessDate"`
VoidReason struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"voidReason"`
} `json:"voidInfo"`
CheckGUID string `json:"checkGuid"`
OtherPayment struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"otherPayment"`
PaidDate DateTime `json:"paidDate"`
OrderGUID string `json:"orderGuid"`
CardEntryMode string `json:"cardEntryMode"`
PaymentStatus string `json:"paymentStatus"`
Amount *float64 `json:"amount"` // switched to pointer
TipAmount *float64 `json:"tipAmount"` // switched to pointer
AmountTendered *float64 `json:"amountTendered"` // switched to pointer
CardType string `json:"cardType"`
HouseAccount struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID string `json:"externalId"`
} `json:"houseAccount"`
McaRepaymentAmount *float64 `json:"mcaRepaymentAmount"` // switched to pointer
CreatedDevice struct {
ID string `json:"id"`
} `json:"createdDevice"`
PaidBusinessDate Date `json:"paidBusinessDate"`
Last4Digits string `json:"last4Digits"`
Refund Refund `json:"refund"` // used to be RefundDetails
CardPaymentID string `json:"cardPaymentId"`
TenderTransactionGUID string `json:"tenderTransactionGuid"`
}