@orderingstack/ordering-types 0.1.0 → 0.1.2

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.
@@ -1,3 +1,4 @@
1
+ export * from "./kiosk";
1
2
  export interface Restaurant {
2
3
  id: string;
3
4
  name: string;
@@ -51,7 +52,6 @@ export declare enum EProductKindBucket {
51
52
  PRODUCT = "product"
52
53
  }
53
54
  export type Literals = {
54
- description?: string;
55
55
  name: string;
56
56
  fiscal?: string;
57
57
  "target-product-id"?: string;
@@ -71,23 +71,24 @@ export type Availability = {
71
71
  };
72
72
  export type Product = {
73
73
  availability?: Availability;
74
- details?: {
75
- literals?: Literals;
76
- media?: Media[];
77
- };
78
- filter?: any;
79
- fltCtx?: any;
80
74
  id: string;
81
75
  img?: string;
82
76
  items?: Product[];
83
77
  kind: EProductKind | EProductKindBucket;
84
78
  literals?: Literals;
79
+ details?: {
80
+ literals?: Literals;
81
+ media?: Media[];
82
+ };
85
83
  price: string;
86
84
  minPrice?: string;
87
85
  quantity: string;
88
86
  vat: string;
87
+ outsideAvailabilitySlot?: boolean;
89
88
  state?: ProductConfig;
90
89
  selCtx: string;
90
+ filter?: any;
91
+ fltCtx?: any;
91
92
  };
92
93
  export type ProductConfig = {
93
94
  selected: any;
@@ -97,13 +98,307 @@ export interface Category {
97
98
  id: string;
98
99
  name: string;
99
100
  }
101
+ export interface Extra {
102
+ [propName: string]: any;
103
+ }
104
+ export interface User {
105
+ userId: string;
106
+ roles: string[];
107
+ name?: string;
108
+ phone?: string;
109
+ email?: string;
110
+ extra?: Extra;
111
+ }
112
+ export declare enum OrderType {
113
+ TAKE_AWAY = "TAKE_AWAY",
114
+ DELIVERY = "DELIVERY",
115
+ DINE_IN = "DINE_IN",
116
+ DINE_IN_OPEN = "DINE_IN_OPEN",
117
+ GLOVO_DELIVERY = "GLOVO_DELIVERY",
118
+ GLOVO_TAKE_AWAY = "GLOVO_TAKE_AWAY",
119
+ JUSTEAT_DELIVERY = "JUSTEAT_DELIVERY",
120
+ JUSTEAT_TAKE_AWAY = "JUSTEAT_TAKE_AWAY",
121
+ UBER_DELIVERY = "UBER_DELIVERY",
122
+ UBER_TAKE_AWAY = "UBER_TAKE_AWAY",
123
+ UBER_DINE_IN = "UBER_DINE_IN",
124
+ BOLT_DELIVERY = "BOLT_DELIVERY",
125
+ BOLT_TAKE_AWAY = "BOLT_TAKE_AWAY",
126
+ WOLT_DELIVERY = "WOLT_DELIVERY",
127
+ WOLT_TAKE_AWAY = "WOLT_TAKE_AWAY",
128
+ WOLT_DINE_IN = "WOLT_DINE_IN"
129
+ }
130
+ export interface OrderDeliveryAddress {
131
+ street: string;
132
+ number: string;
133
+ door?: string;
134
+ postal?: string;
135
+ city: string;
136
+ country: string;
137
+ }
138
+ export interface Order {
139
+ tenant: string;
140
+ id: string;
141
+ extId?: string;
142
+ created: string;
143
+ due?: string;
144
+ closedDate?: string;
145
+ lastChanged?: string;
146
+ completedTime?: string;
147
+ verifiedTime?: string;
148
+ processingStartedTime?: string;
149
+ deliveredTime?: string;
150
+ source: string;
151
+ users?: User[];
152
+ loyaltyId?: string;
153
+ coupons?: OrderCoupon[];
154
+ orderType: OrderType;
155
+ deliveryAddress?: OrderDeliveryAddress;
156
+ geoPosition?: {
157
+ lat: number;
158
+ lng: number;
159
+ };
160
+ total: string;
161
+ editTotal: string;
162
+ status: OrderStatus;
163
+ statusInfo?: string;
164
+ comments?: OrderComment[];
165
+ claimCode?: string;
166
+ buckets: OrderInBucket[];
167
+ payments?: OrderPayment[];
168
+ fiscal?: OrderFiscal[];
169
+ tax: TaxSummary[];
170
+ extra?: OrderExtra;
171
+ traces?: {
172
+ [propName: string]: string;
173
+ };
174
+ logs?: OrderLog[];
175
+ locked?: boolean;
176
+ completed?: boolean;
177
+ verified?: boolean;
178
+ closed?: boolean;
179
+ }
180
+ export interface OrderCoupon {
181
+ coupon: string;
182
+ addedAt: string;
183
+ addedBy: string;
184
+ }
185
+ export declare enum OrderStatus {
186
+ NEW = "NEW",
187
+ COMPLETED = "COMPLETED",
188
+ VERIFIED = "VERIFIED",
189
+ DELIVER = "DELIVER",
190
+ DELIVERED = "DELIVERED",
191
+ CLOSED = "CLOSED",
192
+ ABANDONED = "ABANDONED",
193
+ CANCELLED = "CANCELLED",
194
+ PICKED = "PICKED"
195
+ }
196
+ export interface OrderComment {
197
+ id: string;
198
+ creator: string;
199
+ timestamp?: string;
200
+ comment: string;
201
+ extra?: Extra;
202
+ }
203
+ export interface OrderInBucket {
204
+ venue: string;
205
+ sync: boolean;
206
+ syncId: string;
207
+ name: string;
208
+ menu: string;
209
+ lines: OrderLine[];
210
+ priceList?: string;
211
+ warehouse?: string;
212
+ queuePos?: string;
213
+ extra?: Extra;
214
+ }
215
+ export interface IOrderPayment {
216
+ id: string;
217
+ type: OrderPaymentType;
218
+ source: string;
219
+ amount: number;
220
+ initialAmount?: number;
221
+ user: string;
222
+ timestamp?: string;
223
+ extra?: Extra;
224
+ }
225
+ export declare enum OrderPaymentType {
226
+ CASH = "CASH",
227
+ CARD = "CARD",
228
+ COD = "COD",
229
+ TERMINAL = "TERMINAL",
230
+ EPAYMENT = "EPAYMENT",
231
+ COUPON = "COUPON",
232
+ WALLET = "WALLET",
233
+ PREAUTHORIZED = "PREAUTHORIZED",
234
+ RETURN = "RETURN",
235
+ EXTERNAL = "EXTERNAL"
236
+ }
237
+ export interface OrderPayment {
238
+ id: string;
239
+ type: OrderPaymentType;
240
+ source: string;
241
+ amount: number;
242
+ initialAmount?: number;
243
+ user: string;
244
+ timestamp?: string;
245
+ extra?: Extra;
246
+ }
247
+ export interface OrderFiscal {
248
+ timestamp: string;
249
+ user?: string;
250
+ venue?: string;
251
+ amount: number;
252
+ printer: string;
253
+ slip: string;
254
+ taxId?: string;
255
+ message?: string;
256
+ entries: SlipEntry[];
257
+ payments?: {
258
+ [propName: string]: number;
259
+ };
260
+ subTotalDiscounts?: SubTotalDiscount[];
261
+ extra: {
262
+ [propName: string]: number;
263
+ };
264
+ }
265
+ export interface TaxSummary {
266
+ rate: string;
267
+ confirmed?: boolean;
268
+ netto: number;
269
+ tax: number;
270
+ brutto: number;
271
+ }
272
+ /**
273
+ * IOrderExtra interface
274
+ *
275
+ * @interface IOrderExtra
276
+ * @manual-verify {string} order needs manual verification
277
+ * @x-collect-time {string} estimated pickup time from aggregator
278
+ * @courier-name {string} courier name from aggregator
279
+ * @courier-phone {string} courier phone from aggregator
280
+ * @customer-name {string} customer name from aggregator
281
+ * @customer-phone {string} customer phone from aggregator
282
+ * @requiresVatInvoice {boolean}
283
+ * @allergies {string} customer allergies from aggregator
284
+ * @x-agg-id {string} order ID from aggregator
285
+ * @support-order-id {string} order code from aggregator to be used with support and same as seen by customer,
286
+ */
287
+ export interface OrderExtra {
288
+ "x-source"?: OrderSource;
289
+ "x-source-type"?: "INTEGRATOR";
290
+ "manual-verify"?: string;
291
+ "x-collect-time"?: string;
292
+ "courier-name"?: string;
293
+ "courier-phone"?: string;
294
+ "customer-name"?: string;
295
+ "customer-phone"?: string;
296
+ requiresVatInvoice?: string;
297
+ allergies?: string;
298
+ "x-agg-id"?: string;
299
+ "support-order-id"?: string;
300
+ }
301
+ export interface OrderLog {
302
+ timestamp?: string;
303
+ user?: string;
304
+ ip?: string;
305
+ message?: string;
306
+ lines?: string[];
307
+ }
308
+ export interface OrderLine {
309
+ id: string;
310
+ creator?: string;
311
+ created: string;
312
+ updated: string;
313
+ source: string;
314
+ quantity: number;
315
+ price: number;
316
+ productId: string;
317
+ product: OrderProduct;
318
+ productConfig: ProductConfig;
319
+ bom: Object;
320
+ status: OrderLineStatus;
321
+ comments?: OrderComment[];
322
+ discounts?: Discount[];
323
+ extra: Extra;
324
+ hash: string;
325
+ total: number;
326
+ }
327
+ export interface SlipEntry {
328
+ item: string;
329
+ qty: number;
330
+ price: number;
331
+ discount?: number;
332
+ total: number;
333
+ vat: string;
334
+ }
335
+ export interface SubTotalDiscount {
336
+ name: string;
337
+ discount: number;
338
+ vat: string;
339
+ }
340
+ export declare enum OrderSource {
341
+ KIOSK = "KIOSK",
342
+ WEB = "WEB",
343
+ JUST_EAT_TAKE_AWAY = "JUSTEATTAKEAWAY",
344
+ GLOVO = "GLOVO",
345
+ PYSZNE = "PYSZNE",
346
+ WOLT = "WOLT",
347
+ UBER = "UBER",
348
+ BOLT = "BOLT"
349
+ }
350
+ export interface OrderProduct {
351
+ id: string;
352
+ kind: OrderProductKind;
353
+ literals: ProductLiterals;
354
+ items?: OrderProduct[];
355
+ img: string;
356
+ quantity: number;
357
+ price: number;
358
+ extra: Extra;
359
+ }
360
+ export interface OrderProduct {
361
+ id: string;
362
+ kind: OrderProductKind;
363
+ literals: ProductLiterals;
364
+ items?: OrderProduct[];
365
+ img: string;
366
+ quantity: number;
367
+ price: number;
368
+ extra: Extra;
369
+ }
370
+ export declare enum OrderLineStatus {
371
+ NEW = "NEW",
372
+ TECHNICAL = "TECHNICAL",
373
+ CONFIRMED = "CONFIRMED",
374
+ PROCESSING = "PROCESSING",
375
+ PROCESSED = "PROCESSED",
376
+ VOID = "VOID",
377
+ WASTE = "WASTE"
378
+ }
379
+ export interface Discount {
380
+ layer: string;
381
+ name?: string;
382
+ discountPrice: number;
383
+ type: string;
384
+ product: string;
385
+ path?: string;
386
+ price: number;
387
+ }
388
+ export declare enum OrderProductKind {
389
+ GROUP = "group",
390
+ PRODUCT = "product"
391
+ }
392
+ export interface ProductLiterals {
393
+ [propName: string]: any;
394
+ }
100
395
  export interface SaleChannel {
101
396
  active?: boolean;
102
397
  minDeliveryTime?: string;
103
398
  minOrderValue?: string;
104
399
  week?: Availability;
105
400
  }
106
- declare enum EChannelName {
401
+ export declare enum EChannelName {
107
402
  DINE_IN = "DINE_IN",
108
403
  TAKE_AWAY = "TAKE_AWAY",
109
404
  DELIVERY = "DELIVERY",
@@ -134,4 +429,3 @@ export interface VenueConfig {
134
429
  timeZone: string;
135
430
  warehouse: string;
136
431
  }
137
- export {};
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EProductKindBucket = exports.EProductKind = exports.CouponViewType = void 0;
17
+ exports.EChannelName = exports.OrderProductKind = exports.OrderLineStatus = exports.OrderSource = exports.OrderPaymentType = exports.OrderStatus = exports.OrderType = exports.EProductKindBucket = exports.EProductKind = exports.CouponViewType = void 0;
18
+ __exportStar(require("./kiosk"), exports);
4
19
  var CouponViewType;
5
20
  (function (CouponViewType) {
6
21
  CouponViewType["CAROUSEL"] = "carousel";
@@ -23,6 +38,76 @@ var EProductKindBucket;
23
38
  EProductKindBucket["GROUP"] = "group";
24
39
  EProductKindBucket["PRODUCT"] = "product";
25
40
  })(EProductKindBucket = exports.EProductKindBucket || (exports.EProductKindBucket = {}));
41
+ var OrderType;
42
+ (function (OrderType) {
43
+ OrderType["TAKE_AWAY"] = "TAKE_AWAY";
44
+ OrderType["DELIVERY"] = "DELIVERY";
45
+ OrderType["DINE_IN"] = "DINE_IN";
46
+ OrderType["DINE_IN_OPEN"] = "DINE_IN_OPEN";
47
+ OrderType["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
48
+ OrderType["GLOVO_TAKE_AWAY"] = "GLOVO_TAKE_AWAY";
49
+ OrderType["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
50
+ OrderType["JUSTEAT_TAKE_AWAY"] = "JUSTEAT_TAKE_AWAY";
51
+ OrderType["UBER_DELIVERY"] = "UBER_DELIVERY";
52
+ OrderType["UBER_TAKE_AWAY"] = "UBER_TAKE_AWAY";
53
+ OrderType["UBER_DINE_IN"] = "UBER_DINE_IN";
54
+ OrderType["BOLT_DELIVERY"] = "BOLT_DELIVERY";
55
+ OrderType["BOLT_TAKE_AWAY"] = "BOLT_TAKE_AWAY";
56
+ OrderType["WOLT_DELIVERY"] = "WOLT_DELIVERY";
57
+ OrderType["WOLT_TAKE_AWAY"] = "WOLT_TAKE_AWAY";
58
+ OrderType["WOLT_DINE_IN"] = "WOLT_DINE_IN";
59
+ })(OrderType = exports.OrderType || (exports.OrderType = {}));
60
+ var OrderStatus;
61
+ (function (OrderStatus) {
62
+ OrderStatus["NEW"] = "NEW";
63
+ OrderStatus["COMPLETED"] = "COMPLETED";
64
+ OrderStatus["VERIFIED"] = "VERIFIED";
65
+ OrderStatus["DELIVER"] = "DELIVER";
66
+ OrderStatus["DELIVERED"] = "DELIVERED";
67
+ OrderStatus["CLOSED"] = "CLOSED";
68
+ OrderStatus["ABANDONED"] = "ABANDONED";
69
+ OrderStatus["CANCELLED"] = "CANCELLED";
70
+ OrderStatus["PICKED"] = "PICKED";
71
+ })(OrderStatus = exports.OrderStatus || (exports.OrderStatus = {}));
72
+ var OrderPaymentType;
73
+ (function (OrderPaymentType) {
74
+ OrderPaymentType["CASH"] = "CASH";
75
+ OrderPaymentType["CARD"] = "CARD";
76
+ OrderPaymentType["COD"] = "COD";
77
+ OrderPaymentType["TERMINAL"] = "TERMINAL";
78
+ OrderPaymentType["EPAYMENT"] = "EPAYMENT";
79
+ OrderPaymentType["COUPON"] = "COUPON";
80
+ OrderPaymentType["WALLET"] = "WALLET";
81
+ OrderPaymentType["PREAUTHORIZED"] = "PREAUTHORIZED";
82
+ OrderPaymentType["RETURN"] = "RETURN";
83
+ OrderPaymentType["EXTERNAL"] = "EXTERNAL";
84
+ })(OrderPaymentType = exports.OrderPaymentType || (exports.OrderPaymentType = {}));
85
+ var OrderSource;
86
+ (function (OrderSource) {
87
+ OrderSource["KIOSK"] = "KIOSK";
88
+ OrderSource["WEB"] = "WEB";
89
+ OrderSource["JUST_EAT_TAKE_AWAY"] = "JUSTEATTAKEAWAY";
90
+ OrderSource["GLOVO"] = "GLOVO";
91
+ OrderSource["PYSZNE"] = "PYSZNE";
92
+ OrderSource["WOLT"] = "WOLT";
93
+ OrderSource["UBER"] = "UBER";
94
+ OrderSource["BOLT"] = "BOLT";
95
+ })(OrderSource = exports.OrderSource || (exports.OrderSource = {}));
96
+ var OrderLineStatus;
97
+ (function (OrderLineStatus) {
98
+ OrderLineStatus["NEW"] = "NEW";
99
+ OrderLineStatus["TECHNICAL"] = "TECHNICAL";
100
+ OrderLineStatus["CONFIRMED"] = "CONFIRMED";
101
+ OrderLineStatus["PROCESSING"] = "PROCESSING";
102
+ OrderLineStatus["PROCESSED"] = "PROCESSED";
103
+ OrderLineStatus["VOID"] = "VOID";
104
+ OrderLineStatus["WASTE"] = "WASTE";
105
+ })(OrderLineStatus = exports.OrderLineStatus || (exports.OrderLineStatus = {}));
106
+ var OrderProductKind;
107
+ (function (OrderProductKind) {
108
+ OrderProductKind["GROUP"] = "group";
109
+ OrderProductKind["PRODUCT"] = "product";
110
+ })(OrderProductKind = exports.OrderProductKind || (exports.OrderProductKind = {}));
26
111
  var EChannelName;
27
112
  (function (EChannelName) {
28
113
  EChannelName["DINE_IN"] = "DINE_IN";
@@ -40,4 +125,4 @@ var EChannelName;
40
125
  EChannelName["WOLT_DELIVERY"] = "WOLT_DELIVERY";
41
126
  // WOLT_TAKE_AWAY = "WOLT_TAKE_AWAY",
42
127
  // WOLT_DINE_IN = "WOLT_DINE_IN"
43
- })(EChannelName || (EChannelName = {}));
128
+ })(EChannelName = exports.EChannelName || (exports.EChannelName = {}));
@@ -0,0 +1,10 @@
1
+ export declare enum EPaymentStatus {
2
+ UNINITIALIZED = "UNINITIALIZED",
3
+ PROCESSING = "PROCESSING",
4
+ PAID = "PAID",
5
+ PRINTING_RECEIPT = "PRINTING_RECEIPT",
6
+ PRINTING_RECEIPT_SUCCESS = "PRINTING_RECEIPT_SUCCESS",
7
+ SENDING_RECEIPT = "SENDING_RECEIPT",
8
+ SENDING_RECEIPT_SUCCESS = "SENDING_RECEIPT_SUCCESS",
9
+ ERROR = "ERROR"
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EPaymentStatus = void 0;
4
+ var EPaymentStatus;
5
+ (function (EPaymentStatus) {
6
+ EPaymentStatus["UNINITIALIZED"] = "UNINITIALIZED";
7
+ EPaymentStatus["PROCESSING"] = "PROCESSING";
8
+ EPaymentStatus["PAID"] = "PAID";
9
+ EPaymentStatus["PRINTING_RECEIPT"] = "PRINTING_RECEIPT";
10
+ EPaymentStatus["PRINTING_RECEIPT_SUCCESS"] = "PRINTING_RECEIPT_SUCCESS";
11
+ EPaymentStatus["SENDING_RECEIPT"] = "SENDING_RECEIPT";
12
+ EPaymentStatus["SENDING_RECEIPT_SUCCESS"] = "SENDING_RECEIPT_SUCCESS";
13
+ EPaymentStatus["ERROR"] = "ERROR";
14
+ })(EPaymentStatus = exports.EPaymentStatus || (exports.EPaymentStatus = {}));
@@ -1,3 +1,4 @@
1
+ export * from "./kiosk";
1
2
  export interface Restaurant {
2
3
  id: string;
3
4
  name: string;
@@ -51,7 +52,6 @@ export declare enum EProductKindBucket {
51
52
  PRODUCT = "product"
52
53
  }
53
54
  export type Literals = {
54
- description?: string;
55
55
  name: string;
56
56
  fiscal?: string;
57
57
  "target-product-id"?: string;
@@ -71,23 +71,24 @@ export type Availability = {
71
71
  };
72
72
  export type Product = {
73
73
  availability?: Availability;
74
- details?: {
75
- literals?: Literals;
76
- media?: Media[];
77
- };
78
- filter?: any;
79
- fltCtx?: any;
80
74
  id: string;
81
75
  img?: string;
82
76
  items?: Product[];
83
77
  kind: EProductKind | EProductKindBucket;
84
78
  literals?: Literals;
79
+ details?: {
80
+ literals?: Literals;
81
+ media?: Media[];
82
+ };
85
83
  price: string;
86
84
  minPrice?: string;
87
85
  quantity: string;
88
86
  vat: string;
87
+ outsideAvailabilitySlot?: boolean;
89
88
  state?: ProductConfig;
90
89
  selCtx: string;
90
+ filter?: any;
91
+ fltCtx?: any;
91
92
  };
92
93
  export type ProductConfig = {
93
94
  selected: any;
@@ -97,13 +98,307 @@ export interface Category {
97
98
  id: string;
98
99
  name: string;
99
100
  }
101
+ export interface Extra {
102
+ [propName: string]: any;
103
+ }
104
+ export interface User {
105
+ userId: string;
106
+ roles: string[];
107
+ name?: string;
108
+ phone?: string;
109
+ email?: string;
110
+ extra?: Extra;
111
+ }
112
+ export declare enum OrderType {
113
+ TAKE_AWAY = "TAKE_AWAY",
114
+ DELIVERY = "DELIVERY",
115
+ DINE_IN = "DINE_IN",
116
+ DINE_IN_OPEN = "DINE_IN_OPEN",
117
+ GLOVO_DELIVERY = "GLOVO_DELIVERY",
118
+ GLOVO_TAKE_AWAY = "GLOVO_TAKE_AWAY",
119
+ JUSTEAT_DELIVERY = "JUSTEAT_DELIVERY",
120
+ JUSTEAT_TAKE_AWAY = "JUSTEAT_TAKE_AWAY",
121
+ UBER_DELIVERY = "UBER_DELIVERY",
122
+ UBER_TAKE_AWAY = "UBER_TAKE_AWAY",
123
+ UBER_DINE_IN = "UBER_DINE_IN",
124
+ BOLT_DELIVERY = "BOLT_DELIVERY",
125
+ BOLT_TAKE_AWAY = "BOLT_TAKE_AWAY",
126
+ WOLT_DELIVERY = "WOLT_DELIVERY",
127
+ WOLT_TAKE_AWAY = "WOLT_TAKE_AWAY",
128
+ WOLT_DINE_IN = "WOLT_DINE_IN"
129
+ }
130
+ export interface OrderDeliveryAddress {
131
+ street: string;
132
+ number: string;
133
+ door?: string;
134
+ postal?: string;
135
+ city: string;
136
+ country: string;
137
+ }
138
+ export interface Order {
139
+ tenant: string;
140
+ id: string;
141
+ extId?: string;
142
+ created: string;
143
+ due?: string;
144
+ closedDate?: string;
145
+ lastChanged?: string;
146
+ completedTime?: string;
147
+ verifiedTime?: string;
148
+ processingStartedTime?: string;
149
+ deliveredTime?: string;
150
+ source: string;
151
+ users?: User[];
152
+ loyaltyId?: string;
153
+ coupons?: OrderCoupon[];
154
+ orderType: OrderType;
155
+ deliveryAddress?: OrderDeliveryAddress;
156
+ geoPosition?: {
157
+ lat: number;
158
+ lng: number;
159
+ };
160
+ total: string;
161
+ editTotal: string;
162
+ status: OrderStatus;
163
+ statusInfo?: string;
164
+ comments?: OrderComment[];
165
+ claimCode?: string;
166
+ buckets: OrderInBucket[];
167
+ payments?: OrderPayment[];
168
+ fiscal?: OrderFiscal[];
169
+ tax: TaxSummary[];
170
+ extra?: OrderExtra;
171
+ traces?: {
172
+ [propName: string]: string;
173
+ };
174
+ logs?: OrderLog[];
175
+ locked?: boolean;
176
+ completed?: boolean;
177
+ verified?: boolean;
178
+ closed?: boolean;
179
+ }
180
+ export interface OrderCoupon {
181
+ coupon: string;
182
+ addedAt: string;
183
+ addedBy: string;
184
+ }
185
+ export declare enum OrderStatus {
186
+ NEW = "NEW",
187
+ COMPLETED = "COMPLETED",
188
+ VERIFIED = "VERIFIED",
189
+ DELIVER = "DELIVER",
190
+ DELIVERED = "DELIVERED",
191
+ CLOSED = "CLOSED",
192
+ ABANDONED = "ABANDONED",
193
+ CANCELLED = "CANCELLED",
194
+ PICKED = "PICKED"
195
+ }
196
+ export interface OrderComment {
197
+ id: string;
198
+ creator: string;
199
+ timestamp?: string;
200
+ comment: string;
201
+ extra?: Extra;
202
+ }
203
+ export interface OrderInBucket {
204
+ venue: string;
205
+ sync: boolean;
206
+ syncId: string;
207
+ name: string;
208
+ menu: string;
209
+ lines: OrderLine[];
210
+ priceList?: string;
211
+ warehouse?: string;
212
+ queuePos?: string;
213
+ extra?: Extra;
214
+ }
215
+ export interface IOrderPayment {
216
+ id: string;
217
+ type: OrderPaymentType;
218
+ source: string;
219
+ amount: number;
220
+ initialAmount?: number;
221
+ user: string;
222
+ timestamp?: string;
223
+ extra?: Extra;
224
+ }
225
+ export declare enum OrderPaymentType {
226
+ CASH = "CASH",
227
+ CARD = "CARD",
228
+ COD = "COD",
229
+ TERMINAL = "TERMINAL",
230
+ EPAYMENT = "EPAYMENT",
231
+ COUPON = "COUPON",
232
+ WALLET = "WALLET",
233
+ PREAUTHORIZED = "PREAUTHORIZED",
234
+ RETURN = "RETURN",
235
+ EXTERNAL = "EXTERNAL"
236
+ }
237
+ export interface OrderPayment {
238
+ id: string;
239
+ type: OrderPaymentType;
240
+ source: string;
241
+ amount: number;
242
+ initialAmount?: number;
243
+ user: string;
244
+ timestamp?: string;
245
+ extra?: Extra;
246
+ }
247
+ export interface OrderFiscal {
248
+ timestamp: string;
249
+ user?: string;
250
+ venue?: string;
251
+ amount: number;
252
+ printer: string;
253
+ slip: string;
254
+ taxId?: string;
255
+ message?: string;
256
+ entries: SlipEntry[];
257
+ payments?: {
258
+ [propName: string]: number;
259
+ };
260
+ subTotalDiscounts?: SubTotalDiscount[];
261
+ extra: {
262
+ [propName: string]: number;
263
+ };
264
+ }
265
+ export interface TaxSummary {
266
+ rate: string;
267
+ confirmed?: boolean;
268
+ netto: number;
269
+ tax: number;
270
+ brutto: number;
271
+ }
272
+ /**
273
+ * IOrderExtra interface
274
+ *
275
+ * @interface IOrderExtra
276
+ * @manual-verify {string} order needs manual verification
277
+ * @x-collect-time {string} estimated pickup time from aggregator
278
+ * @courier-name {string} courier name from aggregator
279
+ * @courier-phone {string} courier phone from aggregator
280
+ * @customer-name {string} customer name from aggregator
281
+ * @customer-phone {string} customer phone from aggregator
282
+ * @requiresVatInvoice {boolean}
283
+ * @allergies {string} customer allergies from aggregator
284
+ * @x-agg-id {string} order ID from aggregator
285
+ * @support-order-id {string} order code from aggregator to be used with support and same as seen by customer,
286
+ */
287
+ export interface OrderExtra {
288
+ "x-source"?: OrderSource;
289
+ "x-source-type"?: "INTEGRATOR";
290
+ "manual-verify"?: string;
291
+ "x-collect-time"?: string;
292
+ "courier-name"?: string;
293
+ "courier-phone"?: string;
294
+ "customer-name"?: string;
295
+ "customer-phone"?: string;
296
+ requiresVatInvoice?: string;
297
+ allergies?: string;
298
+ "x-agg-id"?: string;
299
+ "support-order-id"?: string;
300
+ }
301
+ export interface OrderLog {
302
+ timestamp?: string;
303
+ user?: string;
304
+ ip?: string;
305
+ message?: string;
306
+ lines?: string[];
307
+ }
308
+ export interface OrderLine {
309
+ id: string;
310
+ creator?: string;
311
+ created: string;
312
+ updated: string;
313
+ source: string;
314
+ quantity: number;
315
+ price: number;
316
+ productId: string;
317
+ product: OrderProduct;
318
+ productConfig: ProductConfig;
319
+ bom: Object;
320
+ status: OrderLineStatus;
321
+ comments?: OrderComment[];
322
+ discounts?: Discount[];
323
+ extra: Extra;
324
+ hash: string;
325
+ total: number;
326
+ }
327
+ export interface SlipEntry {
328
+ item: string;
329
+ qty: number;
330
+ price: number;
331
+ discount?: number;
332
+ total: number;
333
+ vat: string;
334
+ }
335
+ export interface SubTotalDiscount {
336
+ name: string;
337
+ discount: number;
338
+ vat: string;
339
+ }
340
+ export declare enum OrderSource {
341
+ KIOSK = "KIOSK",
342
+ WEB = "WEB",
343
+ JUST_EAT_TAKE_AWAY = "JUSTEATTAKEAWAY",
344
+ GLOVO = "GLOVO",
345
+ PYSZNE = "PYSZNE",
346
+ WOLT = "WOLT",
347
+ UBER = "UBER",
348
+ BOLT = "BOLT"
349
+ }
350
+ export interface OrderProduct {
351
+ id: string;
352
+ kind: OrderProductKind;
353
+ literals: ProductLiterals;
354
+ items?: OrderProduct[];
355
+ img: string;
356
+ quantity: number;
357
+ price: number;
358
+ extra: Extra;
359
+ }
360
+ export interface OrderProduct {
361
+ id: string;
362
+ kind: OrderProductKind;
363
+ literals: ProductLiterals;
364
+ items?: OrderProduct[];
365
+ img: string;
366
+ quantity: number;
367
+ price: number;
368
+ extra: Extra;
369
+ }
370
+ export declare enum OrderLineStatus {
371
+ NEW = "NEW",
372
+ TECHNICAL = "TECHNICAL",
373
+ CONFIRMED = "CONFIRMED",
374
+ PROCESSING = "PROCESSING",
375
+ PROCESSED = "PROCESSED",
376
+ VOID = "VOID",
377
+ WASTE = "WASTE"
378
+ }
379
+ export interface Discount {
380
+ layer: string;
381
+ name?: string;
382
+ discountPrice: number;
383
+ type: string;
384
+ product: string;
385
+ path?: string;
386
+ price: number;
387
+ }
388
+ export declare enum OrderProductKind {
389
+ GROUP = "group",
390
+ PRODUCT = "product"
391
+ }
392
+ export interface ProductLiterals {
393
+ [propName: string]: any;
394
+ }
100
395
  export interface SaleChannel {
101
396
  active?: boolean;
102
397
  minDeliveryTime?: string;
103
398
  minOrderValue?: string;
104
399
  week?: Availability;
105
400
  }
106
- declare enum EChannelName {
401
+ export declare enum EChannelName {
107
402
  DINE_IN = "DINE_IN",
108
403
  TAKE_AWAY = "TAKE_AWAY",
109
404
  DELIVERY = "DELIVERY",
@@ -134,4 +429,3 @@ export interface VenueConfig {
134
429
  timeZone: string;
135
430
  warehouse: string;
136
431
  }
137
- export {};
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./kiosk";
1
2
  export var CouponViewType;
2
3
  (function (CouponViewType) {
3
4
  CouponViewType["CAROUSEL"] = "carousel";
@@ -20,7 +21,77 @@ export var EProductKindBucket;
20
21
  EProductKindBucket["GROUP"] = "group";
21
22
  EProductKindBucket["PRODUCT"] = "product";
22
23
  })(EProductKindBucket || (EProductKindBucket = {}));
23
- var EChannelName;
24
+ export var OrderType;
25
+ (function (OrderType) {
26
+ OrderType["TAKE_AWAY"] = "TAKE_AWAY";
27
+ OrderType["DELIVERY"] = "DELIVERY";
28
+ OrderType["DINE_IN"] = "DINE_IN";
29
+ OrderType["DINE_IN_OPEN"] = "DINE_IN_OPEN";
30
+ OrderType["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
31
+ OrderType["GLOVO_TAKE_AWAY"] = "GLOVO_TAKE_AWAY";
32
+ OrderType["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
33
+ OrderType["JUSTEAT_TAKE_AWAY"] = "JUSTEAT_TAKE_AWAY";
34
+ OrderType["UBER_DELIVERY"] = "UBER_DELIVERY";
35
+ OrderType["UBER_TAKE_AWAY"] = "UBER_TAKE_AWAY";
36
+ OrderType["UBER_DINE_IN"] = "UBER_DINE_IN";
37
+ OrderType["BOLT_DELIVERY"] = "BOLT_DELIVERY";
38
+ OrderType["BOLT_TAKE_AWAY"] = "BOLT_TAKE_AWAY";
39
+ OrderType["WOLT_DELIVERY"] = "WOLT_DELIVERY";
40
+ OrderType["WOLT_TAKE_AWAY"] = "WOLT_TAKE_AWAY";
41
+ OrderType["WOLT_DINE_IN"] = "WOLT_DINE_IN";
42
+ })(OrderType || (OrderType = {}));
43
+ export var OrderStatus;
44
+ (function (OrderStatus) {
45
+ OrderStatus["NEW"] = "NEW";
46
+ OrderStatus["COMPLETED"] = "COMPLETED";
47
+ OrderStatus["VERIFIED"] = "VERIFIED";
48
+ OrderStatus["DELIVER"] = "DELIVER";
49
+ OrderStatus["DELIVERED"] = "DELIVERED";
50
+ OrderStatus["CLOSED"] = "CLOSED";
51
+ OrderStatus["ABANDONED"] = "ABANDONED";
52
+ OrderStatus["CANCELLED"] = "CANCELLED";
53
+ OrderStatus["PICKED"] = "PICKED";
54
+ })(OrderStatus || (OrderStatus = {}));
55
+ export var OrderPaymentType;
56
+ (function (OrderPaymentType) {
57
+ OrderPaymentType["CASH"] = "CASH";
58
+ OrderPaymentType["CARD"] = "CARD";
59
+ OrderPaymentType["COD"] = "COD";
60
+ OrderPaymentType["TERMINAL"] = "TERMINAL";
61
+ OrderPaymentType["EPAYMENT"] = "EPAYMENT";
62
+ OrderPaymentType["COUPON"] = "COUPON";
63
+ OrderPaymentType["WALLET"] = "WALLET";
64
+ OrderPaymentType["PREAUTHORIZED"] = "PREAUTHORIZED";
65
+ OrderPaymentType["RETURN"] = "RETURN";
66
+ OrderPaymentType["EXTERNAL"] = "EXTERNAL";
67
+ })(OrderPaymentType || (OrderPaymentType = {}));
68
+ export var OrderSource;
69
+ (function (OrderSource) {
70
+ OrderSource["KIOSK"] = "KIOSK";
71
+ OrderSource["WEB"] = "WEB";
72
+ OrderSource["JUST_EAT_TAKE_AWAY"] = "JUSTEATTAKEAWAY";
73
+ OrderSource["GLOVO"] = "GLOVO";
74
+ OrderSource["PYSZNE"] = "PYSZNE";
75
+ OrderSource["WOLT"] = "WOLT";
76
+ OrderSource["UBER"] = "UBER";
77
+ OrderSource["BOLT"] = "BOLT";
78
+ })(OrderSource || (OrderSource = {}));
79
+ export var OrderLineStatus;
80
+ (function (OrderLineStatus) {
81
+ OrderLineStatus["NEW"] = "NEW";
82
+ OrderLineStatus["TECHNICAL"] = "TECHNICAL";
83
+ OrderLineStatus["CONFIRMED"] = "CONFIRMED";
84
+ OrderLineStatus["PROCESSING"] = "PROCESSING";
85
+ OrderLineStatus["PROCESSED"] = "PROCESSED";
86
+ OrderLineStatus["VOID"] = "VOID";
87
+ OrderLineStatus["WASTE"] = "WASTE";
88
+ })(OrderLineStatus || (OrderLineStatus = {}));
89
+ export var OrderProductKind;
90
+ (function (OrderProductKind) {
91
+ OrderProductKind["GROUP"] = "group";
92
+ OrderProductKind["PRODUCT"] = "product";
93
+ })(OrderProductKind || (OrderProductKind = {}));
94
+ export var EChannelName;
24
95
  (function (EChannelName) {
25
96
  EChannelName["DINE_IN"] = "DINE_IN";
26
97
  EChannelName["TAKE_AWAY"] = "TAKE_AWAY";
@@ -0,0 +1,10 @@
1
+ export declare enum EPaymentStatus {
2
+ UNINITIALIZED = "UNINITIALIZED",
3
+ PROCESSING = "PROCESSING",
4
+ PAID = "PAID",
5
+ PRINTING_RECEIPT = "PRINTING_RECEIPT",
6
+ PRINTING_RECEIPT_SUCCESS = "PRINTING_RECEIPT_SUCCESS",
7
+ SENDING_RECEIPT = "SENDING_RECEIPT",
8
+ SENDING_RECEIPT_SUCCESS = "SENDING_RECEIPT_SUCCESS",
9
+ ERROR = "ERROR"
10
+ }
@@ -0,0 +1,11 @@
1
+ export var EPaymentStatus;
2
+ (function (EPaymentStatus) {
3
+ EPaymentStatus["UNINITIALIZED"] = "UNINITIALIZED";
4
+ EPaymentStatus["PROCESSING"] = "PROCESSING";
5
+ EPaymentStatus["PAID"] = "PAID";
6
+ EPaymentStatus["PRINTING_RECEIPT"] = "PRINTING_RECEIPT";
7
+ EPaymentStatus["PRINTING_RECEIPT_SUCCESS"] = "PRINTING_RECEIPT_SUCCESS";
8
+ EPaymentStatus["SENDING_RECEIPT"] = "SENDING_RECEIPT";
9
+ EPaymentStatus["SENDING_RECEIPT_SUCCESS"] = "SENDING_RECEIPT_SUCCESS";
10
+ EPaymentStatus["ERROR"] = "ERROR";
11
+ })(EPaymentStatus || (EPaymentStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderingstack/ordering-types",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Typescript types for @orderingstack",
5
5
  "types": "dist/esm/index.d.ts",
6
6
  "main": "dist/cjs/index.js",