@orderingstack/ordering-types 0.1.0 → 0.1.1

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