@orderingstack/ordering-types 1.28.0 → 1.28.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.
package/dist/cjs/api.d.ts CHANGED
@@ -1,99 +1,99 @@
1
- import { EOrderPaymentType, EOrderStatus, EOrderType, IProductState, IStringKeyRecord } from "./index";
2
- export declare const aggregators: readonly ["BOLT", "GLOVO", "JUSTEAT", "TAZZ", "UBER", "UPMENU", "WOLT", "_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
- totalMin?: number;
32
- totalMax?: number;
33
- };
34
- headers: {
35
- "x-tenant"?: string;
36
- };
37
- }
38
- interface IDiscount {
39
- /**
40
- * Discount layer. It is used to distinguish discounts from loyalty, manual discounts, etc.
41
- * @pattern [a-zA-Z0-9_.-]+
42
- */
43
- layer: string;
44
- /**
45
- * Name that describes this discount
46
- * @minLength 0
47
- * @maxLength 128
48
- */
49
- name?: string;
50
- /** Discount price (subtracted from line total) */
51
- discountPrice: number;
52
- /** Extra params */
53
- extra?: IStringKeyRecord<string>;
54
- type: string;
55
- }
56
- interface ILineDiscount {
57
- /** Applied discounts */
58
- discount: IDiscount;
59
- /** @format date-time */
60
- expires?: string;
61
- /**
62
- * @minLength 0
63
- * @maxLength 128
64
- * @pattern [a-zA-Z0-9_. -]+
65
- */
66
- sign: string;
67
- }
68
- export interface IAppendedLine {
69
- /**
70
- * @format int32
71
- * @min 1
72
- * @max 100000
73
- */
74
- quantity: number;
75
- /**
76
- * 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).
77
- * @min 0
78
- * @exclusiveMin false
79
- */
80
- price?: number;
81
- /** @pattern [a-zA-Z0-9_.-]+ */
82
- productId: string;
83
- /** Configuration of product */
84
- productConfig?: IProductState;
85
- /** @default "NEW" */
86
- status: "NEW" | "CONFIRMED";
87
- /**
88
- * @minLength 0
89
- * @maxLength 255
90
- */
91
- comment?: string;
92
- /**
93
- * @maxItems 10
94
- * @minItems 0
95
- */
96
- discounts?: ILineDiscount[];
97
- extra?: IStringKeyRecord<string>;
98
- }
99
- export {};
1
+ import { EOrderPaymentType, EOrderStatus, EOrderType, IProductState, IStringKeyRecord } from "./index";
2
+ export declare const aggregators: readonly ["BOLT", "GLOVO", "JUSTEAT", "TAZZ", "UBER", "UPMENU", "WOLT", "_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
+ totalMin?: number;
32
+ totalMax?: number;
33
+ };
34
+ headers: {
35
+ "x-tenant"?: string;
36
+ };
37
+ }
38
+ interface IDiscount {
39
+ /**
40
+ * Discount layer. It is used to distinguish discounts from loyalty, manual discounts, etc.
41
+ * @pattern [a-zA-Z0-9_.-]+
42
+ */
43
+ layer: string;
44
+ /**
45
+ * Name that describes this discount
46
+ * @minLength 0
47
+ * @maxLength 128
48
+ */
49
+ name?: string;
50
+ /** Discount price (subtracted from line total) */
51
+ discountPrice: number;
52
+ /** Extra params */
53
+ extra?: IStringKeyRecord<string>;
54
+ type: string;
55
+ }
56
+ interface ILineDiscount {
57
+ /** Applied discounts */
58
+ discount: IDiscount;
59
+ /** @format date-time */
60
+ expires?: string;
61
+ /**
62
+ * @minLength 0
63
+ * @maxLength 128
64
+ * @pattern [a-zA-Z0-9_. -]+
65
+ */
66
+ sign: string;
67
+ }
68
+ export interface IAppendedLine {
69
+ /**
70
+ * @format int32
71
+ * @min 1
72
+ * @max 100000
73
+ */
74
+ quantity: number;
75
+ /**
76
+ * 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).
77
+ * @min 0
78
+ * @exclusiveMin false
79
+ */
80
+ price?: number;
81
+ /** @pattern [a-zA-Z0-9_.-]+ */
82
+ productId: string;
83
+ /** Configuration of product */
84
+ productConfig?: IProductState;
85
+ /** @default "NEW" */
86
+ status: "NEW" | "CONFIRMED";
87
+ /**
88
+ * @minLength 0
89
+ * @maxLength 255
90
+ */
91
+ comment?: string;
92
+ /**
93
+ * @maxItems 10
94
+ * @minItems 0
95
+ */
96
+ discounts?: ILineDiscount[];
97
+ extra?: IStringKeyRecord<string>;
98
+ }
99
+ export {};
package/dist/cjs/api.js CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.aggregators = void 0;
4
- exports.aggregators = [
5
- "BOLT",
6
- "GLOVO",
7
- "JUSTEAT",
8
- "TAZZ",
9
- "UBER",
10
- "UPMENU",
11
- "WOLT",
12
- "_ANY_",
13
- ];
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aggregators = void 0;
4
+ exports.aggregators = [
5
+ "BOLT",
6
+ "GLOVO",
7
+ "JUSTEAT",
8
+ "TAZZ",
9
+ "UBER",
10
+ "UPMENU",
11
+ "WOLT",
12
+ "_ANY_",
13
+ ];