@orderingstack/ordering-types 1.13.1 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  export * from "./kiosk";
2
2
  export * from "./kioskErrors";
3
3
  export * from "./api";
4
+ export * from "./loyalty";
4
5
  export interface IRestaurant {
5
6
  id: string;
6
7
  name: string;
package/dist/cjs/index.js CHANGED
@@ -18,6 +18,7 @@ exports.ENotificationType = exports.EChannelName = exports.EOrderProductKind = e
18
18
  __exportStar(require("./kiosk"), exports);
19
19
  __exportStar(require("./kioskErrors"), exports);
20
20
  __exportStar(require("./api"), exports);
21
+ __exportStar(require("./loyalty"), exports);
21
22
  var ECouponViewType;
22
23
  (function (ECouponViewType) {
23
24
  ECouponViewType["CAROUSEL"] = "carousel";
@@ -0,0 +1,102 @@
1
+ import { IOrder } from "./index";
2
+ export interface Campaign {
3
+ /**
4
+ * @minLength 0
5
+ * @maxLength 64
6
+ * @pattern [a-zA-Z0-9_-]+
7
+ */
8
+ id: string;
9
+ initialized?: boolean;
10
+ /**
11
+ * @minLength 0
12
+ * @maxLength 128
13
+ */
14
+ name: string;
15
+ /**
16
+ * @maxItems 16
17
+ * @minItems 1
18
+ */
19
+ constraints: Constraint[];
20
+ /** @format date-time */
21
+ initializedAt?: string;
22
+ initializedBy?: string;
23
+ /** @format int64 */
24
+ cnt?: number;
25
+ /** @format date-time */
26
+ previewedAt?: string;
27
+ samples?: string[];
28
+ }
29
+ interface Constraint {
30
+ /**
31
+ * @minLength 0
32
+ * @maxLength 64
33
+ * @pattern ((counters|properties|venues|tags)\.[a-zA-Z0-9_-]+)|(header\.(firstName|created|lastOrder|birthdate))
34
+ */
35
+ field: string;
36
+ op: "EQ" | "NE" | "IN" | "GT" | "GTE" | "LT" | "LTE" | "EXISTS";
37
+ /**
38
+ * @maxItems 16
39
+ * @minItems 0
40
+ */
41
+ value?: string[];
42
+ }
43
+ interface AccountHeader {
44
+ phone?: string;
45
+ email?: string;
46
+ pushId?: string;
47
+ firstName?: string;
48
+ lastName?: string;
49
+ /** @format date */
50
+ birthdate?: string;
51
+ /** @format date-time */
52
+ created?: string;
53
+ /** @format date-time */
54
+ lastEvent?: string;
55
+ /** @format date-time */
56
+ lastLogged?: string;
57
+ /** @format date-time */
58
+ lastOrder?: string;
59
+ }
60
+ export interface ApiAccount {
61
+ id?: string;
62
+ card?: string;
63
+ mgm?: string;
64
+ header?: AccountHeader;
65
+ consents?: Consents;
66
+ /** @uniqueItems true */
67
+ tags?: string[];
68
+ /** @uniqueItems true */
69
+ importantTags?: string[];
70
+ /** @uniqueItems true */
71
+ venues?: string[];
72
+ properties?: Record<string, string>;
73
+ counters?: Record<string, number>;
74
+ relations?: Relation[];
75
+ openedOrders?: IOrder[];
76
+ previousOrders?: IOrder[];
77
+ /** @uniqueItems true */
78
+ coupons?: string[];
79
+ campaigns?: CampaignState[];
80
+ segment?: string;
81
+ }
82
+ interface CampaignState {
83
+ id?: string;
84
+ state?: string;
85
+ }
86
+ interface Consents {
87
+ scope: "ACCOUNT" | "TRANSACTION";
88
+ /**
89
+ * @minLength 0
90
+ * @maxLength 128
91
+ * @pattern [a-zA-Z0-9_.-]+
92
+ */
93
+ transaction?: string;
94
+ consents: Record<string, string>;
95
+ }
96
+ interface Relation {
97
+ id?: string;
98
+ /** @format date-time */
99
+ at?: string;
100
+ type?: "INVITED_BY" | "INVITED" | "FRIEND" | "UNKNOWN";
101
+ }
102
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,97 @@
1
+ import { EOrderPaymentType, EOrderStatus, EOrderType, IProductState, IStringKeyRecord } from "./index";
2
+ export declare const aggregators: readonly ["GLOVO", "JUSTEAT", "UBER", "WOLT", "BOLT", "TAZZ", "_ANY_"];
3
+ export type TAggregator = typeof aggregators[number];
4
+ type TOrderDir = "DESC" | "ASC";
5
+ interface ApiParams {
6
+ query?: any;
7
+ headers?: IStringKeyRecord<string>;
8
+ data?: any;
9
+ }
10
+ export interface IOrderApiGetListParams extends ApiParams {
11
+ query: {
12
+ _sort?: string;
13
+ _order?: TOrderDir;
14
+ _start?: number;
15
+ _end?: number;
16
+ id?: string;
17
+ extId?: string;
18
+ status?: EOrderStatus;
19
+ type?: EOrderType;
20
+ completed?: boolean;
21
+ closed?: boolean;
22
+ phone?: string;
23
+ mail?: string;
24
+ createdFrom?: string;
25
+ createdTo?: string;
26
+ completedFrom?: string;
27
+ completedTo?: string;
28
+ venue?: string;
29
+ aggregator?: TAggregator;
30
+ payment?: EOrderPaymentType;
31
+ };
32
+ headers: {
33
+ "x-tenant"?: string;
34
+ };
35
+ }
36
+ interface IDiscount {
37
+ /**
38
+ * Discount layer. It is used to distinguish discounts from loyalty, manual discounts, etc.
39
+ * @pattern [a-zA-Z0-9_.-]+
40
+ */
41
+ layer: string;
42
+ /**
43
+ * Name that describes this discount
44
+ * @minLength 0
45
+ * @maxLength 128
46
+ */
47
+ name?: string;
48
+ /** Discount price (subtracted from line total) */
49
+ discountPrice: number;
50
+ /** Extra params */
51
+ extra?: IStringKeyRecord<string>;
52
+ type: string;
53
+ }
54
+ interface ILineDiscount {
55
+ /** Applied discounts */
56
+ discount: IDiscount;
57
+ /** @format date-time */
58
+ expires?: string;
59
+ /**
60
+ * @minLength 0
61
+ * @maxLength 128
62
+ * @pattern [a-zA-Z0-9_. -]+
63
+ */
64
+ sign: string;
65
+ }
66
+ export interface IAppendedLine {
67
+ /**
68
+ * @format int32
69
+ * @min 1
70
+ * @max 100000
71
+ */
72
+ quantity: number;
73
+ /**
74
+ * One should not provide price - it will be automatically calculated. If user is privileged (internal system user or has role 'SU' or 'ALTERPRICE') OrderingStack will use provided price and override one from menu. Please be careful when providing value '0' as privileged user here! If you do not want to override price - do not provide 'price' attribute at all (null).
75
+ * @min 0
76
+ * @exclusiveMin false
77
+ */
78
+ price?: number;
79
+ /** @pattern [a-zA-Z0-9_.-]+ */
80
+ productId: string;
81
+ /** Configuration of product */
82
+ productConfig?: IProductState;
83
+ /** @default "NEW" */
84
+ status: "NEW" | "CONFIRMED";
85
+ /**
86
+ * @minLength 0
87
+ * @maxLength 255
88
+ */
89
+ comment?: string;
90
+ /**
91
+ * @maxItems 10
92
+ * @minItems 0
93
+ */
94
+ discounts?: ILineDiscount[];
95
+ extra?: IStringKeyRecord<string>;
96
+ }
97
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aggregators = void 0;
4
+ exports.aggregators = [
5
+ "GLOVO",
6
+ "JUSTEAT",
7
+ "UBER",
8
+ "WOLT",
9
+ "BOLT",
10
+ "TAZZ",
11
+ "_ANY_",
12
+ ];