@medusajs/types 1.11.7 → 1.11.8-next-20231124092248
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/pricing/common/currency.d.ts +39 -20
- package/dist/pricing/common/money-amount.d.ts +63 -25
- package/dist/pricing/common/price-list.d.ts +298 -0
- package/dist/pricing/common/price-list.js +22 -0
- package/dist/pricing/common/price-list.js.map +1 -1
- package/dist/pricing/common/price-rule.d.ts +61 -48
- package/dist/pricing/common/price-set-money-amount-rules.d.ts +49 -19
- package/dist/pricing/common/price-set-money-amount.d.ts +38 -8
- package/dist/pricing/common/price-set.d.ts +145 -35
- package/dist/pricing/common/rule-type.d.ts +49 -19
- package/dist/pricing/service.d.ts +758 -1
- package/dist/product/common.d.ts +57 -1
- package/dist/product/service.d.ts +24 -3
- package/dist/workflow/index.d.ts +1 -0
- package/dist/workflow/index.js +2 -1
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/price-list/create-price-list.d.ts +66 -0
- package/dist/workflow/price-list/create-price-list.js +3 -0
- package/dist/workflow/price-list/create-price-list.js.map +1 -0
- package/dist/workflow/price-list/index.d.ts +3 -0
- package/dist/workflow/price-list/index.js +20 -0
- package/dist/workflow/price-list/index.js.map +1 -0
- package/dist/workflow/price-list/remove-price-list.d.ts +3 -0
- package/dist/workflow/price-list/remove-price-list.js +3 -0
- package/dist/workflow/price-list/remove-price-list.js.map +1 -0
- package/dist/workflow/price-list/update-price-list.d.ts +21 -0
- package/dist/workflow/price-list/update-price-list.js +3 -0
- package/dist/workflow/price-list/update-price-list.js.map +1 -0
- package/dist/workflow/product/create-product-variants.d.ts +26 -0
- package/dist/workflow/product/create-product-variants.js +3 -0
- package/dist/workflow/product/create-product-variants.js.map +1 -0
- package/dist/workflow/product/index.d.ts +1 -0
- package/dist/workflow/product/index.js +1 -0
- package/dist/workflow/product/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,60 +3,79 @@ import { BaseFilterable } from "../../dal";
|
|
|
3
3
|
* @interface
|
|
4
4
|
*
|
|
5
5
|
* A currency's data.
|
|
6
|
-
*
|
|
7
|
-
* @prop code - The code of the currency.
|
|
8
|
-
* @prop symbol - The symbol of the currency.
|
|
9
|
-
* @prop symbol_native -
|
|
10
|
-
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
|
|
11
|
-
* @prop name - The name of the currency.
|
|
12
6
|
*/
|
|
13
7
|
export interface CurrencyDTO {
|
|
8
|
+
/**
|
|
9
|
+
* The code of the currency.
|
|
10
|
+
*/
|
|
14
11
|
code: string;
|
|
12
|
+
/**
|
|
13
|
+
* The symbol of the currency.
|
|
14
|
+
*/
|
|
15
15
|
symbol?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
|
|
18
|
+
*/
|
|
16
19
|
symbol_native?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the currency.
|
|
22
|
+
*/
|
|
17
23
|
name?: string;
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
26
|
* @interface
|
|
21
27
|
*
|
|
22
28
|
* A currency to create.
|
|
23
|
-
*
|
|
24
|
-
* @prop code - The code of the currency.
|
|
25
|
-
* @prop symbol - The symbol of the currency.
|
|
26
|
-
* @prop symbol_native -
|
|
27
|
-
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
|
|
28
|
-
* @prop name - The name of the currency.
|
|
29
29
|
*/
|
|
30
30
|
export interface CreateCurrencyDTO {
|
|
31
|
+
/**
|
|
32
|
+
* The code of the currency.
|
|
33
|
+
*/
|
|
31
34
|
code: string;
|
|
35
|
+
/**
|
|
36
|
+
* The symbol of the currency.
|
|
37
|
+
*/
|
|
32
38
|
symbol: string;
|
|
39
|
+
/**
|
|
40
|
+
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
|
|
41
|
+
*/
|
|
33
42
|
symbol_native: string;
|
|
43
|
+
/**
|
|
44
|
+
* The name of the currency.
|
|
45
|
+
*/
|
|
34
46
|
name: string;
|
|
35
47
|
}
|
|
36
48
|
/**
|
|
37
49
|
* @interface
|
|
38
50
|
*
|
|
39
51
|
* The data to update in a currency. The `code` is used to identify which currency to update.
|
|
40
|
-
*
|
|
41
|
-
* @prop code - The code of the currency to update.
|
|
42
|
-
* @prop symbol - The symbol of the currency.
|
|
43
|
-
* @prop symbol_native -
|
|
44
|
-
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
|
|
45
|
-
* @prop name - The name of the currency.
|
|
46
52
|
*/
|
|
47
53
|
export interface UpdateCurrencyDTO {
|
|
54
|
+
/**
|
|
55
|
+
* The code of the currency to update.
|
|
56
|
+
*/
|
|
48
57
|
code: string;
|
|
58
|
+
/**
|
|
59
|
+
* The symbol of the currency.
|
|
60
|
+
*/
|
|
49
61
|
symbol?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.
|
|
64
|
+
*/
|
|
50
65
|
symbol_native?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The name of the currency.
|
|
68
|
+
*/
|
|
51
69
|
name?: string;
|
|
52
70
|
}
|
|
53
71
|
/**
|
|
54
72
|
* @interface
|
|
55
73
|
*
|
|
56
74
|
* Filters to apply on a currency.
|
|
57
|
-
*
|
|
58
|
-
* @prop code - The codes to filter the currencies by.
|
|
59
75
|
*/
|
|
60
76
|
export interface FilterableCurrencyProps extends BaseFilterable<FilterableCurrencyProps> {
|
|
77
|
+
/**
|
|
78
|
+
* The codes to filter the currencies by.
|
|
79
|
+
*/
|
|
61
80
|
code?: string[];
|
|
62
81
|
}
|
|
@@ -5,71 +5,109 @@ import { PriceSetMoneyAmountDTO } from "./price-set-money-amount";
|
|
|
5
5
|
* @interface
|
|
6
6
|
*
|
|
7
7
|
* A money amount's data. A money amount represents a price.
|
|
8
|
-
*
|
|
9
|
-
* @prop id - The ID of the money amount.
|
|
10
|
-
* @prop currency_code - The currency code of this money amount.
|
|
11
|
-
* @prop currency - The money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.
|
|
12
|
-
* @prop amount - The price of this money amount.
|
|
13
|
-
* @prop min_quantity - The minimum quantity required to be purchased for this price to be applied.
|
|
14
|
-
* @prop max_quantity - The maximum quantity required to be purchased for this price to be applied.
|
|
15
8
|
*/
|
|
16
9
|
export interface MoneyAmountDTO {
|
|
10
|
+
/**
|
|
11
|
+
* The ID of the money amount.
|
|
12
|
+
*/
|
|
17
13
|
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* The currency code of this money amount.
|
|
16
|
+
*/
|
|
18
17
|
currency_code?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The money amount's currency.
|
|
20
|
+
*
|
|
21
|
+
* @expandable
|
|
22
|
+
*/
|
|
19
23
|
currency?: CurrencyDTO;
|
|
24
|
+
/**
|
|
25
|
+
* The price of this money amount.
|
|
26
|
+
*/
|
|
20
27
|
amount?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The minimum quantity required to be purchased for this price to be applied.
|
|
30
|
+
*/
|
|
21
31
|
min_quantity?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The maximum quantity required to be purchased for this price to be applied.
|
|
34
|
+
*/
|
|
22
35
|
max_quantity?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The details of the relation between the money amount and its associated price set.
|
|
38
|
+
*/
|
|
23
39
|
price_set_money_amount?: PriceSetMoneyAmountDTO;
|
|
24
40
|
}
|
|
25
41
|
/**
|
|
26
42
|
* @interface
|
|
27
43
|
*
|
|
28
44
|
* The money amount to create.
|
|
29
|
-
*
|
|
30
|
-
* @prop id - The ID of the money amount.
|
|
31
|
-
* @prop currency_code - The currency code of this money amount.
|
|
32
|
-
* @prop currency - The currency of this money amount.
|
|
33
|
-
* @prop amount - The amount of this money amount.
|
|
34
|
-
* @prop min_quantity - The minimum quantity required to be purchased for this money amount to be applied.
|
|
35
|
-
* @prop max_quantity - The maximum quantity required to be purchased for this money amount to be applied.
|
|
36
45
|
*/
|
|
37
46
|
export interface CreateMoneyAmountDTO {
|
|
47
|
+
/**
|
|
48
|
+
* The ID of the money amount.
|
|
49
|
+
*/
|
|
38
50
|
id?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The currency code of this money amount.
|
|
53
|
+
*/
|
|
39
54
|
currency_code: string;
|
|
55
|
+
/**
|
|
56
|
+
* The currency of this money amount.
|
|
57
|
+
*/
|
|
40
58
|
currency?: CreateCurrencyDTO;
|
|
59
|
+
/**
|
|
60
|
+
* The amount of this money amount.
|
|
61
|
+
*/
|
|
41
62
|
amount: number;
|
|
63
|
+
/**
|
|
64
|
+
* The minimum quantity required to be purchased for this money amount to be applied.
|
|
65
|
+
*/
|
|
42
66
|
min_quantity?: number | null;
|
|
67
|
+
/**
|
|
68
|
+
* The maximum quantity required to be purchased for this money amount to be applied.
|
|
69
|
+
*/
|
|
43
70
|
max_quantity?: number | null;
|
|
44
71
|
}
|
|
45
72
|
/**
|
|
46
|
-
*
|
|
73
|
+
* @interface
|
|
47
74
|
*
|
|
48
75
|
* The data to update in a money amount. The `id` is used to identify which money amount to update.
|
|
49
|
-
*
|
|
50
|
-
* @prop id - The ID of the money amount to update.
|
|
51
|
-
* @prop currency_code - The code of the currency to associate with the money amount.
|
|
52
|
-
* @prop currency - The currency to associte with the money amount.
|
|
53
|
-
* @prop amount - The price of this money amount.
|
|
54
|
-
* @prop min_quantity - The minimum quantity required to be purchased for this money amount to be applied.
|
|
55
|
-
* @prop max_quantity - The maximum quantity required to be purchased for this money amount to be applied.
|
|
56
76
|
*/
|
|
57
77
|
export interface UpdateMoneyAmountDTO {
|
|
78
|
+
/**
|
|
79
|
+
* The ID of the money amount to update.
|
|
80
|
+
*/
|
|
58
81
|
id: string;
|
|
82
|
+
/**
|
|
83
|
+
* The code of the currency to associate with the money amount.
|
|
84
|
+
*/
|
|
59
85
|
currency_code?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The price of this money amount.
|
|
88
|
+
*/
|
|
60
89
|
amount?: number;
|
|
90
|
+
/**
|
|
91
|
+
* The minimum quantity required to be purchased for this money amount to be applied.
|
|
92
|
+
*/
|
|
61
93
|
min_quantity?: number;
|
|
94
|
+
/**
|
|
95
|
+
* The maximum quantity required to be purchased for this money amount to be applied.
|
|
96
|
+
*/
|
|
62
97
|
max_quantity?: number;
|
|
63
98
|
}
|
|
64
99
|
/**
|
|
65
100
|
* @interface
|
|
66
101
|
*
|
|
67
102
|
* Filters to apply on a money amount.
|
|
68
|
-
*
|
|
69
|
-
* @prop id - IDs to filter money amounts by.
|
|
70
|
-
* @prop currency_code - Currency codes to filter money amounts by.
|
|
71
103
|
*/
|
|
72
104
|
export interface FilterableMoneyAmountProps extends BaseFilterable<FilterableMoneyAmountProps> {
|
|
105
|
+
/**
|
|
106
|
+
* IDs to filter money amounts by.
|
|
107
|
+
*/
|
|
73
108
|
id?: string[];
|
|
109
|
+
/**
|
|
110
|
+
* Currency codes to filter money amounts by.
|
|
111
|
+
*/
|
|
74
112
|
currency_code?: string | string[];
|
|
75
113
|
}
|
|
@@ -2,63 +2,245 @@ import { CreateMoneyAmountDTO, MoneyAmountDTO } from "./money-amount";
|
|
|
2
2
|
import { BaseFilterable } from "../../dal";
|
|
3
3
|
import { PriceSetMoneyAmountDTO } from "./price-set-money-amount";
|
|
4
4
|
import { RuleTypeDTO } from "./rule-type";
|
|
5
|
+
/**
|
|
6
|
+
* @enum
|
|
7
|
+
*
|
|
8
|
+
* The price list's status.
|
|
9
|
+
*/
|
|
5
10
|
export declare enum PriceListStatus {
|
|
11
|
+
/**
|
|
12
|
+
* The price list is enabled and its prices can be used.
|
|
13
|
+
*/
|
|
6
14
|
ACTIVE = "active",
|
|
15
|
+
/**
|
|
16
|
+
* The price list is disabled, meaning its prices can't be used yet.
|
|
17
|
+
*/
|
|
7
18
|
DRAFT = "draft"
|
|
8
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @enum
|
|
22
|
+
*
|
|
23
|
+
* The price list's type.
|
|
24
|
+
*/
|
|
9
25
|
export declare enum PriceListType {
|
|
26
|
+
/**
|
|
27
|
+
* The price list's prices are used for a sale.
|
|
28
|
+
*/
|
|
10
29
|
SALE = "sale",
|
|
30
|
+
/**
|
|
31
|
+
* The price list's prices override original prices. This affects the calculated price of associated price sets.
|
|
32
|
+
*/
|
|
11
33
|
OVERRIDE = "override"
|
|
12
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @interface
|
|
37
|
+
*
|
|
38
|
+
* A price list's details.
|
|
39
|
+
*/
|
|
13
40
|
export interface PriceListDTO {
|
|
41
|
+
/**
|
|
42
|
+
* The price list's ID.
|
|
43
|
+
*/
|
|
14
44
|
id: string;
|
|
45
|
+
/**
|
|
46
|
+
* The price list's title.
|
|
47
|
+
*/
|
|
15
48
|
title?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The price list is enabled starting from this date.
|
|
51
|
+
*/
|
|
16
52
|
starts_at?: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* The price list's status.
|
|
55
|
+
*/
|
|
17
56
|
status?: PriceListStatus;
|
|
57
|
+
/**
|
|
58
|
+
* The price list expires after this date.
|
|
59
|
+
*/
|
|
18
60
|
ends_at?: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* The number of rules associated with this price list.
|
|
63
|
+
*/
|
|
19
64
|
number_rules?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The associated price set money amounts.
|
|
67
|
+
*
|
|
68
|
+
* @expandable
|
|
69
|
+
*/
|
|
20
70
|
price_set_money_amounts?: PriceSetMoneyAmountDTO[];
|
|
71
|
+
/**
|
|
72
|
+
* The associated money amounts.
|
|
73
|
+
*
|
|
74
|
+
* @expandable
|
|
75
|
+
*/
|
|
21
76
|
money_amounts?: MoneyAmountDTO[];
|
|
77
|
+
/**
|
|
78
|
+
* The associated rule types.
|
|
79
|
+
*
|
|
80
|
+
* @expandable
|
|
81
|
+
*/
|
|
22
82
|
rule_types?: RuleTypeDTO[];
|
|
83
|
+
/**
|
|
84
|
+
* The price set's rules.
|
|
85
|
+
*
|
|
86
|
+
* @expandable
|
|
87
|
+
*/
|
|
23
88
|
rules?: PriceListRuleDTO[];
|
|
89
|
+
/**
|
|
90
|
+
* The price set's rules.
|
|
91
|
+
*
|
|
92
|
+
* @privateRemarks
|
|
93
|
+
* Do we need both this and `rules`?
|
|
94
|
+
*
|
|
95
|
+
* @expandable
|
|
96
|
+
*/
|
|
24
97
|
price_list_rules?: PriceListRuleDTO[];
|
|
25
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* @interface
|
|
101
|
+
*
|
|
102
|
+
* The prices associated with a price list.
|
|
103
|
+
*/
|
|
26
104
|
export interface PriceListPriceDTO extends CreateMoneyAmountDTO {
|
|
105
|
+
/**
|
|
106
|
+
* The ID of the associated price set.
|
|
107
|
+
*/
|
|
27
108
|
price_set_id: string;
|
|
28
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* @interface
|
|
112
|
+
*
|
|
113
|
+
* The price list's rules to be set. Each key of the object is a rule type's `rule_attribute`, and its value
|
|
114
|
+
* is the values of the rule.
|
|
115
|
+
*/
|
|
29
116
|
export interface CreatePriceListRules extends Record<string, string[]> {
|
|
30
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* @interface
|
|
120
|
+
*
|
|
121
|
+
* The price list to create.
|
|
122
|
+
*/
|
|
31
123
|
export interface CreatePriceListDTO {
|
|
124
|
+
/**
|
|
125
|
+
* The price list's title.
|
|
126
|
+
*/
|
|
32
127
|
title: string;
|
|
128
|
+
/**
|
|
129
|
+
* The price list's description.
|
|
130
|
+
*/
|
|
33
131
|
description: string;
|
|
132
|
+
/**
|
|
133
|
+
* The price list is enabled starting from this date.
|
|
134
|
+
*/
|
|
34
135
|
starts_at?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The price list expires after this date.
|
|
138
|
+
*/
|
|
35
139
|
ends_at?: string;
|
|
140
|
+
/**
|
|
141
|
+
* The price list's status.
|
|
142
|
+
*/
|
|
36
143
|
status?: PriceListStatus;
|
|
144
|
+
/**
|
|
145
|
+
* The price list's type.
|
|
146
|
+
*/
|
|
37
147
|
type?: PriceListType;
|
|
148
|
+
/**
|
|
149
|
+
* The number of rules associated with the price list.
|
|
150
|
+
*/
|
|
38
151
|
number_rules?: number;
|
|
152
|
+
/**
|
|
153
|
+
* The rules to be created and associated with the price list.
|
|
154
|
+
*/
|
|
39
155
|
rules?: CreatePriceListRules;
|
|
156
|
+
/**
|
|
157
|
+
* The prices associated with the price list.
|
|
158
|
+
*/
|
|
40
159
|
prices?: PriceListPriceDTO[];
|
|
41
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* @interface
|
|
163
|
+
*
|
|
164
|
+
* The attributes to update in a price list.
|
|
165
|
+
*/
|
|
42
166
|
export interface UpdatePriceListDTO {
|
|
167
|
+
/**
|
|
168
|
+
* The ID of the price list to update.
|
|
169
|
+
*/
|
|
43
170
|
id: string;
|
|
171
|
+
/**
|
|
172
|
+
* The price list's title.
|
|
173
|
+
*/
|
|
44
174
|
title?: string;
|
|
175
|
+
/**
|
|
176
|
+
* The price list is enabled starting from this date.
|
|
177
|
+
*/
|
|
45
178
|
starts_at?: string;
|
|
179
|
+
/**
|
|
180
|
+
* The price list expires after this date.
|
|
181
|
+
*/
|
|
46
182
|
ends_at?: string;
|
|
183
|
+
/**
|
|
184
|
+
* The price list's status.
|
|
185
|
+
*/
|
|
47
186
|
status?: PriceListStatus;
|
|
187
|
+
/**
|
|
188
|
+
* The number of rules associated with the price list.
|
|
189
|
+
*/
|
|
48
190
|
number_rules?: number;
|
|
191
|
+
/**
|
|
192
|
+
* The rules to be created and associated with the price list.
|
|
193
|
+
*/
|
|
49
194
|
rules?: CreatePriceListRules;
|
|
50
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* @inteface
|
|
198
|
+
*
|
|
199
|
+
* Filters to apply on price lists.
|
|
200
|
+
*/
|
|
51
201
|
export interface FilterablePriceListProps extends BaseFilterable<FilterablePriceListProps> {
|
|
202
|
+
/**
|
|
203
|
+
* The IDs to filter price lists by
|
|
204
|
+
*/
|
|
52
205
|
id?: string[];
|
|
206
|
+
/**
|
|
207
|
+
* The start dates to filter price lists by.
|
|
208
|
+
*/
|
|
53
209
|
starts_at?: string[];
|
|
210
|
+
/**
|
|
211
|
+
* The end dates to filter price lists by.
|
|
212
|
+
*/
|
|
54
213
|
ends_at?: string[];
|
|
214
|
+
/**
|
|
215
|
+
* The statuses to filter price lists by.
|
|
216
|
+
*/
|
|
55
217
|
status?: PriceListStatus[];
|
|
218
|
+
/**
|
|
219
|
+
* The number of rules to filter price lists by.
|
|
220
|
+
*/
|
|
56
221
|
number_rules?: number[];
|
|
57
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* @interface
|
|
225
|
+
*
|
|
226
|
+
* Filters to apply on price list rules.
|
|
227
|
+
*/
|
|
58
228
|
export interface FilterablePriceListRuleProps extends BaseFilterable<FilterablePriceListRuleProps> {
|
|
229
|
+
/**
|
|
230
|
+
* The IDs to filter price list rules by.
|
|
231
|
+
*/
|
|
59
232
|
id?: string[];
|
|
233
|
+
/**
|
|
234
|
+
* The values to filter price list rules by.
|
|
235
|
+
*/
|
|
60
236
|
value?: string[];
|
|
237
|
+
/**
|
|
238
|
+
* Filter price list rules by the ID of their associated rule types.
|
|
239
|
+
*/
|
|
61
240
|
rule_type?: string[];
|
|
241
|
+
/**
|
|
242
|
+
* Filter price list rules by the ID of their associated price lists.
|
|
243
|
+
*/
|
|
62
244
|
price_list_id?: string[];
|
|
63
245
|
}
|
|
64
246
|
export interface FilterablePriceListRuleValueProps extends BaseFilterable<FilterablePriceListRuleValueProps> {
|
|
@@ -66,29 +248,111 @@ export interface FilterablePriceListRuleValueProps extends BaseFilterable<Filter
|
|
|
66
248
|
value?: string[];
|
|
67
249
|
price_list_rule_id?: string[];
|
|
68
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* @interface
|
|
253
|
+
*
|
|
254
|
+
* The price list rule's details.
|
|
255
|
+
*/
|
|
69
256
|
export interface PriceListRuleDTO {
|
|
257
|
+
/**
|
|
258
|
+
* The price list rule's ID.
|
|
259
|
+
*/
|
|
70
260
|
id: string;
|
|
261
|
+
/**
|
|
262
|
+
* The value of the rule.
|
|
263
|
+
*
|
|
264
|
+
* @privateRemarks
|
|
265
|
+
* Shouldn't this be in PriceListRuleValueDTO only?
|
|
266
|
+
*/
|
|
71
267
|
value: string;
|
|
268
|
+
/**
|
|
269
|
+
* The associated rule type.
|
|
270
|
+
*
|
|
271
|
+
* @expandable
|
|
272
|
+
*/
|
|
72
273
|
rule_type: RuleTypeDTO;
|
|
274
|
+
/**
|
|
275
|
+
* The associated price list.
|
|
276
|
+
*
|
|
277
|
+
* @expandable
|
|
278
|
+
*/
|
|
73
279
|
price_list: PriceListDTO;
|
|
280
|
+
/**
|
|
281
|
+
* The associated rule values.
|
|
282
|
+
*
|
|
283
|
+
* @expandable
|
|
284
|
+
*/
|
|
74
285
|
price_list_rule_values?: PriceListRuleValueDTO[];
|
|
75
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
* @interface
|
|
289
|
+
*
|
|
290
|
+
* The price list rule to create.
|
|
291
|
+
*/
|
|
76
292
|
export interface CreatePriceListRuleDTO {
|
|
293
|
+
/**
|
|
294
|
+
* The ID of a rule type to be associated with the price list rule.
|
|
295
|
+
*/
|
|
77
296
|
rule_type_id?: string;
|
|
297
|
+
/**
|
|
298
|
+
* The ID of a rule type or the details of an existing rule type to be associated with the price list rule.
|
|
299
|
+
*/
|
|
78
300
|
rule_type?: string | RuleTypeDTO;
|
|
301
|
+
/**
|
|
302
|
+
* The ID of a price list to be associated with the price list rule.
|
|
303
|
+
*/
|
|
79
304
|
price_list_id?: string;
|
|
305
|
+
/**
|
|
306
|
+
* The ID of a price list or the details of an existing price list to be associated with the price list rule.
|
|
307
|
+
*/
|
|
80
308
|
price_list?: string | PriceListDTO;
|
|
81
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* @interface
|
|
312
|
+
*
|
|
313
|
+
* The attributes to update in a price list rule.
|
|
314
|
+
*/
|
|
82
315
|
export interface UpdatePriceListRuleDTO {
|
|
316
|
+
/**
|
|
317
|
+
* The ID of the price list rule to update.
|
|
318
|
+
*/
|
|
83
319
|
id: string;
|
|
320
|
+
/**
|
|
321
|
+
* The ID of a price list to be associated with the price list rule.
|
|
322
|
+
*/
|
|
84
323
|
price_list_id?: string;
|
|
324
|
+
/**
|
|
325
|
+
* The ID of a rule type to be associated with the price list rule.
|
|
326
|
+
*/
|
|
85
327
|
rule_type_id?: string;
|
|
328
|
+
/**
|
|
329
|
+
* The ID of a price list to be associated with the price list rule.
|
|
330
|
+
*/
|
|
86
331
|
price_list?: string;
|
|
332
|
+
/**
|
|
333
|
+
* The ID of a rule type or the details of an existing rule type to be associated with the price list rule.
|
|
334
|
+
*/
|
|
87
335
|
rule_type?: string;
|
|
88
336
|
}
|
|
337
|
+
/**
|
|
338
|
+
* @interface
|
|
339
|
+
*
|
|
340
|
+
* The price list rule value's details.
|
|
341
|
+
*/
|
|
89
342
|
export interface PriceListRuleValueDTO {
|
|
343
|
+
/**
|
|
344
|
+
* The price list rule value's ID.
|
|
345
|
+
*/
|
|
90
346
|
id: string;
|
|
347
|
+
/**
|
|
348
|
+
* The rule's value.
|
|
349
|
+
*/
|
|
91
350
|
value: string;
|
|
351
|
+
/**
|
|
352
|
+
* The associated price list rule.
|
|
353
|
+
*
|
|
354
|
+
* @expandable
|
|
355
|
+
*/
|
|
92
356
|
price_list_rule: PriceListRuleDTO;
|
|
93
357
|
}
|
|
94
358
|
export interface CreatePriceListRuleValueDTO {
|
|
@@ -101,15 +365,49 @@ export interface UpdatePriceListRuleValueDTO {
|
|
|
101
365
|
value: string;
|
|
102
366
|
price_list_rule_id: string;
|
|
103
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* @interface
|
|
370
|
+
*
|
|
371
|
+
* The prices to be added to a price list.
|
|
372
|
+
*/
|
|
104
373
|
export interface AddPriceListPricesDTO {
|
|
374
|
+
/**
|
|
375
|
+
* The ID of the price list to add prices to.
|
|
376
|
+
*/
|
|
105
377
|
priceListId: string;
|
|
378
|
+
/**
|
|
379
|
+
* The prices to add.
|
|
380
|
+
*/
|
|
106
381
|
prices: PriceListPriceDTO[];
|
|
107
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* @interface
|
|
385
|
+
*
|
|
386
|
+
* The rules to add to a price list.
|
|
387
|
+
*/
|
|
108
388
|
export interface SetPriceListRulesDTO {
|
|
389
|
+
/**
|
|
390
|
+
* The ID of the price list to add rules to.
|
|
391
|
+
*/
|
|
109
392
|
priceListId: string;
|
|
393
|
+
/**
|
|
394
|
+
* The rules to add to the price list. Each key of the object is a rule type's `rule_attribute`, and its value
|
|
395
|
+
* is the value(s) of the rule.
|
|
396
|
+
*/
|
|
110
397
|
rules: Record<string, string | string[]>;
|
|
111
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* @interface
|
|
401
|
+
*
|
|
402
|
+
* The rules to remove from a price list.
|
|
403
|
+
*/
|
|
112
404
|
export interface RemovePriceListRulesDTO {
|
|
405
|
+
/**
|
|
406
|
+
* The ID of the price list to remove rules from.
|
|
407
|
+
*/
|
|
113
408
|
priceListId: string;
|
|
409
|
+
/**
|
|
410
|
+
* The rules to remove from the price list. Each item being a rule type's `rule_attribute`.
|
|
411
|
+
*/
|
|
114
412
|
rules: string[];
|
|
115
413
|
}
|
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PriceListType = exports.PriceListStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @enum
|
|
6
|
+
*
|
|
7
|
+
* The price list's status.
|
|
8
|
+
*/
|
|
4
9
|
var PriceListStatus;
|
|
5
10
|
(function (PriceListStatus) {
|
|
11
|
+
/**
|
|
12
|
+
* The price list is enabled and its prices can be used.
|
|
13
|
+
*/
|
|
6
14
|
PriceListStatus["ACTIVE"] = "active";
|
|
15
|
+
/**
|
|
16
|
+
* The price list is disabled, meaning its prices can't be used yet.
|
|
17
|
+
*/
|
|
7
18
|
PriceListStatus["DRAFT"] = "draft";
|
|
8
19
|
})(PriceListStatus || (exports.PriceListStatus = PriceListStatus = {}));
|
|
20
|
+
/**
|
|
21
|
+
* @enum
|
|
22
|
+
*
|
|
23
|
+
* The price list's type.
|
|
24
|
+
*/
|
|
9
25
|
var PriceListType;
|
|
10
26
|
(function (PriceListType) {
|
|
27
|
+
/**
|
|
28
|
+
* The price list's prices are used for a sale.
|
|
29
|
+
*/
|
|
11
30
|
PriceListType["SALE"] = "sale";
|
|
31
|
+
/**
|
|
32
|
+
* The price list's prices override original prices. This affects the calculated price of associated price sets.
|
|
33
|
+
*/
|
|
12
34
|
PriceListType["OVERRIDE"] = "override";
|
|
13
35
|
})(PriceListType || (exports.PriceListType = PriceListType = {}));
|
|
14
36
|
//# sourceMappingURL=price-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price-list.js","sourceRoot":"","sources":["../../../src/pricing/common/price-list.ts"],"names":[],"mappings":";;;AAMA,IAAY,
|
|
1
|
+
{"version":3,"file":"price-list.js","sourceRoot":"","sources":["../../../src/pricing/common/price-list.ts"],"names":[],"mappings":";;;AAMA;;;;GAIG;AACH,IAAY,eASX;AATD,WAAY,eAAe;IACzB;;OAEG;IACH,oCAAiB,CAAA;IACjB;;OAEG;IACH,kCAAe,CAAA;AACjB,CAAC,EATW,eAAe,+BAAf,eAAe,QAS1B;AAED;;;;GAIG;AACH,IAAY,aASX;AATD,WAAY,aAAa;IACvB;;OAEG;IACH,8BAAa,CAAA;IACb;;OAEG;IACH,sCAAqB,CAAA;AACvB,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB"}
|