@compassdigital/sdk.typescript 4.263.0 → 4.264.0
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.
- package/lib/messages/events/OrderCreatedEvent.d.ts +0 -1
- package/lib/messages/events/OrderCreatedEvent.d.ts.map +1 -1
- package/lib/messages/events/OrderUpdatedEvent.d.ts +0 -1
- package/lib/messages/events/OrderUpdatedEvent.d.ts.map +1 -1
- package/lib/messages/events/ShoppingCartCreatedEvent.d.ts +415 -0
- package/lib/messages/events/ShoppingCartCreatedEvent.d.ts.map +1 -0
- package/lib/messages/events/ShoppingCartCreatedEvent.js +4 -0
- package/lib/messages/events/ShoppingCartCreatedEvent.js.map +1 -0
- package/lib/messages/events/ShoppingCartUpdatedEvent.d.ts +415 -0
- package/lib/messages/events/ShoppingCartUpdatedEvent.d.ts.map +1 -0
- package/lib/messages/events/ShoppingCartUpdatedEvent.js +4 -0
- package/lib/messages/events/ShoppingCartUpdatedEvent.js.map +1 -0
- package/lib/messages/events/index.d.ts +2 -0
- package/lib/messages/events/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/messages/events/OrderCreatedEvent.ts +0 -1
- package/src/messages/events/OrderUpdatedEvent.ts +0 -1
- package/src/messages/events/ShoppingCartCreatedEvent.ts +499 -0
- package/src/messages/events/ShoppingCartUpdatedEvent.ts +499 -0
- package/src/messages/events/index.ts +4 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
2
|
+
|
|
3
|
+
export interface ShoppingCart {
|
|
4
|
+
// Shopping cart ID
|
|
5
|
+
id?: string;
|
|
6
|
+
// The CDL id representing the location
|
|
7
|
+
location?: string;
|
|
8
|
+
// The CDL id representing the menu
|
|
9
|
+
menu?: string;
|
|
10
|
+
// The CDL id representing the brand
|
|
11
|
+
brand?: string;
|
|
12
|
+
date?: Record<string, any>;
|
|
13
|
+
items?: ItemResponse[];
|
|
14
|
+
sub_total?: {
|
|
15
|
+
amount?: MonetaryValue;
|
|
16
|
+
};
|
|
17
|
+
promo?: PromoDetails;
|
|
18
|
+
discount?: PromoDetails;
|
|
19
|
+
discounts?: Discounts;
|
|
20
|
+
payment_method?: PaymentMethod;
|
|
21
|
+
taxes?: Taxes;
|
|
22
|
+
total?: {
|
|
23
|
+
amount?: MonetaryValue;
|
|
24
|
+
meals?: MonetaryValue;
|
|
25
|
+
};
|
|
26
|
+
exemptions?: {
|
|
27
|
+
tax?: boolean;
|
|
28
|
+
};
|
|
29
|
+
order?: {
|
|
30
|
+
// order id
|
|
31
|
+
id?: string;
|
|
32
|
+
};
|
|
33
|
+
service_fee?: {
|
|
34
|
+
amount?: MonetaryValue;
|
|
35
|
+
};
|
|
36
|
+
delivery_fee?: {
|
|
37
|
+
amount?: MonetaryValue;
|
|
38
|
+
};
|
|
39
|
+
is?: {
|
|
40
|
+
// Shoppingcart Type
|
|
41
|
+
type?: 'delivery' | 'pickup' | 'scan_and_go' | 'frictionless';
|
|
42
|
+
// If an order should be paid with meal exchange. If true, this will calculate meals total.
|
|
43
|
+
mx_cart?: boolean;
|
|
44
|
+
// If a user's email or email domain is a match in a sites list of tax exempt emails or domains
|
|
45
|
+
email_tax_exempt?: boolean;
|
|
46
|
+
// Indicates to clients that a tax recalculation is required
|
|
47
|
+
tax_calculation_required?: boolean;
|
|
48
|
+
// Indicates that the shopping cart is a system 365 shopping cart
|
|
49
|
+
system365?: boolean;
|
|
50
|
+
};
|
|
51
|
+
meta?: {
|
|
52
|
+
// Raw request from any vendor integrated with CDL
|
|
53
|
+
vendor?: Record<string, any>;
|
|
54
|
+
drain_order_type?: DrainOrderType;
|
|
55
|
+
[index: string]: any;
|
|
56
|
+
};
|
|
57
|
+
incentives: Incentives;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ItemResponse {
|
|
61
|
+
// can be cdl item id or stringified timestamp
|
|
62
|
+
id: string;
|
|
63
|
+
description?: Label;
|
|
64
|
+
// index based on cdl id or stringified timestamp
|
|
65
|
+
_index?: string;
|
|
66
|
+
quantity: Quantity;
|
|
67
|
+
quantity_by_weight?: {
|
|
68
|
+
unit?: string;
|
|
69
|
+
value?: number;
|
|
70
|
+
};
|
|
71
|
+
unit?: number;
|
|
72
|
+
price?: Price;
|
|
73
|
+
// Final item price after LTO/Bundle/BOGO etc is applied on the item.
|
|
74
|
+
sale_price?: {
|
|
75
|
+
active?: boolean;
|
|
76
|
+
amount?: MonetaryValue;
|
|
77
|
+
};
|
|
78
|
+
weighed_price?: Price;
|
|
79
|
+
// Subtotal of the item including all options
|
|
80
|
+
_subtotal?: {
|
|
81
|
+
amount?: MonetaryValue;
|
|
82
|
+
};
|
|
83
|
+
// Promo applied to this item
|
|
84
|
+
_promo?: {
|
|
85
|
+
amount?: MonetaryValue;
|
|
86
|
+
};
|
|
87
|
+
// discount applied to this item
|
|
88
|
+
_discount?: {
|
|
89
|
+
amount?: MonetaryValue;
|
|
90
|
+
};
|
|
91
|
+
meta?: {
|
|
92
|
+
// menu id
|
|
93
|
+
menu?: string;
|
|
94
|
+
// brand id
|
|
95
|
+
brand?: string;
|
|
96
|
+
brand_label?: Label;
|
|
97
|
+
taxes?: string[];
|
|
98
|
+
tax?: {
|
|
99
|
+
tax_tag_code?: string;
|
|
100
|
+
tax_rate?: number;
|
|
101
|
+
tax_amount?: number;
|
|
102
|
+
};
|
|
103
|
+
menu_tax_tags?: string[];
|
|
104
|
+
orderable?: boolean;
|
|
105
|
+
volante_id?: string;
|
|
106
|
+
barcodes?: string[];
|
|
107
|
+
plu?: string;
|
|
108
|
+
[index: string]: any;
|
|
109
|
+
};
|
|
110
|
+
options?: ModifierGroupResponse[];
|
|
111
|
+
// Details about discount like BOGO, LTO, Bundle etc.
|
|
112
|
+
item_discount?: Record<string, any>;
|
|
113
|
+
// user specified instructions for the item
|
|
114
|
+
special_instructions?: string;
|
|
115
|
+
amount_off_exclusions?: AmountOffExclusion[];
|
|
116
|
+
added_on?: string;
|
|
117
|
+
meal_value?: IntegerValue;
|
|
118
|
+
category?: Label;
|
|
119
|
+
menu_label?: Label;
|
|
120
|
+
tax_rate?: MonetaryValue;
|
|
121
|
+
label?: Label;
|
|
122
|
+
reporting?: {
|
|
123
|
+
category?: {
|
|
124
|
+
primary?: string;
|
|
125
|
+
secondary?: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface ModifierGroupResponse {
|
|
131
|
+
id?: string;
|
|
132
|
+
label?: Label;
|
|
133
|
+
meta?: {
|
|
134
|
+
taxes?: string[];
|
|
135
|
+
original_label?: Label;
|
|
136
|
+
order_type?: 'selection' | 'option' | 'quantity';
|
|
137
|
+
surchage_limit_value?: number;
|
|
138
|
+
[index: string]: any;
|
|
139
|
+
};
|
|
140
|
+
items?: ModifierResponse[];
|
|
141
|
+
is?: {
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
incremental?: boolean;
|
|
144
|
+
surchage_limit?: boolean;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface ModifierResponse {
|
|
149
|
+
// option/modifier
|
|
150
|
+
id?: string;
|
|
151
|
+
price?: Price;
|
|
152
|
+
quantity?: Quantity;
|
|
153
|
+
label?: Label;
|
|
154
|
+
// index
|
|
155
|
+
_index?: string;
|
|
156
|
+
meta?: {
|
|
157
|
+
sort_number?: number;
|
|
158
|
+
original_label?: Label;
|
|
159
|
+
taxes?: string[];
|
|
160
|
+
sizing?: ModifierSizing;
|
|
161
|
+
[index: string]: any;
|
|
162
|
+
};
|
|
163
|
+
amount_off_exclusions?: AmountOffExclusion[];
|
|
164
|
+
is?: {
|
|
165
|
+
disabled?: boolean;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface Taxes {
|
|
170
|
+
amount?: MonetaryValue;
|
|
171
|
+
rate?: MonetaryValue;
|
|
172
|
+
breakdown?: {
|
|
173
|
+
taxable_amount?: MonetaryValue;
|
|
174
|
+
tax_collectable?: MonetaryValue;
|
|
175
|
+
combined_tax_rate?: MonetaryValue;
|
|
176
|
+
gst?: MonetaryValue;
|
|
177
|
+
pst?: MonetaryValue;
|
|
178
|
+
provider?: string;
|
|
179
|
+
[index: string]: any;
|
|
180
|
+
};
|
|
181
|
+
provider?: string;
|
|
182
|
+
quote_payload?: TaxRequestDTO;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface PromoDetails {
|
|
186
|
+
code?: string;
|
|
187
|
+
provider?: 'fp' | 'voucherify';
|
|
188
|
+
amount_off?: MonetaryValue;
|
|
189
|
+
percent_off?: MonetaryValue;
|
|
190
|
+
amount?: MonetaryValue;
|
|
191
|
+
app?: string;
|
|
192
|
+
discount?: {
|
|
193
|
+
// effect of the discount, current usage reflects if it is a whole order or item level promo
|
|
194
|
+
effect?: string;
|
|
195
|
+
[index: string]: any;
|
|
196
|
+
};
|
|
197
|
+
provider_data?: FPValidationData;
|
|
198
|
+
order?: PromoOrder;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface Discounts {
|
|
202
|
+
stacked_total?: MonetaryValue;
|
|
203
|
+
stacked_discounts?: Discount[];
|
|
204
|
+
app?: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface Discount {
|
|
208
|
+
id: string;
|
|
209
|
+
// unix epoch timestamp of discount creation in UTC
|
|
210
|
+
createdAt: string;
|
|
211
|
+
// unix epoch timestamp of discount update in UTC
|
|
212
|
+
updatedAt: string;
|
|
213
|
+
// id of the user who created the discount
|
|
214
|
+
createdBy: string;
|
|
215
|
+
// id of the user who updated the discount most recently
|
|
216
|
+
updatedBy: string;
|
|
217
|
+
name: string;
|
|
218
|
+
is?: {
|
|
219
|
+
badgepayPromo?: boolean;
|
|
220
|
+
mealplanPromo?: boolean;
|
|
221
|
+
decliningBalancePromo?: boolean;
|
|
222
|
+
voucherPromo?: boolean;
|
|
223
|
+
};
|
|
224
|
+
status?: {
|
|
225
|
+
live?: boolean;
|
|
226
|
+
publishedTo3rdParty?: boolean;
|
|
227
|
+
readyToPublish?: boolean;
|
|
228
|
+
};
|
|
229
|
+
meta?: {
|
|
230
|
+
provider: {
|
|
231
|
+
voucherify?: {
|
|
232
|
+
id?: string;
|
|
233
|
+
code?: string;
|
|
234
|
+
discount?: {
|
|
235
|
+
type: string;
|
|
236
|
+
amountOff?: number;
|
|
237
|
+
percentOff?: number;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
[index: string]: any;
|
|
242
|
+
};
|
|
243
|
+
applied_amount: MonetaryValue;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface PaymentMethod {
|
|
247
|
+
mealplan?: Mealplan;
|
|
248
|
+
credit_card?: CreditCard;
|
|
249
|
+
digital_wallet_pay?: DigitalWalletPay;
|
|
250
|
+
meal_swipes?: MealSwipes;
|
|
251
|
+
meal_exchange?: MealExchange;
|
|
252
|
+
badge_pay?: CashlessTender;
|
|
253
|
+
stipend?: CashlessTender;
|
|
254
|
+
voucher?: CashlessTender;
|
|
255
|
+
coupon_voucher?: CashlessTender;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface Mealplan {
|
|
259
|
+
id?: string;
|
|
260
|
+
tender?: string;
|
|
261
|
+
total?: MonetaryValue;
|
|
262
|
+
type?: PaymentType;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface CreditCard {
|
|
266
|
+
card_type?: string;
|
|
267
|
+
last4?: string;
|
|
268
|
+
total?: MonetaryValue;
|
|
269
|
+
type?: PaymentType;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface DigitalWalletPay {
|
|
273
|
+
wallet_type?: string;
|
|
274
|
+
total?: MonetaryValue;
|
|
275
|
+
type?: PaymentType;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface MealSwipes {
|
|
279
|
+
id?: string;
|
|
280
|
+
tender?: string;
|
|
281
|
+
tender_type?: string;
|
|
282
|
+
tender_name?: string;
|
|
283
|
+
swipes?: MonetaryValue;
|
|
284
|
+
rate?: MonetaryValue;
|
|
285
|
+
total?: MonetaryValue;
|
|
286
|
+
type?: PaymentType;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export interface MealExchange {
|
|
290
|
+
id?: string;
|
|
291
|
+
tender?: string;
|
|
292
|
+
type?: PaymentType;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface CashlessTender {
|
|
296
|
+
id?: string;
|
|
297
|
+
total?: MonetaryValue;
|
|
298
|
+
tender?: string;
|
|
299
|
+
name?: string;
|
|
300
|
+
type?: PaymentType;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface DrainOrderType {
|
|
304
|
+
taxable?: boolean;
|
|
305
|
+
tax_exempt?: boolean;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface Incentives {
|
|
309
|
+
discounts?: Discounts;
|
|
310
|
+
promo?: PromoDetails;
|
|
311
|
+
stacked_total?: MonetaryValue;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface Label {
|
|
315
|
+
en?: string;
|
|
316
|
+
fr?: string;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface Price {
|
|
320
|
+
amount?: MonetaryValue;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export type MonetaryValue = number;
|
|
324
|
+
|
|
325
|
+
export type IntegerValue = number;
|
|
326
|
+
|
|
327
|
+
export type Quantity = number;
|
|
328
|
+
|
|
329
|
+
export type PaymentType = string;
|
|
330
|
+
|
|
331
|
+
export type AmountOffExclusion = 'discount' | 'promo';
|
|
332
|
+
|
|
333
|
+
export type ModifierSizing = {
|
|
334
|
+
name?: string;
|
|
335
|
+
price?: MonetaryValue;
|
|
336
|
+
posid?: string;
|
|
337
|
+
}[];
|
|
338
|
+
|
|
339
|
+
export interface FPValidationData {
|
|
340
|
+
discountIncentives?: {
|
|
341
|
+
id?: string;
|
|
342
|
+
program?: {
|
|
343
|
+
code?: string;
|
|
344
|
+
};
|
|
345
|
+
[index: string]: any;
|
|
346
|
+
}[];
|
|
347
|
+
[index: string]: any;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface PromoOrder {
|
|
351
|
+
items_applied_discount_amount?: number;
|
|
352
|
+
amount?: number;
|
|
353
|
+
items_discount_amount?: number;
|
|
354
|
+
total_amount?: number;
|
|
355
|
+
total_applied_discount_amount?: number;
|
|
356
|
+
total_discount_amount?: number;
|
|
357
|
+
items?: PromoItem[];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface PromoItem {
|
|
361
|
+
applied_discount_amount?: number;
|
|
362
|
+
amount?: number;
|
|
363
|
+
discount_amount?: number;
|
|
364
|
+
price?: number;
|
|
365
|
+
quantity?: number;
|
|
366
|
+
source_id?: string;
|
|
367
|
+
subtotal_amount?: number;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export interface TaxRequestDTO {
|
|
371
|
+
// a unique identifier representing the transaction
|
|
372
|
+
id: string;
|
|
373
|
+
// the app to associate the transaction with
|
|
374
|
+
appName: string;
|
|
375
|
+
// the order fulfillment type
|
|
376
|
+
transactionType: 'pickup' | 'delivery';
|
|
377
|
+
// numeric value of service fee
|
|
378
|
+
serviceFee?: number;
|
|
379
|
+
// numeric value of delivery fee
|
|
380
|
+
deliveryFee?: number;
|
|
381
|
+
locationData: TaxLocationData;
|
|
382
|
+
// items to calculate tax on
|
|
383
|
+
items: TaxItemDTO[];
|
|
384
|
+
// iso timstamp of transaction date
|
|
385
|
+
transactionDate?: string;
|
|
386
|
+
// an array of items to refund
|
|
387
|
+
refunds?: TaxRefund[];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export interface TaxLocationData {
|
|
391
|
+
// unique location identifier
|
|
392
|
+
id: string;
|
|
393
|
+
// country of transaction
|
|
394
|
+
country: string;
|
|
395
|
+
// state or province of transaction
|
|
396
|
+
stateOrProvince: string;
|
|
397
|
+
// city of transaction
|
|
398
|
+
city: string;
|
|
399
|
+
// postal code of transaction
|
|
400
|
+
postalCode: string;
|
|
401
|
+
// street address of transaction
|
|
402
|
+
streetAddress: string;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export interface TaxItemDTO {
|
|
406
|
+
// unique item identifier
|
|
407
|
+
id: string;
|
|
408
|
+
// indicates a tax rule for an item
|
|
409
|
+
taxTagCode: string;
|
|
410
|
+
// amount of an item
|
|
411
|
+
quantity: number;
|
|
412
|
+
// decimal price of an item
|
|
413
|
+
price: number;
|
|
414
|
+
// amount of tax charged on an item after funds are captured
|
|
415
|
+
taxedAmount?: number;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export interface TaxRefund {
|
|
419
|
+
// unique identifier of the refunded item
|
|
420
|
+
refundItemId: string;
|
|
421
|
+
// quantity amount of the item to be refunded
|
|
422
|
+
refundItemQuantity: number;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export interface Tender {
|
|
426
|
+
id: string;
|
|
427
|
+
name?: string;
|
|
428
|
+
balance?: MonetaryValue;
|
|
429
|
+
type: 'declining_balance' | 'meal_equivalent' | 'meal_exchange';
|
|
430
|
+
is: {
|
|
431
|
+
eligible: boolean;
|
|
432
|
+
validated?: boolean;
|
|
433
|
+
};
|
|
434
|
+
currency?: string;
|
|
435
|
+
tender_number?: string;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export interface PaymentMethods {
|
|
439
|
+
mealplan?: {
|
|
440
|
+
tenders: Tender[];
|
|
441
|
+
};
|
|
442
|
+
cashless?: {
|
|
443
|
+
tenders: {
|
|
444
|
+
balance?: MonetaryValue;
|
|
445
|
+
id: string;
|
|
446
|
+
name?: string;
|
|
447
|
+
is: {
|
|
448
|
+
eligible: boolean;
|
|
449
|
+
};
|
|
450
|
+
}[];
|
|
451
|
+
};
|
|
452
|
+
credit_cards?: {
|
|
453
|
+
data: {
|
|
454
|
+
billing_address?: {
|
|
455
|
+
postal_code?: string;
|
|
456
|
+
};
|
|
457
|
+
card_type?: string;
|
|
458
|
+
expiry?: {
|
|
459
|
+
month?: number;
|
|
460
|
+
year?: number;
|
|
461
|
+
};
|
|
462
|
+
is: {
|
|
463
|
+
eligible: boolean;
|
|
464
|
+
preferred?: boolean;
|
|
465
|
+
};
|
|
466
|
+
masked_card_number?: string;
|
|
467
|
+
name_on_card?: string;
|
|
468
|
+
nickname?: string;
|
|
469
|
+
token: string;
|
|
470
|
+
token_expiration_date?: string;
|
|
471
|
+
}[];
|
|
472
|
+
};
|
|
473
|
+
digital_wallet_pay?: {
|
|
474
|
+
applewallet: {
|
|
475
|
+
is: {
|
|
476
|
+
eligible: boolean;
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
googlewallet: {
|
|
480
|
+
is: {
|
|
481
|
+
eligible: boolean;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export interface ShoppingCartCreatedEvent {
|
|
488
|
+
id: string;
|
|
489
|
+
type: 'ShoppingCartCreatedEvent';
|
|
490
|
+
version: '0.0.1';
|
|
491
|
+
timestamp: string;
|
|
492
|
+
traceContext: {
|
|
493
|
+
traceId?: string;
|
|
494
|
+
};
|
|
495
|
+
payload: {
|
|
496
|
+
shoppingCart: ShoppingCart;
|
|
497
|
+
};
|
|
498
|
+
source: string;
|
|
499
|
+
}
|