-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
522 lines (493 loc) · 20.9 KB
/
types.go
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
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 interface{} `json:"externalId"`
RevenueCenter RevenueCenter `json:"revenueCenter"`
Server struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"server"`
LastModifiedDevice struct {
ID string `json:"id"`
} `json:"lastModifiedDevice"`
Source string `json:"source"`
VoidDate DateTime `json:"voidDate"`
Duration int `json:"duration"`
BusinessDate Date `json:"businessDate"`
PaidDate DateTime `json:"paidDate"`
RestaurantService struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"restaurantService"`
Voided bool `json:"voided"`
EstimatedFulfillmentDate DateTime `json:"estimatedFulfillmentDate"`
Table interface{} `json:"table"`
RequiredPrepTime string `json:"requiredPrepTime"`
ApprovalStatus string `json:"approvalStatus"`
DeliveryInfo interface{} `json:"deliveryInfo"`
ServiceArea interface{} `json:"serviceArea"`
CurbsidePickupInfo interface{} `json:"curbsidePickupInfo"`
NumberOfGuests int `json:"numberOfGuests"`
DiningOption DiningOption `json:"diningOption"`
OpenedDate DateTime `json:"openedDate"`
VoidBusinessDate Date `json:"voidBusinessDate"`
Checks []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
DisplayNumber string `json:"displayNumber"`
Payments []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
OriginalProcessingFee float64 `json:"originalProcessingFee"`
Server struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"server"`
CashDrawer interface{} `json:"cashDrawer"`
LastModifiedDevice struct {
ID string `json:"id"`
} `json:"lastModifiedDevice"`
RefundStatus string `json:"refundStatus"`
IsProcessedOffline interface{} `json:"isProcessedOffline"`
Type string `json:"type"`
VoidInfo interface{} `json:"voidInfo"`
CheckGUID string `json:"checkGuid"`
OtherPayment struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"otherPayment"`
PaidDate DateTime `json:"paidDate"`
OrderGUID string `json:"orderGuid"`
CardEntryMode interface{} `json:"cardEntryMode"`
PaymentStatus string `json:"paymentStatus"`
Amount float64 `json:"amount"`
TipAmount float64 `json:"tipAmount"`
AmountTendered float64 `json:"amountTendered"`
CardType interface{} `json:"cardType"`
HouseAccount interface{} `json:"houseAccount"`
McaRepaymentAmount interface{} `json:"mcaRepaymentAmount"`
CreatedDevice struct {
ID string `json:"id"`
} `json:"createdDevice"`
PaidBusinessDate Date `json:"paidBusinessDate"`
Last4Digits interface{} `json:"last4Digits"`
Refund RefundDetails `json:"refund"`
} `json:"payments"`
AppliedDiscounts []struct {
AppliedPromoCode interface{} `json:"appliedPromoCode"`
Approver struct {
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
GUID string `json:"guid"`
} `json:"approver"`
ComboItems []interface{} `json:"comboItems"`
Discount struct {
EntityType string `json:"entityType"`
GUID string `json:"guid"`
} `json:"discount"`
DiscountAmount float64 `json:"discountAmount"`
DiscountPercent float64 `json:"discountPercent"`
DiscountType string `json:"discountType"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
GUID string `json:"guid"`
LoyaltyDetails interface{} `json:"loyaltyDetails"`
Name string `json:"name"`
NonTaxDiscountAmount float64 `json:"nonTaxDiscountAmount"`
ProcessingState interface{} `json:"processingState"`
Triggers []struct {
Quantity float64 `json:"quantity"`
Selection struct {
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
GUID string `json:"guid"`
} `json:"selection"`
} `json:"triggers"`
} `json:"AppliedDiscounts"`
LastModifiedDevice struct {
ID string `json:"id"`
} `json:"lastModifiedDevice"`
VoidDate DateTime `json:"voidDate"`
PaidDate DateTime `json:"paidDate"`
AppliedLoyaltyInfo interface{} `json:"appliedLoyaltyInfo"`
Voided bool `json:"voided"`
PaymentStatus string `json:"paymentStatus"`
Amount float64 `json:"amount"`
TabName string `json:"tabName"`
TaxExempt bool `json:"taxExempt"`
OpenedDate DateTime `json:"openedDate"`
TotalAmount float64 `json:"totalAmount"`
Selections []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
Deferred bool `json:"deferred"`
PreDiscountPrice float64 `json:"preDiscountPrice"`
VoidReason interface{} `json:"voidReason"`
OptionGroup interface{} `json:"optionGroup"`
DisplayName string `json:"displayName"`
AppliedDiscounts []struct {
AppliedPromoCode interface{} `json:"appliedPromoCode"`
Approver struct {
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
GUID string `json:"guid"`
} `json:"approver"`
ComboItems []interface{} `json:"comboItems"`
Discount struct {
EntityType string `json:"entityType"`
GUID string `json:"guid"`
} `json:"discount"`
DiscountAmount float64 `json:"discountAmount"`
DiscountPercent float64 `json:"discountPercent"`
DiscountType string `json:"discountType"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
GUID string `json:"guid"`
LoyaltyDetails interface{} `json:"loyaltyDetails"`
Name string `json:"name"`
NonTaxDiscountAmount float64 `json:"nonTaxDiscountAmount"`
ProcessingState interface{} `json:"processingState"`
Triggers []struct {
Quantity float64 `json:"quantity"`
Selection struct {
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
GUID string `json:"guid"`
} `json:"selection"`
} `json:"triggers"`
} `json:"AppliedDiscounts"`
Modifiers Modifiers `json:"modifiers"`
SeatNumber int `json:"seatNumber"`
VoidDate DateTime `json:"voidDate"`
FulfillmentStatus string `json:"fulfillmentStatus"`
OptionGroupPricingMode interface{} `json:"optionGroupPricingMode"`
SalesCategory SalesCategory `json:"salesCategory"`
SelectionType string `json:"selectionType"`
Price float64 `json:"price"`
Voided bool `json:"voided"`
AppliedTaxes AppliedTaxes `json:"appliedTaxes"`
StoredValueTransactionID interface{} `json:"storedValueTransactionId"`
ItemGroup struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
} `json:"itemGroup"`
Item struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
MultiLocationID string `json:"multiLocationId"`
} `json:"item"`
TaxInclusion string `json:"taxInclusion"`
Quantity float64 `json:"quantity"`
ReceiptLinePrice float64 `json:"receiptLinePrice"`
UnitOfMeasure string `json:"unitOfMeasure"`
RefundDetails RefundDetails `json:"refundDetails"`
ToastGiftCard interface{} `json:"toastGiftCard"`
Tax float64 `json:"tax"`
DiningOption interface{} `json:"diningOption"`
VoidBusinessDate Date `json:"voidBusinessDate"`
CreatedDate DateTime `json:"createdDate"`
PreModifier interface{} `json:"preModifier"`
ModifiedDate DateTime `json:"modifiedDate"`
} `json:"selections"`
VoidBusinessDate Date `json:"voidBusinessDate"`
CreatedDate DateTime `json:"createdDate"`
Deleted bool `json:"deleted"`
CreatedDevice struct {
ID string `json:"id"`
} `json:"createdDevice"`
ClosedDate DateTime `json:"closedDate"`
DeletedDate DateTime `json:"deletedDate"`
ModifiedDate DateTime `json:"modifiedDate"`
TaxAmount float64 `json:"taxAmount"`
AppliedServiceCharges []interface{} `json:"appliedServiceCharges"`
Customer interface{} `json:"customer"`
} `json:"checks"`
Deleted bool `json:"deleted"`
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 interface{} `json:"channelGuid"`
PricingFeatures []string `json:"pricingFeatures"`
}
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 interface{} `json:"parent"`
Images []interface{} `json:"images"`
Visibility string `json:"visibility"`
UnitOfMeasure string `json:"unitOfMeasure"`
OptionGroups []struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"optionGroups"`
Menu struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
} `json:"menu"`
InheritUnitOfMeasure bool `json:"inheritUnitOfMeasure"`
Subgroups []interface{} `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 interface{} `json:"externalId"`
} `json:"items"`
}
type MenuItems []MenuItem
type MenuItem struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
Images []interface{} `json:"images"`
Visibility string `json:"visibility"`
UnitOfMeasure string `json:"unitOfMeasure"`
OptionGroups []interface{} `json:"optionGroups"`
Calories interface{} `json:"calories"`
Type interface{} `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"`
}
type DiningOptions []DiningOption
type DiningOption struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
Name string `json:"name"`
Curbside bool `json:"curbside"`
Behavior string `json:"behavior"`
}
type RevenueCenters []RevenueCenter
type RevenueCenter struct {
GUID string `json:"guid"`
EntityType string `json:"entityType"`
Name string `json:"name"`
Description string `json:"description"`
}
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 Modifiers []Modifier
type Modifier struct {
AppliedDiscounts []interface{} `json:"appliedDiscounts"`
AppliedTaxes AppliedTaxes `json:"appliedTaxes"`
CreatedDate string `json:"createdDate"`
Deferred bool `json:"deferred"`
DiningOption interface{} `json:"diningOption"`
DisplayName string `json:"displayName"`
EntityType string `json:"entityType"`
ExternalID interface{} `json:"externalId"`
FulfillmentStatus string `json:"fulfillmentStatus"`
GUID string `json:"guid"`
Item interface{} `json:"item"`
ItemGroup interface{} `json:"itemGroup"`
ModifiedDate string `json:"modifiedDate"`
// Modifiers Modifiers `json:"modifiers"`
OptionGroup interface{} `json:"optionGroup"`
OptionGroupPricingMode interface{} `json:"optionGroupPricingMode"`
PreDiscountPrice float64 `json:"preDiscountPrice"`
PreModifier interface{} `json:"preModifier"`
Price float64 `json:"price"`
Quantity float64 `json:"quantity"`
ReceiptLinePrice float64 `json:"receiptLinePrice"`
RefundDetails RefundDetails `json:"refundDetails"`
SalesCategory interface{} `json:"salesCategory"`
SeatNumber int `json:"seatNumber"`
SelectionType string `json:"selectionType"`
StoredValueTransactionID interface{} `json:"storedValueTransactionId"`
Tax float64 `json:"tax"`
TaxInclusion string `json:"taxInclusion"`
ToastGiftCard interface{} `json:"toastGiftCard"`
UnitOfMeasure string `json:"unitOfMeasure"`
VoidBusinessDate Date `json:"voidBusinessDate"`
VoidDate DateTime `json:"voidDate"`
VoidReason interface{} `json:"voidReason"`
Voided bool `json:"voided"`
}
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"`
Name string `json:"name"`
TaxAmount float64 `json:"taxAmount"`
Type string `json:"type"`
FacilitatorCollectAndRemitTax bool `json:"facilitatorCollectAndRemitTax"`
}
type RefundDetails struct {
RefundAmount float64 `json:"refundAmount"`
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"`
}