@orderingstack/ordering-types 1.0.1 → 1.0.9
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/dist/cjs/index.d.ts +68 -69
- package/dist/cjs/index.js +66 -66
- package/dist/cjs/kiosk.d.ts +72 -0
- package/dist/esm/index.d.ts +68 -69
- package/dist/esm/index.js +65 -65
- package/dist/esm/kiosk.d.ts +72 -0
- package/package.json +5 -2
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,41 +2,41 @@ export * from "./kiosk";
|
|
|
2
2
|
export interface Restaurant {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
|
-
geoPosition:
|
|
6
|
-
address:
|
|
5
|
+
geoPosition: IGeoPosition;
|
|
6
|
+
address: IAddress;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface IGeoPosition {
|
|
9
9
|
lat: number;
|
|
10
10
|
lng: number;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface IAddress {
|
|
13
13
|
street: string;
|
|
14
14
|
number: string;
|
|
15
15
|
postal: string;
|
|
16
16
|
city: string;
|
|
17
17
|
country: string;
|
|
18
18
|
}
|
|
19
|
-
export declare enum
|
|
19
|
+
export declare enum ECouponViewType {
|
|
20
20
|
CAROUSEL = "carousel",
|
|
21
21
|
NORMAL = "normal",
|
|
22
22
|
IMAGE = "image"
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface ICoupon {
|
|
25
25
|
id: string;
|
|
26
26
|
img: string;
|
|
27
|
-
viewType?:
|
|
27
|
+
viewType?: ECouponViewType;
|
|
28
28
|
size?: "md" | "lg";
|
|
29
29
|
price?: number;
|
|
30
30
|
name?: string;
|
|
31
31
|
endDate?: string;
|
|
32
32
|
timeToEnd?: any;
|
|
33
33
|
}
|
|
34
|
-
export interface
|
|
34
|
+
export interface ILanguage {
|
|
35
35
|
label: string;
|
|
36
36
|
key: string;
|
|
37
37
|
icon: any;
|
|
38
38
|
}
|
|
39
|
-
export type StringBoolean = "true" | "false";
|
|
39
|
+
export declare type StringBoolean = "true" | "false";
|
|
40
40
|
export declare enum EProductKind {
|
|
41
41
|
GROUP = "3e/group",
|
|
42
42
|
PRODUCT = "3e/product",
|
|
@@ -51,12 +51,13 @@ export declare enum EProductKindBucket {
|
|
|
51
51
|
GROUP = "group",
|
|
52
52
|
PRODUCT = "product"
|
|
53
53
|
}
|
|
54
|
-
export type
|
|
54
|
+
export declare type TLiterals = {
|
|
55
55
|
name: string;
|
|
56
56
|
fiscal?: string;
|
|
57
57
|
"target-product-id"?: string;
|
|
58
|
+
description?: string;
|
|
58
59
|
};
|
|
59
|
-
export type
|
|
60
|
+
export declare type TMedia = {
|
|
60
61
|
url: string;
|
|
61
62
|
name: string;
|
|
62
63
|
};
|
|
@@ -75,21 +76,29 @@ export interface IProduct {
|
|
|
75
76
|
img?: string;
|
|
76
77
|
items?: IProduct[];
|
|
77
78
|
kind: EProductKind | EProductKindBucket;
|
|
78
|
-
literals?:
|
|
79
|
+
literals?: TLiterals;
|
|
79
80
|
details?: {
|
|
80
|
-
literals?:
|
|
81
|
-
media?:
|
|
81
|
+
literals?: TLiterals;
|
|
82
|
+
media?: TMedia[];
|
|
82
83
|
};
|
|
83
|
-
price
|
|
84
|
+
price?: string;
|
|
84
85
|
minPrice?: string;
|
|
85
|
-
quantity
|
|
86
|
-
vat
|
|
86
|
+
quantity?: string;
|
|
87
|
+
vat?: string;
|
|
87
88
|
outsideAvailabilitySlot?: boolean;
|
|
88
89
|
state?: IProductState;
|
|
89
90
|
selCtx: string;
|
|
90
91
|
filter?: IProductFilter;
|
|
91
92
|
fltCtx?: string;
|
|
92
93
|
emit?: IProductEmit;
|
|
94
|
+
qtyMin?: string;
|
|
95
|
+
qtyMax?: string;
|
|
96
|
+
_?: Record<string, string>;
|
|
97
|
+
bom?: Record<string, {
|
|
98
|
+
unit: string;
|
|
99
|
+
qty: string;
|
|
100
|
+
}>;
|
|
101
|
+
attrs?: Record<string, string | boolean>;
|
|
93
102
|
}
|
|
94
103
|
export interface IProductState {
|
|
95
104
|
selected: IProductStateFilter;
|
|
@@ -126,7 +135,7 @@ export interface User {
|
|
|
126
135
|
email?: string;
|
|
127
136
|
extra?: Extra;
|
|
128
137
|
}
|
|
129
|
-
export declare enum
|
|
138
|
+
export declare enum EOrderType {
|
|
130
139
|
TAKE_AWAY = "TAKE_AWAY",
|
|
131
140
|
DELIVERY = "DELIVERY",
|
|
132
141
|
DINE_IN = "DINE_IN",
|
|
@@ -152,7 +161,7 @@ export interface OrderDeliveryAddress {
|
|
|
152
161
|
city: string;
|
|
153
162
|
country: string;
|
|
154
163
|
}
|
|
155
|
-
export interface
|
|
164
|
+
export interface IOrder {
|
|
156
165
|
tenant: string;
|
|
157
166
|
id: string;
|
|
158
167
|
extId?: string;
|
|
@@ -167,8 +176,8 @@ export interface Order {
|
|
|
167
176
|
source: string;
|
|
168
177
|
users?: User[];
|
|
169
178
|
loyaltyId?: string;
|
|
170
|
-
coupons?:
|
|
171
|
-
orderType:
|
|
179
|
+
coupons?: IOrderCoupon[];
|
|
180
|
+
orderType: EOrderType;
|
|
172
181
|
deliveryAddress?: OrderDeliveryAddress;
|
|
173
182
|
geoPosition?: {
|
|
174
183
|
lat: number;
|
|
@@ -176,25 +185,25 @@ export interface Order {
|
|
|
176
185
|
};
|
|
177
186
|
total: string;
|
|
178
187
|
editTotal: string;
|
|
179
|
-
status:
|
|
188
|
+
status: EOrderStatus;
|
|
180
189
|
statusInfo?: string;
|
|
181
190
|
comments?: OrderComment[];
|
|
182
191
|
claimCode?: string;
|
|
183
|
-
buckets:
|
|
192
|
+
buckets: IOrderInBucket[];
|
|
184
193
|
payments?: OrderPayment[];
|
|
185
|
-
fiscal?:
|
|
186
|
-
tax:
|
|
187
|
-
extra?:
|
|
194
|
+
fiscal?: IOrderFiscal[];
|
|
195
|
+
tax: ITaxSummary[];
|
|
196
|
+
extra?: IOrderExtra;
|
|
188
197
|
traces?: {
|
|
189
198
|
[propName: string]: string;
|
|
190
199
|
};
|
|
191
|
-
logs?:
|
|
200
|
+
logs?: IOrderLog[];
|
|
192
201
|
locked?: boolean;
|
|
193
202
|
completed?: boolean;
|
|
194
203
|
verified?: boolean;
|
|
195
204
|
closed?: boolean;
|
|
196
205
|
}
|
|
197
|
-
export interface
|
|
206
|
+
export interface IOrderCoupon {
|
|
198
207
|
coupon: string;
|
|
199
208
|
addedAt: string;
|
|
200
209
|
addedBy: string;
|
|
@@ -207,7 +216,7 @@ export interface OrderCoupon {
|
|
|
207
216
|
userId?: string;
|
|
208
217
|
};
|
|
209
218
|
}
|
|
210
|
-
export declare enum
|
|
219
|
+
export declare enum EOrderStatus {
|
|
211
220
|
NEW = "NEW",
|
|
212
221
|
COMPLETED = "COMPLETED",
|
|
213
222
|
VERIFIED = "VERIFIED",
|
|
@@ -225,13 +234,13 @@ export interface OrderComment {
|
|
|
225
234
|
comment: string;
|
|
226
235
|
extra?: Extra;
|
|
227
236
|
}
|
|
228
|
-
export interface
|
|
237
|
+
export interface IOrderInBucket {
|
|
229
238
|
venue: string;
|
|
230
239
|
sync: boolean;
|
|
231
240
|
syncId: string;
|
|
232
241
|
name: string;
|
|
233
242
|
menu: string;
|
|
234
|
-
lines:
|
|
243
|
+
lines: IOrderLine[];
|
|
235
244
|
priceList?: string;
|
|
236
245
|
warehouse?: string;
|
|
237
246
|
queuePos?: string;
|
|
@@ -239,7 +248,7 @@ export interface OrderInBucket {
|
|
|
239
248
|
}
|
|
240
249
|
export interface IOrderPayment {
|
|
241
250
|
id: string;
|
|
242
|
-
type:
|
|
251
|
+
type: EOrderPaymentType;
|
|
243
252
|
source: string;
|
|
244
253
|
amount: number;
|
|
245
254
|
initialAmount?: number;
|
|
@@ -247,7 +256,7 @@ export interface IOrderPayment {
|
|
|
247
256
|
timestamp?: string;
|
|
248
257
|
extra?: Extra;
|
|
249
258
|
}
|
|
250
|
-
export declare enum
|
|
259
|
+
export declare enum EOrderPaymentType {
|
|
251
260
|
CASH = "CASH",
|
|
252
261
|
CARD = "CARD",
|
|
253
262
|
COD = "COD",
|
|
@@ -261,7 +270,7 @@ export declare enum OrderPaymentType {
|
|
|
261
270
|
}
|
|
262
271
|
export interface OrderPayment {
|
|
263
272
|
id: string;
|
|
264
|
-
type:
|
|
273
|
+
type: EOrderPaymentType;
|
|
265
274
|
source: string;
|
|
266
275
|
amount: number;
|
|
267
276
|
initialAmount?: number;
|
|
@@ -269,7 +278,7 @@ export interface OrderPayment {
|
|
|
269
278
|
timestamp?: string;
|
|
270
279
|
extra?: Extra;
|
|
271
280
|
}
|
|
272
|
-
export interface
|
|
281
|
+
export interface IOrderFiscal {
|
|
273
282
|
timestamp: string;
|
|
274
283
|
user?: string;
|
|
275
284
|
venue?: string;
|
|
@@ -287,7 +296,7 @@ export interface OrderFiscal {
|
|
|
287
296
|
[propName: string]: number;
|
|
288
297
|
};
|
|
289
298
|
}
|
|
290
|
-
export interface
|
|
299
|
+
export interface ITaxSummary {
|
|
291
300
|
rate: string;
|
|
292
301
|
confirmed?: boolean;
|
|
293
302
|
netto: number;
|
|
@@ -297,7 +306,7 @@ export interface TaxSummary {
|
|
|
297
306
|
/**
|
|
298
307
|
* OrderExtra interface
|
|
299
308
|
*
|
|
300
|
-
* @interface
|
|
309
|
+
* @interface IOrderExtra
|
|
301
310
|
* @manual-verify {string} order needs manual verification
|
|
302
311
|
* @x-collect-time {string} estimated pickup time from aggregator
|
|
303
312
|
* @courier-name {string} courier name from aggregator
|
|
@@ -309,7 +318,7 @@ export interface TaxSummary {
|
|
|
309
318
|
* @x-agg-id {string} order ID from aggregator
|
|
310
319
|
* @support-order-id {string} order code from aggregator to be used with support and same as seen by customer,
|
|
311
320
|
*/
|
|
312
|
-
export interface
|
|
321
|
+
export interface IOrderExtra {
|
|
313
322
|
"x-source"?: OrderSource;
|
|
314
323
|
"x-source-type"?: "INTEGRATOR";
|
|
315
324
|
"manual-verify"?: string;
|
|
@@ -324,29 +333,29 @@ export interface OrderExtra {
|
|
|
324
333
|
"support-order-id"?: string;
|
|
325
334
|
"x-pos-id"?: string;
|
|
326
335
|
}
|
|
327
|
-
export interface
|
|
336
|
+
export interface IOrderLog {
|
|
328
337
|
timestamp?: string;
|
|
329
338
|
user?: string;
|
|
330
339
|
ip?: string;
|
|
331
340
|
message?: string;
|
|
332
341
|
lines?: string[];
|
|
333
342
|
}
|
|
334
|
-
export interface
|
|
343
|
+
export interface IOrderLine {
|
|
335
344
|
bom?: Object;
|
|
336
345
|
comments?: OrderComment[];
|
|
337
346
|
created: string;
|
|
338
347
|
creator?: string;
|
|
339
|
-
discounts?:
|
|
348
|
+
discounts?: IDiscount[];
|
|
340
349
|
extra: Extra;
|
|
341
350
|
hash: string;
|
|
342
351
|
id: string;
|
|
343
352
|
price: string;
|
|
344
|
-
product:
|
|
353
|
+
product: IOrderProduct;
|
|
345
354
|
productConfig: IProductState;
|
|
346
355
|
productId: string;
|
|
347
356
|
quantity: number;
|
|
348
357
|
source: string;
|
|
349
|
-
status:
|
|
358
|
+
status: EOrderLineStatus;
|
|
350
359
|
total: string;
|
|
351
360
|
updated: string;
|
|
352
361
|
}
|
|
@@ -373,27 +382,17 @@ export declare enum OrderSource {
|
|
|
373
382
|
UBER = "UBER",
|
|
374
383
|
BOLT = "BOLT"
|
|
375
384
|
}
|
|
376
|
-
export interface
|
|
385
|
+
export interface IOrderProduct {
|
|
377
386
|
id: string;
|
|
378
|
-
kind:
|
|
379
|
-
literals:
|
|
380
|
-
items?:
|
|
387
|
+
kind: EOrderProductKind;
|
|
388
|
+
literals: IProductLiterals;
|
|
389
|
+
items?: IOrderProduct[];
|
|
381
390
|
img: string;
|
|
382
|
-
quantity:
|
|
383
|
-
price:
|
|
384
|
-
extra: Extra;
|
|
385
|
-
}
|
|
386
|
-
export interface OrderProduct {
|
|
387
|
-
id: string;
|
|
388
|
-
kind: OrderProductKind;
|
|
389
|
-
literals: ProductLiterals;
|
|
390
|
-
items?: OrderProduct[];
|
|
391
|
-
img: string;
|
|
392
|
-
quantity: number;
|
|
393
|
-
price: number;
|
|
391
|
+
quantity: string;
|
|
392
|
+
price: string;
|
|
394
393
|
extra: Extra;
|
|
395
394
|
}
|
|
396
|
-
export declare enum
|
|
395
|
+
export declare enum EOrderLineStatus {
|
|
397
396
|
NEW = "NEW",
|
|
398
397
|
TECHNICAL = "TECHNICAL",
|
|
399
398
|
CONFIRMED = "CONFIRMED",
|
|
@@ -402,7 +401,7 @@ export declare enum OrderLineStatus {
|
|
|
402
401
|
VOID = "VOID",
|
|
403
402
|
WASTE = "WASTE"
|
|
404
403
|
}
|
|
405
|
-
export interface
|
|
404
|
+
export interface IDiscount {
|
|
406
405
|
layer: string;
|
|
407
406
|
name?: string;
|
|
408
407
|
discountPrice: number;
|
|
@@ -411,15 +410,15 @@ export interface Discount {
|
|
|
411
410
|
path?: string;
|
|
412
411
|
price: number;
|
|
413
412
|
}
|
|
414
|
-
export declare enum
|
|
413
|
+
export declare enum EOrderProductKind {
|
|
415
414
|
GROUP = "group",
|
|
416
415
|
PRODUCT = "product"
|
|
417
416
|
}
|
|
418
|
-
export interface
|
|
417
|
+
export interface IProductLiterals {
|
|
419
418
|
[propName: string]: any;
|
|
420
419
|
}
|
|
421
|
-
type
|
|
422
|
-
export type
|
|
420
|
+
declare type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";
|
|
421
|
+
export declare type TSaleChannelWeek = Partial<Record<TWeekDay, {
|
|
423
422
|
from: string;
|
|
424
423
|
to: string;
|
|
425
424
|
}[]>>;
|
|
@@ -427,7 +426,7 @@ export interface SaleChannel {
|
|
|
427
426
|
active?: boolean;
|
|
428
427
|
minDeliveryTime?: string;
|
|
429
428
|
minOrderValue?: string;
|
|
430
|
-
week?:
|
|
429
|
+
week?: TSaleChannelWeek;
|
|
431
430
|
}
|
|
432
431
|
export declare enum EChannelName {
|
|
433
432
|
DINE_IN = "DINE_IN",
|
|
@@ -439,7 +438,7 @@ export declare enum EChannelName {
|
|
|
439
438
|
BOLT_DELIVERY = "BOLT_DELIVERY",
|
|
440
439
|
WOLT_DELIVERY = "WOLT_DELIVERY"
|
|
441
440
|
}
|
|
442
|
-
export interface
|
|
441
|
+
export interface IVenueConfig {
|
|
443
442
|
active: boolean;
|
|
444
443
|
address: {
|
|
445
444
|
city: string;
|
|
@@ -451,7 +450,7 @@ export interface VenueConfig {
|
|
|
451
450
|
channelConstraints: Partial<Record<EChannelName, SaleChannel>>;
|
|
452
451
|
device: Record<string, Record<string, string>>;
|
|
453
452
|
extra: Record<string, string>;
|
|
454
|
-
geoPosition:
|
|
453
|
+
geoPosition: IGeoPosition;
|
|
455
454
|
id: string;
|
|
456
455
|
menu: string;
|
|
457
456
|
name: string;
|
|
@@ -471,7 +470,7 @@ export interface IFiscalEntry {
|
|
|
471
470
|
export interface IFiscalData {
|
|
472
471
|
amount: string;
|
|
473
472
|
entries: IFiscalEntry[];
|
|
474
|
-
payments: Partial<Record<
|
|
473
|
+
payments: Partial<Record<EOrderPaymentType, string>>;
|
|
475
474
|
timestamp: string;
|
|
476
475
|
}
|
|
477
476
|
/**
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,14 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.EChannelName = exports.
|
|
17
|
+
exports.EChannelName = exports.EOrderProductKind = exports.EOrderLineStatus = exports.OrderSource = exports.EOrderPaymentType = exports.EOrderStatus = exports.EOrderType = exports.EProductKindBucket = exports.EProductKind = exports.ECouponViewType = void 0;
|
|
18
18
|
__exportStar(require("./kiosk"), exports);
|
|
19
|
-
var
|
|
20
|
-
(function (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})(
|
|
19
|
+
var ECouponViewType;
|
|
20
|
+
(function (ECouponViewType) {
|
|
21
|
+
ECouponViewType["CAROUSEL"] = "carousel";
|
|
22
|
+
ECouponViewType["NORMAL"] = "normal";
|
|
23
|
+
ECouponViewType["IMAGE"] = "image";
|
|
24
|
+
})(ECouponViewType = exports.ECouponViewType || (exports.ECouponViewType = {}));
|
|
25
25
|
var EProductKind;
|
|
26
26
|
(function (EProductKind) {
|
|
27
27
|
EProductKind["GROUP"] = "3e/group";
|
|
@@ -38,50 +38,50 @@ var EProductKindBucket;
|
|
|
38
38
|
EProductKindBucket["GROUP"] = "group";
|
|
39
39
|
EProductKindBucket["PRODUCT"] = "product";
|
|
40
40
|
})(EProductKindBucket = exports.EProductKindBucket || (exports.EProductKindBucket = {}));
|
|
41
|
-
var
|
|
42
|
-
(function (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})(
|
|
60
|
-
var
|
|
61
|
-
(function (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})(
|
|
72
|
-
var
|
|
73
|
-
(function (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
})(
|
|
41
|
+
var EOrderType;
|
|
42
|
+
(function (EOrderType) {
|
|
43
|
+
EOrderType["TAKE_AWAY"] = "TAKE_AWAY";
|
|
44
|
+
EOrderType["DELIVERY"] = "DELIVERY";
|
|
45
|
+
EOrderType["DINE_IN"] = "DINE_IN";
|
|
46
|
+
EOrderType["DINE_IN_OPEN"] = "DINE_IN_OPEN";
|
|
47
|
+
EOrderType["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
48
|
+
EOrderType["GLOVO_TAKE_AWAY"] = "GLOVO_TAKE_AWAY";
|
|
49
|
+
EOrderType["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
50
|
+
EOrderType["JUSTEAT_TAKE_AWAY"] = "JUSTEAT_TAKE_AWAY";
|
|
51
|
+
EOrderType["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
52
|
+
EOrderType["UBER_TAKE_AWAY"] = "UBER_TAKE_AWAY";
|
|
53
|
+
EOrderType["UBER_DINE_IN"] = "UBER_DINE_IN";
|
|
54
|
+
EOrderType["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
55
|
+
EOrderType["BOLT_TAKE_AWAY"] = "BOLT_TAKE_AWAY";
|
|
56
|
+
EOrderType["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
57
|
+
EOrderType["WOLT_TAKE_AWAY"] = "WOLT_TAKE_AWAY";
|
|
58
|
+
EOrderType["WOLT_DINE_IN"] = "WOLT_DINE_IN";
|
|
59
|
+
})(EOrderType = exports.EOrderType || (exports.EOrderType = {}));
|
|
60
|
+
var EOrderStatus;
|
|
61
|
+
(function (EOrderStatus) {
|
|
62
|
+
EOrderStatus["NEW"] = "NEW";
|
|
63
|
+
EOrderStatus["COMPLETED"] = "COMPLETED";
|
|
64
|
+
EOrderStatus["VERIFIED"] = "VERIFIED";
|
|
65
|
+
EOrderStatus["DELIVER"] = "DELIVER";
|
|
66
|
+
EOrderStatus["DELIVERED"] = "DELIVERED";
|
|
67
|
+
EOrderStatus["CLOSED"] = "CLOSED";
|
|
68
|
+
EOrderStatus["ABANDONED"] = "ABANDONED";
|
|
69
|
+
EOrderStatus["CANCELLED"] = "CANCELLED";
|
|
70
|
+
EOrderStatus["PICKED"] = "PICKED";
|
|
71
|
+
})(EOrderStatus = exports.EOrderStatus || (exports.EOrderStatus = {}));
|
|
72
|
+
var EOrderPaymentType;
|
|
73
|
+
(function (EOrderPaymentType) {
|
|
74
|
+
EOrderPaymentType["CASH"] = "CASH";
|
|
75
|
+
EOrderPaymentType["CARD"] = "CARD";
|
|
76
|
+
EOrderPaymentType["COD"] = "COD";
|
|
77
|
+
EOrderPaymentType["TERMINAL"] = "TERMINAL";
|
|
78
|
+
EOrderPaymentType["EPAYMENT"] = "EPAYMENT";
|
|
79
|
+
EOrderPaymentType["COUPON"] = "COUPON";
|
|
80
|
+
EOrderPaymentType["WALLET"] = "WALLET";
|
|
81
|
+
EOrderPaymentType["PREAUTHORIZED"] = "PREAUTHORIZED";
|
|
82
|
+
EOrderPaymentType["RETURN"] = "RETURN";
|
|
83
|
+
EOrderPaymentType["EXTERNAL"] = "EXTERNAL";
|
|
84
|
+
})(EOrderPaymentType = exports.EOrderPaymentType || (exports.EOrderPaymentType = {}));
|
|
85
85
|
var OrderSource;
|
|
86
86
|
(function (OrderSource) {
|
|
87
87
|
OrderSource["KIOSK"] = "KIOSK";
|
|
@@ -93,21 +93,21 @@ var OrderSource;
|
|
|
93
93
|
OrderSource["UBER"] = "UBER";
|
|
94
94
|
OrderSource["BOLT"] = "BOLT";
|
|
95
95
|
})(OrderSource = exports.OrderSource || (exports.OrderSource = {}));
|
|
96
|
-
var
|
|
97
|
-
(function (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})(
|
|
106
|
-
var
|
|
107
|
-
(function (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
})(
|
|
96
|
+
var EOrderLineStatus;
|
|
97
|
+
(function (EOrderLineStatus) {
|
|
98
|
+
EOrderLineStatus["NEW"] = "NEW";
|
|
99
|
+
EOrderLineStatus["TECHNICAL"] = "TECHNICAL";
|
|
100
|
+
EOrderLineStatus["CONFIRMED"] = "CONFIRMED";
|
|
101
|
+
EOrderLineStatus["PROCESSING"] = "PROCESSING";
|
|
102
|
+
EOrderLineStatus["PROCESSED"] = "PROCESSED";
|
|
103
|
+
EOrderLineStatus["VOID"] = "VOID";
|
|
104
|
+
EOrderLineStatus["WASTE"] = "WASTE";
|
|
105
|
+
})(EOrderLineStatus = exports.EOrderLineStatus || (exports.EOrderLineStatus = {}));
|
|
106
|
+
var EOrderProductKind;
|
|
107
|
+
(function (EOrderProductKind) {
|
|
108
|
+
EOrderProductKind["GROUP"] = "group";
|
|
109
|
+
EOrderProductKind["PRODUCT"] = "product";
|
|
110
|
+
})(EOrderProductKind = exports.EOrderProductKind || (exports.EOrderProductKind = {}));
|
|
111
111
|
var EChannelName;
|
|
112
112
|
(function (EChannelName) {
|
|
113
113
|
EChannelName["DINE_IN"] = "DINE_IN";
|
package/dist/cjs/kiosk.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import { IProduct, IOrder } from "./index";
|
|
3
|
+
import { UseTransitionProps } from "react-spring";
|
|
4
|
+
import { IOrderLine } from "./index";
|
|
1
5
|
export declare enum EPaymentStatus {
|
|
2
6
|
UNINITIALIZED = "UNINITIALIZED",
|
|
3
7
|
PROCESSING = "PROCESSING",
|
|
@@ -9,3 +13,71 @@ export declare enum EPaymentStatus {
|
|
|
9
13
|
SENDING_RECEIPT_SUCCESS = "SENDING_RECEIPT_SUCCESS",
|
|
10
14
|
ERROR = "ERROR"
|
|
11
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Theme interface
|
|
18
|
+
* @interface ITheme
|
|
19
|
+
* @
|
|
20
|
+
*/
|
|
21
|
+
export interface ITheme {
|
|
22
|
+
'--color-primary': string;
|
|
23
|
+
'--color-primary-light': string;
|
|
24
|
+
'--color-primary-dark': string;
|
|
25
|
+
'--color-secondary': string;
|
|
26
|
+
'--color-grey-light': string;
|
|
27
|
+
'--color-red': string;
|
|
28
|
+
'--color-red-light': string;
|
|
29
|
+
'--fontFamily': string;
|
|
30
|
+
'--fontFamily-upper': string;
|
|
31
|
+
'--color-background': string;
|
|
32
|
+
'--color-btn-primary': string;
|
|
33
|
+
'--color-btn-secondary': string;
|
|
34
|
+
'--color-btn-disabled': string;
|
|
35
|
+
'--font-color-btn-primary': string;
|
|
36
|
+
'--font-color-btn-secondary': string;
|
|
37
|
+
'--font-color-btn-disabled': string;
|
|
38
|
+
'--font-color-bg-primary': string;
|
|
39
|
+
'--product-tile-border-color': string;
|
|
40
|
+
[property: string]: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IMenuProps {
|
|
43
|
+
menu: IProduct[];
|
|
44
|
+
handleSelectProduct: (product: IProduct | string) => void;
|
|
45
|
+
Header?: ReactElement;
|
|
46
|
+
Logo?: ReactElement;
|
|
47
|
+
TopNav?: ReactElement;
|
|
48
|
+
BottomNav?: ReactElement;
|
|
49
|
+
MenuTile?: React.FC<IMenuTileProps>;
|
|
50
|
+
CategorySection?: React.FC<IMenuCategorySectionProps>;
|
|
51
|
+
fallbackImg?: string;
|
|
52
|
+
lazyLoadImg?: boolean;
|
|
53
|
+
currency?: string;
|
|
54
|
+
timeZone?: string;
|
|
55
|
+
availabilityMarkOnly?: boolean;
|
|
56
|
+
availabilityCheckInterval?: number;
|
|
57
|
+
cols?: number;
|
|
58
|
+
colsLg?: number;
|
|
59
|
+
stacking: 'vertical' | 'horizontal';
|
|
60
|
+
transitionProps?: UseTransitionProps;
|
|
61
|
+
onMenuCategoryViewed?: (category: IProduct) => void;
|
|
62
|
+
goToCheckout: () => void;
|
|
63
|
+
goToStart: () => void;
|
|
64
|
+
order?: IOrder;
|
|
65
|
+
changeQuantity: (line: IOrderLine, quantity: number) => void;
|
|
66
|
+
}
|
|
67
|
+
export interface IMenuTileProps {
|
|
68
|
+
product: IProduct;
|
|
69
|
+
onProductClicked: (product: IProduct | string) => void;
|
|
70
|
+
fallbackImg: string;
|
|
71
|
+
currency?: string;
|
|
72
|
+
lazyLoadImg?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface IMenuCategorySectionProps {
|
|
75
|
+
category: IProduct;
|
|
76
|
+
onProductClicked: (IProduct: IProduct | string) => void;
|
|
77
|
+
fallbackImg: string;
|
|
78
|
+
lazyLoadImg?: boolean;
|
|
79
|
+
currency?: string;
|
|
80
|
+
cols?: number;
|
|
81
|
+
colsLg?: number;
|
|
82
|
+
MenuTile?: React.FC<IMenuTileProps>;
|
|
83
|
+
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,41 +2,41 @@ export * from "./kiosk";
|
|
|
2
2
|
export interface Restaurant {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
|
-
geoPosition:
|
|
6
|
-
address:
|
|
5
|
+
geoPosition: IGeoPosition;
|
|
6
|
+
address: IAddress;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface IGeoPosition {
|
|
9
9
|
lat: number;
|
|
10
10
|
lng: number;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface IAddress {
|
|
13
13
|
street: string;
|
|
14
14
|
number: string;
|
|
15
15
|
postal: string;
|
|
16
16
|
city: string;
|
|
17
17
|
country: string;
|
|
18
18
|
}
|
|
19
|
-
export declare enum
|
|
19
|
+
export declare enum ECouponViewType {
|
|
20
20
|
CAROUSEL = "carousel",
|
|
21
21
|
NORMAL = "normal",
|
|
22
22
|
IMAGE = "image"
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface ICoupon {
|
|
25
25
|
id: string;
|
|
26
26
|
img: string;
|
|
27
|
-
viewType?:
|
|
27
|
+
viewType?: ECouponViewType;
|
|
28
28
|
size?: "md" | "lg";
|
|
29
29
|
price?: number;
|
|
30
30
|
name?: string;
|
|
31
31
|
endDate?: string;
|
|
32
32
|
timeToEnd?: any;
|
|
33
33
|
}
|
|
34
|
-
export interface
|
|
34
|
+
export interface ILanguage {
|
|
35
35
|
label: string;
|
|
36
36
|
key: string;
|
|
37
37
|
icon: any;
|
|
38
38
|
}
|
|
39
|
-
export type StringBoolean = "true" | "false";
|
|
39
|
+
export declare type StringBoolean = "true" | "false";
|
|
40
40
|
export declare enum EProductKind {
|
|
41
41
|
GROUP = "3e/group",
|
|
42
42
|
PRODUCT = "3e/product",
|
|
@@ -51,12 +51,13 @@ export declare enum EProductKindBucket {
|
|
|
51
51
|
GROUP = "group",
|
|
52
52
|
PRODUCT = "product"
|
|
53
53
|
}
|
|
54
|
-
export type
|
|
54
|
+
export declare type TLiterals = {
|
|
55
55
|
name: string;
|
|
56
56
|
fiscal?: string;
|
|
57
57
|
"target-product-id"?: string;
|
|
58
|
+
description?: string;
|
|
58
59
|
};
|
|
59
|
-
export type
|
|
60
|
+
export declare type TMedia = {
|
|
60
61
|
url: string;
|
|
61
62
|
name: string;
|
|
62
63
|
};
|
|
@@ -75,21 +76,29 @@ export interface IProduct {
|
|
|
75
76
|
img?: string;
|
|
76
77
|
items?: IProduct[];
|
|
77
78
|
kind: EProductKind | EProductKindBucket;
|
|
78
|
-
literals?:
|
|
79
|
+
literals?: TLiterals;
|
|
79
80
|
details?: {
|
|
80
|
-
literals?:
|
|
81
|
-
media?:
|
|
81
|
+
literals?: TLiterals;
|
|
82
|
+
media?: TMedia[];
|
|
82
83
|
};
|
|
83
|
-
price
|
|
84
|
+
price?: string;
|
|
84
85
|
minPrice?: string;
|
|
85
|
-
quantity
|
|
86
|
-
vat
|
|
86
|
+
quantity?: string;
|
|
87
|
+
vat?: string;
|
|
87
88
|
outsideAvailabilitySlot?: boolean;
|
|
88
89
|
state?: IProductState;
|
|
89
90
|
selCtx: string;
|
|
90
91
|
filter?: IProductFilter;
|
|
91
92
|
fltCtx?: string;
|
|
92
93
|
emit?: IProductEmit;
|
|
94
|
+
qtyMin?: string;
|
|
95
|
+
qtyMax?: string;
|
|
96
|
+
_?: Record<string, string>;
|
|
97
|
+
bom?: Record<string, {
|
|
98
|
+
unit: string;
|
|
99
|
+
qty: string;
|
|
100
|
+
}>;
|
|
101
|
+
attrs?: Record<string, string | boolean>;
|
|
93
102
|
}
|
|
94
103
|
export interface IProductState {
|
|
95
104
|
selected: IProductStateFilter;
|
|
@@ -126,7 +135,7 @@ export interface User {
|
|
|
126
135
|
email?: string;
|
|
127
136
|
extra?: Extra;
|
|
128
137
|
}
|
|
129
|
-
export declare enum
|
|
138
|
+
export declare enum EOrderType {
|
|
130
139
|
TAKE_AWAY = "TAKE_AWAY",
|
|
131
140
|
DELIVERY = "DELIVERY",
|
|
132
141
|
DINE_IN = "DINE_IN",
|
|
@@ -152,7 +161,7 @@ export interface OrderDeliveryAddress {
|
|
|
152
161
|
city: string;
|
|
153
162
|
country: string;
|
|
154
163
|
}
|
|
155
|
-
export interface
|
|
164
|
+
export interface IOrder {
|
|
156
165
|
tenant: string;
|
|
157
166
|
id: string;
|
|
158
167
|
extId?: string;
|
|
@@ -167,8 +176,8 @@ export interface Order {
|
|
|
167
176
|
source: string;
|
|
168
177
|
users?: User[];
|
|
169
178
|
loyaltyId?: string;
|
|
170
|
-
coupons?:
|
|
171
|
-
orderType:
|
|
179
|
+
coupons?: IOrderCoupon[];
|
|
180
|
+
orderType: EOrderType;
|
|
172
181
|
deliveryAddress?: OrderDeliveryAddress;
|
|
173
182
|
geoPosition?: {
|
|
174
183
|
lat: number;
|
|
@@ -176,25 +185,25 @@ export interface Order {
|
|
|
176
185
|
};
|
|
177
186
|
total: string;
|
|
178
187
|
editTotal: string;
|
|
179
|
-
status:
|
|
188
|
+
status: EOrderStatus;
|
|
180
189
|
statusInfo?: string;
|
|
181
190
|
comments?: OrderComment[];
|
|
182
191
|
claimCode?: string;
|
|
183
|
-
buckets:
|
|
192
|
+
buckets: IOrderInBucket[];
|
|
184
193
|
payments?: OrderPayment[];
|
|
185
|
-
fiscal?:
|
|
186
|
-
tax:
|
|
187
|
-
extra?:
|
|
194
|
+
fiscal?: IOrderFiscal[];
|
|
195
|
+
tax: ITaxSummary[];
|
|
196
|
+
extra?: IOrderExtra;
|
|
188
197
|
traces?: {
|
|
189
198
|
[propName: string]: string;
|
|
190
199
|
};
|
|
191
|
-
logs?:
|
|
200
|
+
logs?: IOrderLog[];
|
|
192
201
|
locked?: boolean;
|
|
193
202
|
completed?: boolean;
|
|
194
203
|
verified?: boolean;
|
|
195
204
|
closed?: boolean;
|
|
196
205
|
}
|
|
197
|
-
export interface
|
|
206
|
+
export interface IOrderCoupon {
|
|
198
207
|
coupon: string;
|
|
199
208
|
addedAt: string;
|
|
200
209
|
addedBy: string;
|
|
@@ -207,7 +216,7 @@ export interface OrderCoupon {
|
|
|
207
216
|
userId?: string;
|
|
208
217
|
};
|
|
209
218
|
}
|
|
210
|
-
export declare enum
|
|
219
|
+
export declare enum EOrderStatus {
|
|
211
220
|
NEW = "NEW",
|
|
212
221
|
COMPLETED = "COMPLETED",
|
|
213
222
|
VERIFIED = "VERIFIED",
|
|
@@ -225,13 +234,13 @@ export interface OrderComment {
|
|
|
225
234
|
comment: string;
|
|
226
235
|
extra?: Extra;
|
|
227
236
|
}
|
|
228
|
-
export interface
|
|
237
|
+
export interface IOrderInBucket {
|
|
229
238
|
venue: string;
|
|
230
239
|
sync: boolean;
|
|
231
240
|
syncId: string;
|
|
232
241
|
name: string;
|
|
233
242
|
menu: string;
|
|
234
|
-
lines:
|
|
243
|
+
lines: IOrderLine[];
|
|
235
244
|
priceList?: string;
|
|
236
245
|
warehouse?: string;
|
|
237
246
|
queuePos?: string;
|
|
@@ -239,7 +248,7 @@ export interface OrderInBucket {
|
|
|
239
248
|
}
|
|
240
249
|
export interface IOrderPayment {
|
|
241
250
|
id: string;
|
|
242
|
-
type:
|
|
251
|
+
type: EOrderPaymentType;
|
|
243
252
|
source: string;
|
|
244
253
|
amount: number;
|
|
245
254
|
initialAmount?: number;
|
|
@@ -247,7 +256,7 @@ export interface IOrderPayment {
|
|
|
247
256
|
timestamp?: string;
|
|
248
257
|
extra?: Extra;
|
|
249
258
|
}
|
|
250
|
-
export declare enum
|
|
259
|
+
export declare enum EOrderPaymentType {
|
|
251
260
|
CASH = "CASH",
|
|
252
261
|
CARD = "CARD",
|
|
253
262
|
COD = "COD",
|
|
@@ -261,7 +270,7 @@ export declare enum OrderPaymentType {
|
|
|
261
270
|
}
|
|
262
271
|
export interface OrderPayment {
|
|
263
272
|
id: string;
|
|
264
|
-
type:
|
|
273
|
+
type: EOrderPaymentType;
|
|
265
274
|
source: string;
|
|
266
275
|
amount: number;
|
|
267
276
|
initialAmount?: number;
|
|
@@ -269,7 +278,7 @@ export interface OrderPayment {
|
|
|
269
278
|
timestamp?: string;
|
|
270
279
|
extra?: Extra;
|
|
271
280
|
}
|
|
272
|
-
export interface
|
|
281
|
+
export interface IOrderFiscal {
|
|
273
282
|
timestamp: string;
|
|
274
283
|
user?: string;
|
|
275
284
|
venue?: string;
|
|
@@ -287,7 +296,7 @@ export interface OrderFiscal {
|
|
|
287
296
|
[propName: string]: number;
|
|
288
297
|
};
|
|
289
298
|
}
|
|
290
|
-
export interface
|
|
299
|
+
export interface ITaxSummary {
|
|
291
300
|
rate: string;
|
|
292
301
|
confirmed?: boolean;
|
|
293
302
|
netto: number;
|
|
@@ -297,7 +306,7 @@ export interface TaxSummary {
|
|
|
297
306
|
/**
|
|
298
307
|
* OrderExtra interface
|
|
299
308
|
*
|
|
300
|
-
* @interface
|
|
309
|
+
* @interface IOrderExtra
|
|
301
310
|
* @manual-verify {string} order needs manual verification
|
|
302
311
|
* @x-collect-time {string} estimated pickup time from aggregator
|
|
303
312
|
* @courier-name {string} courier name from aggregator
|
|
@@ -309,7 +318,7 @@ export interface TaxSummary {
|
|
|
309
318
|
* @x-agg-id {string} order ID from aggregator
|
|
310
319
|
* @support-order-id {string} order code from aggregator to be used with support and same as seen by customer,
|
|
311
320
|
*/
|
|
312
|
-
export interface
|
|
321
|
+
export interface IOrderExtra {
|
|
313
322
|
"x-source"?: OrderSource;
|
|
314
323
|
"x-source-type"?: "INTEGRATOR";
|
|
315
324
|
"manual-verify"?: string;
|
|
@@ -324,29 +333,29 @@ export interface OrderExtra {
|
|
|
324
333
|
"support-order-id"?: string;
|
|
325
334
|
"x-pos-id"?: string;
|
|
326
335
|
}
|
|
327
|
-
export interface
|
|
336
|
+
export interface IOrderLog {
|
|
328
337
|
timestamp?: string;
|
|
329
338
|
user?: string;
|
|
330
339
|
ip?: string;
|
|
331
340
|
message?: string;
|
|
332
341
|
lines?: string[];
|
|
333
342
|
}
|
|
334
|
-
export interface
|
|
343
|
+
export interface IOrderLine {
|
|
335
344
|
bom?: Object;
|
|
336
345
|
comments?: OrderComment[];
|
|
337
346
|
created: string;
|
|
338
347
|
creator?: string;
|
|
339
|
-
discounts?:
|
|
348
|
+
discounts?: IDiscount[];
|
|
340
349
|
extra: Extra;
|
|
341
350
|
hash: string;
|
|
342
351
|
id: string;
|
|
343
352
|
price: string;
|
|
344
|
-
product:
|
|
353
|
+
product: IOrderProduct;
|
|
345
354
|
productConfig: IProductState;
|
|
346
355
|
productId: string;
|
|
347
356
|
quantity: number;
|
|
348
357
|
source: string;
|
|
349
|
-
status:
|
|
358
|
+
status: EOrderLineStatus;
|
|
350
359
|
total: string;
|
|
351
360
|
updated: string;
|
|
352
361
|
}
|
|
@@ -373,27 +382,17 @@ export declare enum OrderSource {
|
|
|
373
382
|
UBER = "UBER",
|
|
374
383
|
BOLT = "BOLT"
|
|
375
384
|
}
|
|
376
|
-
export interface
|
|
385
|
+
export interface IOrderProduct {
|
|
377
386
|
id: string;
|
|
378
|
-
kind:
|
|
379
|
-
literals:
|
|
380
|
-
items?:
|
|
387
|
+
kind: EOrderProductKind;
|
|
388
|
+
literals: IProductLiterals;
|
|
389
|
+
items?: IOrderProduct[];
|
|
381
390
|
img: string;
|
|
382
|
-
quantity:
|
|
383
|
-
price:
|
|
384
|
-
extra: Extra;
|
|
385
|
-
}
|
|
386
|
-
export interface OrderProduct {
|
|
387
|
-
id: string;
|
|
388
|
-
kind: OrderProductKind;
|
|
389
|
-
literals: ProductLiterals;
|
|
390
|
-
items?: OrderProduct[];
|
|
391
|
-
img: string;
|
|
392
|
-
quantity: number;
|
|
393
|
-
price: number;
|
|
391
|
+
quantity: string;
|
|
392
|
+
price: string;
|
|
394
393
|
extra: Extra;
|
|
395
394
|
}
|
|
396
|
-
export declare enum
|
|
395
|
+
export declare enum EOrderLineStatus {
|
|
397
396
|
NEW = "NEW",
|
|
398
397
|
TECHNICAL = "TECHNICAL",
|
|
399
398
|
CONFIRMED = "CONFIRMED",
|
|
@@ -402,7 +401,7 @@ export declare enum OrderLineStatus {
|
|
|
402
401
|
VOID = "VOID",
|
|
403
402
|
WASTE = "WASTE"
|
|
404
403
|
}
|
|
405
|
-
export interface
|
|
404
|
+
export interface IDiscount {
|
|
406
405
|
layer: string;
|
|
407
406
|
name?: string;
|
|
408
407
|
discountPrice: number;
|
|
@@ -411,15 +410,15 @@ export interface Discount {
|
|
|
411
410
|
path?: string;
|
|
412
411
|
price: number;
|
|
413
412
|
}
|
|
414
|
-
export declare enum
|
|
413
|
+
export declare enum EOrderProductKind {
|
|
415
414
|
GROUP = "group",
|
|
416
415
|
PRODUCT = "product"
|
|
417
416
|
}
|
|
418
|
-
export interface
|
|
417
|
+
export interface IProductLiterals {
|
|
419
418
|
[propName: string]: any;
|
|
420
419
|
}
|
|
421
|
-
type
|
|
422
|
-
export type
|
|
420
|
+
declare type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";
|
|
421
|
+
export declare type TSaleChannelWeek = Partial<Record<TWeekDay, {
|
|
423
422
|
from: string;
|
|
424
423
|
to: string;
|
|
425
424
|
}[]>>;
|
|
@@ -427,7 +426,7 @@ export interface SaleChannel {
|
|
|
427
426
|
active?: boolean;
|
|
428
427
|
minDeliveryTime?: string;
|
|
429
428
|
minOrderValue?: string;
|
|
430
|
-
week?:
|
|
429
|
+
week?: TSaleChannelWeek;
|
|
431
430
|
}
|
|
432
431
|
export declare enum EChannelName {
|
|
433
432
|
DINE_IN = "DINE_IN",
|
|
@@ -439,7 +438,7 @@ export declare enum EChannelName {
|
|
|
439
438
|
BOLT_DELIVERY = "BOLT_DELIVERY",
|
|
440
439
|
WOLT_DELIVERY = "WOLT_DELIVERY"
|
|
441
440
|
}
|
|
442
|
-
export interface
|
|
441
|
+
export interface IVenueConfig {
|
|
443
442
|
active: boolean;
|
|
444
443
|
address: {
|
|
445
444
|
city: string;
|
|
@@ -451,7 +450,7 @@ export interface VenueConfig {
|
|
|
451
450
|
channelConstraints: Partial<Record<EChannelName, SaleChannel>>;
|
|
452
451
|
device: Record<string, Record<string, string>>;
|
|
453
452
|
extra: Record<string, string>;
|
|
454
|
-
geoPosition:
|
|
453
|
+
geoPosition: IGeoPosition;
|
|
455
454
|
id: string;
|
|
456
455
|
menu: string;
|
|
457
456
|
name: string;
|
|
@@ -471,7 +470,7 @@ export interface IFiscalEntry {
|
|
|
471
470
|
export interface IFiscalData {
|
|
472
471
|
amount: string;
|
|
473
472
|
entries: IFiscalEntry[];
|
|
474
|
-
payments: Partial<Record<
|
|
473
|
+
payments: Partial<Record<EOrderPaymentType, string>>;
|
|
475
474
|
timestamp: string;
|
|
476
475
|
}
|
|
477
476
|
/**
|
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from "./kiosk";
|
|
2
|
-
export var
|
|
3
|
-
(function (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})(
|
|
2
|
+
export var ECouponViewType;
|
|
3
|
+
(function (ECouponViewType) {
|
|
4
|
+
ECouponViewType["CAROUSEL"] = "carousel";
|
|
5
|
+
ECouponViewType["NORMAL"] = "normal";
|
|
6
|
+
ECouponViewType["IMAGE"] = "image";
|
|
7
|
+
})(ECouponViewType || (ECouponViewType = {}));
|
|
8
8
|
export var EProductKind;
|
|
9
9
|
(function (EProductKind) {
|
|
10
10
|
EProductKind["GROUP"] = "3e/group";
|
|
@@ -21,50 +21,50 @@ export var EProductKindBucket;
|
|
|
21
21
|
EProductKindBucket["GROUP"] = "group";
|
|
22
22
|
EProductKindBucket["PRODUCT"] = "product";
|
|
23
23
|
})(EProductKindBucket || (EProductKindBucket = {}));
|
|
24
|
-
export var
|
|
25
|
-
(function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})(
|
|
43
|
-
export var
|
|
44
|
-
(function (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})(
|
|
55
|
-
export var
|
|
56
|
-
(function (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})(
|
|
24
|
+
export var EOrderType;
|
|
25
|
+
(function (EOrderType) {
|
|
26
|
+
EOrderType["TAKE_AWAY"] = "TAKE_AWAY";
|
|
27
|
+
EOrderType["DELIVERY"] = "DELIVERY";
|
|
28
|
+
EOrderType["DINE_IN"] = "DINE_IN";
|
|
29
|
+
EOrderType["DINE_IN_OPEN"] = "DINE_IN_OPEN";
|
|
30
|
+
EOrderType["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
31
|
+
EOrderType["GLOVO_TAKE_AWAY"] = "GLOVO_TAKE_AWAY";
|
|
32
|
+
EOrderType["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
33
|
+
EOrderType["JUSTEAT_TAKE_AWAY"] = "JUSTEAT_TAKE_AWAY";
|
|
34
|
+
EOrderType["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
35
|
+
EOrderType["UBER_TAKE_AWAY"] = "UBER_TAKE_AWAY";
|
|
36
|
+
EOrderType["UBER_DINE_IN"] = "UBER_DINE_IN";
|
|
37
|
+
EOrderType["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
38
|
+
EOrderType["BOLT_TAKE_AWAY"] = "BOLT_TAKE_AWAY";
|
|
39
|
+
EOrderType["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
40
|
+
EOrderType["WOLT_TAKE_AWAY"] = "WOLT_TAKE_AWAY";
|
|
41
|
+
EOrderType["WOLT_DINE_IN"] = "WOLT_DINE_IN";
|
|
42
|
+
})(EOrderType || (EOrderType = {}));
|
|
43
|
+
export var EOrderStatus;
|
|
44
|
+
(function (EOrderStatus) {
|
|
45
|
+
EOrderStatus["NEW"] = "NEW";
|
|
46
|
+
EOrderStatus["COMPLETED"] = "COMPLETED";
|
|
47
|
+
EOrderStatus["VERIFIED"] = "VERIFIED";
|
|
48
|
+
EOrderStatus["DELIVER"] = "DELIVER";
|
|
49
|
+
EOrderStatus["DELIVERED"] = "DELIVERED";
|
|
50
|
+
EOrderStatus["CLOSED"] = "CLOSED";
|
|
51
|
+
EOrderStatus["ABANDONED"] = "ABANDONED";
|
|
52
|
+
EOrderStatus["CANCELLED"] = "CANCELLED";
|
|
53
|
+
EOrderStatus["PICKED"] = "PICKED";
|
|
54
|
+
})(EOrderStatus || (EOrderStatus = {}));
|
|
55
|
+
export var EOrderPaymentType;
|
|
56
|
+
(function (EOrderPaymentType) {
|
|
57
|
+
EOrderPaymentType["CASH"] = "CASH";
|
|
58
|
+
EOrderPaymentType["CARD"] = "CARD";
|
|
59
|
+
EOrderPaymentType["COD"] = "COD";
|
|
60
|
+
EOrderPaymentType["TERMINAL"] = "TERMINAL";
|
|
61
|
+
EOrderPaymentType["EPAYMENT"] = "EPAYMENT";
|
|
62
|
+
EOrderPaymentType["COUPON"] = "COUPON";
|
|
63
|
+
EOrderPaymentType["WALLET"] = "WALLET";
|
|
64
|
+
EOrderPaymentType["PREAUTHORIZED"] = "PREAUTHORIZED";
|
|
65
|
+
EOrderPaymentType["RETURN"] = "RETURN";
|
|
66
|
+
EOrderPaymentType["EXTERNAL"] = "EXTERNAL";
|
|
67
|
+
})(EOrderPaymentType || (EOrderPaymentType = {}));
|
|
68
68
|
export var OrderSource;
|
|
69
69
|
(function (OrderSource) {
|
|
70
70
|
OrderSource["KIOSK"] = "KIOSK";
|
|
@@ -76,21 +76,21 @@ export var OrderSource;
|
|
|
76
76
|
OrderSource["UBER"] = "UBER";
|
|
77
77
|
OrderSource["BOLT"] = "BOLT";
|
|
78
78
|
})(OrderSource || (OrderSource = {}));
|
|
79
|
-
export var
|
|
80
|
-
(function (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})(
|
|
89
|
-
export var
|
|
90
|
-
(function (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})(
|
|
79
|
+
export var EOrderLineStatus;
|
|
80
|
+
(function (EOrderLineStatus) {
|
|
81
|
+
EOrderLineStatus["NEW"] = "NEW";
|
|
82
|
+
EOrderLineStatus["TECHNICAL"] = "TECHNICAL";
|
|
83
|
+
EOrderLineStatus["CONFIRMED"] = "CONFIRMED";
|
|
84
|
+
EOrderLineStatus["PROCESSING"] = "PROCESSING";
|
|
85
|
+
EOrderLineStatus["PROCESSED"] = "PROCESSED";
|
|
86
|
+
EOrderLineStatus["VOID"] = "VOID";
|
|
87
|
+
EOrderLineStatus["WASTE"] = "WASTE";
|
|
88
|
+
})(EOrderLineStatus || (EOrderLineStatus = {}));
|
|
89
|
+
export var EOrderProductKind;
|
|
90
|
+
(function (EOrderProductKind) {
|
|
91
|
+
EOrderProductKind["GROUP"] = "group";
|
|
92
|
+
EOrderProductKind["PRODUCT"] = "product";
|
|
93
|
+
})(EOrderProductKind || (EOrderProductKind = {}));
|
|
94
94
|
export var EChannelName;
|
|
95
95
|
(function (EChannelName) {
|
|
96
96
|
EChannelName["DINE_IN"] = "DINE_IN";
|
package/dist/esm/kiosk.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import { IProduct, IOrder } from "./index";
|
|
3
|
+
import { UseTransitionProps } from "react-spring";
|
|
4
|
+
import { IOrderLine } from "./index";
|
|
1
5
|
export declare enum EPaymentStatus {
|
|
2
6
|
UNINITIALIZED = "UNINITIALIZED",
|
|
3
7
|
PROCESSING = "PROCESSING",
|
|
@@ -9,3 +13,71 @@ export declare enum EPaymentStatus {
|
|
|
9
13
|
SENDING_RECEIPT_SUCCESS = "SENDING_RECEIPT_SUCCESS",
|
|
10
14
|
ERROR = "ERROR"
|
|
11
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Theme interface
|
|
18
|
+
* @interface ITheme
|
|
19
|
+
* @
|
|
20
|
+
*/
|
|
21
|
+
export interface ITheme {
|
|
22
|
+
'--color-primary': string;
|
|
23
|
+
'--color-primary-light': string;
|
|
24
|
+
'--color-primary-dark': string;
|
|
25
|
+
'--color-secondary': string;
|
|
26
|
+
'--color-grey-light': string;
|
|
27
|
+
'--color-red': string;
|
|
28
|
+
'--color-red-light': string;
|
|
29
|
+
'--fontFamily': string;
|
|
30
|
+
'--fontFamily-upper': string;
|
|
31
|
+
'--color-background': string;
|
|
32
|
+
'--color-btn-primary': string;
|
|
33
|
+
'--color-btn-secondary': string;
|
|
34
|
+
'--color-btn-disabled': string;
|
|
35
|
+
'--font-color-btn-primary': string;
|
|
36
|
+
'--font-color-btn-secondary': string;
|
|
37
|
+
'--font-color-btn-disabled': string;
|
|
38
|
+
'--font-color-bg-primary': string;
|
|
39
|
+
'--product-tile-border-color': string;
|
|
40
|
+
[property: string]: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IMenuProps {
|
|
43
|
+
menu: IProduct[];
|
|
44
|
+
handleSelectProduct: (product: IProduct | string) => void;
|
|
45
|
+
Header?: ReactElement;
|
|
46
|
+
Logo?: ReactElement;
|
|
47
|
+
TopNav?: ReactElement;
|
|
48
|
+
BottomNav?: ReactElement;
|
|
49
|
+
MenuTile?: React.FC<IMenuTileProps>;
|
|
50
|
+
CategorySection?: React.FC<IMenuCategorySectionProps>;
|
|
51
|
+
fallbackImg?: string;
|
|
52
|
+
lazyLoadImg?: boolean;
|
|
53
|
+
currency?: string;
|
|
54
|
+
timeZone?: string;
|
|
55
|
+
availabilityMarkOnly?: boolean;
|
|
56
|
+
availabilityCheckInterval?: number;
|
|
57
|
+
cols?: number;
|
|
58
|
+
colsLg?: number;
|
|
59
|
+
stacking: 'vertical' | 'horizontal';
|
|
60
|
+
transitionProps?: UseTransitionProps;
|
|
61
|
+
onMenuCategoryViewed?: (category: IProduct) => void;
|
|
62
|
+
goToCheckout: () => void;
|
|
63
|
+
goToStart: () => void;
|
|
64
|
+
order?: IOrder;
|
|
65
|
+
changeQuantity: (line: IOrderLine, quantity: number) => void;
|
|
66
|
+
}
|
|
67
|
+
export interface IMenuTileProps {
|
|
68
|
+
product: IProduct;
|
|
69
|
+
onProductClicked: (product: IProduct | string) => void;
|
|
70
|
+
fallbackImg: string;
|
|
71
|
+
currency?: string;
|
|
72
|
+
lazyLoadImg?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface IMenuCategorySectionProps {
|
|
75
|
+
category: IProduct;
|
|
76
|
+
onProductClicked: (IProduct: IProduct | string) => void;
|
|
77
|
+
fallbackImg: string;
|
|
78
|
+
lazyLoadImg?: boolean;
|
|
79
|
+
currency?: string;
|
|
80
|
+
cols?: number;
|
|
81
|
+
colsLg?: number;
|
|
82
|
+
MenuTile?: React.FC<IMenuTileProps>;
|
|
83
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orderingstack/ordering-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Typescript types for @orderingstack",
|
|
5
5
|
"types": "dist/esm/index.d.ts",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"author": "Tomasz Rojek <tomasz.rojek@e3.pl>",
|
|
16
16
|
"devDependencies": {
|
|
17
|
+
"@types/react": "^18.0.26",
|
|
18
|
+
"react": "^18.2.0",
|
|
19
|
+
"react-spring": "^9.6.1",
|
|
17
20
|
"typescript": "next"
|
|
18
21
|
}
|
|
19
|
-
}
|
|
22
|
+
}
|