@orderingstack/ordering-types 1.8.8 → 1.9.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.
@@ -144,12 +144,23 @@ export interface IProductFilter {
144
144
  }
145
145
  export interface IUser {
146
146
  userId: string;
147
- roles: string[];
147
+ roles: Array<EOrderUserRole>;
148
148
  name?: string;
149
149
  phone?: string;
150
150
  email?: string;
151
151
  extra?: IStringKeyRecord<string>;
152
152
  }
153
+ export declare enum EOrderUserRole {
154
+ CREATOR = "CREATOR",
155
+ CUSTOMER = "CUSTOMER",
156
+ COUPON = "COUPON",
157
+ KIOSK = "KIOSK",
158
+ WAITER = "WAITER",
159
+ MANAGER = "MANAGER",
160
+ VIEWER = "VIEWER",
161
+ DRIVER = "DRIVER",
162
+ STAFF = "STAFF"
163
+ }
153
164
  export declare enum EOrderType {
154
165
  TAKE_AWAY = "TAKE_AWAY",
155
166
  DELIVERY = "DELIVERY",
@@ -311,6 +322,12 @@ export interface ITaxSummary {
311
322
  tax: number;
312
323
  brutto: number;
313
324
  }
325
+ export declare enum ERbiOrderExtra {
326
+ POINTS_TOTAL = "x-rbi-loyalty-points",
327
+ POINTS_EARNED = "x-rbi-points-earned",
328
+ REWARDS = "x-rbi-rewards",
329
+ OFFERS = "x-rbi-offers"
330
+ }
314
331
  /**
315
332
  * OrderExtra interface
316
333
  *
@@ -325,8 +342,12 @@ export interface ITaxSummary {
325
342
  * @allergies {string} customer allergies from aggregator
326
343
  * @x-agg-id {string} order ID from aggregator
327
344
  * @support-order-id {string} order code from aggregator to be used with support and same as seen by customer,
345
+ * @x-rbi-loyalty-points {string} current user RBI loyalty points
346
+ * @x-rbi-points-earned {string} RBI loyalty points to be earned for a current order basket
347
+ * @x-rbi-rewards {string} comma separated product IDs of preselected RBI REWARDS
348
+ * @x-rbi-offers {string} comma separated product IDs of preselected RBI OFFERS
328
349
  */
329
- export interface IOrderExtra extends IStringKeyRecord<string | undefined> {
350
+ interface IOrderExtra {
330
351
  "x-source"?: EOrderSource;
331
352
  "x-source-type"?: "INTEGRATOR";
332
353
  "manual-verify"?: string;
@@ -342,6 +363,11 @@ export interface IOrderExtra extends IStringKeyRecord<string | undefined> {
342
363
  "x-pos-id"?: string;
343
364
  "company-tax-id"?: string;
344
365
  "x-kiosk-id"?: string;
366
+ [ERbiOrderExtra.OFFERS]?: string;
367
+ [ERbiOrderExtra.REWARDS]?: string;
368
+ [ERbiOrderExtra.POINTS_EARNED]?: string;
369
+ [ERbiOrderExtra.POINTS_TOTAL]?: string;
370
+ [key: string]: string | undefined;
345
371
  }
346
372
  interface IStringKeyRecord<T> {
347
373
  [key: string]: T;
package/dist/cjs/index.js CHANGED
@@ -14,7 +14,7 @@ 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.ENotificationType = exports.EChannelName = exports.EOrderProductKind = exports.EOrderLineStatus = exports.EOrderSource = exports.EOrderPaymentType = exports.EOrderStatus = exports.EOrderType = exports.EProductKindBucket = exports.EProductKind = exports.ECouponViewType = void 0;
17
+ exports.ENotificationType = exports.EChannelName = exports.EOrderProductKind = exports.EOrderLineStatus = exports.EOrderSource = exports.ERbiOrderExtra = exports.EOrderPaymentType = exports.EOrderStatus = exports.EOrderType = exports.EOrderUserRole = exports.EProductKindBucket = exports.EProductKind = exports.ECouponViewType = void 0;
18
18
  __exportStar(require("./kiosk"), exports);
19
19
  __exportStar(require("./kioskErrors"), exports);
20
20
  var ECouponViewType;
@@ -39,6 +39,18 @@ var EProductKindBucket;
39
39
  EProductKindBucket["GROUP"] = "group";
40
40
  EProductKindBucket["PRODUCT"] = "product";
41
41
  })(EProductKindBucket = exports.EProductKindBucket || (exports.EProductKindBucket = {}));
42
+ var EOrderUserRole;
43
+ (function (EOrderUserRole) {
44
+ EOrderUserRole["CREATOR"] = "CREATOR";
45
+ EOrderUserRole["CUSTOMER"] = "CUSTOMER";
46
+ EOrderUserRole["COUPON"] = "COUPON";
47
+ EOrderUserRole["KIOSK"] = "KIOSK";
48
+ EOrderUserRole["WAITER"] = "WAITER";
49
+ EOrderUserRole["MANAGER"] = "MANAGER";
50
+ EOrderUserRole["VIEWER"] = "VIEWER";
51
+ EOrderUserRole["DRIVER"] = "DRIVER";
52
+ EOrderUserRole["STAFF"] = "STAFF";
53
+ })(EOrderUserRole = exports.EOrderUserRole || (exports.EOrderUserRole = {}));
42
54
  // Update EOrderSource & EChannelName upon adding EOrderType
43
55
  var EOrderType;
44
56
  (function (EOrderType) {
@@ -86,6 +98,13 @@ var EOrderPaymentType;
86
98
  EOrderPaymentType["RETURN"] = "RETURN";
87
99
  EOrderPaymentType["EXTERNAL"] = "EXTERNAL";
88
100
  })(EOrderPaymentType = exports.EOrderPaymentType || (exports.EOrderPaymentType = {}));
101
+ var ERbiOrderExtra;
102
+ (function (ERbiOrderExtra) {
103
+ ERbiOrderExtra["POINTS_TOTAL"] = "x-rbi-loyalty-points";
104
+ ERbiOrderExtra["POINTS_EARNED"] = "x-rbi-points-earned";
105
+ ERbiOrderExtra["REWARDS"] = "x-rbi-rewards";
106
+ ERbiOrderExtra["OFFERS"] = "x-rbi-offers";
107
+ })(ERbiOrderExtra = exports.ERbiOrderExtra || (exports.ERbiOrderExtra = {}));
89
108
  var EOrderSource;
90
109
  (function (EOrderSource) {
91
110
  EOrderSource["KIOSK"] = "KIOSK";
@@ -144,12 +144,23 @@ export interface IProductFilter {
144
144
  }
145
145
  export interface IUser {
146
146
  userId: string;
147
- roles: string[];
147
+ roles: Array<EOrderUserRole>;
148
148
  name?: string;
149
149
  phone?: string;
150
150
  email?: string;
151
151
  extra?: IStringKeyRecord<string>;
152
152
  }
153
+ export declare enum EOrderUserRole {
154
+ CREATOR = "CREATOR",
155
+ CUSTOMER = "CUSTOMER",
156
+ COUPON = "COUPON",
157
+ KIOSK = "KIOSK",
158
+ WAITER = "WAITER",
159
+ MANAGER = "MANAGER",
160
+ VIEWER = "VIEWER",
161
+ DRIVER = "DRIVER",
162
+ STAFF = "STAFF"
163
+ }
153
164
  export declare enum EOrderType {
154
165
  TAKE_AWAY = "TAKE_AWAY",
155
166
  DELIVERY = "DELIVERY",
@@ -311,6 +322,12 @@ export interface ITaxSummary {
311
322
  tax: number;
312
323
  brutto: number;
313
324
  }
325
+ export declare enum ERbiOrderExtra {
326
+ POINTS_TOTAL = "x-rbi-loyalty-points",
327
+ POINTS_EARNED = "x-rbi-points-earned",
328
+ REWARDS = "x-rbi-rewards",
329
+ OFFERS = "x-rbi-offers"
330
+ }
314
331
  /**
315
332
  * OrderExtra interface
316
333
  *
@@ -325,8 +342,12 @@ export interface ITaxSummary {
325
342
  * @allergies {string} customer allergies from aggregator
326
343
  * @x-agg-id {string} order ID from aggregator
327
344
  * @support-order-id {string} order code from aggregator to be used with support and same as seen by customer,
345
+ * @x-rbi-loyalty-points {string} current user RBI loyalty points
346
+ * @x-rbi-points-earned {string} RBI loyalty points to be earned for a current order basket
347
+ * @x-rbi-rewards {string} comma separated product IDs of preselected RBI REWARDS
348
+ * @x-rbi-offers {string} comma separated product IDs of preselected RBI OFFERS
328
349
  */
329
- export interface IOrderExtra extends IStringKeyRecord<string | undefined> {
350
+ interface IOrderExtra {
330
351
  "x-source"?: EOrderSource;
331
352
  "x-source-type"?: "INTEGRATOR";
332
353
  "manual-verify"?: string;
@@ -342,6 +363,11 @@ export interface IOrderExtra extends IStringKeyRecord<string | undefined> {
342
363
  "x-pos-id"?: string;
343
364
  "company-tax-id"?: string;
344
365
  "x-kiosk-id"?: string;
366
+ [ERbiOrderExtra.OFFERS]?: string;
367
+ [ERbiOrderExtra.REWARDS]?: string;
368
+ [ERbiOrderExtra.POINTS_EARNED]?: string;
369
+ [ERbiOrderExtra.POINTS_TOTAL]?: string;
370
+ [key: string]: string | undefined;
345
371
  }
346
372
  interface IStringKeyRecord<T> {
347
373
  [key: string]: T;
package/dist/esm/index.js CHANGED
@@ -22,6 +22,18 @@ export var EProductKindBucket;
22
22
  EProductKindBucket["GROUP"] = "group";
23
23
  EProductKindBucket["PRODUCT"] = "product";
24
24
  })(EProductKindBucket || (EProductKindBucket = {}));
25
+ export var EOrderUserRole;
26
+ (function (EOrderUserRole) {
27
+ EOrderUserRole["CREATOR"] = "CREATOR";
28
+ EOrderUserRole["CUSTOMER"] = "CUSTOMER";
29
+ EOrderUserRole["COUPON"] = "COUPON";
30
+ EOrderUserRole["KIOSK"] = "KIOSK";
31
+ EOrderUserRole["WAITER"] = "WAITER";
32
+ EOrderUserRole["MANAGER"] = "MANAGER";
33
+ EOrderUserRole["VIEWER"] = "VIEWER";
34
+ EOrderUserRole["DRIVER"] = "DRIVER";
35
+ EOrderUserRole["STAFF"] = "STAFF";
36
+ })(EOrderUserRole || (EOrderUserRole = {}));
25
37
  // Update EOrderSource & EChannelName upon adding EOrderType
26
38
  export var EOrderType;
27
39
  (function (EOrderType) {
@@ -69,6 +81,13 @@ export var EOrderPaymentType;
69
81
  EOrderPaymentType["RETURN"] = "RETURN";
70
82
  EOrderPaymentType["EXTERNAL"] = "EXTERNAL";
71
83
  })(EOrderPaymentType || (EOrderPaymentType = {}));
84
+ export var ERbiOrderExtra;
85
+ (function (ERbiOrderExtra) {
86
+ ERbiOrderExtra["POINTS_TOTAL"] = "x-rbi-loyalty-points";
87
+ ERbiOrderExtra["POINTS_EARNED"] = "x-rbi-points-earned";
88
+ ERbiOrderExtra["REWARDS"] = "x-rbi-rewards";
89
+ ERbiOrderExtra["OFFERS"] = "x-rbi-offers";
90
+ })(ERbiOrderExtra || (ERbiOrderExtra = {}));
72
91
  export var EOrderSource;
73
92
  (function (EOrderSource) {
74
93
  EOrderSource["KIOSK"] = "KIOSK";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderingstack/ordering-types",
3
- "version": "1.8.8",
3
+ "version": "1.9.1",
4
4
  "description": "Typescript types for @orderingstack",
5
5
  "types": "dist/esm/index.d.ts",
6
6
  "main": "dist/cjs/index.js",