@medusajs/types 1.12.0-snapshot-20240805210411 → 1.12.0-snapshot-20240807192059
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http/claim/admin/payloads.d.ts +3 -3
- package/dist/http/claim/admin/payloads.d.ts.map +1 -1
- package/dist/http/claim/common.d.ts +3 -3
- package/dist/http/claim/common.d.ts.map +1 -1
- package/dist/http/fulfillment-set/admin/entities.d.ts +3 -0
- package/dist/http/fulfillment-set/admin/entities.d.ts.map +1 -1
- package/dist/http/order/admin.d.ts +14 -1
- package/dist/http/order/admin.d.ts.map +1 -1
- package/dist/http/order/common.d.ts +183 -1
- package/dist/http/order/common.d.ts.map +1 -1
- package/dist/http/payment/admin.d.ts +17 -1
- package/dist/http/payment/admin.d.ts.map +1 -1
- package/dist/http/payment/common.d.ts +38 -0
- package/dist/http/payment/common.d.ts.map +1 -1
- package/dist/http/return/admin.d.ts +2 -2
- package/dist/http/return/admin.d.ts.map +1 -1
- package/dist/order/common.d.ts +755 -65
- package/dist/order/common.d.ts.map +1 -1
- package/dist/order/mutations.d.ts +1268 -3
- package/dist/order/mutations.d.ts.map +1 -1
- package/dist/order/service.d.ts +3202 -657
- package/dist/order/service.d.ts.map +1 -1
- package/dist/payment/common.d.ts +44 -0
- package/dist/payment/common.d.ts.map +1 -1
- package/dist/payment/mutations.d.ts +40 -0
- package/dist/payment/mutations.d.ts.map +1 -1
- package/dist/payment/service.d.ts +157 -2
- package/dist/payment/service.d.ts.map +1 -1
- package/dist/product/common.d.ts +4 -0
- package/dist/product/common.d.ts.map +1 -1
- package/dist/workflow/order/create-fulfillment.d.ts +2 -0
- package/dist/workflow/order/create-fulfillment.d.ts.map +1 -1
- package/dist/workflow/order/items.d.ts +1 -1
- package/dist/workflow/order/items.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/order/service.d.ts
CHANGED
@@ -5,1217 +5,3762 @@ import { Context } from "../shared-context";
|
|
5
5
|
import { FilterableOrderAddressProps, FilterableOrderChangeActionProps, FilterableOrderClaimProps, FilterableOrderExchangeProps, FilterableOrderLineItemAdjustmentProps, FilterableOrderLineItemProps, FilterableOrderLineItemTaxLineProps, FilterableOrderProps, FilterableOrderReturnReasonProps, FilterableOrderShippingMethodAdjustmentProps, FilterableOrderShippingMethodProps, FilterableOrderShippingMethodTaxLineProps, FilterableOrderTransactionProps, FilterableReturnProps, OrderAddressDTO, OrderChangeActionDTO, OrderChangeDTO, OrderChangeReturn, OrderClaimDTO, OrderClaimItemDTO, OrderDTO, OrderExchangeDTO, OrderExchangeItemDTO, OrderItemDTO, OrderLineItemAdjustmentDTO, OrderLineItemDTO, OrderLineItemTaxLineDTO, OrderReturnItemDTO, OrderReturnReasonDTO, OrderShippingMethodAdjustmentDTO, OrderShippingMethodDTO, OrderShippingMethodTaxLineDTO, OrderTransactionDTO, ReturnDTO } from "./common";
|
6
6
|
import { CancelOrderChangeDTO, CancelOrderClaimDTO, CancelOrderExchangeDTO, CancelOrderFulfillmentDTO, CancelOrderReturnDTO, ConfirmOrderChangeDTO, CreateOrderAddressDTO, CreateOrderAdjustmentDTO, CreateOrderChangeActionDTO, CreateOrderChangeDTO, CreateOrderClaimDTO, CreateOrderClaimItemDTO, CreateOrderDTO, CreateOrderExchangeDTO, CreateOrderExchangeItemDTO, CreateOrderLineItemDTO, CreateOrderLineItemTaxLineDTO, CreateOrderReturnDTO, CreateOrderReturnItemDTO, CreateOrderReturnReasonDTO, CreateOrderShippingMethodAdjustmentDTO, CreateOrderShippingMethodDTO, CreateOrderShippingMethodTaxLineDTO, CreateOrderTransactionDTO, DeclineOrderChangeDTO, ReceiveOrderReturnDTO, RegisterOrderFulfillmentDTO, RegisterOrderShipmentDTO, UpdateOrderAddressDTO, UpdateOrderChangeActionDTO, UpdateOrderChangeDTO, UpdateOrderClaimDTO, UpdateOrderClaimWithSelectorDTO, UpdateOrderDTO, UpdateOrderExchangeDTO, UpdateOrderExchangeWithSelectorDTO, UpdateOrderItemDTO, UpdateOrderItemWithSelectorDTO, UpdateOrderLineItemDTO, UpdateOrderLineItemTaxLineDTO, UpdateOrderLineItemWithSelectorDTO, UpdateOrderReturnReasonDTO, UpdateOrderReturnReasonWithSelectorDTO, UpdateOrderReturnWithSelectorDTO, UpdateOrderShippingMethodAdjustmentDTO, UpdateOrderShippingMethodDTO, UpdateOrderShippingMethodTaxLineDTO, UpdateReturnDTO, UpsertOrderLineItemAdjustmentDTO } from "./mutations";
|
7
7
|
/**
|
8
|
-
*
|
8
|
+
* The main service interface for the Order Module.
|
9
9
|
*/
|
10
10
|
export interface IOrderModuleService extends IModuleService {
|
11
11
|
/**
|
12
|
-
* This method retrieves
|
12
|
+
* This method retrieves an order by its ID.
|
13
13
|
*
|
14
14
|
* @param {string} orderId - The order's ID.
|
15
15
|
* @param {FindConfig<OrderDTO>} config - The configurations determining how the order is retrieved. Its properties, such as `select` or `relations`, accept the
|
16
16
|
* attributes or relations associated with a order.
|
17
17
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
18
|
-
* @returns {Promise<OrderDTO>} The retrieved
|
18
|
+
* @returns {Promise<OrderDTO>} The retrieved order.
|
19
19
|
*
|
20
20
|
* @example
|
21
|
-
*
|
22
|
-
*
|
21
|
+
* A simple example that retrieves an order change by its ID:
|
22
|
+
*
|
23
|
+
* ```ts
|
24
|
+
* const order = await orderModuleService.retrieveOrder(
|
25
|
+
* "123"
|
26
|
+
* )
|
27
|
+
* ```
|
28
|
+
*
|
29
|
+
* To specify relations that should be retrieved:
|
30
|
+
*
|
31
|
+
* ```ts
|
32
|
+
* const order = await orderModuleService.retrieveOrder(
|
33
|
+
* "123",
|
34
|
+
* {
|
35
|
+
* relations: ["items"]
|
36
|
+
* }
|
37
|
+
* )
|
23
38
|
* ```
|
24
39
|
*
|
25
40
|
*/
|
26
41
|
retrieveOrder(orderId: string, config?: FindConfig<OrderDTO>, sharedContext?: Context): Promise<OrderDTO>;
|
27
42
|
/**
|
28
|
-
* This method retrieves a paginated list of
|
43
|
+
* This method retrieves a paginated list of orders based on optional filters and configuration.
|
29
44
|
*
|
30
45
|
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved order.
|
31
46
|
* @param {FindConfig<OrderDTO>} config - The configurations determining how the order is retrieved. Its properties, such as `select` or `relations`, accept the
|
32
47
|
* attributes or relations associated with a order.
|
33
48
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
34
|
-
* @returns {Promise<OrderDTO[]>} The list of
|
49
|
+
* @returns {Promise<OrderDTO[]>} The list of orders.
|
35
50
|
*
|
36
51
|
* @example
|
37
|
-
*
|
38
|
-
*
|
52
|
+
* To retrieve a list of orders using their IDs:
|
53
|
+
*
|
54
|
+
* ```ts
|
55
|
+
* const orders = await orderModuleService.listOrders({
|
56
|
+
* id: ["123", "321"]
|
57
|
+
* })
|
58
|
+
* ```
|
59
|
+
*
|
60
|
+
* To specify relations that should be retrieved within the order:
|
61
|
+
*
|
62
|
+
* ```ts
|
63
|
+
* const orders = await orderModuleService.listOrders({
|
64
|
+
* id: ["123", "321"]
|
65
|
+
* }, {
|
66
|
+
* relations: ["items"]
|
67
|
+
* })
|
68
|
+
* ```
|
69
|
+
*
|
70
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
71
|
+
*
|
72
|
+
* ```ts
|
73
|
+
* const orders = await orderModuleService.listOrders({
|
74
|
+
* id: ["123", "321"]
|
75
|
+
* }, {
|
76
|
+
* relations: ["items"],
|
77
|
+
* take: 20,
|
78
|
+
* skip: 2
|
79
|
+
* })
|
39
80
|
* ```
|
40
81
|
*
|
41
82
|
*/
|
42
83
|
listOrders(filters?: FilterableOrderProps, config?: FindConfig<OrderDTO>, sharedContext?: Context): Promise<OrderDTO[]>;
|
43
84
|
/**
|
44
|
-
* This method retrieves a paginated list of
|
85
|
+
* This method retrieves a paginated list of orders along with the total count of available orders satisfying the provided filters.
|
45
86
|
*
|
46
87
|
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved order.
|
47
88
|
* @param {FindConfig<OrderDTO>} config - The configurations determining how the order is retrieved. Its properties, such as `select` or `relations`, accept the
|
48
89
|
* attributes or relations associated with a order.
|
49
90
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
50
|
-
* @returns {Promise<[OrderDTO[], number]>} The list of
|
91
|
+
* @returns {Promise<[OrderDTO[], number]>} The list of orders along with their total count.
|
51
92
|
*
|
52
93
|
* @example
|
53
|
-
*
|
54
|
-
*
|
94
|
+
* To retrieve a list of orders using their IDs:
|
95
|
+
*
|
96
|
+
* ```ts
|
97
|
+
* const [orders, count] = await orderModuleService.listAndCountOrders({
|
98
|
+
* id: ["123", "321"]
|
99
|
+
* })
|
100
|
+
* ```
|
101
|
+
*
|
102
|
+
* To specify relations that should be retrieved within the order:
|
103
|
+
*
|
104
|
+
* ```ts
|
105
|
+
* const [orders, count] = await orderModuleService.listAndCountOrders({
|
106
|
+
* id: ["123", "321"]
|
107
|
+
* }, {
|
108
|
+
* relations: ["items"],
|
109
|
+
* })
|
110
|
+
* ```
|
111
|
+
*
|
112
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
113
|
+
*
|
114
|
+
* ```ts
|
115
|
+
* const [orders, count] = await orderModuleService.listAndCountOrders({
|
116
|
+
* id: ["123", "321"]
|
117
|
+
* }, {
|
118
|
+
* relations: ["items"],
|
119
|
+
* take: 20,
|
120
|
+
* skip: 2
|
121
|
+
* })
|
55
122
|
* ```
|
56
123
|
*
|
57
124
|
*/
|
58
125
|
listAndCountOrders(filters?: FilterableOrderProps, config?: FindConfig<OrderDTO>, sharedContext?: Context): Promise<[OrderDTO[], number]>;
|
59
|
-
retrieveReturn(returnId: string, config?: FindConfig<ReturnDTO>, sharedContext?: Context): Promise<ReturnDTO>;
|
60
|
-
listReturns(filters?: FilterableOrderProps, config?: FindConfig<ReturnDTO>, sharedContext?: Context): Promise<ReturnDTO[]>;
|
61
|
-
listAndCountReturns(filters?: FilterableOrderProps, config?: FindConfig<ReturnDTO>, sharedContext?: Context): Promise<[ReturnDTO[], number]>;
|
62
|
-
retrieveOrderClaim(claimnId: string, config?: FindConfig<OrderClaimDTO>, sharedContext?: Context): Promise<OrderClaimDTO>;
|
63
|
-
listOrderClaims(filters?: FilterableOrderProps, config?: FindConfig<OrderClaimDTO>, sharedContext?: Context): Promise<OrderClaimDTO[]>;
|
64
|
-
listAndCountOrderClaims(filters?: FilterableOrderProps, config?: FindConfig<OrderClaimDTO>, sharedContext?: Context): Promise<[OrderClaimDTO[], number]>;
|
65
|
-
retrieveOrderExchange(claimnId: string, config?: FindConfig<OrderExchangeDTO>, sharedContext?: Context): Promise<OrderExchangeDTO>;
|
66
|
-
listOrderExchanges(filters?: FilterableOrderProps, config?: FindConfig<OrderExchangeDTO>, sharedContext?: Context): Promise<OrderExchangeDTO[]>;
|
67
|
-
listAndCountOrderExchanges(filters?: FilterableOrderProps, config?: FindConfig<OrderExchangeDTO>, sharedContext?: Context): Promise<[OrderExchangeDTO[], number]>;
|
68
126
|
/**
|
69
|
-
* This method
|
127
|
+
* This method retrieves a return by its ID.
|
70
128
|
*
|
71
|
-
* @param {
|
129
|
+
* @param {string} returnId - The return's ID.
|
130
|
+
* @param {FindConfig<ReturnDTO>} config - The configurations determining how the return is retrieved. Its properties, such as `select` or `relations`, accept the
|
131
|
+
* attributes or relations associated with a return.
|
72
132
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
73
|
-
* @returns {Promise<
|
133
|
+
* @returns {Promise<ReturnDTO>} The retrieved return.
|
74
134
|
*
|
75
135
|
* @example
|
76
|
-
*
|
77
|
-
* const orderData: CreateOrderDTO[] = [
|
78
|
-
* {
|
79
|
-
* currency_code: "USD",
|
80
|
-
* items: [
|
81
|
-
* {
|
82
|
-
* title: "Product Name",
|
83
|
-
* quantity: 1,
|
84
|
-
* unit_price: 1999, // Assuming type is an integer for price in cents
|
85
|
-
* }
|
86
|
-
* ]
|
87
|
-
* }
|
88
|
-
* ];
|
136
|
+
* A simple example that retrieves an order change by its ID:
|
89
137
|
*
|
90
|
-
*
|
138
|
+
* ```ts
|
139
|
+
* const orderReturn = await orderModuleService.retrieveReturn(
|
140
|
+
* "123"
|
141
|
+
* )
|
91
142
|
* ```
|
92
143
|
*
|
144
|
+
* To specify relations that should be retrieved:
|
145
|
+
*
|
146
|
+
* ```ts
|
147
|
+
* const orderReturn = await orderModuleService.retrieveReturn(
|
148
|
+
* "123",
|
149
|
+
* {
|
150
|
+
* relations: ["order"]
|
151
|
+
* }
|
152
|
+
* )
|
153
|
+
* ```
|
93
154
|
*/
|
94
|
-
|
155
|
+
retrieveReturn(returnId: string, config?: FindConfig<ReturnDTO>, sharedContext?: Context): Promise<ReturnDTO>;
|
95
156
|
/**
|
96
|
-
* This method
|
157
|
+
* This method retrieves a paginated list of returns based on optional filters and configuration.
|
97
158
|
*
|
98
|
-
* @param {
|
159
|
+
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved returns.
|
160
|
+
* @param {FindConfig<ReturnDTO>} config - The configurations determining how the return is retrieved. Its properties, such as `select` or `relations`, accept the
|
161
|
+
* attributes or relations associated with a return.
|
99
162
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
100
|
-
* @returns {Promise<
|
163
|
+
* @returns {Promise<ReturnDTO[]>} The list of returns.
|
101
164
|
*
|
102
165
|
* @example
|
103
|
-
*
|
104
|
-
* // Example execution of the create method of IOrderModuleService
|
105
|
-
* const orderData: CreateOrderDTO = {
|
106
|
-
* currency_code: "USD"
|
107
|
-
* };
|
166
|
+
* To retrieve a list of returns using their IDs:
|
108
167
|
*
|
109
|
-
*
|
168
|
+
* ```ts
|
169
|
+
* const returns = await orderModuleService.listReturns({
|
170
|
+
* id: ["123", "321"]
|
171
|
+
* })
|
110
172
|
* ```
|
111
173
|
*
|
112
|
-
|
113
|
-
createOrders(data: CreateOrderDTO, sharedContext?: Context): Promise<OrderDTO>;
|
114
|
-
/**
|
115
|
-
* This method updates existing {return type}(s).
|
116
|
-
*
|
117
|
-
* @param {UpdateOrderDTO[]} data - The attributes to update in the order.
|
118
|
-
* @returns {Promise<OrderDTO[]>} The updated {return type}(s).
|
174
|
+
* To specify relations that should be retrieved within the return:
|
119
175
|
*
|
120
|
-
*
|
121
|
-
*
|
122
|
-
*
|
123
|
-
*
|
124
|
-
*
|
125
|
-
*
|
126
|
-
* },
|
127
|
-
* {
|
128
|
-
* id: "order_id_2",
|
129
|
-
* status: "delivered"
|
130
|
-
* }
|
131
|
-
* ]);
|
176
|
+
* ```ts
|
177
|
+
* const returns = await orderModuleService.listReturns({
|
178
|
+
* id: ["123", "321"]
|
179
|
+
* }, {
|
180
|
+
* relations: ["order"]
|
181
|
+
* })
|
132
182
|
* ```
|
133
183
|
*
|
184
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
185
|
+
*
|
186
|
+
* ```ts
|
187
|
+
* const returns = await orderModuleService.listReturns({
|
188
|
+
* id: ["123", "321"]
|
189
|
+
* }, {
|
190
|
+
* relations: ["order"],
|
191
|
+
* take: 20,
|
192
|
+
* skip: 2
|
193
|
+
* })
|
194
|
+
* ```
|
134
195
|
*/
|
135
|
-
|
196
|
+
listReturns(filters?: FilterableOrderProps, config?: FindConfig<ReturnDTO>, sharedContext?: Context): Promise<ReturnDTO[]>;
|
136
197
|
/**
|
137
|
-
* This method
|
198
|
+
* This method retrieves a paginated list of returns along with the total count of available returns satisfying the provided filters.
|
138
199
|
*
|
139
|
-
* @param {
|
140
|
-
* @param {
|
200
|
+
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved returns.
|
201
|
+
* @param {FindConfig<ReturnDTO>} config - The configurations determining how the return is retrieved. Its properties, such as `select` or `relations`, accept the
|
202
|
+
* attributes or relations associated with a return.
|
141
203
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
142
|
-
* @returns {Promise<
|
204
|
+
* @returns {Promise<[ReturnDTO[], number]>} The list of returns along with their total count.
|
143
205
|
*
|
144
206
|
* @example
|
145
|
-
*
|
146
|
-
*
|
147
|
-
*
|
148
|
-
*
|
207
|
+
* To retrieve a list of returns using their IDs:
|
208
|
+
*
|
209
|
+
* ```ts
|
210
|
+
* const [returns, count] = await orderModuleService.listAndCountReturns({
|
211
|
+
* id: ["123", "321"]
|
212
|
+
* })
|
213
|
+
* ```
|
214
|
+
*
|
215
|
+
* To specify relations that should be retrieved within the return:
|
216
|
+
*
|
217
|
+
* ```ts
|
218
|
+
* const [returns, count] = await orderModuleService.listAndCountReturns({
|
219
|
+
* id: ["123", "321"]
|
220
|
+
* }, {
|
221
|
+
* relations: ["order"],
|
222
|
+
* })
|
149
223
|
* ```
|
150
224
|
*
|
225
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
226
|
+
*
|
227
|
+
* ```ts
|
228
|
+
* const [returns, count] = await orderModuleService.listAndCountReturns({
|
229
|
+
* id: ["123", "321"]
|
230
|
+
* }, {
|
231
|
+
* relations: ["order"],
|
232
|
+
* take: 20,
|
233
|
+
* skip: 2
|
234
|
+
* })
|
235
|
+
* ```
|
151
236
|
*/
|
152
|
-
|
237
|
+
listAndCountReturns(filters?: FilterableOrderProps, config?: FindConfig<ReturnDTO>, sharedContext?: Context): Promise<[ReturnDTO[], number]>;
|
153
238
|
/**
|
154
|
-
* This method
|
239
|
+
* This method retrieves an order claim by its ID.
|
155
240
|
*
|
156
|
-
* @param {
|
157
|
-
* @param {
|
241
|
+
* @param {string} claimId - The claim's ID.
|
242
|
+
* @param {FindConfig<OrderClaimDTO>} config - The configurations determining how the order claim is retrieved. Its properties, such as `select` or `relations`, accept the
|
243
|
+
* attributes or relations associated with a order claim.
|
158
244
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
159
|
-
* @returns {Promise<
|
245
|
+
* @returns {Promise<OrderClaimDTO>} The retrieved order claim.
|
160
246
|
*
|
161
247
|
* @example
|
162
|
-
*
|
163
|
-
*
|
164
|
-
*
|
165
|
-
*
|
166
|
-
*
|
248
|
+
* A simple example that retrieves an order change by its ID:
|
249
|
+
*
|
250
|
+
* ```ts
|
251
|
+
* const claim = await orderModuleService.retrieveOrderClaim(
|
252
|
+
* "123"
|
253
|
+
* )
|
167
254
|
* ```
|
168
255
|
*
|
256
|
+
* To specify relations that should be retrieved:
|
257
|
+
*
|
258
|
+
* ```ts
|
259
|
+
* const claim = await orderModuleService.retrieveOrderClaim(
|
260
|
+
* "123",
|
261
|
+
* {
|
262
|
+
* relations: ["order"]
|
263
|
+
* }
|
264
|
+
* )
|
265
|
+
* ```
|
169
266
|
*/
|
170
|
-
|
267
|
+
retrieveOrderClaim(claimId: string, config?: FindConfig<OrderClaimDTO>, sharedContext?: Context): Promise<OrderClaimDTO>;
|
171
268
|
/**
|
172
|
-
* This method
|
269
|
+
* This method retrieves a paginated list of order claims based on optional filters and configuration.
|
173
270
|
*
|
174
|
-
* @param {
|
271
|
+
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved order claims.
|
272
|
+
* @param {FindConfig<OrderClaimDTO>} config - The configurations determining how the order claim is retrieved. Its properties, such as `select` or `relations`, accept the
|
273
|
+
* attributes or relations associated with a order claim.
|
175
274
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
176
|
-
* @returns {Promise<
|
275
|
+
* @returns {Promise<OrderClaimDTO[]>} The list of order claims.
|
177
276
|
*
|
178
277
|
* @example
|
179
|
-
*
|
180
|
-
*
|
278
|
+
* To retrieve a list of order claims using their IDs:
|
279
|
+
*
|
280
|
+
* ```ts
|
281
|
+
* const claims = await orderModuleService.listOrderClaims({
|
282
|
+
* id: ["123", "321"]
|
283
|
+
* })
|
284
|
+
* ```
|
285
|
+
*
|
286
|
+
* To specify relations that should be retrieved within the claim:
|
287
|
+
*
|
288
|
+
* ```ts
|
289
|
+
* const claims = await orderModuleService.listOrderClaims({
|
290
|
+
* id: ["123", "321"]
|
291
|
+
* }, {
|
292
|
+
* relations: ["order"]
|
293
|
+
* })
|
181
294
|
* ```
|
182
295
|
*
|
296
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
297
|
+
*
|
298
|
+
* ```ts
|
299
|
+
* const claims = await orderModuleService.listOrderClaims({
|
300
|
+
* id: ["123", "321"]
|
301
|
+
* }, {
|
302
|
+
* relations: ["order"],
|
303
|
+
* take: 20,
|
304
|
+
* skip: 2
|
305
|
+
* })
|
306
|
+
* ```
|
183
307
|
*/
|
184
|
-
|
308
|
+
listOrderClaims(filters?: FilterableOrderProps, config?: FindConfig<OrderClaimDTO>, sharedContext?: Context): Promise<OrderClaimDTO[]>;
|
185
309
|
/**
|
186
|
-
* This method
|
310
|
+
* This method retrieves a paginated list of order claims along with the total count of available claims satisfying the provided filters.
|
187
311
|
*
|
188
|
-
* @param {
|
312
|
+
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved order claims.
|
313
|
+
* @param {FindConfig<OrderClaimDTO>} config - The configurations determining how the order claim is retrieved. Its properties, such as `select` or `relations`, accept the
|
314
|
+
* attributes or relations associated with a order claim.
|
189
315
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
190
|
-
* @returns {Promise<
|
316
|
+
* @returns {Promise<[OrderClaimDTO[], number]>} The list of order claims along with their total count.
|
191
317
|
*
|
192
318
|
* @example
|
193
|
-
*
|
194
|
-
*
|
319
|
+
* To retrieve a list of order claims using their IDs:
|
320
|
+
*
|
321
|
+
* ```ts
|
322
|
+
* const [claims, count] = await orderModuleService.listAndCountOrderClaims({
|
323
|
+
* id: ["123", "321"]
|
324
|
+
* })
|
195
325
|
* ```
|
196
326
|
*
|
327
|
+
* To specify relations that should be retrieved within the claim:
|
328
|
+
*
|
329
|
+
* ```ts
|
330
|
+
* const [claims, count] = await orderModuleService.listAndCountOrderClaims({
|
331
|
+
* id: ["123", "321"]
|
332
|
+
* }, {
|
333
|
+
* relations: ["order"],
|
334
|
+
* })
|
335
|
+
* ```
|
336
|
+
*
|
337
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
338
|
+
*
|
339
|
+
* ```ts
|
340
|
+
* const [claims, count] = await orderModuleService.listAndCountOrderClaims({
|
341
|
+
* id: ["123", "321"]
|
342
|
+
* }, {
|
343
|
+
* relations: ["order"],
|
344
|
+
* take: 20,
|
345
|
+
* skip: 2
|
346
|
+
* })
|
347
|
+
* ```
|
197
348
|
*/
|
198
|
-
|
199
|
-
softDeleteOrders<TReturnableLinkableKeys extends string = string>(storeIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
200
|
-
restoreOrders<TReturnableLinkableKeys extends string = string>(storeIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
201
|
-
listAddresses(filters?: FilterableOrderAddressProps, config?: FindConfig<OrderAddressDTO>, sharedContext?: Context): Promise<OrderAddressDTO[]>;
|
349
|
+
listAndCountOrderClaims(filters?: FilterableOrderProps, config?: FindConfig<OrderClaimDTO>, sharedContext?: Context): Promise<[OrderClaimDTO[], number]>;
|
202
350
|
/**
|
203
|
-
* This method
|
351
|
+
* This method retrieves an order exchange by its ID.
|
204
352
|
*
|
205
|
-
* @param {
|
353
|
+
* @param {string} exchangeId - The exchange's ID.
|
354
|
+
* @param {FindConfig<OrderExchangeDTO>} config - The configurations determining how the order exchange is retrieved. Its properties, such as `select` or `relations`, accept the
|
355
|
+
* attributes or relations associated with a order exchange.
|
206
356
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
207
|
-
* @returns {Promise<
|
357
|
+
* @returns {Promise<OrderExchangeDTO>} The retrieved order exchange.
|
208
358
|
*
|
209
359
|
* @example
|
210
|
-
*
|
211
|
-
*
|
360
|
+
* A simple example that retrieves an order change by its ID:
|
361
|
+
*
|
362
|
+
* ```ts
|
363
|
+
* const exchange = await orderModuleService.retrieveOrderExchange(
|
364
|
+
* "123"
|
365
|
+
* )
|
366
|
+
* ```
|
367
|
+
*
|
368
|
+
* To specify relations that should be retrieved:
|
369
|
+
*
|
370
|
+
* ```ts
|
371
|
+
* const exchange = await orderModuleService.retrieveOrderExchange(
|
372
|
+
* "123",
|
212
373
|
* {
|
213
|
-
*
|
214
|
-
* last_name: "Doe",
|
215
|
-
* address_1: "123 Main St",
|
216
|
-
* city: "Anytown",
|
217
|
-
* country_code: "US",
|
218
|
-
* province: "AnyState",
|
219
|
-
* postal_code: "12345"
|
374
|
+
* relations: ["order"]
|
220
375
|
* }
|
221
|
-
*
|
376
|
+
* )
|
222
377
|
* ```
|
223
|
-
*
|
224
378
|
*/
|
225
|
-
|
379
|
+
retrieveOrderExchange(exchangeId: string, config?: FindConfig<OrderExchangeDTO>, sharedContext?: Context): Promise<OrderExchangeDTO>;
|
226
380
|
/**
|
227
|
-
* This method
|
381
|
+
* This method retrieves a paginated list of order exchanges based on optional filters and configuration.
|
228
382
|
*
|
229
|
-
* @param {
|
383
|
+
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved exchanges.
|
384
|
+
* @param {FindConfig<OrderExchangeDTO>} config - The configurations determining how the order exchange is retrieved. Its properties, such as `select` or `relations`, accept the
|
385
|
+
* attributes or relations associated with a order exchange.
|
230
386
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
231
|
-
* @returns {Promise<
|
387
|
+
* @returns {Promise<OrderExchangeDTO[]>} The list of exchanges.
|
232
388
|
*
|
233
389
|
* @example
|
234
|
-
*
|
235
|
-
*
|
236
|
-
*
|
237
|
-
*
|
238
|
-
*
|
239
|
-
*
|
240
|
-
*
|
241
|
-
*
|
242
|
-
*
|
390
|
+
* To retrieve a list of exchanges using their IDs:
|
391
|
+
*
|
392
|
+
* ```ts
|
393
|
+
* const exchanges = await orderModuleService.listOrderExchanges({
|
394
|
+
* id: ["123", "321"]
|
395
|
+
* })
|
396
|
+
* ```
|
397
|
+
*
|
398
|
+
* To specify relations that should be retrieved within the exchange:
|
243
399
|
*
|
244
|
-
*
|
400
|
+
* ```ts
|
401
|
+
* const exchanges = await orderModuleService.listOrderExchanges({
|
402
|
+
* id: ["123", "321"]
|
403
|
+
* }, {
|
404
|
+
* relations: ["order"]
|
405
|
+
* })
|
245
406
|
* ```
|
246
407
|
*
|
408
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
409
|
+
*
|
410
|
+
* ```ts
|
411
|
+
* const exchanges = await orderModuleService.listOrderExchanges({
|
412
|
+
* id: ["123", "321"]
|
413
|
+
* }, {
|
414
|
+
* relations: ["order"],
|
415
|
+
* take: 20,
|
416
|
+
* skip: 2
|
417
|
+
* })
|
418
|
+
* ```
|
247
419
|
*/
|
248
|
-
|
420
|
+
listOrderExchanges(filters?: FilterableOrderProps, config?: FindConfig<OrderExchangeDTO>, sharedContext?: Context): Promise<OrderExchangeDTO[]>;
|
249
421
|
/**
|
250
|
-
* This method
|
422
|
+
* This method retrieves a paginated list of exchanges along with the total count of available exchanges satisfying the provided filters.
|
251
423
|
*
|
252
|
-
* @param {
|
424
|
+
* @param {FilterableOrderProps} filters - The filters to apply on the retrieved exchanges.
|
425
|
+
* @param {FindConfig<OrderExchangeDTO>} config - The configurations determining how the order exchange is retrieved. Its properties, such as `select` or `relations`, accept the
|
426
|
+
* attributes or relations associated with a order exchange.
|
253
427
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
254
|
-
* @returns {Promise<
|
428
|
+
* @returns {Promise<[OrderExchangeDTO[], number]>} The list of exchanges along with their total count.
|
255
429
|
*
|
256
430
|
* @example
|
257
|
-
*
|
258
|
-
* const updatedAddress: UpdateOrderAddressDTO[] = [
|
259
|
-
* {
|
260
|
-
* id: "address1",
|
261
|
-
* first_name: "John",
|
262
|
-
* last_name: "Doe",
|
263
|
-
* address_1: "123 Main St",
|
264
|
-
* city: "Anytown",
|
265
|
-
* country_code: "US",
|
266
|
-
* province: "AnyState",
|
267
|
-
* postal_code: "12345"
|
268
|
-
* }
|
269
|
-
* ];
|
431
|
+
* To retrieve a list of exchanges using their IDs:
|
270
432
|
*
|
271
|
-
*
|
433
|
+
* ```ts
|
434
|
+
* const [exchanges, count] = await orderModuleService.listOrderExchanges({
|
435
|
+
* id: ["123", "321"]
|
436
|
+
* })
|
272
437
|
* ```
|
273
438
|
*
|
439
|
+
* To specify relations that should be retrieved within the exchange:
|
440
|
+
*
|
441
|
+
* ```ts
|
442
|
+
* const [exchanges, count] = await orderModuleService.listOrderExchanges({
|
443
|
+
* id: ["123", "321"]
|
444
|
+
* }, {
|
445
|
+
* relations: ["order"],
|
446
|
+
* })
|
447
|
+
* ```
|
448
|
+
*
|
449
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
450
|
+
*
|
451
|
+
* ```ts
|
452
|
+
* const [exchanges, count] = await orderModuleService.listOrderExchanges({
|
453
|
+
* id: ["123", "321"]
|
454
|
+
* }, {
|
455
|
+
* relations: ["order"],
|
456
|
+
* take: 20,
|
457
|
+
* skip: 2
|
458
|
+
* })
|
459
|
+
* ```
|
274
460
|
*/
|
275
|
-
|
461
|
+
listAndCountOrderExchanges(filters?: FilterableOrderProps, config?: FindConfig<OrderExchangeDTO>, sharedContext?: Context): Promise<[OrderExchangeDTO[], number]>;
|
276
462
|
/**
|
277
|
-
* This method
|
463
|
+
* This method creates orders
|
278
464
|
*
|
279
|
-
* @param {
|
465
|
+
* @param {CreateOrderDTO[]} data - The order to be created.
|
280
466
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
281
|
-
* @returns {Promise<
|
467
|
+
* @returns {Promise<OrderDTO[]>} The created orders.
|
282
468
|
*
|
283
469
|
* @example
|
284
|
-
* ```
|
285
|
-
* const
|
286
|
-
*
|
287
|
-
*
|
288
|
-
*
|
289
|
-
*
|
290
|
-
*
|
291
|
-
*
|
292
|
-
*
|
293
|
-
*
|
470
|
+
* ```ts
|
471
|
+
* const orders = await orderModuleService.createOrders([{
|
472
|
+
* currency_code: "usd",
|
473
|
+
* items: [
|
474
|
+
* {
|
475
|
+
* title: "Product Name",
|
476
|
+
* quantity: 1,
|
477
|
+
* unit_price: 20
|
478
|
+
* }
|
479
|
+
* ]
|
480
|
+
* }])
|
294
481
|
* ```
|
295
482
|
*
|
296
483
|
*/
|
297
|
-
|
484
|
+
createOrders(data: CreateOrderDTO[], sharedContext?: Context): Promise<OrderDTO[]>;
|
298
485
|
/**
|
299
|
-
* This method
|
486
|
+
* This method creates orders
|
300
487
|
*
|
301
|
-
* @param {
|
488
|
+
* @param {CreateOrderDTO} data - The order to be created.
|
302
489
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
303
|
-
* @returns {Promise<
|
490
|
+
* @returns {Promise<OrderDTO>} The created orders.
|
304
491
|
*
|
305
492
|
* @example
|
306
|
-
* ```
|
307
|
-
* await orderModuleService.
|
493
|
+
* ```ts
|
494
|
+
* const order = await orderModuleService.createOrders({
|
495
|
+
* currency_code: "usd",
|
496
|
+
* items: [
|
497
|
+
* {
|
498
|
+
* title: "Product Name",
|
499
|
+
* quantity: 1,
|
500
|
+
* unit_price: 20
|
501
|
+
* }
|
502
|
+
* ]
|
503
|
+
* })
|
308
504
|
* ```
|
309
505
|
*
|
310
506
|
*/
|
311
|
-
|
507
|
+
createOrders(data: CreateOrderDTO, sharedContext?: Context): Promise<OrderDTO>;
|
312
508
|
/**
|
313
|
-
* This method
|
509
|
+
* This method updates existing orders. The order IDs are specified in each order object.
|
314
510
|
*
|
315
|
-
* @param {
|
316
|
-
* @
|
317
|
-
* @returns {Promise<void>} Resolves when {summary}
|
511
|
+
* @param {UpdateOrderDTO[]} data - The attributes to update in the order.
|
512
|
+
* @returns {Promise<OrderDTO[]>} The updated orders.
|
318
513
|
*
|
319
514
|
* @example
|
320
515
|
* ```typescript
|
321
|
-
* await orderModuleService.
|
516
|
+
* const orders = await orderModuleService.updateOrders([{
|
517
|
+
* id: "123",
|
518
|
+
* email: "example@gmail.com"
|
519
|
+
* }])
|
322
520
|
* ```
|
323
521
|
*
|
324
522
|
*/
|
325
|
-
|
523
|
+
updateOrders(data: UpdateOrderDTO[], sharedContext?: Context): Promise<OrderDTO[]>;
|
326
524
|
/**
|
327
|
-
* This method
|
525
|
+
* This method updates existing orders.
|
328
526
|
*
|
329
|
-
* @param {string}
|
330
|
-
* @param {
|
331
|
-
* attributes or relations associated with a order line item.
|
527
|
+
* @param {string} orderId - The ID of the order to update.
|
528
|
+
* @param {UpdateOrderDTO} data - The attributes to update in the order.
|
332
529
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
333
|
-
* @returns {Promise<
|
530
|
+
* @returns {Promise<OrderDTO>} The updated orders.
|
334
531
|
*
|
335
532
|
* @example
|
336
533
|
* ```typescript
|
337
|
-
* await orderModuleService.
|
534
|
+
* const order = await orderModuleService.updateOrders(
|
535
|
+
* "123",
|
536
|
+
* {
|
537
|
+
* email: "example@gmail.com"
|
538
|
+
* }
|
539
|
+
* )
|
338
540
|
* ```
|
339
541
|
*
|
340
542
|
*/
|
341
|
-
|
543
|
+
updateOrders(orderId: string, data: UpdateOrderDTO, sharedContext?: Context): Promise<OrderDTO>;
|
342
544
|
/**
|
343
|
-
* This method
|
545
|
+
* This method updates existing orders matching the specified filters.
|
344
546
|
*
|
345
|
-
* @param {
|
346
|
-
* @param {
|
347
|
-
* attributes or relations associated with a order line item.
|
547
|
+
* @param {Partial<OrderDTO>} selector - The filters specifying which orders to update.
|
548
|
+
* @param {UpdateOrderDTO} data - The attributes to update in the orders.
|
348
549
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
349
|
-
* @returns {Promise<
|
550
|
+
* @returns {Promise<OrderDTO[]>} The updated orders.
|
350
551
|
*
|
351
552
|
* @example
|
352
553
|
* ```typescript
|
353
|
-
* const
|
354
|
-
*
|
355
|
-
* }
|
554
|
+
* const orders = await orderModuleService.updateOrders({
|
555
|
+
* id: ["123", "321"]
|
556
|
+
* }, {
|
557
|
+
* email: "example@gmail.com"
|
558
|
+
* })
|
356
559
|
* ```
|
357
560
|
*
|
358
561
|
*/
|
359
|
-
|
360
|
-
createLineItems(data: CreateOrderLineItemDTO, sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
361
|
-
createLineItems(data: CreateOrderLineItemDTO[], sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
362
|
-
createLineItems(orderId: string, items: CreateOrderLineItemDTO[], sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
562
|
+
updateOrders(selector: Partial<FilterableOrderProps>, data: UpdateOrderDTO, sharedContext?: Context): Promise<OrderDTO[]>;
|
363
563
|
/**
|
364
|
-
* This method
|
564
|
+
* This method deletes orders by its ID.
|
365
565
|
*
|
366
|
-
* @param {
|
367
|
-
* @
|
566
|
+
* @param {string[]} orderIds - The IDs of orders to delete.
|
567
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
568
|
+
* @returns {Promise<void>} Resolves when the orders are deleted successfully.
|
368
569
|
*
|
369
570
|
* @example
|
370
571
|
* ```typescript
|
371
|
-
*
|
372
|
-
* {
|
373
|
-
* selector: {
|
374
|
-
* id: "line-item-id-1"
|
375
|
-
* },
|
376
|
-
* data: {
|
377
|
-
* id: "line-item-id-1",
|
378
|
-
* quantity: 2,
|
379
|
-
* unit_price: 1999
|
380
|
-
* }
|
381
|
-
* }
|
382
|
-
* ];
|
383
|
-
*
|
384
|
-
* const updatedLineItems = await orderModuleService.updateLineItems(updateOrderLineItems);
|
572
|
+
* await orderModuleService.deleteOrders(["123", "321"])
|
385
573
|
* ```
|
386
574
|
*
|
387
575
|
*/
|
388
|
-
|
576
|
+
deleteOrders(orderIds: string[], sharedContext?: Context): Promise<void>;
|
389
577
|
/**
|
390
|
-
* This method
|
578
|
+
* This method deletes an order by its ID.
|
391
579
|
*
|
392
|
-
* @param {
|
393
|
-
* @param {Partial<UpdateOrderLineItemDTO>} data - Make all properties in T optional
|
580
|
+
* @param {string} orderId - The order's ID.
|
394
581
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
395
|
-
* @returns {Promise<
|
582
|
+
* @returns {Promise<void>} Resolves when the order is deleted successfully.
|
396
583
|
*
|
397
584
|
* @example
|
398
585
|
* ```typescript
|
399
|
-
*
|
400
|
-
* { id: "line-item-id-1" },
|
401
|
-
* { quantity: 10 }
|
402
|
-
* );
|
586
|
+
* await orderModuleService.deleteOrders("123");
|
403
587
|
* ```
|
404
588
|
*
|
405
589
|
*/
|
406
|
-
|
590
|
+
deleteOrders(orderId: string, sharedContext?: Context): Promise<void>;
|
407
591
|
/**
|
408
|
-
* This method
|
592
|
+
* This method soft deletes orders by their IDs.
|
409
593
|
*
|
410
|
-
* @param {string}
|
411
|
-
* @param {
|
594
|
+
* @param {string[]} orderIds - The list of order IDs.
|
595
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
412
596
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
413
|
-
* @returns {Promise<
|
597
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted, such as the ID of the associated items.
|
598
|
+
* The object's keys are the ID attribute names of the order entity's relations, such as `item_id`, and its value is an array of strings, each being the ID of a record associated
|
599
|
+
* with the order through this relation, such as the IDs of associated item.
|
414
600
|
*
|
415
|
-
*
|
416
|
-
* ```typescript
|
417
|
-
* const result = await orderModuleService.updateLineItems(
|
418
|
-
* "lineIdExample",
|
419
|
-
* {
|
420
|
-
* quantity: 10,
|
421
|
-
* }
|
422
|
-
* );
|
423
|
-
* ```
|
601
|
+
* If there are no related records, the promise resolves to `void`.
|
424
602
|
*
|
603
|
+
* @example
|
604
|
+
* await orderModuleService.softDeleteOrders(["123", "321"])
|
425
605
|
*/
|
426
|
-
|
427
|
-
deleteLineItems(itemIds: string[], sharedContext?: Context): Promise<void>;
|
428
|
-
deleteLineItems(itemIds: string, sharedContext?: Context): Promise<void>;
|
429
|
-
deleteLineItems(selector: Partial<FilterableOrderLineItemProps>, sharedContext?: Context): Promise<void>;
|
606
|
+
softDeleteOrders<TReturnableLinkableKeys extends string = string>(orderIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
430
607
|
/**
|
431
|
-
* This method
|
608
|
+
* This method restores soft deleted orders by their IDs.
|
432
609
|
*
|
433
|
-
* @param {
|
434
|
-
* @param {
|
610
|
+
* @param {string[]} orderIds - The list of order IDs.
|
611
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the orders. You can pass to its `returnLinkableKeys`
|
612
|
+
* property any of the order's relation attribute names, such as `items`.
|
435
613
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
436
|
-
* @returns {Promise<
|
614
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored, such as the IDs of associated items.
|
615
|
+
* The object's keys are the ID attribute names of the order entity's relations, such as `item_id`,
|
616
|
+
* and its value is an array of strings, each being the ID of the record associated with the order through this relation,
|
617
|
+
* such as the IDs of associated items.
|
437
618
|
*
|
438
|
-
*
|
439
|
-
* ```typescript
|
440
|
-
* await orderModuleService.updateOrderItem(
|
441
|
-
* { id: "item123" },
|
442
|
-
* { quantity: "2" }
|
443
|
-
* );
|
444
|
-
* ```
|
619
|
+
* If there are no related records restored, the promise resolves to `void`.
|
445
620
|
*
|
621
|
+
* @example
|
622
|
+
* await orderModuleService.restoreOrders(["123", "321"])
|
446
623
|
*/
|
447
|
-
|
624
|
+
restoreOrders<TReturnableLinkableKeys extends string = string>(orderIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
448
625
|
/**
|
449
|
-
* This method
|
626
|
+
* This method retrieves a paginated list of addresses based on optional filters and configuration.
|
450
627
|
*
|
451
|
-
* @param {
|
452
|
-
* @param {
|
628
|
+
* @param {FilterableOrderAddressProps} filters - The filters to apply on the retrieved order addresss.
|
629
|
+
* @param {FindConfig<OrderAddressDTO>} config - The configurations determining how the order address is retrieved. Its properties, such as `select` or `relations`, accept the
|
630
|
+
* attributes or relations associated with a order address.
|
453
631
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
454
|
-
* @returns {Promise<
|
632
|
+
* @returns {Promise<OrderAddressDTO[]>} The list of addresses.
|
455
633
|
*
|
456
634
|
* @example
|
457
|
-
*
|
458
|
-
*
|
459
|
-
*
|
460
|
-
*
|
461
|
-
*
|
462
|
-
*
|
463
|
-
* }
|
464
|
-
* );
|
635
|
+
* To retrieve a list of addresses using their IDs:
|
636
|
+
*
|
637
|
+
* ```ts
|
638
|
+
* const addresses = await orderModuleService.listAddresses({
|
639
|
+
* id: ["123", "321"]
|
640
|
+
* })
|
465
641
|
* ```
|
466
642
|
*
|
643
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
644
|
+
*
|
645
|
+
* ```ts
|
646
|
+
* const addresses = await orderModuleService.listAddresses({
|
647
|
+
* id: ["123", "321"]
|
648
|
+
* }, {
|
649
|
+
* take: 20,
|
650
|
+
* skip: 2
|
651
|
+
* })
|
652
|
+
* ```
|
467
653
|
*/
|
468
|
-
|
654
|
+
listAddresses(filters?: FilterableOrderAddressProps, config?: FindConfig<OrderAddressDTO>, sharedContext?: Context): Promise<OrderAddressDTO[]>;
|
469
655
|
/**
|
470
|
-
* This method
|
656
|
+
* This method creates addresses.
|
471
657
|
*
|
472
|
-
* @param {
|
473
|
-
* @param {UpdateOrderItemDTO | Partial<UpdateOrderItemDTO>} data - {summary}
|
658
|
+
* @param {CreateOrderAddressDTO[]} data - The addresses to be created.
|
474
659
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
475
|
-
* @returns {Promise<
|
660
|
+
* @returns {Promise<OrderAddressDTO[]>} The created addresses.
|
476
661
|
*
|
477
662
|
* @example
|
478
663
|
* ```typescript
|
479
|
-
* await orderModuleService.
|
480
|
-
* "order-detail-id",
|
664
|
+
* const addresses = await orderModuleService.createAddresses([
|
481
665
|
* {
|
482
|
-
*
|
483
|
-
*
|
666
|
+
* first_name: "John",
|
667
|
+
* last_name: "Doe",
|
668
|
+
* address_1: "123 Main St",
|
669
|
+
* city: "Anytown",
|
670
|
+
* country_code: "US",
|
671
|
+
* province: "AnyState",
|
672
|
+
* postal_code: "12345"
|
484
673
|
* }
|
485
|
-
* )
|
674
|
+
* ])
|
486
675
|
* ```
|
487
676
|
*
|
488
677
|
*/
|
489
|
-
|
678
|
+
createAddresses(data: CreateOrderAddressDTO[], sharedContext?: Context): Promise<OrderAddressDTO[]>;
|
490
679
|
/**
|
491
|
-
* This method
|
680
|
+
* This method creates a return.
|
492
681
|
*
|
493
|
-
* @param {
|
494
|
-
* @param {FindConfig<OrderShippingMethodDTO>} config - The configurations determining how the order shipping method is retrieved. Its properties, such as `select` or `relations`, accept the
|
495
|
-
* attributes or relations associated with a order shipping method.
|
682
|
+
* @param {CreateOrderAddressDTO} data - The address to be created.
|
496
683
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
497
|
-
* @returns {Promise<
|
684
|
+
* @returns {Promise<OrderAddressDTO>} The created return.
|
498
685
|
*
|
499
686
|
* @example
|
500
687
|
* ```typescript
|
501
|
-
* await orderModuleService.
|
502
|
-
*
|
503
|
-
*
|
504
|
-
*
|
688
|
+
* const address = await orderModuleService.createAddresses({
|
689
|
+
* first_name: "John",
|
690
|
+
* last_name: "Doe",
|
691
|
+
* address_1: "123 Main St",
|
692
|
+
* city: "Anytown",
|
693
|
+
* country_code: "US",
|
694
|
+
* province: "AnyState",
|
695
|
+
* postal_code: "12345"
|
696
|
+
* })
|
505
697
|
* ```
|
506
698
|
*
|
507
699
|
*/
|
508
|
-
|
509
|
-
createShippingMethods(data: CreateOrderShippingMethodDTO, sharedContext?: Context): Promise<OrderShippingMethodDTO>;
|
510
|
-
createShippingMethods(data: CreateOrderShippingMethodDTO[], sharedContext?: Context): Promise<OrderShippingMethodDTO[]>;
|
511
|
-
createShippingMethods(orderId: string, methods: CreateOrderShippingMethodDTO[], sharedContext?: Context): Promise<OrderShippingMethodDTO[]>;
|
512
|
-
updateShippingMethods(data: UpdateOrderShippingMethodDTO[], sharedContext?: Context): Promise<OrderShippingMethodDTO[]>;
|
513
|
-
updateShippingMethods(data: UpdateOrderShippingMethodDTO, sharedContext?: Context): Promise<OrderShippingMethodDTO>;
|
514
|
-
deleteShippingMethods(methodIds: string[], sharedContext?: Context): Promise<void>;
|
515
|
-
deleteShippingMethods(methodIds: string, sharedContext?: Context): Promise<void>;
|
516
|
-
deleteShippingMethods(selector: Partial<FilterableOrderShippingMethodProps>, sharedContext?: Context): Promise<void>;
|
700
|
+
createAddresses(data: CreateOrderAddressDTO, sharedContext?: Context): Promise<OrderAddressDTO>;
|
517
701
|
/**
|
518
|
-
* This method
|
702
|
+
* This method updates existing addresses. The address ID is specified in each address object.
|
519
703
|
*
|
520
|
-
* @param {
|
521
|
-
* @param {FindConfig<OrderLineItemAdjustmentDTO>} config - The configurations determining how the order line item adjustment is retrieved. Its properties, such as `select` or `relations`, accept the
|
522
|
-
* attributes or relations associated with a order line item adjustment.
|
704
|
+
* @param {UpdateOrderAddressDTO[]} data - The attributes to update in the address.
|
523
705
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
524
|
-
* @returns {Promise<
|
706
|
+
* @returns {Promise<OrderAddressDTO[]>} The updated addresses.
|
525
707
|
*
|
526
708
|
* @example
|
527
709
|
* ```typescript
|
528
|
-
* const
|
710
|
+
* const addresses = await orderModuleService.updateAddresses([{
|
711
|
+
* id: "123",
|
712
|
+
* first_name: "John",
|
713
|
+
* }])
|
529
714
|
* ```
|
530
715
|
*
|
531
716
|
*/
|
532
|
-
|
533
|
-
createLineItemAdjustments(data: CreateOrderAdjustmentDTO[], sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
534
|
-
createLineItemAdjustments(data: CreateOrderAdjustmentDTO, sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
535
|
-
createLineItemAdjustments(orderId: string, data: CreateOrderAdjustmentDTO[], sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
717
|
+
updateAddresses(data: UpdateOrderAddressDTO[], sharedContext?: Context): Promise<OrderAddressDTO[]>;
|
536
718
|
/**
|
537
|
-
* This method
|
719
|
+
* This method updates an existing address.
|
538
720
|
*
|
539
|
-
* @param {
|
540
|
-
* @param {UpsertOrderLineItemAdjustmentDTO[]} data - The upsert order line item adjustment details.
|
721
|
+
* @param {UpdateOrderAddressDTO} data - The attributes to update in the address.
|
541
722
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
542
|
-
* @returns {Promise<
|
723
|
+
* @returns {Promise<OrderAddressDTO>} The updated address.
|
543
724
|
*
|
544
725
|
* @example
|
545
726
|
* ```typescript
|
546
|
-
* const
|
547
|
-
*
|
548
|
-
*
|
549
|
-
* }
|
550
|
-
*
|
551
|
-
* const result = await orderModuleService.setLineItemAdjustments("order456", adjustmentsData);
|
727
|
+
* const address = await orderModuleService.updateAddresses({
|
728
|
+
* id: "123",
|
729
|
+
* first_name: "John",
|
730
|
+
* })
|
552
731
|
* ```
|
553
732
|
*
|
554
733
|
*/
|
555
|
-
|
556
|
-
deleteLineItemAdjustments(adjustmentIds: string[], sharedContext?: Context): Promise<void>;
|
557
|
-
deleteLineItemAdjustments(adjustmentIds: string, sharedContext?: Context): Promise<void>;
|
558
|
-
deleteLineItemAdjustments(selector: Partial<OrderLineItemAdjustmentDTO>, sharedContext?: Context): Promise<void>;
|
734
|
+
updateAddresses(data: UpdateOrderAddressDTO, sharedContext?: Context): Promise<OrderAddressDTO>;
|
559
735
|
/**
|
560
|
-
* This method
|
736
|
+
* This method deletes addresses by their IDs.
|
561
737
|
*
|
562
|
-
* @param {
|
563
|
-
* @param {FindConfig<OrderShippingMethodAdjustmentDTO>} config - The configurations determining how the order shipping method adjustment is retrieved. Its properties, such as `select` or `relations`, accept the
|
564
|
-
* attributes or relations associated with a order shipping method adjustment.
|
738
|
+
* @param {string[]} ids - The list of address IDs.
|
565
739
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
566
|
-
* @returns {Promise<
|
740
|
+
* @returns {Promise<void>} Resolves when the addresses are deleted.
|
567
741
|
*
|
568
742
|
* @example
|
569
743
|
* ```typescript
|
570
|
-
*
|
571
|
-
* id: "12345",
|
572
|
-
* });
|
744
|
+
* await orderModuleService.deleteAddresses(["123", "321"])
|
573
745
|
* ```
|
574
746
|
*
|
575
747
|
*/
|
576
|
-
|
577
|
-
createShippingMethodAdjustments(data: CreateOrderShippingMethodAdjustmentDTO[], sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO[]>;
|
578
|
-
createShippingMethodAdjustments(data: CreateOrderShippingMethodAdjustmentDTO, sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO>;
|
579
|
-
createShippingMethodAdjustments(orderId: string, data: CreateOrderShippingMethodAdjustmentDTO[], sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO[]>;
|
748
|
+
deleteAddresses(ids: string[], sharedContext?: Context): Promise<void>;
|
580
749
|
/**
|
581
|
-
* This method
|
750
|
+
* This method deletes an address by its ID.
|
582
751
|
*
|
583
|
-
* @param {string}
|
584
|
-
* @param {(CreateOrderShippingMethodAdjustmentDTO | UpdateOrderShippingMethodAdjustmentDTO)[]} data - The list of The order shipping method adjustment d t o | update order shipping method adjustment to be created.
|
752
|
+
* @param {string} ids - The ID of the address.
|
585
753
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
586
|
-
* @returns {Promise<
|
754
|
+
* @returns {Promise<void>} Resolves when the address is deleted.
|
587
755
|
*
|
588
756
|
* @example
|
589
757
|
* ```typescript
|
590
|
-
* await orderModuleService.
|
591
|
-
* {
|
592
|
-
* shipping_method_id: "shipMethodId123",
|
593
|
-
* code: "CODE123",
|
594
|
-
* amount: 1000,
|
595
|
-
* }
|
596
|
-
* ]);
|
758
|
+
* await orderModuleService.deleteAddresses("123")
|
597
759
|
* ```
|
598
760
|
*
|
599
761
|
*/
|
600
|
-
|
601
|
-
deleteShippingMethodAdjustments(adjustmentIds: string[], sharedContext?: Context): Promise<void>;
|
602
|
-
deleteShippingMethodAdjustments(adjustmentId: string, sharedContext?: Context): Promise<void>;
|
603
|
-
deleteShippingMethodAdjustments(selector: Partial<OrderShippingMethodAdjustmentDTO>, sharedContext?: Context): Promise<void>;
|
762
|
+
deleteAddresses(ids: string, sharedContext?: Context): Promise<void>;
|
604
763
|
/**
|
605
|
-
* This method retrieves a
|
764
|
+
* This method retrieves a line item by its ID.
|
606
765
|
*
|
607
|
-
* @param {
|
608
|
-
* @param {FindConfig<
|
609
|
-
* attributes or relations associated with a
|
766
|
+
* @param {string} itemId - The item's ID.
|
767
|
+
* @param {FindConfig<OrderLineItemDTO>} config - The configurations determining how the line item is retrieved. Its properties, such as `select` or `relations`, accept the
|
768
|
+
* attributes or relations associated with a line item.
|
610
769
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
611
|
-
* @returns {Promise<
|
770
|
+
* @returns {Promise<OrderLineItemDTO>} The retrieved line item.
|
612
771
|
*
|
613
772
|
* @example
|
614
|
-
*
|
615
|
-
*
|
773
|
+
* A simple example that retrieves an order change by its ID:
|
774
|
+
*
|
775
|
+
* ```ts
|
776
|
+
* const lineItem = await orderModuleService.retrieveLineItem("123")
|
777
|
+
* ```
|
778
|
+
*
|
779
|
+
* To specify relations that should be retrieved:
|
780
|
+
*
|
781
|
+
* ```ts
|
782
|
+
* const lineItem = await orderModuleService.retrieveLineItem(
|
783
|
+
* "123",
|
784
|
+
* {
|
785
|
+
* relations: ["order"]
|
786
|
+
* }
|
787
|
+
* )
|
616
788
|
* ```
|
617
789
|
*
|
618
790
|
*/
|
619
|
-
|
620
|
-
createLineItemTaxLines(taxLines: CreateOrderLineItemTaxLineDTO[], sharedContext?: Context): Promise<OrderLineItemTaxLineDTO[]>;
|
621
|
-
createLineItemTaxLines(taxLine: CreateOrderLineItemTaxLineDTO, sharedContext?: Context): Promise<OrderLineItemTaxLineDTO>;
|
622
|
-
createLineItemTaxLines(orderId: string, taxLines: CreateOrderLineItemTaxLineDTO[] | CreateOrderLineItemTaxLineDTO, sharedContext?: Context): Promise<OrderLineItemTaxLineDTO[]>;
|
791
|
+
retrieveLineItem(itemId: string, config?: FindConfig<OrderLineItemDTO>, sharedContext?: Context): Promise<OrderLineItemDTO>;
|
623
792
|
/**
|
624
|
-
* This method
|
793
|
+
* This method retrieves a paginated list of line items based on optional filters and configuration.
|
625
794
|
*
|
626
|
-
* @param {
|
627
|
-
* @param {
|
795
|
+
* @param {FilterableOrderLineItemProps} filters - The filters to apply on the retrieved line item.
|
796
|
+
* @param {FindConfig<OrderLineItemDTO>} config - The configurations determining how the line item is retrieved. Its properties, such as `select` or `relations`, accept the
|
797
|
+
* attributes or relations associated with a line item.
|
628
798
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
629
|
-
* @returns {Promise<
|
799
|
+
* @returns {Promise<OrderLineItemDTO[]>} The list of line items.
|
630
800
|
*
|
631
801
|
* @example
|
632
|
-
*
|
633
|
-
*
|
634
|
-
*
|
635
|
-
*
|
636
|
-
*
|
637
|
-
*
|
638
|
-
*
|
639
|
-
* ];
|
802
|
+
* To retrieve a list of line items using their IDs:
|
803
|
+
*
|
804
|
+
* ```ts
|
805
|
+
* const lineItems = await orderModuleService.listLineItems({
|
806
|
+
* id: ["123", "321"]
|
807
|
+
* })
|
808
|
+
* ```
|
640
809
|
*
|
641
|
-
*
|
810
|
+
* To specify relations that should be retrieved within the line item:
|
642
811
|
*
|
643
|
-
*
|
812
|
+
* ```ts
|
813
|
+
* const lineItems = await orderModuleService.listLineItems({
|
814
|
+
* id: ["123", "321"]
|
815
|
+
* }, {
|
816
|
+
* relations: ["order"]
|
817
|
+
* })
|
818
|
+
* ```
|
819
|
+
*
|
820
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
821
|
+
*
|
822
|
+
* ```ts
|
823
|
+
* const lineItems = await orderModuleService.listLineItems({
|
824
|
+
* id: ["123", "321"]
|
825
|
+
* }, {
|
826
|
+
* relations: ["order"],
|
827
|
+
* take: 20,
|
828
|
+
* skip: 2
|
829
|
+
* })
|
644
830
|
* ```
|
645
831
|
*
|
646
832
|
*/
|
647
|
-
|
648
|
-
deleteLineItemTaxLines(taxLineIds: string[], sharedContext?: Context): Promise<void>;
|
649
|
-
deleteLineItemTaxLines(taxLineIds: string, sharedContext?: Context): Promise<void>;
|
650
|
-
deleteLineItemTaxLines(selector: FilterableOrderLineItemTaxLineProps, sharedContext?: Context): Promise<void>;
|
833
|
+
listLineItems(filters: FilterableOrderLineItemProps, config?: FindConfig<OrderLineItemDTO>, sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
651
834
|
/**
|
652
|
-
* This method
|
835
|
+
* This method creates a line item.
|
653
836
|
*
|
654
|
-
* @param {
|
655
|
-
* @param {FindConfig<OrderShippingMethodTaxLineDTO>} config - The configurations determining how the order shipping method tax line is retrieved. Its properties, such as `select` or `relations`, accept the
|
656
|
-
* attributes or relations associated with a order shipping method tax line.
|
837
|
+
* @param {CreateOrderLineItemDTO} data - The line item to be created.
|
657
838
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
658
|
-
* @returns {Promise<
|
839
|
+
* @returns {Promise<OrderLineItemDTO[]>} The created line items.
|
659
840
|
*
|
660
841
|
* @example
|
661
|
-
*
|
662
|
-
*
|
663
|
-
*
|
664
|
-
*
|
665
|
-
*
|
666
|
-
|
667
|
-
|
842
|
+
* const lineItems = await orderModuleService.createLineItems({
|
843
|
+
* title: "Shirt",
|
844
|
+
* quantity: 1,
|
845
|
+
* unit_price: 20
|
846
|
+
* })
|
847
|
+
*/
|
848
|
+
createLineItems(data: CreateOrderLineItemDTO, sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
849
|
+
/**
|
850
|
+
* This method creates line items.
|
851
|
+
*
|
852
|
+
* @param {CreateOrderLineItemDTO[]} data - The line items to be created.
|
853
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
854
|
+
* @returns {Promise<OrderLineItemDTO[]>} The created line items.
|
668
855
|
*
|
856
|
+
* @example
|
857
|
+
* const lineItems = await orderModuleService.createLineItems([{
|
858
|
+
* title: "Shirt",
|
859
|
+
* quantity: 1,
|
860
|
+
* unit_price: 20
|
861
|
+
* }])
|
669
862
|
*/
|
670
|
-
|
671
|
-
createShippingMethodTaxLines(taxLines: CreateOrderShippingMethodTaxLineDTO[], sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO[]>;
|
672
|
-
createShippingMethodTaxLines(taxLine: CreateOrderShippingMethodTaxLineDTO, sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO>;
|
673
|
-
createShippingMethodTaxLines(orderId: string, taxLines: CreateOrderShippingMethodTaxLineDTO[] | CreateOrderShippingMethodTaxLineDTO, sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO[]>;
|
863
|
+
createLineItems(data: CreateOrderLineItemDTO[], sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
674
864
|
/**
|
675
|
-
* This method
|
865
|
+
* This method creates orders.
|
676
866
|
*
|
677
867
|
* @param {string} orderId - The order's ID.
|
678
|
-
* @param {
|
868
|
+
* @param {CreateOrderLineItemDTO[]} items - The order line items to be created.
|
679
869
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
680
|
-
* @returns {Promise<
|
870
|
+
* @returns {Promise<OrderLineItemDTO[]>} The created orders.
|
871
|
+
*
|
872
|
+
* @example
|
873
|
+
* const lineItems = await orderModuleService.createLineItems(
|
874
|
+
* "123",
|
875
|
+
* [{
|
876
|
+
* title: "Shirt",
|
877
|
+
* quantity: 1,
|
878
|
+
* unit_price: 20
|
879
|
+
* }]
|
880
|
+
* )
|
881
|
+
*/
|
882
|
+
createLineItems(orderId: string, items: CreateOrderLineItemDTO[], sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
883
|
+
/**
|
884
|
+
* This method updates existing line items. The line item to update is specified by the `selector` property of the first parameter.
|
885
|
+
*
|
886
|
+
* @param {UpdateOrderLineItemWithSelectorDTO[]} data - The attributes to update in the order line item with selector.
|
887
|
+
* @returns {Promise<OrderLineItemDTO[]>} The updated line items.
|
681
888
|
*
|
682
889
|
* @example
|
683
890
|
* ```typescript
|
684
|
-
* const
|
685
|
-
* const taxLines = [
|
891
|
+
* const lineItems = await orderModuleService.updateLineItems([
|
686
892
|
* {
|
687
|
-
*
|
688
|
-
*
|
893
|
+
* selector: {
|
894
|
+
* id: "123"
|
895
|
+
* },
|
896
|
+
* data: {
|
897
|
+
* quantity: 2
|
898
|
+
* }
|
689
899
|
* }
|
690
|
-
* ]
|
691
|
-
*
|
692
|
-
* const result = await orderModuleService.setShippingMethodTaxLines(orderId, taxLines);
|
900
|
+
* ])
|
693
901
|
* ```
|
694
902
|
*
|
695
903
|
*/
|
696
|
-
|
697
|
-
deleteShippingMethodTaxLines(taxLineIds: string[], sharedContext?: Context): Promise<void>;
|
698
|
-
deleteShippingMethodTaxLines(taxLineIds: string, sharedContext?: Context): Promise<void>;
|
699
|
-
deleteShippingMethodTaxLines(selector: FilterableOrderShippingMethodTaxLineProps, sharedContext?: Context): Promise<void>;
|
904
|
+
updateLineItems(data: UpdateOrderLineItemWithSelectorDTO[], sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
700
905
|
/**
|
701
|
-
* This method
|
906
|
+
* This method updates existing line items matching the specified filters.
|
702
907
|
*
|
703
|
-
* @param {
|
704
|
-
* @param {
|
705
|
-
* attributes or relations associated with a order.
|
908
|
+
* @param {Partial<OrderLineItemDTO>} selector - The filters specifying which line items to update.
|
909
|
+
* @param {Partial<UpdateOrderLineItemDTO>} data - The data to update in the line items.
|
706
910
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
707
|
-
* @returns {Promise<
|
911
|
+
* @returns {Promise<OrderLineItemDTO[]>} The updated line items.
|
708
912
|
*
|
709
913
|
* @example
|
710
|
-
*
|
711
|
-
*
|
712
|
-
*
|
914
|
+
* const lineItems = await orderModuleService.updateLineItems({
|
915
|
+
* id: "123"
|
916
|
+
* }, {
|
917
|
+
* quantity: 2
|
918
|
+
* })
|
713
919
|
*
|
714
920
|
*/
|
715
|
-
|
716
|
-
createOrderChange(data: CreateOrderChangeDTO, sharedContext?: Context): Promise<OrderChangeDTO>;
|
921
|
+
updateLineItems(selector: Partial<FilterableOrderLineItemProps>, data: Partial<UpdateOrderLineItemDTO>, sharedContext?: Context): Promise<OrderLineItemDTO[]>;
|
717
922
|
/**
|
718
|
-
* This method
|
923
|
+
* This method updates an existing line item.
|
719
924
|
*
|
720
|
-
* @param {
|
925
|
+
* @param {string} lineId - The line items's ID.
|
926
|
+
* @param {Partial<UpdateOrderLineItemDTO>} data - The data to update in the line item.
|
721
927
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
722
|
-
* @returns {Promise<
|
928
|
+
* @returns {Promise<OrderLineItemDTO>} The updated line item.
|
723
929
|
*
|
724
930
|
* @example
|
725
|
-
*
|
726
|
-
*
|
931
|
+
* const lineItem = await orderModuleService.updateLineItems(
|
932
|
+
* "123",
|
933
|
+
* {
|
934
|
+
* quantity: 2
|
935
|
+
* }
|
936
|
+
* )
|
727
937
|
*
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
*
|
938
|
+
*/
|
939
|
+
updateLineItems(lineId: string, data: Partial<UpdateOrderLineItemDTO>, sharedContext?: Context): Promise<OrderLineItemDTO>;
|
940
|
+
/**
|
941
|
+
* This method deletes line items by their IDs.
|
732
942
|
*
|
733
|
-
*
|
734
|
-
*
|
943
|
+
* @param {string[]} itemIds - The IDs of the line items to delete.
|
944
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
945
|
+
* @returns {Promise<void>} Resolves when the line items are deleted successfully.
|
735
946
|
*
|
947
|
+
* @example
|
948
|
+
* await orderModuleService.deleteLineItems([
|
949
|
+
* "123", "321"
|
950
|
+
* ])
|
736
951
|
*/
|
737
|
-
|
952
|
+
deleteLineItems(itemIds: string[], sharedContext?: Context): Promise<void>;
|
738
953
|
/**
|
739
|
-
* This method
|
954
|
+
* This method deletes a line item by its ID.
|
740
955
|
*
|
741
|
-
* @param {
|
956
|
+
* @param {string} itemId - The line item's ID.
|
742
957
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
743
|
-
* @returns {Promise<
|
958
|
+
* @returns {Promise<void>} Resolves when the line item is deleted successfully.
|
744
959
|
*
|
745
960
|
* @example
|
746
|
-
*
|
747
|
-
* const result = await orderModuleService.createOrderChange({
|
748
|
-
* order_id: "order123",
|
749
|
-
* description: "Adding new item to the order"
|
750
|
-
* });
|
751
|
-
* ```
|
752
|
-
*
|
961
|
+
* await orderModuleService.deleteLineItems("123")
|
753
962
|
*/
|
754
|
-
|
755
|
-
updateOrderChanges(data: UpdateOrderChangeDTO, sharedContext?: Context): Promise<OrderChangeDTO>;
|
963
|
+
deleteLineItems(itemId: string, sharedContext?: Context): Promise<void>;
|
756
964
|
/**
|
757
|
-
* This method
|
965
|
+
* This method deletes line items that match the specified filters.
|
758
966
|
*
|
759
|
-
* @param {
|
967
|
+
* @param {Partial<FilterableOrderLineItemProps>} selector - The filters specifying which line items to delete.
|
760
968
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
761
|
-
* @returns {Promise<
|
969
|
+
* @returns {Promise<void>} Resolves when the line items are deleted successfully.
|
762
970
|
*
|
763
971
|
* @example
|
764
|
-
*
|
765
|
-
*
|
972
|
+
* await orderModuleService.deleteLineItems({
|
973
|
+
* id: ["123", "321"]
|
974
|
+
* })
|
975
|
+
*/
|
976
|
+
deleteLineItems(selector: Partial<FilterableOrderLineItemProps>, sharedContext?: Context): Promise<void>;
|
977
|
+
/**
|
978
|
+
* This method updates existing order items matching the specified filters.
|
766
979
|
*
|
767
|
-
*
|
768
|
-
*
|
769
|
-
*
|
770
|
-
* }
|
980
|
+
* @param {Partial<OrderItemDTO>} selector - The filters specifying which order items to update.
|
981
|
+
* @param {UpdateOrderItemDTO} data - The attributes to update in the order item.
|
982
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
983
|
+
* @returns {Promise<OrderItemDTO[]>} The updated order items.
|
771
984
|
*
|
772
|
-
*
|
773
|
-
*
|
985
|
+
* @example
|
986
|
+
* const orderItems = await orderModuleService.updateOrderItem({
|
987
|
+
* id: "123"
|
988
|
+
* }, {
|
989
|
+
* quantity: 2
|
990
|
+
* })
|
774
991
|
*
|
775
992
|
*/
|
776
|
-
|
993
|
+
updateOrderItem(selector: Partial<FilterableOrderShippingMethodProps>, data: UpdateOrderItemDTO, sharedContext?: Context): Promise<OrderItemDTO[]>;
|
777
994
|
/**
|
778
|
-
* This method updates
|
995
|
+
* This method updates an existing order item.
|
779
996
|
*
|
780
|
-
* @param {
|
997
|
+
* @param {string} orderItemId - The order item's ID.
|
998
|
+
* @param {Partial<UpdateOrderItemDTO>} data - The data to update in the order item.
|
781
999
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
782
|
-
* @returns {Promise<
|
1000
|
+
* @returns {Promise<OrderItemDTO>} The updated order item.
|
783
1001
|
*
|
784
1002
|
* @example
|
785
|
-
*
|
786
|
-
*
|
787
|
-
*
|
788
|
-
*
|
789
|
-
*
|
790
|
-
*
|
1003
|
+
* const orderItem = await orderModuleService.updateOrderItem(
|
1004
|
+
* "123",
|
1005
|
+
* {
|
1006
|
+
* quantity: 2
|
1007
|
+
* }
|
1008
|
+
* )
|
791
1009
|
*
|
792
1010
|
*/
|
793
|
-
|
1011
|
+
updateOrderItem(orderItemId: string, data: Partial<UpdateOrderItemDTO>, sharedContext?: Context): Promise<OrderItemDTO>;
|
794
1012
|
/**
|
795
|
-
* This method
|
1013
|
+
* This method updates existing order items. The items are identified either by their ID or the specified filters.
|
796
1014
|
*
|
797
|
-
* @param {string[]}
|
1015
|
+
* @param {string | Partial<OrderItemDTO> | UpdateOrderItemWithSelectorDTO[]} orderItemIdOrDataOrSelector - Either the ID of an order item, or the
|
1016
|
+
* filters specifying which order items to update.
|
1017
|
+
* @param {UpdateOrderItemDTO | Partial<UpdateOrderItemDTO>} data - The data to update.
|
798
1018
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
799
|
-
* @returns {Promise<
|
1019
|
+
* @returns {Promise<OrderItemDTO | OrderItemDTO[]>} The updated order items.
|
800
1020
|
*
|
801
1021
|
* @example
|
802
|
-
*
|
803
|
-
*
|
804
|
-
*
|
1022
|
+
* const orderItem = await orderModuleService.updateOrderItem(
|
1023
|
+
* "123",
|
1024
|
+
* {
|
1025
|
+
* quantity: 2
|
1026
|
+
* }
|
1027
|
+
* )
|
805
1028
|
*
|
806
1029
|
*/
|
807
|
-
|
1030
|
+
updateOrderItem(orderItemIdOrDataOrSelector: string | UpdateOrderItemWithSelectorDTO[] | Partial<OrderItemDTO>, data?: UpdateOrderItemDTO | Partial<UpdateOrderItemDTO>, sharedContext?: Context): Promise<OrderItemDTO[] | OrderItemDTO>;
|
808
1031
|
/**
|
809
|
-
* This method
|
1032
|
+
* This method retrieves a paginated list of shipping methods based on optional filters and configuration.
|
810
1033
|
*
|
811
|
-
* @param {
|
1034
|
+
* @param {FilterableOrderShippingMethodProps} filters - The filters to apply on the retrieved shipping method.
|
1035
|
+
* @param {FindConfig<OrderShippingMethodDTO>} config - The configurations determining how the shipping method is retrieved. Its properties, such as `select` or `relations`, accept the
|
1036
|
+
* attributes or relations associated with a shipping method.
|
812
1037
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
813
|
-
* @returns {Promise<
|
1038
|
+
* @returns {Promise<OrderShippingMethodDTO[]>} The list of shipping methods.
|
814
1039
|
*
|
815
1040
|
* @example
|
816
|
-
*
|
817
|
-
*
|
1041
|
+
* To retrieve a list of shipping methods using their IDs:
|
1042
|
+
*
|
1043
|
+
* ```ts
|
1044
|
+
* const shippingMethods = await orderModuleService.listShippingMethods({
|
1045
|
+
* id: ["123", "321"]
|
1046
|
+
* }, {})
|
1047
|
+
* ```
|
1048
|
+
*
|
1049
|
+
* To specify relations that should be retrieved within the shipping method:
|
1050
|
+
*
|
1051
|
+
* ```ts
|
1052
|
+
* const shippingMethods = await orderModuleService.listShippingMethods({
|
1053
|
+
* id: ["123", "321"]
|
1054
|
+
* }, {
|
1055
|
+
* relations: ["adjustments"]
|
1056
|
+
* })
|
1057
|
+
* ```
|
1058
|
+
*
|
1059
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
1060
|
+
*
|
1061
|
+
* ```ts
|
1062
|
+
* const shippingMethods = await orderModuleService.listShippingMethods({
|
1063
|
+
* id: ["123", "321"]
|
1064
|
+
* }, {
|
1065
|
+
* relations: ["adjustments"],
|
1066
|
+
* take: 20,
|
1067
|
+
* skip: 2
|
1068
|
+
* })
|
818
1069
|
* ```
|
819
1070
|
*
|
820
1071
|
*/
|
821
|
-
|
1072
|
+
listShippingMethods(filters: FilterableOrderShippingMethodProps, config: FindConfig<OrderShippingMethodDTO>, sharedContext?: Context): Promise<OrderShippingMethodDTO[]>;
|
822
1073
|
/**
|
823
|
-
* This method
|
1074
|
+
* This method creates a shipping method.
|
824
1075
|
*
|
825
|
-
* @param {
|
826
|
-
* @
|
827
|
-
* @returns {Promise<void>} Resolves when {summary}
|
1076
|
+
* @param {CreateOrderShippingMethodDTO} data - The shipping method to be created.
|
1077
|
+
* @returns {Promise<OrderShippingMethodDTO>} The created shipping method.
|
828
1078
|
*
|
829
1079
|
* @example
|
830
|
-
*
|
831
|
-
*
|
832
|
-
*
|
1080
|
+
* const shippingMethod = await orderModuleService.createShippingMethods({
|
1081
|
+
* name: "Express Shipping",
|
1082
|
+
* order_id: "123",
|
1083
|
+
* amount: 10
|
1084
|
+
* })
|
1085
|
+
*/
|
1086
|
+
createShippingMethods(data: CreateOrderShippingMethodDTO, sharedContext?: Context): Promise<OrderShippingMethodDTO>;
|
1087
|
+
/**
|
1088
|
+
* This method creates shipping methods.
|
833
1089
|
*
|
1090
|
+
* @param {CreateOrderShippingMethodDTO[]} data - The order shipping methods to be created.
|
1091
|
+
* @returns {Promise<OrderShippingMethodDTO[]>} The created orders.
|
1092
|
+
*
|
1093
|
+
* @example
|
1094
|
+
* const shippingMethods = await orderModuleService.createShippingMethods([{
|
1095
|
+
* name: "Express Shipping",
|
1096
|
+
* order_id: "123",
|
1097
|
+
* amount: 10
|
1098
|
+
* }])
|
834
1099
|
*/
|
835
|
-
|
1100
|
+
createShippingMethods(data: CreateOrderShippingMethodDTO[], sharedContext?: Context): Promise<OrderShippingMethodDTO[]>;
|
836
1101
|
/**
|
837
|
-
* This method
|
1102
|
+
* This method creates shipping methods for an order.
|
838
1103
|
*
|
839
|
-
* @param {string
|
1104
|
+
* @param {string} orderId - The order's ID.
|
1105
|
+
* @param {CreateOrderShippingMethodDTO[]} methods - The shipping methods to be created.
|
840
1106
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
841
|
-
* @returns {Promise<
|
1107
|
+
* @returns {Promise<OrderShippingMethodDTO[]>} The created shipping methods.
|
842
1108
|
*
|
843
1109
|
* @example
|
844
|
-
*
|
845
|
-
*
|
846
|
-
*
|
847
|
-
*
|
1110
|
+
* const shippingMethods = await orderModuleService.createShippingMethods(
|
1111
|
+
* "123",
|
1112
|
+
* [
|
1113
|
+
* {
|
1114
|
+
* name: "Express Shipping",
|
1115
|
+
* order_id: "123",
|
1116
|
+
* amount: 10
|
1117
|
+
* }
|
1118
|
+
* ]
|
1119
|
+
* )
|
848
1120
|
*/
|
849
|
-
|
850
|
-
previewOrderChange(orderId: string, sharedContext?: Context): Promise<OrderDTO>;
|
1121
|
+
createShippingMethods(orderId: string, methods: CreateOrderShippingMethodDTO[], sharedContext?: Context): Promise<OrderShippingMethodDTO[]>;
|
851
1122
|
/**
|
852
|
-
* This method
|
1123
|
+
* This method updates existing shipping methods. The shipping method IDs are specified in each shipping method object.
|
853
1124
|
*
|
854
|
-
* @param {
|
1125
|
+
* @param {UpdateOrderShippingMethodDTO[]} data - The attributes to update in the shipping methods.
|
855
1126
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
856
|
-
* @returns {Promise<
|
1127
|
+
* @returns {Promise<OrderShippingMethodDTO[]>} The updated shipping methods.
|
857
1128
|
*
|
858
1129
|
* @example
|
859
|
-
*
|
860
|
-
*
|
861
|
-
*
|
862
|
-
* }
|
1130
|
+
* const shippingMethods = await orderModuleService.updateShippingMethods([{
|
1131
|
+
* id: "123",
|
1132
|
+
* name: "Express Shipping"
|
1133
|
+
* }])
|
1134
|
+
*/
|
1135
|
+
updateShippingMethods(data: UpdateOrderShippingMethodDTO[], sharedContext?: Context): Promise<OrderShippingMethodDTO[]>;
|
1136
|
+
/**
|
1137
|
+
* This method updates an existing shipping method.
|
863
1138
|
*
|
864
|
-
*
|
865
|
-
*
|
1139
|
+
* @param {UpdateOrderShippingMethodDTO} data - The attributes to update in the shipping method.
|
1140
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1141
|
+
* @returns {Promise<OrderShippingMethodDTO>} The updated shipping method.
|
866
1142
|
*
|
1143
|
+
* @example
|
1144
|
+
* const shippingMethod = await orderModuleService.updateShippingMethods({
|
1145
|
+
* id: "123",
|
1146
|
+
* name: "Express Shipping"
|
1147
|
+
* })
|
867
1148
|
*/
|
868
|
-
|
1149
|
+
updateShippingMethods(data: UpdateOrderShippingMethodDTO, sharedContext?: Context): Promise<OrderShippingMethodDTO>;
|
869
1150
|
/**
|
870
|
-
* This method
|
1151
|
+
* This method deletes shipping methods by their IDs.
|
871
1152
|
*
|
872
|
-
* @param {
|
1153
|
+
* @param {string[]} methodIds - The list of shipping methods.
|
873
1154
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
874
|
-
* @returns {Promise<void>} Resolves when
|
1155
|
+
* @returns {Promise<void>} Resolves when the shipping methods are deleted successfully.
|
875
1156
|
*
|
876
1157
|
* @example
|
877
|
-
*
|
878
|
-
*
|
879
|
-
*
|
880
|
-
*
|
1158
|
+
* await orderModuleService.deleteShippingMethods([
|
1159
|
+
* "123", "321"
|
1160
|
+
* ])
|
881
1161
|
*/
|
882
|
-
|
1162
|
+
deleteShippingMethods(methodIds: string[], sharedContext?: Context): Promise<void>;
|
883
1163
|
/**
|
884
|
-
* This method
|
1164
|
+
* This method deletes a shipping method by its ID.
|
885
1165
|
*
|
886
|
-
* @param {string}
|
1166
|
+
* @param {string} methodId - The shipping method's ID.
|
887
1167
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
888
|
-
* @returns {Promise<
|
1168
|
+
* @returns {Promise<void>} Resolves when the shipping method is deleted successfully.
|
889
1169
|
*
|
890
1170
|
* @example
|
891
|
-
*
|
892
|
-
* await orderModuleService.confirmOrderChange("123456789");
|
893
|
-
* ```
|
894
|
-
*
|
1171
|
+
* await orderModuleService.deleteShippingMethods("123")
|
895
1172
|
*/
|
896
|
-
|
1173
|
+
deleteShippingMethods(methodId: string, sharedContext?: Context): Promise<void>;
|
897
1174
|
/**
|
898
|
-
* This method
|
1175
|
+
* This method deletes shipping methods matching the specified filters.
|
899
1176
|
*
|
900
|
-
* @param {
|
1177
|
+
* @param {Partial<FilterableOrderShippingMethodProps>} selector - The filters specifying the shipping methods to delete.
|
901
1178
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
902
|
-
* @returns {Promise<void>} Resolves when
|
1179
|
+
* @returns {Promise<void>} Resolves when the shipping methods are deleted successfully.
|
903
1180
|
*
|
904
1181
|
* @example
|
905
|
-
*
|
906
|
-
*
|
907
|
-
*
|
908
|
-
*
|
1182
|
+
* await orderModuleService.deleteShippingMethods({
|
1183
|
+
* id: "123"
|
1184
|
+
* })
|
909
1185
|
*/
|
910
|
-
|
1186
|
+
deleteShippingMethods(selector: Partial<FilterableOrderShippingMethodProps>, sharedContext?: Context): Promise<void>;
|
911
1187
|
/**
|
912
|
-
* This method
|
1188
|
+
* This method retrieves a paginated list of line item adjustments based on optional filters and configuration.
|
913
1189
|
*
|
914
|
-
* @param {
|
1190
|
+
* @param {FilterableOrderLineItemAdjustmentProps} filters - The filters to apply on the retrieved line item adjustment.
|
1191
|
+
* @param {FindConfig<OrderLineItemAdjustmentDTO>} config - The configurations determining how the line item adjustment is retrieved. Its properties, such as `select` or `relations`, accept the
|
1192
|
+
* attributes or relations associated with a line item adjustment.
|
915
1193
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
916
|
-
* @returns {Promise<
|
1194
|
+
* @returns {Promise<OrderLineItemAdjustmentDTO[]>} The list of line item adjustments.
|
917
1195
|
*
|
918
1196
|
* @example
|
919
|
-
*
|
920
|
-
*
|
921
|
-
*
|
922
|
-
*
|
1197
|
+
* To retrieve a list of line item adjustments using their IDs:
|
1198
|
+
*
|
1199
|
+
* ```ts
|
1200
|
+
* const lineItemAdjustment = await orderModuleService.listLineItemAdjustments({
|
1201
|
+
* id: ["123", "321"]
|
1202
|
+
* })
|
1203
|
+
* ```
|
1204
|
+
*
|
1205
|
+
* To specify relations that should be retrieved within the line item adjustment:
|
1206
|
+
*
|
1207
|
+
* ```ts
|
1208
|
+
* const lineItemAdjustment = await orderModuleService.listLineItemAdjustments({
|
1209
|
+
* id: ["123", "321"]
|
1210
|
+
* }, {
|
1211
|
+
* relations: ["item"]
|
1212
|
+
* })
|
1213
|
+
* ```
|
1214
|
+
*
|
1215
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
1216
|
+
*
|
1217
|
+
* ```ts
|
1218
|
+
* const lineItemAdjustment = await orderModuleService.listLineItemAdjustments({
|
1219
|
+
* id: ["123", "321"]
|
1220
|
+
* }, {
|
1221
|
+
* relations: ["item"],
|
1222
|
+
* take: 20,
|
1223
|
+
* skip: 2
|
1224
|
+
* })
|
923
1225
|
* ```
|
924
1226
|
*
|
925
1227
|
*/
|
926
|
-
|
1228
|
+
listLineItemAdjustments(filters: FilterableOrderLineItemAdjustmentProps, config?: FindConfig<OrderLineItemAdjustmentDTO>, sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
927
1229
|
/**
|
928
|
-
* This method
|
1230
|
+
* This method creates line item adjustments.
|
929
1231
|
*
|
930
|
-
* @param {
|
931
|
-
* @
|
932
|
-
* @returns {Promise<void>} Resolves when {summary}
|
1232
|
+
* @param {CreateOrderAdjustmentDTO[]} data - The line item adjustments to be created.
|
1233
|
+
* @returns {Promise<OrderLineItemAdjustmentDTO[]>} The created line item adjustments.
|
933
1234
|
*
|
934
1235
|
* @example
|
935
|
-
*
|
936
|
-
*
|
937
|
-
*
|
938
|
-
|
1236
|
+
* const lineItemAdjustments = await orderModuleService.createLineItemAdjustments([{
|
1237
|
+
* amount: 5
|
1238
|
+
* }])
|
1239
|
+
*/
|
1240
|
+
createLineItemAdjustments(data: CreateOrderAdjustmentDTO[], sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
1241
|
+
/**
|
1242
|
+
* This method creates a line item adjustment.
|
939
1243
|
*
|
940
|
-
*
|
941
|
-
*
|
1244
|
+
* @param {CreateOrderAdjustmentDTO} data - The line-item adjustment to be created.
|
1245
|
+
* @returns {Promise<OrderLineItemAdjustmentDTO[]>} The created line-item adjustment.
|
942
1246
|
*
|
1247
|
+
* @example
|
1248
|
+
* const lineItemAdjustment = await orderModuleService.createLineItemAdjustments({
|
1249
|
+
* amount: 5
|
1250
|
+
* })
|
943
1251
|
*/
|
944
|
-
|
1252
|
+
createLineItemAdjustments(data: CreateOrderAdjustmentDTO, sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
945
1253
|
/**
|
946
|
-
* This method
|
1254
|
+
* This method creates line item adjustments for an order.
|
947
1255
|
*
|
948
|
-
* @param {string}
|
949
|
-
* @param {
|
950
|
-
* @returns {Promise<
|
1256
|
+
* @param {string} orderId - The order's ID.
|
1257
|
+
* @param {CreateOrderAdjustmentDTO[]} data - The line-item adjustments to be created.
|
1258
|
+
* @returns {Promise<OrderLineItemAdjustmentDTO[]>} The created line item adjustments.
|
951
1259
|
*
|
952
1260
|
* @example
|
953
|
-
*
|
954
|
-
*
|
955
|
-
*
|
956
|
-
*
|
1261
|
+
* const lineItemAdjustments = await orderModuleService.createLineItemAdjustments(
|
1262
|
+
* "123",
|
1263
|
+
* [{
|
1264
|
+
* amount: 5
|
1265
|
+
* }]
|
1266
|
+
* )
|
957
1267
|
*/
|
958
|
-
|
1268
|
+
createLineItemAdjustments(orderId: string, data: CreateOrderAdjustmentDTO[], sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
959
1269
|
/**
|
960
|
-
* This method
|
1270
|
+
* This method sets the line item adjustments of an order.
|
961
1271
|
*
|
962
|
-
* @param {string
|
1272
|
+
* @param {string} orderId - The order's ID.
|
1273
|
+
* @param {UpsertOrderLineItemAdjustmentDTO[]} data - The line item adjustments to create or update. If the `id` property is provided
|
1274
|
+
* in an object, it means an existing line item adjustment will be updated. Otherwise, a new one is created.
|
963
1275
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
964
|
-
* @returns {Promise<
|
1276
|
+
* @returns {Promise<OrderLineItemAdjustmentDTO[]>} The order's line item adjustments.
|
965
1277
|
*
|
966
1278
|
* @example
|
967
|
-
*
|
968
|
-
*
|
969
|
-
*
|
1279
|
+
* const lineItemAdjustments = await orderModuleService.setLineItemAdjustments(
|
1280
|
+
* "123",
|
1281
|
+
* [
|
1282
|
+
* {
|
1283
|
+
* item_id: "1234",
|
1284
|
+
* amount: 10
|
1285
|
+
* },
|
1286
|
+
* {
|
1287
|
+
* id: "123",
|
1288
|
+
* item_id: "4321",
|
1289
|
+
* amount: 20
|
1290
|
+
* }
|
1291
|
+
* ]
|
1292
|
+
* )
|
970
1293
|
*
|
971
1294
|
*/
|
972
|
-
|
1295
|
+
setLineItemAdjustments(orderId: string, data: UpsertOrderLineItemAdjustmentDTO[], sharedContext?: Context): Promise<OrderLineItemAdjustmentDTO[]>;
|
973
1296
|
/**
|
974
|
-
* This method
|
1297
|
+
* This method deletes a line item adjustment by its ID.
|
975
1298
|
*
|
976
|
-
* @param {
|
1299
|
+
* @param {string[]} adjustmentIds - The IDs of line item adjustments.
|
977
1300
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
978
|
-
* @returns {Promise<void>} Resolves when
|
1301
|
+
* @returns {Promise<void>} Resolves when the line item adjustments are deleted successfully.
|
979
1302
|
*
|
980
1303
|
* @example
|
981
|
-
*
|
982
|
-
*
|
983
|
-
*
|
984
|
-
* });
|
985
|
-
* ```
|
986
|
-
*
|
1304
|
+
* await orderModuleService.deleteLineItemAdjustments([
|
1305
|
+
* "123", "321"
|
1306
|
+
* ])
|
987
1307
|
*/
|
988
|
-
|
1308
|
+
deleteLineItemAdjustments(adjustmentIds: string[], sharedContext?: Context): Promise<void>;
|
989
1309
|
/**
|
990
|
-
* This method
|
1310
|
+
* This method deletes a line item adjustment by its ID.
|
991
1311
|
*
|
992
|
-
* @param {
|
1312
|
+
* @param {string} adjustmentId - The ID of the line item adjustment.
|
993
1313
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
994
|
-
* @returns {Promise<void>} Resolves when
|
1314
|
+
* @returns {Promise<void>} Resolves when the line item adjustment is deleted.
|
995
1315
|
*
|
996
1316
|
* @example
|
997
|
-
*
|
998
|
-
* await orderModuleService.declineOrderChange([
|
999
|
-
* {
|
1000
|
-
* id: "12345",
|
1001
|
-
* }
|
1002
|
-
* ]);
|
1003
|
-
* ```
|
1004
|
-
*
|
1317
|
+
* await orderModuleService.deleteLineItemAdjustments("123")
|
1005
1318
|
*/
|
1006
|
-
|
1007
|
-
softDeleteOrderChanges<TReturnableLinkableKeys extends string = string>(orderChangeId: string | string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
1008
|
-
restoreOrderChanges<TReturnableLinkableKeys extends string = string>(orderChangeId: string | string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
1319
|
+
deleteLineItemAdjustments(adjustmentId: string, sharedContext?: Context): Promise<void>;
|
1009
1320
|
/**
|
1010
|
-
* This method
|
1321
|
+
* This method deletes line item adjustments matching the specified filters.
|
1011
1322
|
*
|
1012
|
-
* @param {
|
1323
|
+
* @param {Partial<OrderLineItemAdjustmentDTO>} selector - The filters specifying which line item adjustments to delete.
|
1013
1324
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1014
|
-
* @returns {
|
1325
|
+
* @returns {Promise<void>} Resolves when the line item adjustments are deleted successfully.
|
1015
1326
|
*
|
1016
1327
|
* @example
|
1017
|
-
*
|
1018
|
-
*
|
1019
|
-
*
|
1020
|
-
*
|
1328
|
+
* await orderModuleService.deleteLineItemAdjustments({
|
1329
|
+
* id: "123"
|
1330
|
+
* })
|
1021
1331
|
*/
|
1022
|
-
|
1332
|
+
deleteLineItemAdjustments(selector: Partial<OrderLineItemAdjustmentDTO>, sharedContext?: Context): Promise<void>;
|
1023
1333
|
/**
|
1024
|
-
* This method retrieves a paginated list of
|
1334
|
+
* This method retrieves a paginated list of shipping method adjustments based on optional filters and configuration.
|
1025
1335
|
*
|
1026
|
-
* @param {
|
1027
|
-
* @param {FindConfig<
|
1028
|
-
* attributes or relations associated with a
|
1336
|
+
* @param {FilterableOrderShippingMethodAdjustmentProps} filters - The filters to apply on the retrieved shipping method adjustment.
|
1337
|
+
* @param {FindConfig<OrderShippingMethodAdjustmentDTO>} config - The configurations determining how the shipping method adjustment is retrieved. Its properties, such as `select` or `relations`, accept the
|
1338
|
+
* attributes or relations associated with a shipping method adjustment.
|
1029
1339
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1030
|
-
* @returns {Promise<
|
1340
|
+
* @returns {Promise<OrderShippingMethodAdjustmentDTO[]>} The list of shipping method adjustments.
|
1031
1341
|
*
|
1032
1342
|
* @example
|
1033
|
-
*
|
1034
|
-
*
|
1343
|
+
* To retrieve a list of shipping method adjustments using their IDs:
|
1344
|
+
*
|
1345
|
+
* ```ts
|
1346
|
+
* const shippingMethodAdjustments = await orderModuleService
|
1347
|
+
* .listShippingMethodAdjustments({
|
1348
|
+
* id: ["123", "321"]
|
1349
|
+
* })
|
1350
|
+
* ```
|
1351
|
+
*
|
1352
|
+
* To specify relations that should be retrieved within the shipping method adjustment:
|
1353
|
+
*
|
1354
|
+
* ```ts
|
1355
|
+
* const shippingMethodAdjustments = await orderModuleService
|
1356
|
+
* .listShippingMethodAdjustments({
|
1357
|
+
* id: ["123", "321"]
|
1358
|
+
* }, {
|
1359
|
+
* relations: ["shipping_method"]
|
1360
|
+
* })
|
1361
|
+
* ```
|
1362
|
+
*
|
1363
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
1364
|
+
*
|
1365
|
+
* ```ts
|
1366
|
+
* const shippingMethodAdjustments = await orderModuleService
|
1367
|
+
* .listShippingMethodAdjustments({
|
1368
|
+
* id: ["123", "321"]
|
1369
|
+
* }, {
|
1370
|
+
* relations: ["shipping_method"],
|
1371
|
+
* take: 20,
|
1372
|
+
* skip: 2
|
1373
|
+
* })
|
1035
1374
|
* ```
|
1036
1375
|
*
|
1037
1376
|
*/
|
1038
|
-
|
1377
|
+
listShippingMethodAdjustments(filters: FilterableOrderShippingMethodAdjustmentProps, config?: FindConfig<OrderShippingMethodAdjustmentDTO>, sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO[]>;
|
1039
1378
|
/**
|
1040
|
-
* This method
|
1379
|
+
* This method creates shipping method adjustments.
|
1041
1380
|
*
|
1042
|
-
* @param {
|
1043
|
-
* @
|
1044
|
-
* attributes or relations associated with a order.
|
1045
|
-
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1046
|
-
* @returns {Promise<OrderChangeActionDTO>} The retrieved {return type}(s).
|
1381
|
+
* @param {CreateOrderShippingMethodAdjustmentDTO[]} data - The order shipping method adjustments to be created.
|
1382
|
+
* @returns {Promise<OrderShippingMethodAdjustmentDTO[]>} The created shipping method adjustments.
|
1047
1383
|
*
|
1048
1384
|
* @example
|
1049
|
-
*
|
1050
|
-
*
|
1051
|
-
*
|
1385
|
+
* const shippingMethodAdjustments = await orderModuleService
|
1386
|
+
* .createShippingMethodAdjustments([
|
1387
|
+
* {
|
1388
|
+
* shipping_method_id: "123",
|
1389
|
+
* code: "50OFF",
|
1390
|
+
* amount: 5
|
1391
|
+
* }
|
1392
|
+
* ])
|
1393
|
+
*/
|
1394
|
+
createShippingMethodAdjustments(data: CreateOrderShippingMethodAdjustmentDTO[], sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO[]>;
|
1395
|
+
/**
|
1396
|
+
* This method creates a shipping method adjustment.
|
1052
1397
|
*
|
1398
|
+
* @param {CreateOrderShippingMethodAdjustmentDTO} data - The shipping method adjustment to be created.
|
1399
|
+
* @returns {Promise<OrderShippingMethodAdjustmentDTO>} The created shipping method adjustment.
|
1400
|
+
*
|
1401
|
+
* @example
|
1402
|
+
* const shippingMethodAdjustment = await orderModuleService
|
1403
|
+
* .createShippingMethodAdjustments({
|
1404
|
+
* shipping_method_id: "123",
|
1405
|
+
* code: "50OFF",
|
1406
|
+
* amount: 5
|
1407
|
+
* })
|
1053
1408
|
*/
|
1054
|
-
|
1055
|
-
updateOrderChangeActions(data: UpdateOrderChangeActionDTO, sharedContext?: Context): Promise<OrderChangeActionDTO>;
|
1409
|
+
createShippingMethodAdjustments(data: CreateOrderShippingMethodAdjustmentDTO, sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO>;
|
1056
1410
|
/**
|
1057
|
-
* This method
|
1411
|
+
* This method creates shipping method adjustments for an order.
|
1058
1412
|
*
|
1059
|
-
* @param {
|
1413
|
+
* @param {string} orderId - The order's ID.
|
1414
|
+
* @param {CreateOrderShippingMethodAdjustmentDTO[]} data - The order shipping method adjustments to be created.
|
1060
1415
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1061
|
-
* @returns {Promise<
|
1416
|
+
* @returns {Promise<OrderShippingMethodAdjustmentDTO[]>} The created shipping method adjustments.
|
1062
1417
|
*
|
1063
1418
|
* @example
|
1064
|
-
*
|
1065
|
-
*
|
1419
|
+
* const shippingMethodAdjustments = await orderModuleService
|
1420
|
+
* .createShippingMethodAdjustments(
|
1421
|
+
* "123",
|
1422
|
+
* [{
|
1423
|
+
* shipping_method_id: "123",
|
1424
|
+
* code: "50OFF",
|
1425
|
+
* amount: 5
|
1426
|
+
* }]
|
1427
|
+
* )
|
1428
|
+
*/
|
1429
|
+
createShippingMethodAdjustments(orderId: string, data: CreateOrderShippingMethodAdjustmentDTO[], sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO[]>;
|
1430
|
+
/**
|
1431
|
+
* This method sets the shipping method adjustments of an order.
|
1066
1432
|
*
|
1067
|
-
*
|
1068
|
-
*
|
1069
|
-
*
|
1070
|
-
* }
|
1433
|
+
* @param {string} orderId - The order's ID.
|
1434
|
+
* @param {(CreateOrderShippingMethodAdjustmentDTO | UpdateOrderShippingMethodAdjustmentDTO)[]} data - The shipping method adjustments to be created
|
1435
|
+
* or updated. If an adjustment object has an `id` property, it's updated. Otherwise, a new adjustment is created.
|
1436
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1437
|
+
* @returns {Promise<OrderShippingMethodAdjustmentDTO[]>} The order's shipping method adjustments.
|
1071
1438
|
*
|
1072
|
-
*
|
1073
|
-
*
|
1439
|
+
* @example
|
1440
|
+
* const shippingMethodAdjustments = await orderModuleService
|
1441
|
+
* .setShippingMethodAdjustments(
|
1442
|
+
* "123",
|
1443
|
+
* [
|
1444
|
+
* {
|
1445
|
+
* shipping_method_id: "123",
|
1446
|
+
* code: "50OFF",
|
1447
|
+
* amount: 5
|
1448
|
+
* },
|
1449
|
+
* {
|
1450
|
+
* id: "321",
|
1451
|
+
* amount: 5
|
1452
|
+
* }
|
1453
|
+
* ]
|
1454
|
+
* )
|
1074
1455
|
*
|
1075
1456
|
*/
|
1076
|
-
|
1457
|
+
setShippingMethodAdjustments(orderId: string, data: (CreateOrderShippingMethodAdjustmentDTO | UpdateOrderShippingMethodAdjustmentDTO)[], sharedContext?: Context): Promise<OrderShippingMethodAdjustmentDTO[]>;
|
1077
1458
|
/**
|
1078
|
-
* This method
|
1459
|
+
* This method deletes shipping method adjustments by their IDs.
|
1079
1460
|
*
|
1080
|
-
* @param {
|
1461
|
+
* @param {string[]} adjustmentIds - The IDs of shipping method adjustments.
|
1081
1462
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1082
|
-
* @returns {Promise<
|
1463
|
+
* @returns {Promise<void>} Resolves when the shipping method adjustments are deleted successfully.
|
1083
1464
|
*
|
1084
1465
|
* @example
|
1085
|
-
*
|
1086
|
-
*
|
1087
|
-
*
|
1088
|
-
* ...
|
1089
|
-
* });
|
1090
|
-
* ```
|
1091
|
-
*
|
1466
|
+
* await orderModuleService.deleteShippingMethodAdjustments([
|
1467
|
+
* "123", "321"
|
1468
|
+
* ])
|
1092
1469
|
*/
|
1093
|
-
|
1094
|
-
addOrderAction(data: CreateOrderChangeActionDTO, sharedContext?: Context): Promise<OrderChangeActionDTO>;
|
1095
|
-
addOrderAction(data: CreateOrderChangeActionDTO[], sharedContext?: Context): Promise<OrderChangeActionDTO[]>;
|
1470
|
+
deleteShippingMethodAdjustments(adjustmentIds: string[], sharedContext?: Context): Promise<void>;
|
1096
1471
|
/**
|
1097
|
-
* This method deletes
|
1472
|
+
* This method deletes a shipping method adjustment by its ID.
|
1098
1473
|
*
|
1099
|
-
* @param {string
|
1474
|
+
* @param {string} adjustmentId - The adjustment's ID.
|
1100
1475
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1101
|
-
* @returns {Promise<void>} Resolves when
|
1476
|
+
* @returns {Promise<void>} Resolves when the shipping method adjustment is deleted successfully
|
1102
1477
|
*
|
1103
1478
|
* @example
|
1104
|
-
*
|
1105
|
-
* await orderModuleService.deleteOrderActions(["12345abc", "67890def"]);
|
1106
|
-
* ```
|
1107
|
-
*
|
1479
|
+
* await orderModuleService.deleteShippingMethodAdjustments("123")
|
1108
1480
|
*/
|
1109
|
-
|
1481
|
+
deleteShippingMethodAdjustments(adjustmentId: string, sharedContext?: Context): Promise<void>;
|
1110
1482
|
/**
|
1111
|
-
* This method deletes
|
1483
|
+
* This method deletes shipping method adjustments matching the specified filters.
|
1112
1484
|
*
|
1113
|
-
* @param {
|
1485
|
+
* @param {Partial<OrderShippingMethodAdjustmentDTO>} selector - The filters specifying which shipping method adjustments to delete.
|
1114
1486
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1115
|
-
* @returns {Promise<void>} Resolves when
|
1487
|
+
* @returns {Promise<void>} Resolves when the shipping method adjustments are deleted.
|
1116
1488
|
*
|
1117
1489
|
* @example
|
1118
|
-
*
|
1119
|
-
*
|
1120
|
-
*
|
1121
|
-
*
|
1490
|
+
* await orderModuleService.deleteShippingMethodAdjustments({
|
1491
|
+
* id: "123"
|
1492
|
+
* })
|
1122
1493
|
*/
|
1123
|
-
|
1494
|
+
deleteShippingMethodAdjustments(selector: Partial<OrderShippingMethodAdjustmentDTO>, sharedContext?: Context): Promise<void>;
|
1124
1495
|
/**
|
1125
|
-
* This method
|
1496
|
+
* This method retrieves a paginated list of line item taxes based on optional filters and configuration.
|
1126
1497
|
*
|
1127
|
-
* @param {
|
1498
|
+
* @param {FilterableOrderLineItemTaxLineProps} filters - The filters to apply on the retrieved line item tax line.
|
1499
|
+
* @param {FindConfig<OrderLineItemTaxLineDTO>} config - The configurations determining how the line item tax line is retrieved. Its properties, such as `select` or `relations`, accept the
|
1500
|
+
* attributes or relations associated with a line item tax line.
|
1128
1501
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1129
|
-
* @returns {Promise<
|
1502
|
+
* @returns {Promise<OrderLineItemTaxLineDTO[]>} The list of line item taxes.
|
1130
1503
|
*
|
1131
1504
|
* @example
|
1132
|
-
*
|
1133
|
-
*
|
1505
|
+
* To retrieve a list of line item tax lines using their IDs:
|
1506
|
+
*
|
1507
|
+
* ```ts
|
1508
|
+
* const lineItemTaxLines = await orderModuleService
|
1509
|
+
* .listLineItemTaxLines({
|
1510
|
+
* id: ["123", "321"]
|
1511
|
+
* })
|
1134
1512
|
* ```
|
1135
1513
|
*
|
1136
|
-
|
1514
|
+
* To specify relations that should be retrieved within the line item tax line:
|
1515
|
+
*
|
1516
|
+
* ```ts
|
1517
|
+
* const lineItemTaxLines = await orderModuleService
|
1518
|
+
* .listLineItemTaxLines({
|
1519
|
+
* id: ["123", "321"]
|
1520
|
+
* }, {
|
1521
|
+
* relations: ["item"]
|
1522
|
+
* })
|
1523
|
+
* ```
|
1524
|
+
*
|
1525
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
1526
|
+
*
|
1527
|
+
* ```ts
|
1528
|
+
* const lineItemTaxLines = await orderModuleService
|
1529
|
+
* .listLineItemTaxLines({
|
1530
|
+
* id: ["123", "321"]
|
1531
|
+
* }, {
|
1532
|
+
* relations: ["item"],
|
1533
|
+
* take: 20,
|
1534
|
+
* skip: 2
|
1535
|
+
* })
|
1536
|
+
* ```
|
1537
|
+
*
|
1538
|
+
*/
|
1539
|
+
listLineItemTaxLines(filters: FilterableOrderLineItemTaxLineProps, config?: FindConfig<OrderLineItemTaxLineDTO>, sharedContext?: Context): Promise<OrderLineItemTaxLineDTO[]>;
|
1540
|
+
/**
|
1541
|
+
* This method creates line item tax lines.
|
1542
|
+
*
|
1543
|
+
* @param {CreateOrderLineItemTaxLineDTO[]} taxLines - The line item tax lines to be created.
|
1544
|
+
* @returns {Promise<OrderLineItemTaxLineDTO[]>} The created line item tax lines.
|
1545
|
+
*
|
1546
|
+
* @example
|
1547
|
+
* const lineItemTaxLines = await orderModuleService
|
1548
|
+
* .createLineItemTaxLines([
|
1549
|
+
* {
|
1550
|
+
* code: "123",
|
1551
|
+
* rate: 2
|
1552
|
+
* }
|
1553
|
+
* ])
|
1554
|
+
*/
|
1555
|
+
createLineItemTaxLines(taxLines: CreateOrderLineItemTaxLineDTO[], sharedContext?: Context): Promise<OrderLineItemTaxLineDTO[]>;
|
1556
|
+
/**
|
1557
|
+
* This method creates a line item tax line.
|
1558
|
+
*
|
1559
|
+
* @param {CreateOrderLineItemTaxLineDTO} taxLine - The line item tax line to be created.
|
1560
|
+
* @returns {Promise<OrderLineItemTaxLineDTO>} The created line item tax line.
|
1561
|
+
*
|
1562
|
+
* @example
|
1563
|
+
* const lineItemTaxLines = await orderModuleService
|
1564
|
+
* .createLineItemTaxLines({
|
1565
|
+
* code: "123",
|
1566
|
+
* rate: 2
|
1567
|
+
* })
|
1568
|
+
*/
|
1569
|
+
createLineItemTaxLines(taxLine: CreateOrderLineItemTaxLineDTO, sharedContext?: Context): Promise<OrderLineItemTaxLineDTO>;
|
1570
|
+
/**
|
1571
|
+
* This method creates line item tax lines for an order.
|
1572
|
+
*
|
1573
|
+
* @param {string} orderId - The order's ID.
|
1574
|
+
* @param {CreateOrderLineItemTaxLineDTO | CreateOrderLineItemTaxLineDTO[]} taxLines - The line item tax lines to be created.
|
1575
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1576
|
+
* @returns {Promise<OrderLineItemTaxLineDTO[]>} The created line item tax line.
|
1577
|
+
*
|
1578
|
+
* @example
|
1579
|
+
* const lineItemTaxLines = await orderModuleService
|
1580
|
+
* .createLineItemTaxLines(
|
1581
|
+
* "123",
|
1582
|
+
* [
|
1583
|
+
* {
|
1584
|
+
* code: "123",
|
1585
|
+
* rate: 2
|
1586
|
+
* }
|
1587
|
+
* ]
|
1588
|
+
* )
|
1589
|
+
*/
|
1590
|
+
createLineItemTaxLines(orderId: string, taxLines: CreateOrderLineItemTaxLineDTO[] | CreateOrderLineItemTaxLineDTO, sharedContext?: Context): Promise<OrderLineItemTaxLineDTO[]>;
|
1591
|
+
/**
|
1592
|
+
* This method sets the line item tax lines of an order.
|
1593
|
+
*
|
1594
|
+
* @param {string} orderId - The order's ID.
|
1595
|
+
* @param {(CreateOrderLineItemTaxLineDTO | UpdateOrderLineItemTaxLineDTO)[]} taxLines - The line item tax lines to create or update. If the
|
1596
|
+
* tax line object has an `id` property, it'll be updated. Otherwise, a tax line is created.
|
1597
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1598
|
+
* @returns {Promise<OrderLineItemTaxLineDTO[]>} The order's line item tax lines.
|
1599
|
+
*
|
1600
|
+
* @example
|
1601
|
+
* const lineItemTaxLines = await orderModuleService
|
1602
|
+
* .setLineItemTaxLines(
|
1603
|
+
* "123",
|
1604
|
+
* [
|
1605
|
+
* {
|
1606
|
+
* code: "123",
|
1607
|
+
* rate: 2
|
1608
|
+
* }
|
1609
|
+
* ]
|
1610
|
+
* )
|
1611
|
+
*
|
1612
|
+
*/
|
1613
|
+
setLineItemTaxLines(orderId: string, taxLines: (CreateOrderLineItemTaxLineDTO | UpdateOrderLineItemTaxLineDTO)[], sharedContext?: Context): Promise<OrderLineItemTaxLineDTO[]>;
|
1614
|
+
/**
|
1615
|
+
* This method deletes line item tax lines by their IDs.
|
1616
|
+
*
|
1617
|
+
* @param {string[]} taxLineIds - The IDs of the line item tax lines.
|
1618
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1619
|
+
* @returns {Promise<void>} Resolves when the line item tax lines are deleted successfully.
|
1620
|
+
*
|
1621
|
+
* @example
|
1622
|
+
* await orderModuleService.deleteLineItemTaxLines([
|
1623
|
+
* "123", "321"
|
1624
|
+
* ])
|
1625
|
+
*/
|
1626
|
+
deleteLineItemTaxLines(taxLineIds: string[], sharedContext?: Context): Promise<void>;
|
1627
|
+
/**
|
1628
|
+
* This method deletes a line item tax line by its ID.
|
1629
|
+
*
|
1630
|
+
* @param {string} taxLineId - The ID of the line item tax line.
|
1631
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1632
|
+
* @returns {Promise<void>} Resolves when the line item tax line is deleted successfully.
|
1633
|
+
*
|
1634
|
+
* @example
|
1635
|
+
* await orderModuleService.deleteLineItemTaxLines("123")
|
1636
|
+
*/
|
1637
|
+
deleteLineItemTaxLines(taxLineId: string, sharedContext?: Context): Promise<void>;
|
1638
|
+
/**
|
1639
|
+
* This method deletes line item tax lines matching the specified filters.
|
1640
|
+
*
|
1641
|
+
* @param {FilterableOrderLineItemTaxLineProps} selector - The filters specifying which line item tax lines to update.
|
1642
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1643
|
+
* @returns {Promise<void>} Resolves when the line item tax lines are deleted successfully.
|
1644
|
+
*
|
1645
|
+
* @example
|
1646
|
+
* await orderModuleService.deleteLineItemTaxLines({
|
1647
|
+
* id: ["123", "321"]
|
1648
|
+
* })
|
1649
|
+
*/
|
1650
|
+
deleteLineItemTaxLines(selector: FilterableOrderLineItemTaxLineProps, sharedContext?: Context): Promise<void>;
|
1651
|
+
/**
|
1652
|
+
* This method retrieves a paginated list of shipping method tax lines based on optional filters and configuration.
|
1653
|
+
*
|
1654
|
+
* @param {FilterableOrderShippingMethodTaxLineProps} filters - The filters to apply on the retrieved shipping method tax line.
|
1655
|
+
* @param {FindConfig<OrderShippingMethodTaxLineDTO>} config - The configurations determining how the shipping method tax line is retrieved. Its properties, such as `select` or `relations`, accept the
|
1656
|
+
* attributes or relations associated with a shipping method tax line.
|
1657
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1658
|
+
* @returns {Promise<OrderShippingMethodTaxLineDTO[]>} The list of shipping method tax lines.
|
1659
|
+
*
|
1660
|
+
* @example
|
1661
|
+
* To retrieve a list of shipping method tax lines using their IDs:
|
1662
|
+
*
|
1663
|
+
* ```ts
|
1664
|
+
* const shippingMethodTaxLines = await orderModuleService
|
1665
|
+
* .listShippingMethodTaxLines({
|
1666
|
+
* id: ["123", "321"]
|
1667
|
+
* })
|
1668
|
+
* ```
|
1669
|
+
*
|
1670
|
+
* To specify relations that should be retrieved within the shipping method tax line:
|
1671
|
+
*
|
1672
|
+
* ```ts
|
1673
|
+
* const shippingMethodTaxLines = await orderModuleService
|
1674
|
+
* .listShippingMethodTaxLines({
|
1675
|
+
* id: ["123", "321"]
|
1676
|
+
* }, {
|
1677
|
+
* relations: ["shipping_method"]
|
1678
|
+
* })
|
1679
|
+
* ```
|
1680
|
+
*
|
1681
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
1682
|
+
*
|
1683
|
+
* ```ts
|
1684
|
+
* const shippingMethodTaxLines = await orderModuleService
|
1685
|
+
* .listShippingMethodTaxLines({
|
1686
|
+
* id: ["123", "321"]
|
1687
|
+
* }, {
|
1688
|
+
* relations: ["shipping_method"],
|
1689
|
+
* take: 20,
|
1690
|
+
* skip: 2
|
1691
|
+
* })
|
1692
|
+
* ```
|
1693
|
+
*
|
1694
|
+
*/
|
1695
|
+
listShippingMethodTaxLines(filters: FilterableOrderShippingMethodTaxLineProps, config?: FindConfig<OrderShippingMethodTaxLineDTO>, sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO[]>;
|
1696
|
+
/**
|
1697
|
+
* This method creates shipping method tax lines.
|
1698
|
+
*
|
1699
|
+
* @param {CreateOrderShippingMethodTaxLineDTO[]} taxLines - The shipping method tax lines to be created.
|
1700
|
+
* @returns {Promise<OrderShippingMethodTaxLineDTO[]>} The created shipping method tax lines.
|
1701
|
+
*
|
1702
|
+
* @example
|
1703
|
+
* const shippingMethodTaxLines = await orderModuleService
|
1704
|
+
* .createShippingMethodTaxLines([
|
1705
|
+
* {
|
1706
|
+
* code: "123",
|
1707
|
+
* rate: 2
|
1708
|
+
* }
|
1709
|
+
* ])
|
1710
|
+
*/
|
1711
|
+
createShippingMethodTaxLines(taxLines: CreateOrderShippingMethodTaxLineDTO[], sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO[]>;
|
1712
|
+
/**
|
1713
|
+
* This method creates a shipping method tax line.
|
1714
|
+
*
|
1715
|
+
* @param {CreateOrderShippingMethodTaxLineDTO} taxLine - The shipping method tax line to be created.
|
1716
|
+
* @returns {Promise<OrderShippingMethodTaxLineDTO>} The created shipping method tax line.
|
1717
|
+
*
|
1718
|
+
* @example
|
1719
|
+
* const shippingMethodTaxLine = await orderModuleService
|
1720
|
+
* .createShippingMethodTaxLines({
|
1721
|
+
* code: "123",
|
1722
|
+
* rate: 2
|
1723
|
+
* })
|
1724
|
+
*/
|
1725
|
+
createShippingMethodTaxLines(taxLine: CreateOrderShippingMethodTaxLineDTO, sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO>;
|
1726
|
+
/**
|
1727
|
+
* This method creates shipping method tax lines for an order.
|
1728
|
+
*
|
1729
|
+
* @param {string} orderId - The order's ID.
|
1730
|
+
* @param {CreateOrderShippingMethodTaxLineDTO | CreateOrderShippingMethodTaxLineDTO[]} taxLines - The shipping method tax lines to be created.
|
1731
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1732
|
+
* @returns {Promise<OrderShippingMethodTaxLineDTO[]>} The created shipping method tax lines.
|
1733
|
+
*
|
1734
|
+
* @example
|
1735
|
+
* const shippingMethodTaxLines = await orderModuleService
|
1736
|
+
* .createShippingMethodTaxLines(
|
1737
|
+
* "123",
|
1738
|
+
* [{
|
1739
|
+
* code: "123",
|
1740
|
+
* rate: 2
|
1741
|
+
* }]
|
1742
|
+
* )
|
1743
|
+
*/
|
1744
|
+
createShippingMethodTaxLines(orderId: string, taxLines: CreateOrderShippingMethodTaxLineDTO[] | CreateOrderShippingMethodTaxLineDTO, sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO[]>;
|
1745
|
+
/**
|
1746
|
+
* This method set the shipping method tax lines of an order.
|
1747
|
+
*
|
1748
|
+
* @param {string} orderId - The order's ID.
|
1749
|
+
* @param {(CreateOrderShippingMethodTaxLineDTO | UpdateOrderShippingMethodTaxLineDTO)[]} taxLines - The shipping method tax lines to create or update.
|
1750
|
+
* If a tax line object has an `id` property, it's updated. Otherwise, a tax line is created.
|
1751
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1752
|
+
* @returns {Promise<OrderShippingMethodTaxLineDTO[]>} The order's shipping method tax lines.
|
1753
|
+
*
|
1754
|
+
* @example
|
1755
|
+
* const shippingMethodTaxLines = await orderModuleService
|
1756
|
+
* .setShippingMethodTaxLines(
|
1757
|
+
* "123",
|
1758
|
+
* [
|
1759
|
+
* {
|
1760
|
+
* code: "123",
|
1761
|
+
* rate: 2
|
1762
|
+
* },
|
1763
|
+
* {
|
1764
|
+
* id: "321",
|
1765
|
+
* rate: 2
|
1766
|
+
* }
|
1767
|
+
* ]
|
1768
|
+
* )
|
1769
|
+
*
|
1770
|
+
*/
|
1771
|
+
setShippingMethodTaxLines(orderId: string, taxLines: (CreateOrderShippingMethodTaxLineDTO | UpdateOrderShippingMethodTaxLineDTO)[], sharedContext?: Context): Promise<OrderShippingMethodTaxLineDTO[]>;
|
1772
|
+
/**
|
1773
|
+
* This method deletes shipping method tax lines by their IDs.
|
1774
|
+
*
|
1775
|
+
* @param {string[]} taxLineIds - The list of shipping method tax lines.
|
1776
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1777
|
+
* @returns {Promise<void>} Resolves when the shipping method tax lines are deleted successfully.
|
1778
|
+
*
|
1779
|
+
* @example
|
1780
|
+
* await orderModuleService.deleteShippingMethodTaxLines([
|
1781
|
+
* "123", "321"
|
1782
|
+
* ])
|
1783
|
+
*/
|
1784
|
+
deleteShippingMethodTaxLines(taxLineIds: string[], sharedContext?: Context): Promise<void>;
|
1785
|
+
/**
|
1786
|
+
* This method deletes a shipping method tax line by its ID.
|
1787
|
+
*
|
1788
|
+
* @param {string} taxLineId - The ID of the shipping method tax line
|
1789
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1790
|
+
* @returns {Promise<void>} Resolves when the shipping method tax line is deleted successfully.
|
1791
|
+
*
|
1792
|
+
* @example
|
1793
|
+
* await orderModuleService.deleteShippingMethodTaxLines("123")
|
1794
|
+
*/
|
1795
|
+
deleteShippingMethodTaxLines(taxLineId: string, sharedContext?: Context): Promise<void>;
|
1796
|
+
/**
|
1797
|
+
* This method deletes shipping method tax line matching the specified filters.
|
1798
|
+
*
|
1799
|
+
* @param {FilterableOrderShippingMethodTaxLineProps} selector - The filters specifying which shipping method tax lines to delete.
|
1800
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1801
|
+
* @returns {Promise<void>} Resolves when the shipping method tax lines are deleted successfully.
|
1802
|
+
*
|
1803
|
+
* @example
|
1804
|
+
* await orderModuleService.deleteShippingMethodTaxLines({
|
1805
|
+
* id: ["123", "321"]
|
1806
|
+
* })
|
1807
|
+
*/
|
1808
|
+
deleteShippingMethodTaxLines(selector: FilterableOrderShippingMethodTaxLineProps, sharedContext?: Context): Promise<void>;
|
1809
|
+
/**
|
1810
|
+
* This method retrieves an order change by its ID.
|
1811
|
+
*
|
1812
|
+
* @param {string} orderChangeId - The order change ID.
|
1813
|
+
* @param {FindConfig<OrderChangeDTO>} config - The configurations determining how the order change is retrieved. Its properties, such as `select` or `relations`, accept the
|
1814
|
+
* attributes or relations associated with a order change.
|
1815
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1816
|
+
* @returns {Promise<OrderChangeDTO>} The retrieved order change.
|
1817
|
+
*
|
1818
|
+
* @example
|
1819
|
+
* A simple example that retrieves an order change by its ID:
|
1820
|
+
*
|
1821
|
+
* ```ts
|
1822
|
+
* const orderChange = await orderModuleService.retrieveOrderChange(
|
1823
|
+
* "123"
|
1824
|
+
* )
|
1825
|
+
* ```
|
1826
|
+
*
|
1827
|
+
* To specify relations that should be retrieved:
|
1828
|
+
*
|
1829
|
+
* ```ts
|
1830
|
+
* const orderChange = await orderModuleService.retrieveOrderChange(
|
1831
|
+
* "123",
|
1832
|
+
* {
|
1833
|
+
* relations: ["order"]
|
1834
|
+
* }
|
1835
|
+
* )
|
1836
|
+
* ```
|
1837
|
+
*
|
1838
|
+
*/
|
1839
|
+
retrieveOrderChange(orderChangeId: string, config?: FindConfig<OrderChangeDTO>, sharedContext?: Context): Promise<OrderChangeDTO>;
|
1840
|
+
/**
|
1841
|
+
* This method creates an order change.
|
1842
|
+
*
|
1843
|
+
* @param {CreateOrderChangeDTO} data - The order change to be created.
|
1844
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1845
|
+
* @returns {Promise<OrderChangeDTO>} The created order change.
|
1846
|
+
*
|
1847
|
+
* @example
|
1848
|
+
* const orderChange = await orderModuleService.createOrderChange({
|
1849
|
+
* order_id: "123",
|
1850
|
+
* })
|
1851
|
+
*/
|
1852
|
+
createOrderChange(data: CreateOrderChangeDTO, sharedContext?: Context): Promise<OrderChangeDTO>;
|
1853
|
+
/**
|
1854
|
+
* This method creates order changes.
|
1855
|
+
*
|
1856
|
+
* @param {CreateOrderChangeDTO[]} data - The order changes to be created.
|
1857
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1858
|
+
* @returns {Promise<OrderChangeDTO[]>} The created order changes.
|
1859
|
+
*
|
1860
|
+
* @example
|
1861
|
+
* const orderChanges = await orderModuleService.createOrderChange([
|
1862
|
+
* {
|
1863
|
+
* order_id: "123",
|
1864
|
+
* }
|
1865
|
+
* ])
|
1866
|
+
*
|
1867
|
+
*/
|
1868
|
+
createOrderChange(data: CreateOrderChangeDTO[], sharedContext?: Context): Promise<OrderChangeDTO[]>;
|
1869
|
+
/**
|
1870
|
+
* This method creates order changes.
|
1871
|
+
*
|
1872
|
+
* @param {CreateOrderChangeDTO | CreateOrderChangeDTO[]} data - The order changes to be created.
|
1873
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1874
|
+
* @returns {Promise<OrderChangeDTO | OrderChangeDTO[]>} The created order changes.
|
1875
|
+
*
|
1876
|
+
* @example
|
1877
|
+
* const orderChanges = await orderModuleService.createOrderChange([
|
1878
|
+
* {
|
1879
|
+
* order_id: "123",
|
1880
|
+
* }
|
1881
|
+
* ])
|
1882
|
+
*
|
1883
|
+
*/
|
1884
|
+
createOrderChange(data: CreateOrderChangeDTO | CreateOrderChangeDTO[], sharedContext?: Context): Promise<OrderChangeDTO | OrderChangeDTO[]>;
|
1885
|
+
/**
|
1886
|
+
* This method updates an existing order change.
|
1887
|
+
*
|
1888
|
+
* @param {UpdateOrderChangeDTO} data - The attributes to update in the order change.
|
1889
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1890
|
+
* @returns {Promise<OrderChangeDTO>} The updated order change.
|
1891
|
+
*
|
1892
|
+
* @example
|
1893
|
+
* const orderChange = await orderModuleService.updateOrderChanges({
|
1894
|
+
* id: "123"
|
1895
|
+
* })
|
1896
|
+
*/
|
1897
|
+
updateOrderChanges(data: UpdateOrderChangeDTO, sharedContext?: Context): Promise<OrderChangeDTO>;
|
1898
|
+
/**
|
1899
|
+
* This method updates order changes. The order changes are identified by the `id` property of each order change object.
|
1900
|
+
*
|
1901
|
+
* @param {UpdateOrderChangeDTO[]} data - The order changes to be updated.
|
1902
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1903
|
+
* @returns {Promise<OrderChangeDTO[]>} The updated order changes.
|
1904
|
+
*
|
1905
|
+
* @example
|
1906
|
+
* const orderChanges = await orderModuleService.updateOrderChanges([{
|
1907
|
+
* id: "123"
|
1908
|
+
* }])
|
1909
|
+
*
|
1910
|
+
*/
|
1911
|
+
updateOrderChanges(data: UpdateOrderChangeDTO[], sharedContext?: Context): Promise<OrderChangeDTO[]>;
|
1912
|
+
/**
|
1913
|
+
* This method updates order changes. The order changes are identified by the `id` property of each order change object.
|
1914
|
+
*
|
1915
|
+
* @param {UpdateOrderChangeDTO | UpdateOrderChangeDTO[]} data - The data to update in each order change.
|
1916
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1917
|
+
* @returns {Promise<OrderChangeDTO | OrderChangeDTO[]>} The updated order changes.
|
1918
|
+
*
|
1919
|
+
* @example
|
1920
|
+
* const orderChanges = await orderModuleService.updateOrderChanges([{
|
1921
|
+
* id: "123"
|
1922
|
+
* }])
|
1923
|
+
*
|
1924
|
+
*/
|
1925
|
+
updateOrderChanges(data: UpdateOrderChangeDTO | UpdateOrderChangeDTO[], sharedContext?: Context): Promise<OrderChangeDTO | OrderChangeDTO[]>;
|
1926
|
+
/**
|
1927
|
+
* This method deletes order changes by their IDs.
|
1928
|
+
*
|
1929
|
+
* @param {string[]} orderChangeId - The IDs of order changes.
|
1930
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1931
|
+
* @returns {Promise<void>} Resolves when the order changes are deleted successfully.
|
1932
|
+
*
|
1933
|
+
* @example
|
1934
|
+
* await orderModuleService.deleteOrderChanges(["123", "321"])
|
1935
|
+
*
|
1936
|
+
*/
|
1937
|
+
deleteOrderChanges(orderChangeId: string[], sharedContext?: Context): Promise<void>;
|
1938
|
+
/**
|
1939
|
+
* This method deletes an order change by its ID.
|
1940
|
+
*
|
1941
|
+
* @param {string} orderChangeId - The order change's ID.
|
1942
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1943
|
+
* @returns {Promise<void>} Resolves when the order change is deleted successfully.
|
1944
|
+
*
|
1945
|
+
* @example
|
1946
|
+
* await orderModuleService.deleteOrderChanges("123")
|
1947
|
+
*
|
1948
|
+
*/
|
1949
|
+
deleteOrderChanges(orderChangeId: string, sharedContext?: Context): Promise<void>;
|
1950
|
+
/**
|
1951
|
+
* This method cancels an order's change.
|
1952
|
+
*
|
1953
|
+
* @param {string} orderId - The order's ID.
|
1954
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1955
|
+
* @returns {Promise<void>} Resolves when the order's change is canceled successfully.
|
1956
|
+
*
|
1957
|
+
* @example
|
1958
|
+
* await orderModuleService.cancelOrderChange("123")
|
1959
|
+
*
|
1960
|
+
*/
|
1961
|
+
cancelOrderChange(orderId: string, sharedContext?: Context): Promise<void>;
|
1962
|
+
/**
|
1963
|
+
* This method cancels orders' changes.
|
1964
|
+
*
|
1965
|
+
* @param {string[]} orderId - The orders IDs.
|
1966
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1967
|
+
* @returns {Promise<void>} Resolves when the orders' changes are canceled successfully.
|
1968
|
+
*
|
1969
|
+
* @example
|
1970
|
+
* await orderModuleService.cancelOrderChange(["123", "321"])
|
1971
|
+
*
|
1972
|
+
*/
|
1973
|
+
cancelOrderChange(orderId: string[], sharedContext?: Context): Promise<void>;
|
1974
|
+
/**
|
1975
|
+
* This method retrieves a preview of an order if its change was confirmed and applied on it.
|
1976
|
+
*
|
1977
|
+
* @param {string} orderId - The order's ID.
|
1978
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1979
|
+
* @returns {Promise<OrderDTO>} The preview of the order.
|
1980
|
+
*
|
1981
|
+
* @example
|
1982
|
+
* const orderPreview = await orderModuleService.previewOrderChange(
|
1983
|
+
* "123"
|
1984
|
+
* )
|
1985
|
+
*/
|
1986
|
+
previewOrderChange(orderId: string, sharedContext?: Context): Promise<OrderDTO>;
|
1987
|
+
/**
|
1988
|
+
* This method cancels an order's change, providing cancelation details.
|
1989
|
+
*
|
1990
|
+
* @param {CancelOrderChangeDTO} data - The cancelation details of the order's change.
|
1991
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
1992
|
+
* @returns {Promise<void>} Resolves when the order's change is canceled successfully.
|
1993
|
+
*
|
1994
|
+
* @example
|
1995
|
+
* await orderModuleService.cancelOrderChange({
|
1996
|
+
* id: "123",
|
1997
|
+
* canceled_by: "user_123"
|
1998
|
+
* })
|
1999
|
+
*
|
2000
|
+
*/
|
2001
|
+
cancelOrderChange(data: CancelOrderChangeDTO, sharedContext?: Context): Promise<void>;
|
2002
|
+
/**
|
2003
|
+
* This method cancels orders' changes, providing cancelation details.
|
2004
|
+
*
|
2005
|
+
* @param {CancelOrderChangeDTO[]} data - The cancelation details of the orders' changes.
|
2006
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2007
|
+
* @returns {Promise<void>} Resolves when the orders' changes are canceled successfully.
|
2008
|
+
*
|
2009
|
+
* @example
|
2010
|
+
* await orderModuleService.cancelOrderChange([{
|
2011
|
+
* id: "123",
|
2012
|
+
* canceled_by: "user_123"
|
2013
|
+
* }])
|
2014
|
+
*
|
2015
|
+
*/
|
2016
|
+
cancelOrderChange(data: CancelOrderChangeDTO[], sharedContext?: Context): Promise<void>;
|
2017
|
+
/**
|
2018
|
+
* This method confirms an order change, applying these changes on the associated order.
|
2019
|
+
*
|
2020
|
+
* @param {string} orderChangeId - The order change's ID.
|
2021
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2022
|
+
* @returns {Promise<OrderChangeReturn>} The item and shipping method changes made on the order.
|
2023
|
+
*
|
2024
|
+
* @example
|
2025
|
+
* const {
|
2026
|
+
* items,
|
2027
|
+
* shippingMethods
|
2028
|
+
* } = await orderModuleService.confirmOrderChange("123")
|
2029
|
+
*
|
2030
|
+
*/
|
2031
|
+
confirmOrderChange(orderChangeId: string, sharedContext?: Context): Promise<OrderChangeReturn>;
|
2032
|
+
/**
|
2033
|
+
* This method confirms order changes, applying these changes on the associated orders.
|
2034
|
+
*
|
2035
|
+
* @param {string[]} orderChangeId - The order changes' IDs.
|
2036
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2037
|
+
* @returns {Promise<void>} The item and shipping method changes made on the order.
|
2038
|
+
*
|
2039
|
+
* @example
|
2040
|
+
* await orderModuleService.confirmOrderChange(["123"])
|
2041
|
+
*
|
2042
|
+
*/
|
2043
|
+
confirmOrderChange(orderChangeId: string[], sharedContext?: Context): Promise<OrderChangeReturn>;
|
2044
|
+
/**
|
2045
|
+
* This method confirms an order change, specifying confirmation details.
|
2046
|
+
*
|
2047
|
+
* @param {ConfirmOrderChangeDTO} data - The confirmation's details of the order change.
|
2048
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2049
|
+
* @returns {Promise<void>} The item and shipping method changes made on the order.
|
2050
|
+
*
|
2051
|
+
* @example
|
2052
|
+
* await orderModuleService.confirmOrderChange({
|
2053
|
+
* id: "123",
|
2054
|
+
* confirmed_by: "user_123"
|
2055
|
+
* })
|
2056
|
+
*
|
2057
|
+
*/
|
2058
|
+
confirmOrderChange(data: ConfirmOrderChangeDTO, sharedContext?: Context): Promise<OrderChangeReturn>;
|
2059
|
+
/**
|
2060
|
+
* This method confirms order changes, specifying confirmation details.
|
2061
|
+
*
|
2062
|
+
* @param {ConfirmOrderChangeDTO[]} data - The confirm order changes details.
|
2063
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2064
|
+
* @returns {Promise<void>} The item and shipping method changes made on all the orders.
|
2065
|
+
*
|
2066
|
+
* @example
|
2067
|
+
* await orderModuleService.confirmOrderChange([{
|
2068
|
+
* id: "123",
|
2069
|
+
* confirmed_by: "user_123"
|
2070
|
+
* }])
|
2071
|
+
*
|
2072
|
+
*/
|
2073
|
+
confirmOrderChange(data: ConfirmOrderChangeDTO[], sharedContext?: Context): Promise<OrderChangeReturn>;
|
2074
|
+
/**
|
2075
|
+
* This method declines an order change.
|
2076
|
+
*
|
2077
|
+
* @param {string} orderChangeId - The order change's ID.
|
2078
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2079
|
+
* @returns {Promise<void>} Resolves when the order change is declined successfully.
|
2080
|
+
*
|
2081
|
+
* @example
|
2082
|
+
* await orderModuleService.declineOrderChange("123")
|
2083
|
+
*
|
2084
|
+
*/
|
2085
|
+
declineOrderChange(orderChangeId: string, sharedContext?: Context): Promise<void>;
|
2086
|
+
/**
|
2087
|
+
* This method declines order changes.
|
2088
|
+
*
|
2089
|
+
* @param {string[]} orderChangeId - The order changes' IDs.
|
2090
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2091
|
+
* @returns {Promise<void>} Resolves when the order changes are declined successfully.
|
2092
|
+
*
|
2093
|
+
* @example
|
2094
|
+
* await orderModuleService.declineOrderChange(["123", "321"])
|
2095
|
+
*
|
2096
|
+
*/
|
2097
|
+
declineOrderChange(orderChangeId: string[], sharedContext?: Context): Promise<void>;
|
2098
|
+
/**
|
2099
|
+
* This method declines an order change, providing additional details.
|
2100
|
+
*
|
2101
|
+
* @param {DeclineOrderChangeDTO} data - The details of the order change decline.
|
2102
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2103
|
+
* @returns {Promise<void>} Resolves when the order change is declined successfully.
|
2104
|
+
*
|
2105
|
+
* @example
|
2106
|
+
* await orderModuleService.declineOrderChange({
|
2107
|
+
* id: "123",
|
2108
|
+
* declined_by: "user_123"
|
2109
|
+
* })
|
2110
|
+
*
|
2111
|
+
*/
|
2112
|
+
declineOrderChange(data: DeclineOrderChangeDTO, sharedContext?: Context): Promise<void>;
|
2113
|
+
/**
|
2114
|
+
* This method declines order changes, providing additional details for each.
|
2115
|
+
*
|
2116
|
+
* @param {DeclineOrderChangeDTO[]} data - The details of the order change declines.
|
2117
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2118
|
+
* @returns {Promise<void>} Resolves when the order changes are declined successfully.
|
2119
|
+
*
|
2120
|
+
* @example
|
2121
|
+
* await orderModuleService.declineOrderChange([
|
2122
|
+
* {
|
2123
|
+
* id: "123",
|
2124
|
+
* declined_by: "user_123"
|
2125
|
+
* }
|
2126
|
+
* ])
|
2127
|
+
*
|
2128
|
+
*/
|
2129
|
+
declineOrderChange(data: DeclineOrderChangeDTO[], sharedContext?: Context): Promise<void>;
|
2130
|
+
/**
|
2131
|
+
* This method soft deletes order changes by their IDs.
|
2132
|
+
*
|
2133
|
+
* @param {string | string[]} orderChangeId - The IDs of order changes.
|
2134
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2135
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2136
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2137
|
+
* The object's keys are the ID attribute names of the order change entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2138
|
+
* with the order through this relation.
|
2139
|
+
*
|
2140
|
+
* If there are no related records, the promise resolves to `void`.
|
2141
|
+
*
|
2142
|
+
* @example
|
2143
|
+
* await orderModuleService.softDeleteOrderChanges([
|
2144
|
+
* "123", "321"
|
2145
|
+
* ])
|
2146
|
+
*/
|
2147
|
+
softDeleteOrderChanges<TReturnableLinkableKeys extends string = string>(orderChangeId: string | string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
2148
|
+
/**
|
2149
|
+
* This method restores soft deleted order changes by their IDs.
|
2150
|
+
*
|
2151
|
+
* @param {string | string[]} orderChangeId - The IDs of order changes.
|
2152
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the order. You can pass to its `returnLinkableKeys`
|
2153
|
+
* property any of the order change's relation attribute names.
|
2154
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2155
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
2156
|
+
* The object's keys are the ID attribute names of the order change entity's relations,
|
2157
|
+
* and its value is an array of strings, each being the ID of the record associated with the order change through this relation.
|
2158
|
+
*
|
2159
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2160
|
+
*
|
2161
|
+
* @example
|
2162
|
+
* await orderModuleService.restoreOrderChanges([
|
2163
|
+
* "123", "321"
|
2164
|
+
* ])
|
2165
|
+
*/
|
2166
|
+
restoreOrderChanges<TReturnableLinkableKeys extends string = string>(orderChangeId: string | string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
2167
|
+
/**
|
2168
|
+
* This method applies orders' actions who are still pending on the order.
|
2169
|
+
*
|
2170
|
+
* @param {string | string[]} orderId - The order's ID.
|
2171
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2172
|
+
* @returns {Promise<OrderChangeReturn>} The changes made by applying the actions on the orders.
|
2173
|
+
*
|
2174
|
+
* @example
|
2175
|
+
* const {
|
2176
|
+
* items,
|
2177
|
+
* shippingMethods
|
2178
|
+
* } = await orderModuleService.applyPendingOrderActions([
|
2179
|
+
* "123", "321"
|
2180
|
+
* ])
|
2181
|
+
*
|
2182
|
+
*/
|
2183
|
+
applyPendingOrderActions(orderId: string | string[], sharedContext?: Context): Promise<OrderChangeReturn>;
|
2184
|
+
/**
|
2185
|
+
* This method retrieves a paginated list of order change actions based on optional filters and configuration.
|
2186
|
+
*
|
2187
|
+
* @param {FilterableOrderChangeActionProps} filters - The filters to apply on the retrieved order change action.
|
2188
|
+
* @param {FindConfig<OrderChangeActionDTO>} config - The configurations determining how the order change action is retrieved. Its properties, such as `select` or `relations`, accept the
|
2189
|
+
* attributes or relations associated with an order change action.
|
2190
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2191
|
+
* @returns {Promise<OrderChangeActionDTO[]>} The list of order change actions.
|
2192
|
+
*
|
2193
|
+
* @example
|
2194
|
+
* To retrieve a list of shipping method tax lines using their IDs:
|
2195
|
+
*
|
2196
|
+
* ```ts
|
2197
|
+
* const orderChangeActions = await orderModuleService.listOrderChangeActions({
|
2198
|
+
* id: ["123", "321"]
|
2199
|
+
* })
|
2200
|
+
* ```
|
2201
|
+
*
|
2202
|
+
* To specify relations that should be retrieved within the shipping method tax line:
|
2203
|
+
*
|
2204
|
+
* ```ts
|
2205
|
+
* const orderChangeActions = await orderModuleService.listOrderChangeActions({
|
2206
|
+
* id: ["123", "321"]
|
2207
|
+
* }, {
|
2208
|
+
* relations: ["order"]
|
2209
|
+
* })
|
2210
|
+
* ```
|
2211
|
+
*
|
2212
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
2213
|
+
*
|
2214
|
+
* ```ts
|
2215
|
+
* const orderChangeActions = await orderModuleService.listOrderChangeActions({
|
2216
|
+
* id: ["123", "321"]
|
2217
|
+
* }, {
|
2218
|
+
* relations: ["order"],
|
2219
|
+
* take: 20,
|
2220
|
+
* skip: 2
|
2221
|
+
* })
|
2222
|
+
* ```
|
2223
|
+
*
|
2224
|
+
*/
|
2225
|
+
listOrderChangeActions(filters?: FilterableOrderChangeActionProps, config?: FindConfig<OrderChangeActionDTO>, sharedContext?: Context): Promise<OrderChangeActionDTO[]>;
|
2226
|
+
/**
|
2227
|
+
* This method retrieves an orde rchange action by its ID.
|
2228
|
+
*
|
2229
|
+
* @param {string} actionId - The order change action's ID.
|
2230
|
+
* @param {FindConfig<OrderChangeActionDTO>} config - The configurations determining how the order change action is retrieved. Its properties, such as `select` or `relations`, accept the
|
2231
|
+
* attributes or relations associated with an order change action.
|
2232
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2233
|
+
* @returns {Promise<OrderChangeActionDTO>} The retrieved order change action.
|
2234
|
+
*
|
2235
|
+
* @example
|
2236
|
+
* A simple example that retrieves an order change by its ID:
|
2237
|
+
*
|
2238
|
+
* ```ts
|
2239
|
+
* const orderChangeAction = await orderModuleService.retrieveOrderChangeAction(
|
2240
|
+
* "123"
|
2241
|
+
* )
|
2242
|
+
* ```
|
2243
|
+
*
|
2244
|
+
* To specify relations that should be retrieved:
|
2245
|
+
*
|
2246
|
+
* ```ts
|
2247
|
+
* const orderChangeAction = await orderModuleService.retrieveOrderChangeAction(
|
2248
|
+
* "123",
|
2249
|
+
* {
|
2250
|
+
* relations: ["order"]
|
2251
|
+
* }
|
2252
|
+
* )
|
2253
|
+
* ```
|
2254
|
+
*
|
2255
|
+
*/
|
2256
|
+
retrieveOrderChangeAction(actionId: string, config?: FindConfig<OrderChangeActionDTO>, sharedContext?: Context): Promise<OrderChangeActionDTO>;
|
2257
|
+
/**
|
2258
|
+
* This method updates an existing order change action.
|
2259
|
+
*
|
2260
|
+
* @param {UpdateOrderChangeActionDTO} data - The attributes to update in the order change action.
|
2261
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2262
|
+
* @returns {Promise<OrderChangeActionDTO>} The updated order change action.
|
2263
|
+
*
|
2264
|
+
* @example
|
2265
|
+
* const orderChangeAction = await orderModuleService.updateOrderChangeActions({
|
2266
|
+
* id: "123",
|
2267
|
+
* internal_note: "Changing an item"
|
2268
|
+
* })
|
2269
|
+
*/
|
2270
|
+
updateOrderChangeActions(data: UpdateOrderChangeActionDTO, sharedContext?: Context): Promise<OrderChangeActionDTO>;
|
2271
|
+
/**
|
2272
|
+
* This method updates order change actions.
|
2273
|
+
*
|
2274
|
+
* @param {UpdateOrderChangeActionDTO[]} data - The order change actions to be updated.
|
2275
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2276
|
+
* @returns {Promise<OrderChangeActionDTO[]>} The updated order change actions.
|
2277
|
+
*
|
2278
|
+
* @example
|
2279
|
+
* const orderChangeActions = await orderModuleService.updateOrderChangeActions([{
|
2280
|
+
* id: "123",
|
2281
|
+
* internal_note: "Changing an item"
|
2282
|
+
* }])
|
2283
|
+
*
|
2284
|
+
*/
|
2285
|
+
updateOrderChangeActions(data: UpdateOrderChangeActionDTO[], sharedContext?: Context): Promise<OrderChangeActionDTO[]>;
|
2286
|
+
/**
|
2287
|
+
* This method updates order change actions.
|
2288
|
+
*
|
2289
|
+
* @param {UpdateOrderChangeActionDTO | UpdateOrderChangeActionDTO[]} data - The order change actions to be updated.
|
2290
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2291
|
+
* @returns {Promise<OrderChangeActionDTO | OrderChangeActionDTO[]>} The updated order change actions.
|
2292
|
+
*
|
2293
|
+
* @example
|
2294
|
+
* const orderChangeActions = await orderModuleService.updateOrderChangeActions([{
|
2295
|
+
* id: "123",
|
2296
|
+
* internal_note: "Changing an item"
|
2297
|
+
* }])
|
2298
|
+
*
|
2299
|
+
*/
|
2300
|
+
updateOrderChangeActions(data: UpdateOrderChangeActionDTO | UpdateOrderChangeActionDTO[], sharedContext?: Context): Promise<OrderChangeActionDTO | OrderChangeActionDTO[]>;
|
2301
|
+
/**
|
2302
|
+
* This method creates and adds an action to an order and its change.
|
2303
|
+
*
|
2304
|
+
* @param {CreateOrderChangeActionDTO} data - The action to be added to an order.
|
2305
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2306
|
+
* @returns {Promise<OrderChangeActionDTO>} The order change action added.
|
2307
|
+
*
|
2308
|
+
* @example
|
2309
|
+
* const orderChangeAction = await orderModuleService.addOrderAction({
|
2310
|
+
* order_id: "123",
|
2311
|
+
* order_change_id: "321",
|
2312
|
+
* action: "ITEM_ADD"
|
2313
|
+
* })
|
2314
|
+
*/
|
2315
|
+
addOrderAction(data: CreateOrderChangeActionDTO, sharedContext?: Context): Promise<OrderChangeActionDTO>;
|
2316
|
+
/**
|
2317
|
+
* This method creates and adds actions to orders and their changes.
|
2318
|
+
*
|
2319
|
+
* @param {CreateOrderChangeActionDTO[]} data - The order change actions to be created.
|
2320
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2321
|
+
* @returns {Promise<OrderChangeActionDTO[]>} The created order change actions.
|
2322
|
+
*
|
2323
|
+
* @example
|
2324
|
+
* const orderChangeActions = await orderModuleService.addOrderAction([{
|
2325
|
+
* order_id: "123",
|
2326
|
+
* order_change_id: "321",
|
2327
|
+
* action: "ITEM_ADD"
|
2328
|
+
* }])
|
2329
|
+
*/
|
2330
|
+
addOrderAction(data: CreateOrderChangeActionDTO[], sharedContext?: Context): Promise<OrderChangeActionDTO[]>;
|
2331
|
+
/**
|
2332
|
+
* This method deletes order change actions by their IDs.
|
2333
|
+
*
|
2334
|
+
* @param {string[]} actionId - The IDs of order change actions.
|
2335
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2336
|
+
* @returns {Promise<void>} Resolves when the order change actions are deleted successfully.
|
2337
|
+
*
|
2338
|
+
* @example
|
2339
|
+
* await orderModuleService.deleteOrderChangeActions([
|
2340
|
+
* "123", "321"
|
2341
|
+
* ])
|
2342
|
+
*
|
2343
|
+
*/
|
2344
|
+
deleteOrderChangeActions(actionId: string[], sharedContext?: Context): Promise<void>;
|
2345
|
+
/**
|
2346
|
+
* This method deletes an order change action by its ID.
|
2347
|
+
*
|
2348
|
+
* @param {string} actionId - The order change action's ID.
|
2349
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2350
|
+
* @returns {Promise<void>} Resolves when the order change action is deleted successfully.
|
2351
|
+
*
|
2352
|
+
* @example
|
2353
|
+
* ```typescript
|
2354
|
+
* await orderModuleService.deleteOrderActions("123")
|
2355
|
+
* ```
|
2356
|
+
*
|
2357
|
+
*/
|
2358
|
+
deleteOrderChangeActions(actionId: string, sharedContext?: Context): Promise<void>;
|
2359
|
+
/**
|
2360
|
+
* This method soft-deletes order change actions by their IDs.
|
2361
|
+
*
|
2362
|
+
* @param {string} actionIds - The order change action's ID.
|
2363
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2364
|
+
* @returns {Promise<void>} Resolves when the order change action is soft-deleted successfully.
|
2365
|
+
*
|
2366
|
+
* @example
|
2367
|
+
* await orderModuleService.softDeleteOrderChangeActions([
|
2368
|
+
* "123", "321"
|
2369
|
+
* ])
|
2370
|
+
*
|
2371
|
+
*/
|
1137
2372
|
softDeleteOrderChangeActions<TReturnableLinkableKeys extends string = string>(actionIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2373
|
+
/**
|
2374
|
+
* This method restores soft-deleted order change actions by their IDs.
|
2375
|
+
*
|
2376
|
+
* @param {string | string[]} actionId - The IDs of order change actions.
|
2377
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the order change action. You can pass to its `returnLinkableKeys`
|
2378
|
+
* property any of the order's relation attribute names.
|
2379
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2380
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
2381
|
+
* The object's keys are the ID attribute names of the order change action entity's relations,
|
2382
|
+
* and its value is an array of strings, each being the ID of the record associated with the order through this relation.
|
2383
|
+
*
|
2384
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2385
|
+
*
|
2386
|
+
* @example
|
2387
|
+
* await orderModuleService.restoreOrderChangeActions([
|
2388
|
+
* "123", "321"
|
2389
|
+
* ])
|
2390
|
+
*/
|
1138
2391
|
restoreOrderChangeActions<TReturnableLinkableKeys extends string = string>(actionId: string | string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
2392
|
+
/**
|
2393
|
+
* This method soft deletes addresses by their IDs.
|
2394
|
+
*
|
2395
|
+
* @param {string[]} ids - The IDs of the addresses.
|
2396
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2397
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2398
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2399
|
+
* The object's keys are the ID attribute names of the address entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2400
|
+
* with the order through this relation.
|
2401
|
+
*
|
2402
|
+
* If there are no related records, the promise resolves to `void`.
|
2403
|
+
*
|
2404
|
+
* @example
|
2405
|
+
* await orderModuleService.softDeleteAddresses([
|
2406
|
+
* "123", "321"
|
2407
|
+
* ])
|
2408
|
+
*/
|
1139
2409
|
softDeleteAddresses<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2410
|
+
/**
|
2411
|
+
* This method restores soft-deleted addresses by their IDs.
|
2412
|
+
*
|
2413
|
+
* @param {string[]} ids - The IDs of the addresses.
|
2414
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the addresses. You can pass to its `returnLinkableKeys`
|
2415
|
+
* property any of the address's relation attribute names.
|
2416
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2417
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were restored.
|
2418
|
+
* The object's keys are the ID attribute names of the address entity's relations,
|
2419
|
+
* and its value is an array of strings, each being the ID of the record associated with the address through this relation.
|
2420
|
+
*
|
2421
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2422
|
+
*
|
2423
|
+
* @example
|
2424
|
+
* await orderModuleService.restoreAddresses([
|
2425
|
+
* "123", "321"
|
2426
|
+
* ])
|
2427
|
+
*/
|
1140
2428
|
restoreAddresses<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2429
|
+
/**
|
2430
|
+
* This method soft deletes line items by their IDs.
|
2431
|
+
*
|
2432
|
+
* @param {string[]} ids - The IDs of the line items.
|
2433
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2434
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2435
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2436
|
+
* The object's keys are the ID attribute names of the line item entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2437
|
+
* with the line item through this relation.
|
2438
|
+
*
|
2439
|
+
* If there are no related records, the promise resolves to `void`.
|
2440
|
+
*
|
2441
|
+
* @example
|
2442
|
+
* await orderModuleService.softDeleteLineItems([
|
2443
|
+
* "123", "321"
|
2444
|
+
* ])
|
2445
|
+
*/
|
1141
2446
|
softDeleteLineItems<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2447
|
+
/**
|
2448
|
+
* This method restores soft-deleted line item by their IDs.
|
2449
|
+
*
|
2450
|
+
* @param {string[]} ids - The IDs of the line items.
|
2451
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the order. You can pass to its `returnLinkableKeys`
|
2452
|
+
* property any of the line item's relation attribute names.
|
2453
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2454
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were restored.
|
2455
|
+
* The object's keys are the ID attribute names of the line item entity's relations,
|
2456
|
+
* and its value is an array of strings, each being the ID of the record associated with the line item through this relation.
|
2457
|
+
*
|
2458
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2459
|
+
*
|
2460
|
+
* @example
|
2461
|
+
* await orderModuleService.restoreLineItems([
|
2462
|
+
* "123", "321"
|
2463
|
+
* ])
|
2464
|
+
*/
|
1142
2465
|
restoreLineItems<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2466
|
+
/**
|
2467
|
+
* This method soft-deletes shipping methods by their IDs.
|
2468
|
+
*
|
2469
|
+
* @param {string[]} ids - The IDs of the shipping methods.
|
2470
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2471
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2472
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2473
|
+
* The object's keys are the ID attribute names of the shipping method entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2474
|
+
* with the shipping method through this relation.
|
2475
|
+
*
|
2476
|
+
* If there are no related records, the promise resolves to `void`.
|
2477
|
+
*
|
2478
|
+
* @example
|
2479
|
+
* await orderModuleService.softDeleteShippingMethods([
|
2480
|
+
* "123", "321"
|
2481
|
+
* ])
|
2482
|
+
*/
|
1143
2483
|
softDeleteShippingMethods<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2484
|
+
/**
|
2485
|
+
* This method restores soft-deleted shipping methods by their IDs.
|
2486
|
+
*
|
2487
|
+
* @param {string[]} ids - The IDs of the shipping methods.
|
2488
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the shipping methods. You can pass to its `returnLinkableKeys`
|
2489
|
+
* property any of the shipping method's relation attribute names.
|
2490
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2491
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were restored.
|
2492
|
+
* The object's keys are the ID attribute names of the shipping method entity's relations,
|
2493
|
+
* and its value is an array of strings, each being the ID of the record associated with the shipping method through this relation.
|
2494
|
+
*
|
2495
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2496
|
+
*
|
2497
|
+
* @example
|
2498
|
+
* await orderModuleService.restoreShippingMethods([
|
2499
|
+
* "123", "321"
|
2500
|
+
* ])
|
2501
|
+
*/
|
1144
2502
|
restoreShippingMethods<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2503
|
+
/**
|
2504
|
+
* This method soft-deletes line item adjustments by their IDs.
|
2505
|
+
*
|
2506
|
+
* @param {string[]} ids - The IDs of the line item adjustments.
|
2507
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2508
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2509
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2510
|
+
* The object's keys are the ID attribute names of the line item adjustment entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2511
|
+
* with the line item adjustment through this relation.
|
2512
|
+
*
|
2513
|
+
* If there are no related records, the promise resolves to `void`.
|
2514
|
+
*
|
2515
|
+
* @example
|
2516
|
+
* await orderModuleService.softDeleteLineItemAdjustments([
|
2517
|
+
* "123", "321"
|
2518
|
+
* ])
|
2519
|
+
*/
|
1145
2520
|
softDeleteLineItemAdjustments<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2521
|
+
/**
|
2522
|
+
* This method restores soft-deleted line item adjustments by their IDs.
|
2523
|
+
*
|
2524
|
+
* @param {string[]} ids - The IDs of the line item adjustments.
|
2525
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the line item adjustment. You can pass to its `returnLinkableKeys`
|
2526
|
+
* property any of the line item adjustment's relation attribute names.
|
2527
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2528
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were restored.
|
2529
|
+
* The object's keys are the ID attribute names of the line item adjustment entity's relations,
|
2530
|
+
* and its value is an array of strings, each being the ID of the record associated with the line item adjustment through this relation.
|
2531
|
+
*
|
2532
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2533
|
+
*
|
2534
|
+
* @example
|
2535
|
+
* await orderModuleService.restoreLineItemAdjustments([
|
2536
|
+
* "123", "321"
|
2537
|
+
* ])
|
2538
|
+
*/
|
1146
2539
|
restoreLineItemAdjustments<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2540
|
+
/**
|
2541
|
+
* This method soft-deletes shipping method adjustments by their IDs.
|
2542
|
+
*
|
2543
|
+
* @param {string[]} ids - The IDs of the shipping method adjustments.
|
2544
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2545
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2546
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2547
|
+
* The object's keys are the ID attribute names of the shipping method adjustment entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2548
|
+
* with the shipping method adjustment through this relation.
|
2549
|
+
*
|
2550
|
+
* If there are no related records, the promise resolves to `void`.
|
2551
|
+
*
|
2552
|
+
* @example
|
2553
|
+
* await orderModuleService.softDeleteShippingMethodAdjustments([
|
2554
|
+
* "123", "321"
|
2555
|
+
* ])
|
2556
|
+
*/
|
1147
2557
|
softDeleteShippingMethodAdjustments<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2558
|
+
/**
|
2559
|
+
* This method restores soft-deleted shipping method adjustments by their IDs.
|
2560
|
+
*
|
2561
|
+
* @param {string[]} ids - The IDs of the shipping method adjustments.
|
2562
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the shipping method adjustments. You can pass to its `returnLinkableKeys`
|
2563
|
+
* property any of the shipping method adjustment's relation attribute names.
|
2564
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2565
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were restored.
|
2566
|
+
* The object's keys are the ID attribute names of the shipping method adjustment entity's relations,
|
2567
|
+
* and its value is an array of strings, each being the ID of the record associated with the shipping method adjustment through this relation.
|
2568
|
+
*
|
2569
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2570
|
+
*
|
2571
|
+
* @example
|
2572
|
+
* await orderModuleService.restoreShippingMethodAdjustments([
|
2573
|
+
* "123", "321"
|
2574
|
+
* ])
|
2575
|
+
*/
|
1148
2576
|
restoreShippingMethodAdjustments<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2577
|
+
/**
|
2578
|
+
* This method soft-deletes line item tax lines by their IDs.
|
2579
|
+
*
|
2580
|
+
* @param {string[]} ids - The IDs of the line item tax lines.
|
2581
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2582
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2583
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2584
|
+
* The object's keys are the ID attribute names of the line item tax line entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2585
|
+
* with the line item tax line through this relation.
|
2586
|
+
*
|
2587
|
+
* If there are no related records, the promise resolves to `void`.
|
2588
|
+
*
|
2589
|
+
* @example
|
2590
|
+
* await orderModuleService.softDeleteLineItemTaxLines([
|
2591
|
+
* "123", "321"
|
2592
|
+
* ])
|
2593
|
+
*/
|
1149
2594
|
softDeleteLineItemTaxLines<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2595
|
+
/**
|
2596
|
+
* This method restores soft-deleted line item tax lines by their IDs.
|
2597
|
+
*
|
2598
|
+
* @param {string[]} ids - The IDs of the line item tax lines.
|
2599
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the line item tax lines. You can pass to its `returnLinkableKeys`
|
2600
|
+
* property any of the line item tax line's relation attribute names.
|
2601
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2602
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were restored.
|
2603
|
+
* The object's keys are the ID attribute names of the line item tax line entity's relations,
|
2604
|
+
* and its value is an array of strings, each being the ID of the record associated with the line item tax line through this relation.
|
2605
|
+
*
|
2606
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2607
|
+
*
|
2608
|
+
* @example
|
2609
|
+
* await orderModuleService.restoreLineItemTaxLines([
|
2610
|
+
* "123", "321"
|
2611
|
+
* ])
|
2612
|
+
*/
|
1150
2613
|
restoreLineItemTaxLines<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2614
|
+
/**
|
2615
|
+
* This method soft deletes shipping method tax lines by their IDs.
|
2616
|
+
*
|
2617
|
+
* @param {string[]} ids - The IDs of the shipping method tax lines.
|
2618
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2619
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2620
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2621
|
+
* The object's keys are the ID attribute names of the shipping method tax line entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2622
|
+
* with the shipping method tax line through this relation.
|
2623
|
+
*
|
2624
|
+
* If there are no related records, the promise resolves to `void`.
|
2625
|
+
*
|
2626
|
+
* @example
|
2627
|
+
* await orderModuleService.softDeleteShippingMethodTaxLines([
|
2628
|
+
* "123", "321"
|
2629
|
+
* ])
|
2630
|
+
*/
|
1151
2631
|
softDeleteShippingMethodTaxLines<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2632
|
+
/**
|
2633
|
+
* This method restores soft-deleted shipping method tax lines by their IDs.
|
2634
|
+
*
|
2635
|
+
* @param {string[]} ids - The IDs of the shipping method tax lines.
|
2636
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the shipping method tax lines. You can pass to its `returnLinkableKeys`
|
2637
|
+
* property any of the shipping method tax line's relation attribute names.
|
2638
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2639
|
+
* @returns {Promise<void | Record<TReturnableLinkableKeys, string[]>>} An object that includes the IDs of related records that were restored.
|
2640
|
+
* The object's keys are the ID attribute names of the shipping method tax line entity's relations,
|
2641
|
+
* and its value is an array of strings, each being the ID of the record associated with the shipping method tax line through this relation.
|
2642
|
+
*
|
2643
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2644
|
+
*
|
2645
|
+
* @example
|
2646
|
+
* await orderModuleService.restoreShippingMethodTaxLines([
|
2647
|
+
* "123", "321"
|
2648
|
+
* ])
|
2649
|
+
*/
|
1152
2650
|
restoreShippingMethodTaxLines<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<TReturnableLinkableKeys, string[]> | void>;
|
2651
|
+
/**
|
2652
|
+
* This method reverts an order to its last version.
|
2653
|
+
*
|
2654
|
+
* @param {string} orderId - The order's ID.
|
2655
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2656
|
+
* @returns {Promise<void>} Resolves when the order is reverted.
|
2657
|
+
*
|
2658
|
+
* @example
|
2659
|
+
* await orderModuleService.revertLastVersion("123")
|
2660
|
+
*/
|
1153
2661
|
revertLastVersion(orderId: string, sharedContext?: Context): Promise<void>;
|
2662
|
+
/**
|
2663
|
+
* This method retrieves a paginated list of transactions based on optional filters and configuration.
|
2664
|
+
*
|
2665
|
+
* @param {FilterableOrderTransactionProps} filters - The filters to apply on the retrieved transactions.
|
2666
|
+
* @param {FindConfig<OrderTransactionDTO>} config - The configurations determining how the transaction is retrieved. Its properties, such as `select` or `relations`, accept the
|
2667
|
+
* attributes or relations associated with a transaction.
|
2668
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2669
|
+
* @returns {Promise<OrderTransactionDTO[]>} The list of transactions.
|
2670
|
+
*
|
2671
|
+
* @example
|
2672
|
+
* To retrieve a list of transactions using their IDs:
|
2673
|
+
*
|
2674
|
+
* ```ts
|
2675
|
+
* const transactions = await orderModuleService.listTransactions({
|
2676
|
+
* id: ["123", "321"]
|
2677
|
+
* })
|
2678
|
+
* ```
|
2679
|
+
*
|
2680
|
+
* To specify relations that should be retrieved within the transaction:
|
2681
|
+
*
|
2682
|
+
* ```ts
|
2683
|
+
* const transactions = await orderModuleService.listTransactions({
|
2684
|
+
* id: ["123", "321"]
|
2685
|
+
* }, {
|
2686
|
+
* relations: ["order"]
|
2687
|
+
* })
|
2688
|
+
* ```
|
2689
|
+
*
|
2690
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
2691
|
+
*
|
2692
|
+
* ```ts
|
2693
|
+
* const transactions = await orderModuleService.listTransactions({
|
2694
|
+
* id: ["123", "321"]
|
2695
|
+
* }, {
|
2696
|
+
* relations: ["order"],
|
2697
|
+
* take: 20,
|
2698
|
+
* skip: 2
|
2699
|
+
* })
|
2700
|
+
* ```
|
2701
|
+
*/
|
1154
2702
|
listTransactions(filters?: FilterableOrderTransactionProps, config?: FindConfig<OrderTransactionDTO>, sharedContext?: Context): Promise<OrderTransactionDTO[]>;
|
2703
|
+
/**
|
2704
|
+
* This method adds a transaction to an order.
|
2705
|
+
*
|
2706
|
+
* @param {CreateOrderTransactionDTO} data - The transaction to be created.
|
2707
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2708
|
+
* @returns {Promise<OrderTransactionDTO>} The created transaction.
|
2709
|
+
*
|
2710
|
+
* @example
|
2711
|
+
* const transaction = await orderModuleService.addTransactions({
|
2712
|
+
* order_id: "123",
|
2713
|
+
* amount: 10,
|
2714
|
+
* currency_code: "usd"
|
2715
|
+
* })
|
2716
|
+
*/
|
1155
2717
|
addTransactions(data: CreateOrderTransactionDTO, sharedContext?: Context): Promise<OrderTransactionDTO>;
|
2718
|
+
/**
|
2719
|
+
* This method adds transactions to an order.
|
2720
|
+
*
|
2721
|
+
* @param {CreateOrderTransactionDTO[]} data - The order transactions to be created.
|
2722
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2723
|
+
* @returns {Promise<OrderTransactionDTO[]>} The created order transactions.
|
2724
|
+
*
|
2725
|
+
* @example
|
2726
|
+
* const transactions = await orderModuleService.addTransactions([{
|
2727
|
+
* order_id: "123",
|
2728
|
+
* amount: 10,
|
2729
|
+
* currency_code: "usd"
|
2730
|
+
* }])
|
2731
|
+
*/
|
1156
2732
|
addTransactions(data: CreateOrderTransactionDTO[], sharedContext?: Context): Promise<OrderTransactionDTO[]>;
|
2733
|
+
/**
|
2734
|
+
* This method deletes transactions by their IDs.
|
2735
|
+
*
|
2736
|
+
* @param {string | object | string[] | object[]} transactionIds - The ID(s) of the transaction to delete.
|
2737
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2738
|
+
* @returns {Promise<void>} Resolves when the transaction(s) are deleted successfully.
|
2739
|
+
*
|
2740
|
+
* @example
|
2741
|
+
* To delete one transaction:
|
2742
|
+
*
|
2743
|
+
* ```ts
|
2744
|
+
* await orderModuleService.deleteTransactions("123")
|
2745
|
+
* ```
|
2746
|
+
*
|
2747
|
+
* To delete multiple transactions:
|
2748
|
+
*
|
2749
|
+
* ```ts
|
2750
|
+
* await orderModuleService.deleteTransactions(["123", "321"])
|
2751
|
+
* ```
|
2752
|
+
*/
|
1157
2753
|
deleteTransactions(transactionIds: string | object | string[] | object[], sharedContext?: Context): Promise<void>;
|
2754
|
+
/**
|
2755
|
+
* This method soft deletes transactions by their IDs.
|
2756
|
+
*
|
2757
|
+
* @param {string[]} transactionIds - The IDs of transactions.
|
2758
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2759
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2760
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2761
|
+
* The object's keys are the ID attribute names of the transaction entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2762
|
+
* with the transaction through this relation.
|
2763
|
+
*
|
2764
|
+
* If there are no related records, the promise resolves to `void`.
|
2765
|
+
*
|
2766
|
+
* @example
|
2767
|
+
* await orderModuleService.softDeleteTransactions(["123", "321"])
|
2768
|
+
*/
|
1158
2769
|
softDeleteTransactions<TReturnableLinkableKeys extends string = string>(transactionIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
2770
|
+
/**
|
2771
|
+
* This method restores soft-deleted transactions by their IDs.
|
2772
|
+
*
|
2773
|
+
* @param {string[]} transactionIds - The IDs of transactions.
|
2774
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the transactions. You can pass to its `returnLinkableKeys`
|
2775
|
+
* property any of the transaction's relation attribute names.
|
2776
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2777
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
2778
|
+
* The object's keys are the ID attribute names of the transaction entity's relations,
|
2779
|
+
* and its value is an array of strings, each being the ID of the record associated with the transaction through this relation.
|
2780
|
+
*
|
2781
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2782
|
+
*
|
2783
|
+
* @example
|
2784
|
+
* await orderModuleService.restoreTransactions(["123", "321"])
|
2785
|
+
*/
|
1159
2786
|
restoreTransactions<TReturnableLinkableKeys extends string = string>(transactionIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
2787
|
+
/**
|
2788
|
+
* This method retrieves a return reason by its ID.
|
2789
|
+
*
|
2790
|
+
* @param {string} reasonId - The return reason's ID.
|
2791
|
+
* @param {FindConfig<OrderReturnReasonDTO>} config - The configurations determining how the return reason is retrieved. Its properties, such as `select` or `relations`, accept the
|
2792
|
+
* attributes or relations associated with a return reason.
|
2793
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2794
|
+
* @returns {Promise<OrderReturnReasonDTO>} The retrieved return reason.
|
2795
|
+
*
|
2796
|
+
* @example
|
2797
|
+
* A simple example that retrieves a return reason by its ID:
|
2798
|
+
*
|
2799
|
+
* ```ts
|
2800
|
+
* const returnReason = await orderModuleService.retrieveReturnReason(
|
2801
|
+
* "123"
|
2802
|
+
* )
|
2803
|
+
* ```
|
2804
|
+
*
|
2805
|
+
* To specify relations that should be retrieved:
|
2806
|
+
*
|
2807
|
+
* ```ts
|
2808
|
+
* const returnReason = await orderModuleService.retrieveReturnReason(
|
2809
|
+
* "123",
|
2810
|
+
* {
|
2811
|
+
* relations: ["parent_return_reason"]
|
2812
|
+
* }
|
2813
|
+
* )
|
2814
|
+
* ```
|
2815
|
+
*/
|
1160
2816
|
retrieveReturnReason(reasonId: string, config?: FindConfig<OrderReturnReasonDTO>, sharedContext?: Context): Promise<OrderReturnReasonDTO>;
|
2817
|
+
/**
|
2818
|
+
* This method retrieves a paginated list of return reasons based on optional filters and configuration.
|
2819
|
+
*
|
2820
|
+
* @param {FilterableOrderReturnReasonProps} filters - The filters to apply on the retrieved return reasons.
|
2821
|
+
* @param {FindConfig<OrderReturnReasonDTO>} config - The configurations determining how the return reason is retrieved. Its properties, such as `select` or `relations`, accept the
|
2822
|
+
* attributes or relations associated with a return reason.
|
2823
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2824
|
+
* @returns {Promise<OrderReturnReasonDTO[]>} The list of return reasons.
|
2825
|
+
*
|
2826
|
+
* @example
|
2827
|
+
* To retrieve a list of return reasons using their IDs:
|
2828
|
+
*
|
2829
|
+
* ```ts
|
2830
|
+
* const returnReasons = await orderModuleService.listReturnReasons({
|
2831
|
+
* id: ["123", "321"]
|
2832
|
+
* })
|
2833
|
+
* ```
|
2834
|
+
*
|
2835
|
+
* To specify relations that should be retrieved within the return reason:
|
2836
|
+
*
|
2837
|
+
* ```ts
|
2838
|
+
* const returnReasons = await orderModuleService.listReturnReasons({
|
2839
|
+
* id: ["123", "321"]
|
2840
|
+
* }, {
|
2841
|
+
* relations: ["parent_return_reason"]
|
2842
|
+
* })
|
2843
|
+
* ```
|
2844
|
+
*
|
2845
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
2846
|
+
*
|
2847
|
+
* ```ts
|
2848
|
+
* const returnReasons = await orderModuleService.listReturnReasons({
|
2849
|
+
* id: ["123", "321"]
|
2850
|
+
* }, {
|
2851
|
+
* relations: ["parent_return_reason"],
|
2852
|
+
* take: 20,
|
2853
|
+
* skip: 2
|
2854
|
+
* })
|
2855
|
+
* ```
|
2856
|
+
*/
|
1161
2857
|
listReturnReasons(filters: FilterableOrderReturnReasonProps, config?: FindConfig<OrderReturnReasonDTO>, sharedContext?: Context): Promise<OrderReturnReasonDTO[]>;
|
2858
|
+
/**
|
2859
|
+
* This method creates a return reason.
|
2860
|
+
*
|
2861
|
+
* @param {CreateOrderReturnReasonDTO} returnReasonData - The return reason to be created.
|
2862
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2863
|
+
* @returns {Promise<OrderReturnReasonDTO>} The created return reason.
|
2864
|
+
*
|
2865
|
+
* @example
|
2866
|
+
* const returnReason = await orderModuleService.createReturnReasons({
|
2867
|
+
* label: "Damaged",
|
2868
|
+
* value: "damaged"
|
2869
|
+
* })
|
2870
|
+
*/
|
1162
2871
|
createReturnReasons(returnReasonData: CreateOrderReturnReasonDTO, sharedContext?: Context): Promise<OrderReturnReasonDTO>;
|
2872
|
+
/**
|
2873
|
+
* This method creates return reasons.
|
2874
|
+
*
|
2875
|
+
* @param {CreateOrderReturnReasonDTO[]} returnReasonData - The return reasons to be created.
|
2876
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2877
|
+
* @returns {Promise<OrderReturnReasonDTO[]>} The created return reason.
|
2878
|
+
*
|
2879
|
+
* @example
|
2880
|
+
* const returnReasons = await orderModuleService.createReturnReasons([{
|
2881
|
+
* label: "Damaged",
|
2882
|
+
* value: "damaged"
|
2883
|
+
* }])
|
2884
|
+
*/
|
1163
2885
|
createReturnReasons(returnReasonData: CreateOrderReturnReasonDTO[], sharedContext?: Context): Promise<OrderReturnReasonDTO[]>;
|
2886
|
+
/**
|
2887
|
+
* This method updates existing return reasons.
|
2888
|
+
*
|
2889
|
+
* @param {UpdateOrderReturnReasonWithSelectorDTO[]} data - The filters that specifies which
|
2890
|
+
* return reasons to update, and the data to update in them.
|
2891
|
+
* @returns {Promise<OrderReturnReasonDTO[]>} The updated return reasons.
|
2892
|
+
*
|
2893
|
+
* @example
|
2894
|
+
* const returnReasons = await orderModuleService.updateReturnReasons([{
|
2895
|
+
* selector: {
|
2896
|
+
* id: "13"
|
2897
|
+
* },
|
2898
|
+
* data: {
|
2899
|
+
* label: "Damaged"
|
2900
|
+
* }
|
2901
|
+
* }])
|
2902
|
+
*/
|
1164
2903
|
updateReturnReasons(data: UpdateOrderReturnReasonWithSelectorDTO[], sharedContext?: Context): Promise<OrderReturnReasonDTO[]>;
|
2904
|
+
/**
|
2905
|
+
* This method updates existing return reasons matching the specified filters.
|
2906
|
+
*
|
2907
|
+
* @param {Partial<FilterableOrderReturnReasonProps>} selector - The filters specifying which return reason to delete.
|
2908
|
+
* @param {Partial<UpdateOrderReturnReasonDTO>} data - The data to update in the return reasons.
|
2909
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2910
|
+
* @returns {Promise<OrderReturnReasonDTO[]>} The updated return reasons.
|
2911
|
+
*
|
2912
|
+
* @example
|
2913
|
+
* const returnReasons = await orderModuleService.updateReturnReasons({
|
2914
|
+
* id: "123"
|
2915
|
+
* }, {
|
2916
|
+
* label: "Damaged"
|
2917
|
+
* })
|
2918
|
+
*/
|
1165
2919
|
updateReturnReasons(selector: Partial<FilterableOrderReturnReasonProps>, data: Partial<UpdateOrderReturnReasonDTO>, sharedContext?: Context): Promise<OrderReturnReasonDTO[]>;
|
2920
|
+
/**
|
2921
|
+
* This method updates an existing return reason.
|
2922
|
+
*
|
2923
|
+
* @param {string} id - The ID of the return reason.
|
2924
|
+
* @param {Partial<UpdateOrderReturnReasonDTO>} data - The data to update in the return reason.
|
2925
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2926
|
+
* @returns {Promise<OrderReturnReasonDTO>} The updated return reason.
|
2927
|
+
*
|
2928
|
+
* @example
|
2929
|
+
* const returnReason = await orderModuleService.updateReturnReasons(
|
2930
|
+
* "123",
|
2931
|
+
* {
|
2932
|
+
* label: "Damaged"
|
2933
|
+
* }
|
2934
|
+
* )
|
2935
|
+
*/
|
1166
2936
|
updateReturnReasons(id: string, data: Partial<UpdateOrderReturnReasonDTO>, sharedContext?: Context): Promise<OrderReturnReasonDTO>;
|
2937
|
+
/**
|
2938
|
+
* This method deletes return reasons by their IDs.
|
2939
|
+
*
|
2940
|
+
* @param {string[]} returnReasonIds - The IDs of return reasons.
|
2941
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2942
|
+
* @returns {Promise<void>} Resolves when the return reasons are deleted successfully.
|
2943
|
+
*
|
2944
|
+
* @example
|
2945
|
+
* await orderModuleService.deleteReturnReasons([
|
2946
|
+
* "123", "321"
|
2947
|
+
* ])
|
2948
|
+
*/
|
1167
2949
|
deleteReturnReasons(returnReasonIds: string[], sharedContext?: Context): Promise<void>;
|
2950
|
+
/**
|
2951
|
+
* This method soft deletes return reasons by their IDs.
|
2952
|
+
*
|
2953
|
+
* @param {string[]} ids - The IDs of the return reasons.
|
2954
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
2955
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2956
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
2957
|
+
* The object's keys are the ID attribute names of the return reason entity's relations, and its value is an array of strings, each being the ID of a record associated
|
2958
|
+
* with the return reason through this relation.
|
2959
|
+
*
|
2960
|
+
* If there are no related records, the promise resolves to `void`.
|
2961
|
+
*
|
2962
|
+
* @example
|
2963
|
+
* await orderModuleService.softDeleteReturnReasons([
|
2964
|
+
* "123", "321"
|
2965
|
+
* ])
|
2966
|
+
*/
|
1168
2967
|
softDeleteReturnReasons<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
2968
|
+
/**
|
2969
|
+
* This method restores soft-deleted return reasons by their IDs.
|
2970
|
+
*
|
2971
|
+
* @param {string[]} ids - The IDs of the return reasons.
|
2972
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the return reasons. You can pass to its `returnLinkableKeys`
|
2973
|
+
* property any of the return reason's relation attribute names.
|
2974
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2975
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
2976
|
+
* The object's keys are the ID attribute names of the return reason entity's relations,
|
2977
|
+
* and its value is an array of strings, each being the ID of the record associated with the return reason through this relation.
|
2978
|
+
*
|
2979
|
+
* If there are no related records restored, the promise resolves to `void`.
|
2980
|
+
*
|
2981
|
+
* @example
|
2982
|
+
* await orderModuleService.restoreReturnReasons([
|
2983
|
+
* "123", "321"
|
2984
|
+
* ])
|
2985
|
+
*/
|
1169
2986
|
restoreReturnReasons<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
2987
|
+
/**
|
2988
|
+
* This method creates a return item.
|
2989
|
+
*
|
2990
|
+
* @param {CreateOrderReturnItemDTO} data - The return item to be created.
|
2991
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
2992
|
+
* @returns {Promise<OrderReturnItemDTO>} The created return item.
|
2993
|
+
*
|
2994
|
+
* @example
|
2995
|
+
* const returnItem = await orderModuleService.createReturnItems({
|
2996
|
+
* return_id: "123",
|
2997
|
+
* item_id: "321",
|
2998
|
+
* quantity: 1
|
2999
|
+
* })
|
3000
|
+
*/
|
1170
3001
|
createReturnItems(data: CreateOrderReturnItemDTO, sharedContext?: Context): Promise<OrderReturnItemDTO>;
|
3002
|
+
/**
|
3003
|
+
* This method creates return items.
|
3004
|
+
*
|
3005
|
+
* @param {CreateOrderReturnItemDTO[]} data - The return items to be created.
|
3006
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3007
|
+
* @returns {Promise<OrderReturnItemDTO[]>} The created return items.
|
3008
|
+
*
|
3009
|
+
* @example
|
3010
|
+
* const returnItems = await orderModuleService.createReturnItems([{
|
3011
|
+
* return_id: "123",
|
3012
|
+
* item_id: "321",
|
3013
|
+
* quantity: 1
|
3014
|
+
* }])
|
3015
|
+
*/
|
1171
3016
|
createReturnItems(data: CreateOrderReturnItemDTO[], sharedContext?: Context): Promise<OrderReturnItemDTO[]>;
|
3017
|
+
/**
|
3018
|
+
* This method creates a order claim item.
|
3019
|
+
*
|
3020
|
+
* @param {CreateOrderClaimItemDTO} data - The order claim item to be created.
|
3021
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3022
|
+
* @returns {Promise<OrderClaimItemDTO>} The created order claim item.
|
3023
|
+
*
|
3024
|
+
* @example
|
3025
|
+
* const orderClaimItem = await orderModuleService.createOrderClaimItems({
|
3026
|
+
* claim_id: "123",
|
3027
|
+
* item_id: "321",
|
3028
|
+
* quantity: 1
|
3029
|
+
* })
|
3030
|
+
*/
|
1172
3031
|
createOrderClaimItems(data: CreateOrderClaimItemDTO, sharedContext?: Context): Promise<OrderClaimItemDTO>;
|
3032
|
+
/**
|
3033
|
+
* This method creates order claim items.
|
3034
|
+
*
|
3035
|
+
* @param {CreateOrderClaimItemDTO[]} data - The order claim items to be created.
|
3036
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3037
|
+
* @returns {Promise<OrderClaimItemDTO[]>} The created order claim items.
|
3038
|
+
*
|
3039
|
+
* @example
|
3040
|
+
* const orderClaimItems = await orderModuleService.createOrderClaimItems([
|
3041
|
+
* {
|
3042
|
+
* claim_id: "123",
|
3043
|
+
* item_id: "321",
|
3044
|
+
* quantity: 1
|
3045
|
+
* },
|
3046
|
+
* {
|
3047
|
+
* claim_id: "321",
|
3048
|
+
* item_id: "321",
|
3049
|
+
* is_additional_item: 1,
|
3050
|
+
* quantity: 1
|
3051
|
+
* }
|
3052
|
+
* ])
|
3053
|
+
*/
|
1173
3054
|
createOrderClaimItems(data: CreateOrderClaimItemDTO[], sharedContext?: Context): Promise<OrderClaimItemDTO[]>;
|
3055
|
+
/**
|
3056
|
+
* This method creates an order exchange item.
|
3057
|
+
*
|
3058
|
+
* @param {CreateOrderExchangeItemDTO} data - The order exchange item to be created.
|
3059
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3060
|
+
* @returns {Promise<OrderExchangeItemDTO>} The created order exchange item.
|
3061
|
+
*
|
3062
|
+
* @example
|
3063
|
+
* const orderExchangeItem = await orderModuleService.createOrderExchangeItems({
|
3064
|
+
* exchange_id: "123",
|
3065
|
+
* item_id: "321",
|
3066
|
+
* quantity: 1
|
3067
|
+
* })
|
3068
|
+
*/
|
1174
3069
|
createOrderExchangeItems(data: CreateOrderExchangeItemDTO, sharedContext?: Context): Promise<OrderExchangeItemDTO>;
|
3070
|
+
/**
|
3071
|
+
* This method creates order exchange items.
|
3072
|
+
*
|
3073
|
+
* @param {CreateOrderExchangeItemDTO[]} data - The order exchange items to be created.
|
3074
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3075
|
+
* @returns {Promise<OrderExchangeItemDTO[]>} The created order exchange items.
|
3076
|
+
*
|
3077
|
+
* @example
|
3078
|
+
* const orderExchangeItems = await orderModuleService.createOrderExchangeItems([
|
3079
|
+
* {
|
3080
|
+
* exchange_id: "123",
|
3081
|
+
* item_id: "321",
|
3082
|
+
* quantity: 1
|
3083
|
+
* },
|
3084
|
+
* {
|
3085
|
+
* exchange_id: "321",
|
3086
|
+
* item_id: "123",
|
3087
|
+
* quantity: 1
|
3088
|
+
* }
|
3089
|
+
* ])
|
3090
|
+
*/
|
1175
3091
|
createOrderExchangeItems(data: CreateOrderExchangeItemDTO[], sharedContext?: Context): Promise<OrderExchangeItemDTO[]>;
|
3092
|
+
/**
|
3093
|
+
* This method creates a return.
|
3094
|
+
*
|
3095
|
+
* @param {CreateOrderReturnDTO} data - The return to be created.
|
3096
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3097
|
+
* @returns {Promise<ReturnDTO>} The created return.
|
3098
|
+
*
|
3099
|
+
* @example
|
3100
|
+
* const orderReturn = await orderModuleService.createReturns({
|
3101
|
+
* order_id: "123",
|
3102
|
+
* items: [
|
3103
|
+
* {
|
3104
|
+
* id: "321",
|
3105
|
+
* quantity: 1
|
3106
|
+
* }
|
3107
|
+
* ]
|
3108
|
+
* })
|
3109
|
+
*/
|
1176
3110
|
createReturns(data: CreateOrderReturnDTO, sharedContext?: Context): Promise<ReturnDTO>;
|
3111
|
+
/**
|
3112
|
+
* This method creates returns.
|
3113
|
+
*
|
3114
|
+
* @param {CreateOrderReturnDTO[]} data - The returns to be created.
|
3115
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3116
|
+
* @returns {Promise<ReturnDTO[]>} The created returns.
|
3117
|
+
*
|
3118
|
+
* @example
|
3119
|
+
* const returns = await orderModuleService.createReturns([{
|
3120
|
+
* order_id: "123",
|
3121
|
+
* items: [
|
3122
|
+
* {
|
3123
|
+
* id: "321",
|
3124
|
+
* quantity: 1
|
3125
|
+
* }
|
3126
|
+
* ]
|
3127
|
+
* }])
|
3128
|
+
*/
|
1177
3129
|
createReturns(data: CreateOrderReturnDTO[], sharedContext?: Context): Promise<ReturnDTO[]>;
|
3130
|
+
/**
|
3131
|
+
* This method updates existing returns.
|
3132
|
+
*
|
3133
|
+
* @param {UpdateOrderReturnWithSelectorDTO[]} data - The filters specifying which returns to update,
|
3134
|
+
* and the data to update in them.
|
3135
|
+
* @returns {Promise<ReturnDTO[]>} The updated returns.
|
3136
|
+
*
|
3137
|
+
* @example
|
3138
|
+
* const returns = await orderModuleService.updateReturns([{
|
3139
|
+
* selector: {
|
3140
|
+
* id: "123"
|
3141
|
+
* },
|
3142
|
+
* data: {
|
3143
|
+
* refund_amount: 10
|
3144
|
+
* }
|
3145
|
+
* }])
|
3146
|
+
*/
|
1178
3147
|
updateReturns(data: UpdateOrderReturnWithSelectorDTO[], sharedContext?: Context): Promise<ReturnDTO[]>;
|
3148
|
+
/**
|
3149
|
+
* This method updates existing returns matching the specified filters.
|
3150
|
+
*
|
3151
|
+
* @param {Partial<FilterableReturnProps>} selector - The filters specifying which returns to update.
|
3152
|
+
* @param {Partial<UpdateReturnDTO>} data - The data to update in the returns.
|
3153
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3154
|
+
* @returns {Promise<ReturnDTO[]>} The updated returns.
|
3155
|
+
*
|
3156
|
+
* @example
|
3157
|
+
* const returns = await orderModuleService.updateReturns({
|
3158
|
+
* id: "123"
|
3159
|
+
* }, {
|
3160
|
+
* refund_amount: 10
|
3161
|
+
* })
|
3162
|
+
*/
|
1179
3163
|
updateReturns(selector: Partial<FilterableReturnProps>, data: Partial<UpdateReturnDTO>, sharedContext?: Context): Promise<ReturnDTO[]>;
|
3164
|
+
/**
|
3165
|
+
* This method updates an existing return.
|
3166
|
+
*
|
3167
|
+
* @param {string} id - The ID of the return.
|
3168
|
+
* @param {Partial<UpdateReturnDTO>} data - The data to update.
|
3169
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3170
|
+
* @returns {Promise<ReturnDTO>} The updated return.
|
3171
|
+
*
|
3172
|
+
* @example
|
3173
|
+
* const orderReturn = await orderModuleService.updateReturns(
|
3174
|
+
* "123",
|
3175
|
+
* {
|
3176
|
+
* refund_amount: 10
|
3177
|
+
* }
|
3178
|
+
* )
|
3179
|
+
*/
|
1180
3180
|
updateReturns(id: string, data: Partial<UpdateReturnDTO>, sharedContext?: Context): Promise<ReturnDTO>;
|
3181
|
+
/**
|
3182
|
+
* This method deletes returns by their IDs.
|
3183
|
+
*
|
3184
|
+
* @param {string[]} ids - The IDs of the returns.
|
3185
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3186
|
+
* @returns {Promise<void>} Resolves when the returns are deleted successfully.
|
3187
|
+
*
|
3188
|
+
* @example
|
3189
|
+
* await orderModuleService.deleteReturns(["123", "321"])
|
3190
|
+
*/
|
1181
3191
|
deleteReturns(ids: string[], sharedContext?: Context): Promise<void>;
|
3192
|
+
/**
|
3193
|
+
* This method deletes return items by their IDs.
|
3194
|
+
*
|
3195
|
+
* @param {string[]} ids - The IDs of the return items.
|
3196
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3197
|
+
* @returns {Promise<void>} Resolves when the return items are deleted successfully.
|
3198
|
+
*
|
3199
|
+
* @example
|
3200
|
+
* await orderModuleService.deleteReturnItems(["123", "321"])
|
3201
|
+
*/
|
1182
3202
|
deleteReturnItems(ids: string[], sharedContext?: Context): Promise<void>;
|
3203
|
+
/**
|
3204
|
+
* This method soft deletes returns by their IDs.
|
3205
|
+
*
|
3206
|
+
* @param {string[]} ids - The IDs of the returns.
|
3207
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
3208
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3209
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
3210
|
+
* The object's keys are the ID attribute names of the return entity's relations, and its value is an array of strings, each being the ID of a record associated
|
3211
|
+
* with the return through this relation.
|
3212
|
+
*
|
3213
|
+
* If there are no related records, the promise resolves to `void`.
|
3214
|
+
*
|
3215
|
+
* @example
|
3216
|
+
* await orderModuleService.softDeleteReturns(["123", "321"])
|
3217
|
+
*/
|
1183
3218
|
softDeleteReturns<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
3219
|
+
/**
|
3220
|
+
* This method restores soft-deleted returns by their IDs.
|
3221
|
+
*
|
3222
|
+
* @param {string[]} ids - The IDs of the returns.
|
3223
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the returns. You can pass to its `returnLinkableKeys`
|
3224
|
+
* property any of the return's relation attribute names.
|
3225
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3226
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
3227
|
+
* The object's keys are the ID attribute names of the return entity's relations,
|
3228
|
+
* and its value is an array of strings, each being the ID of the record associated with the return through this relation.
|
3229
|
+
*
|
3230
|
+
* If there are no related records restored, the promise resolves to `void`.
|
3231
|
+
*
|
3232
|
+
* @example
|
3233
|
+
* await orderModuleService.restoreReturns(["123", "321"])
|
3234
|
+
*/
|
1184
3235
|
restoreReturns<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
3236
|
+
/**
|
3237
|
+
* This method creates an order claim.
|
3238
|
+
*
|
3239
|
+
* @param {CreateOrderClaimDTO} data - The order claim to be created.
|
3240
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3241
|
+
* @returns {Promise<OrderClaimDTO>} The created order claim.
|
3242
|
+
*
|
3243
|
+
* @example
|
3244
|
+
* const claim = await orderModuleService.createOrderClaims({
|
3245
|
+
* order_id: "123",
|
3246
|
+
* type: "refund"
|
3247
|
+
* })
|
3248
|
+
*/
|
1185
3249
|
createOrderClaims(data: CreateOrderClaimDTO, sharedContext?: Context): Promise<OrderClaimDTO>;
|
3250
|
+
/**
|
3251
|
+
* This method creates order claims.
|
3252
|
+
*
|
3253
|
+
* @param {CreateOrderClaimDTO[]} data - The order claims to be created.
|
3254
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3255
|
+
* @returns {Promise<OrderClaimDTO[]>} The created order claims.
|
3256
|
+
*
|
3257
|
+
* @example
|
3258
|
+
* const claims = await orderModuleService.createOrderClaims([{
|
3259
|
+
* order_id: "123",
|
3260
|
+
* type: "refund"
|
3261
|
+
* }])
|
3262
|
+
*/
|
1186
3263
|
createOrderClaims(data: CreateOrderClaimDTO[], sharedContext?: Context): Promise<OrderClaimDTO[]>;
|
3264
|
+
/**
|
3265
|
+
* This method updates existing order claims.
|
3266
|
+
*
|
3267
|
+
* @param {UpdateOrderClaimWithSelectorDTO[]} data - The filters specifying which order claims to update,
|
3268
|
+
* and the data to update in them.
|
3269
|
+
* @returns {Promise<OrderClaimDTO[]>} The updated order claims.
|
3270
|
+
*
|
3271
|
+
* @example
|
3272
|
+
* const claims = await orderModuleService.updateOrderClaims([
|
3273
|
+
* {
|
3274
|
+
* selector: {
|
3275
|
+
* id: "123"
|
3276
|
+
* },
|
3277
|
+
* data: {
|
3278
|
+
* type: "refund"
|
3279
|
+
* }
|
3280
|
+
* }
|
3281
|
+
* ])
|
3282
|
+
*/
|
1187
3283
|
updateOrderClaims(data: UpdateOrderClaimWithSelectorDTO[], sharedContext?: Context): Promise<OrderClaimDTO[]>;
|
3284
|
+
/**
|
3285
|
+
* This method updates existing order claims matching the specified filters.
|
3286
|
+
*
|
3287
|
+
* @param {Partial<FilterableOrderClaimProps>} selector - The filters specifying which order claims to update.
|
3288
|
+
* @param {Partial<UpdateOrderClaimDTO>} data - The data to update in the order claims.
|
3289
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3290
|
+
* @returns {Promise<OrderClaimDTO[]>} The updated order claims.
|
3291
|
+
*
|
3292
|
+
* @example
|
3293
|
+
* const claims = await orderModuleService.updateOrderClaims({
|
3294
|
+
* id: "123"
|
3295
|
+
* }, {
|
3296
|
+
* type: "refund"
|
3297
|
+
* })
|
3298
|
+
*/
|
1188
3299
|
updateOrderClaims(selector: Partial<FilterableOrderClaimProps>, data: Partial<UpdateOrderClaimDTO>, sharedContext?: Context): Promise<OrderClaimDTO[]>;
|
3300
|
+
/**
|
3301
|
+
* This method updates an existing order claim.
|
3302
|
+
*
|
3303
|
+
* @param {string} id - The ID of the order claim.
|
3304
|
+
* @param {Partial<UpdateOrderClaimDTO>} data - The data to update in the order claim.
|
3305
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3306
|
+
* @returns {Promise<OrderClaimDTO>} The updated order claim.
|
3307
|
+
*
|
3308
|
+
* @example
|
3309
|
+
* const claim = await orderModuleService.updateOrderClaims("123", {
|
3310
|
+
* type: "refund"
|
3311
|
+
* })
|
3312
|
+
*/
|
1189
3313
|
updateOrderClaims(id: string, data: Partial<UpdateOrderClaimDTO>, sharedContext?: Context): Promise<OrderClaimDTO>;
|
3314
|
+
/**
|
3315
|
+
* This method deletes an order claim by its ID.
|
3316
|
+
*
|
3317
|
+
* @param {string[]} ids - The IDs of the order claims.
|
3318
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3319
|
+
* @returns {Promise<void>} Resolves when the order claims are deleted successfully.
|
3320
|
+
*
|
3321
|
+
* @example
|
3322
|
+
* await orderModuleService.deleteOrderClaims(["123", "321"])
|
3323
|
+
*/
|
1190
3324
|
deleteOrderClaims(ids: string[], sharedContext?: Context): Promise<void>;
|
3325
|
+
/**
|
3326
|
+
* This method deletes order claim items by their IDs.
|
3327
|
+
*
|
3328
|
+
* @param {string[]} ids - The IDs of the order claim items.
|
3329
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3330
|
+
* @returns {Promise<void>} Resolves when the claim items are deleted.
|
3331
|
+
*
|
3332
|
+
* @example
|
3333
|
+
* await orderModuleService.deleteOrderClaimItems([
|
3334
|
+
* "123", "321"
|
3335
|
+
* ])
|
3336
|
+
*/
|
1191
3337
|
deleteOrderClaimItems(ids: string[], sharedContext?: Context): Promise<void>;
|
3338
|
+
/**
|
3339
|
+
* This method deletes order claim item images by their IDs.
|
3340
|
+
*
|
3341
|
+
* @param {string[]} ids - The IDs of the order claim item images.
|
3342
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3343
|
+
* @returns {Promise<void>} Resolves when the claim items are deleted.
|
3344
|
+
*
|
3345
|
+
* @example
|
3346
|
+
* await orderModuleService.deleteOrderClaimItemImages([
|
3347
|
+
* "123", "321"
|
3348
|
+
* ])
|
3349
|
+
*/
|
1192
3350
|
deleteOrderClaimItemImages(ids: string[], sharedContext?: Context): Promise<void>;
|
3351
|
+
/**
|
3352
|
+
* This method soft deletes order claims by their IDs.
|
3353
|
+
*
|
3354
|
+
* @param {string[]} ids - The IDs of the order claims.
|
3355
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
3356
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3357
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
3358
|
+
* The object's keys are the ID attribute names of the order claim entity's relations, and its value is an array of strings, each being the ID of a record associated
|
3359
|
+
* with the order claim through this relation.
|
3360
|
+
*
|
3361
|
+
* If there are no related records, the promise resolves to `void`.
|
3362
|
+
*
|
3363
|
+
* @example
|
3364
|
+
* await orderModuleService.softDeleteOrderClaims(["123", "321"])
|
3365
|
+
*/
|
1193
3366
|
softDeleteOrderClaims<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
3367
|
+
/**
|
3368
|
+
* This method restores soft-deleted order claims by their IDs.
|
3369
|
+
*
|
3370
|
+
* @param {string[]} ids - The IDs of the order claims.
|
3371
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the order. You can pass to its `returnLinkableKeys`
|
3372
|
+
* property any of the order claim's relation attribute names.
|
3373
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3374
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
3375
|
+
* The object's keys are the ID attribute names of the order claim entity's relations,
|
3376
|
+
* and its value is an array of strings, each being the ID of the record associated with the order claims through this relation.
|
3377
|
+
*
|
3378
|
+
* If there are no related records restored, the promise resolves to `void`.
|
3379
|
+
*
|
3380
|
+
* @example
|
3381
|
+
* await orderModuleService.restoreOrderClaims(["123", "321"])
|
3382
|
+
*/
|
1194
3383
|
restoreOrderClaims<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
3384
|
+
/**
|
3385
|
+
* This method creates an order exchange.
|
3386
|
+
*
|
3387
|
+
* @param {CreateOrderExchangeDTO} data - The order exchange to be created.
|
3388
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3389
|
+
* @returns {Promise<OrderExchangeDTO>} The created order exchange.
|
3390
|
+
*
|
3391
|
+
* @example
|
3392
|
+
* const exchange = await orderModuleService.createOrderExchanges({
|
3393
|
+
* order_id: "123",
|
3394
|
+
* additional_items: [
|
3395
|
+
* {
|
3396
|
+
* id: "123",
|
3397
|
+
* quantity: 1
|
3398
|
+
* }
|
3399
|
+
* ]
|
3400
|
+
* })
|
3401
|
+
*/
|
1195
3402
|
createOrderExchanges(data: CreateOrderExchangeDTO, sharedContext?: Context): Promise<OrderExchangeDTO>;
|
3403
|
+
/**
|
3404
|
+
* This method creates order exchanges.
|
3405
|
+
*
|
3406
|
+
* @param {CreateOrderExchangeDTO[]} data - The order exchanges to be created.
|
3407
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3408
|
+
* @returns {Promise<OrderExchangeDTO[]>} The created order exchanges.
|
3409
|
+
*
|
3410
|
+
* @example
|
3411
|
+
* const exchanges = await orderModuleService.createOrderExchanges([{
|
3412
|
+
* order_id: "123",
|
3413
|
+
* additional_items: [
|
3414
|
+
* {
|
3415
|
+
* id: "123",
|
3416
|
+
* quantity: 1
|
3417
|
+
* }
|
3418
|
+
* ]
|
3419
|
+
* }])
|
3420
|
+
*/
|
1196
3421
|
createOrderExchanges(data: CreateOrderExchangeDTO[], sharedContext?: Context): Promise<OrderExchangeDTO[]>;
|
3422
|
+
/**
|
3423
|
+
* This method updates existing order exchanges.
|
3424
|
+
*
|
3425
|
+
* @param {UpdateOrderExchangeWithSelectorDTO[]} data - The filters specifying which exchanges to update,
|
3426
|
+
* and the data to update in them.
|
3427
|
+
* @returns {Promise<OrderExchangeDTO[]>} The updated order exchanges.
|
3428
|
+
*
|
3429
|
+
* @example
|
3430
|
+
* const exchanges = await orderModuleService.updateOrderExchanges([
|
3431
|
+
* {
|
3432
|
+
* selector: {
|
3433
|
+
* id: "123"
|
3434
|
+
* },
|
3435
|
+
* data: {
|
3436
|
+
* return_id: "123"
|
3437
|
+
* }
|
3438
|
+
* }
|
3439
|
+
* ])
|
3440
|
+
*/
|
1197
3441
|
updateOrderExchanges(data: UpdateOrderExchangeWithSelectorDTO[], sharedContext?: Context): Promise<OrderExchangeDTO[]>;
|
3442
|
+
/**
|
3443
|
+
* This method updates existing order exchanges matching the specified filters.
|
3444
|
+
*
|
3445
|
+
* @param {Partial<FilterableOrderExchangeProps>} selector - The filters specifying which order exchanges to update.
|
3446
|
+
* @param {Partial<UpdateOrderExchangeDTO>} data - The data to update in the order exchanges.
|
3447
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3448
|
+
* @returns {Promise<OrderExchangeDTO[]>} The updated order exchanges.
|
3449
|
+
*
|
3450
|
+
* @example
|
3451
|
+
* const exchanges = await orderModuleService.updateOrderExchanges({
|
3452
|
+
* id: "123"
|
3453
|
+
* }, {
|
3454
|
+
* return_id: "123"
|
3455
|
+
* })
|
3456
|
+
*/
|
1198
3457
|
updateOrderExchanges(selector: Partial<FilterableOrderExchangeProps>, data: Partial<UpdateOrderExchangeDTO>, sharedContext?: Context): Promise<OrderExchangeDTO[]>;
|
3458
|
+
/**
|
3459
|
+
* This method updates an existing order exchange.
|
3460
|
+
*
|
3461
|
+
* @param {string} id - The ID of the order exchange.
|
3462
|
+
* @param {Partial<UpdateOrderExchangeDTO>} data - The data to update in the order exchange.
|
3463
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3464
|
+
* @returns {Promise<OrderExchangeDTO>} The updated order exchange.
|
3465
|
+
*
|
3466
|
+
* @example
|
3467
|
+
* const exchange = await orderModuleService.updateOrderExchanges(
|
3468
|
+
* "123",
|
3469
|
+
* {
|
3470
|
+
* return_id: "123"
|
3471
|
+
* }
|
3472
|
+
* )
|
3473
|
+
*/
|
1199
3474
|
updateOrderExchanges(id: string, data: Partial<UpdateOrderExchangeDTO>, sharedContext?: Context): Promise<OrderExchangeDTO>;
|
3475
|
+
/**
|
3476
|
+
* This method deletes order exchanges by their IDs.
|
3477
|
+
*
|
3478
|
+
* @param {string[]} ids - The IDs of the order exchanges.
|
3479
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3480
|
+
* @returns {Promise<void>} Resolves when the order exchanges are deleted successfully.
|
3481
|
+
*
|
3482
|
+
* @example
|
3483
|
+
* await orderModuleService.deleteOrderExchanges(["123", "321"])
|
3484
|
+
*/
|
1200
3485
|
deleteOrderExchanges(ids: string[], sharedContext?: Context): Promise<void>;
|
3486
|
+
/**
|
3487
|
+
* This method deletes order exchange items by their IDs.
|
3488
|
+
*
|
3489
|
+
* @param {string[]} ids - The IDs of the order exchange items.
|
3490
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3491
|
+
* @returns {Promise<void>} Resolves when the order exchange items are deleted successfully.
|
3492
|
+
*
|
3493
|
+
* @example
|
3494
|
+
* await orderModuleService.deleteOrderExchangeItems([
|
3495
|
+
* "123", "321"
|
3496
|
+
* ])
|
3497
|
+
*/
|
1201
3498
|
deleteOrderExchangeItems(ids: string[], sharedContext?: Context): Promise<void>;
|
3499
|
+
/**
|
3500
|
+
* This method soft deletes order exchanges by their IDs.
|
3501
|
+
*
|
3502
|
+
* @param {string[]} ids - The IDs of the order exchanges.
|
3503
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
3504
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3505
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
3506
|
+
* The object's keys are the ID attribute names of the order exchange entity's relations, and its value is an array of strings, each being the ID of a record associated
|
3507
|
+
* with the order exchange through this relation.
|
3508
|
+
*
|
3509
|
+
* If there are no related records, the promise resolves to `void`.
|
3510
|
+
*
|
3511
|
+
* @example
|
3512
|
+
* await orderModuleService.softDeleteOrderExchanges(["123", "321"])
|
3513
|
+
*/
|
1202
3514
|
softDeleteOrderExchanges<TReturnableLinkableKeys extends string = string>(ids: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
3515
|
+
/**
|
3516
|
+
* This method restores soft-deleted order exchanges by their IDs.
|
3517
|
+
*
|
3518
|
+
* @param {string[]} ids - The IDs of the order exchanges.
|
3519
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the order exchanges. You can pass to its `returnLinkableKeys`
|
3520
|
+
* property any of the order exchange's relation attribute names.
|
3521
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3522
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
3523
|
+
* The object's keys are the ID attribute names of the order exchange entity's relations,
|
3524
|
+
* and its value is an array of strings, each being the ID of the record associated with the order exchange through this relation.
|
3525
|
+
*
|
3526
|
+
* If there are no related records restored, the promise resolves to `void`.
|
3527
|
+
*
|
3528
|
+
* @example
|
3529
|
+
* await orderModuleService.restoreOrderExchanges(["123", "321"])
|
3530
|
+
*/
|
1203
3531
|
restoreOrderExchanges<TReturnableLinkableKeys extends string = string>(ids: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
1204
|
-
|
3532
|
+
/**
|
3533
|
+
* This method sets the status of orders to `archived`.
|
3534
|
+
*
|
3535
|
+
* @param {string[]} orderIds - The orders' ID.
|
3536
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3537
|
+
* @returns {Promise<OrderDTO[]>} The archived orders.
|
3538
|
+
*
|
3539
|
+
* @example
|
3540
|
+
* const orders = await orderModuleService.archive(["123", "321"])
|
3541
|
+
*/
|
3542
|
+
archive(orderIds: string[], sharedContext?: Context): Promise<OrderDTO[]>;
|
3543
|
+
/**
|
3544
|
+
* This method sets the status of an order to `archived`.
|
3545
|
+
*
|
3546
|
+
* @param {string} orderId - The order's ID.
|
3547
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3548
|
+
* @returns {Promise<OrderDTO>} The archived order.
|
3549
|
+
*
|
3550
|
+
* @example
|
3551
|
+
* const order = await orderModuleService.archive("123")
|
3552
|
+
*/
|
1205
3553
|
archive(orderId: string, sharedContext?: Context): Promise<OrderDTO>;
|
1206
|
-
|
3554
|
+
/**
|
3555
|
+
* This method sets the status of orders to `completed`.
|
3556
|
+
*
|
3557
|
+
* @param {string[]} orderIds - The orders' IDs.
|
3558
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3559
|
+
* @returns {Promise<OrderDTO[]>} The completed orders.
|
3560
|
+
*
|
3561
|
+
* @example
|
3562
|
+
* const orders = await orderModuleService.completeOrder([
|
3563
|
+
* "123", "321"
|
3564
|
+
* ])
|
3565
|
+
*/
|
3566
|
+
completeOrder(orderIds: string[], sharedContext?: Context): Promise<OrderDTO[]>;
|
3567
|
+
/**
|
3568
|
+
* This method sets the status of an order to `completed`.
|
3569
|
+
*
|
3570
|
+
* @param {string} orderId - The order's ID.
|
3571
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3572
|
+
* @returns {Promise<OrderDTO>} The completed order.
|
3573
|
+
*
|
3574
|
+
* @example
|
3575
|
+
* const order = await orderModuleService.completeOrder("123")
|
3576
|
+
*/
|
1207
3577
|
completeOrder(orderId: string, sharedContext?: Context): Promise<OrderDTO>;
|
3578
|
+
/**
|
3579
|
+
* This method sets the status of orders to `canceled`.
|
3580
|
+
*
|
3581
|
+
* @param {string[]} orderId - The orders' IDs.
|
3582
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3583
|
+
* @returns {Promise<OrderDTO[]>} The canceled orders.
|
3584
|
+
*
|
3585
|
+
* @example
|
3586
|
+
* const orders = await orderModuleService.cancel(["123", "321"])
|
3587
|
+
*/
|
1208
3588
|
cancel(orderId: string[], sharedContext?: Context): Promise<OrderDTO[]>;
|
3589
|
+
/**
|
3590
|
+
* This method sets the status of an order to `canceled`.
|
3591
|
+
*
|
3592
|
+
* @param {string} orderId - The order's ID.
|
3593
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3594
|
+
* @returns {Promise<OrderDTO>} Represents the completion of an asynchronous operation
|
3595
|
+
*
|
3596
|
+
* @example
|
3597
|
+
* const orders = await orderModuleService.cancel("123")
|
3598
|
+
*/
|
1209
3599
|
cancel(orderId: string, sharedContext?: Context): Promise<OrderDTO>;
|
3600
|
+
/**
|
3601
|
+
* Register a fulfillment for an order, return, exchange, or claim.
|
3602
|
+
*
|
3603
|
+
* @param {RegisterOrderFulfillmentDTO} data - The fulfillment's details.
|
3604
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3605
|
+
* @returns {Promise<void>} Resolves when the fulfillment is registered successfully.
|
3606
|
+
*
|
3607
|
+
* @example
|
3608
|
+
* await orderModuleService.registerFulfillment({
|
3609
|
+
* order_id: "123",
|
3610
|
+
* items: [
|
3611
|
+
* {
|
3612
|
+
* id: "321",
|
3613
|
+
* quantity: 1
|
3614
|
+
* }
|
3615
|
+
* ]
|
3616
|
+
* })
|
3617
|
+
*/
|
1210
3618
|
registerFulfillment(data: RegisterOrderFulfillmentDTO, sharedContext?: Context): Promise<void>;
|
3619
|
+
/**
|
3620
|
+
* This method cancels the fulfillment of an order, return, claim, or exchange.
|
3621
|
+
*
|
3622
|
+
* @param {CancelOrderFulfillmentDTO} data - The cancelation details.
|
3623
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3624
|
+
* @returns {Promise<void>} Resolves when the fulfillment is canceled.
|
3625
|
+
*
|
3626
|
+
* @example
|
3627
|
+
* await orderModuleService.cancelFulfillment({
|
3628
|
+
* order_id: "123",
|
3629
|
+
* items: [
|
3630
|
+
* {
|
3631
|
+
* id: "321",
|
3632
|
+
* quantity: 1
|
3633
|
+
* }
|
3634
|
+
* ]
|
3635
|
+
* })
|
3636
|
+
*/
|
1211
3637
|
cancelFulfillment(data: CancelOrderFulfillmentDTO, sharedContext?: Context): Promise<void>;
|
3638
|
+
/**
|
3639
|
+
* This method registers a shipment for an order, return, claim, or exchange.
|
3640
|
+
*
|
3641
|
+
* @param {RegisterOrderShipmentDTO} data - The shipment's data.
|
3642
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3643
|
+
* @returns {Promise<void>} Resolves when the shipment's data are registered successfully.
|
3644
|
+
*
|
3645
|
+
* @example
|
3646
|
+
* await orderModuleService.registerShipment({
|
3647
|
+
* order_id: "123",
|
3648
|
+
* items: [
|
3649
|
+
* {
|
3650
|
+
* id: "321",
|
3651
|
+
* quantity: 1
|
3652
|
+
* }
|
3653
|
+
* ]
|
3654
|
+
* })
|
3655
|
+
*/
|
1212
3656
|
registerShipment(data: RegisterOrderShipmentDTO, sharedContext?: Context): Promise<void>;
|
3657
|
+
/**
|
3658
|
+
* This method creates a return.
|
3659
|
+
*
|
3660
|
+
* @param {CreateOrderReturnDTO} returnData - The order return to be created.
|
3661
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3662
|
+
* @returns {Promise<ReturnDTO>} The created order return.
|
3663
|
+
*
|
3664
|
+
* @example
|
3665
|
+
* const orderReturn = await orderModuleService.createReturn({
|
3666
|
+
* order_id: "123",
|
3667
|
+
* items: [{
|
3668
|
+
* id: "321",
|
3669
|
+
* quantity: 1
|
3670
|
+
* }]
|
3671
|
+
* })
|
3672
|
+
*/
|
1213
3673
|
createReturn(returnData: CreateOrderReturnDTO, sharedContext?: Context): Promise<ReturnDTO>;
|
3674
|
+
/**
|
3675
|
+
* This method cancels an order return.
|
3676
|
+
*
|
3677
|
+
* @param {CancelOrderReturnDTO} data - The cancelation details.
|
3678
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3679
|
+
* @returns {Promise<ReturnDTO>} The canceled return.
|
3680
|
+
*
|
3681
|
+
* @example
|
3682
|
+
* const orderReturn = await orderModuleService.cancelReturn({
|
3683
|
+
* return_id: "123"
|
3684
|
+
* })
|
3685
|
+
*/
|
1214
3686
|
cancelReturn(data: CancelOrderReturnDTO, sharedContext?: Context): Promise<ReturnDTO>;
|
3687
|
+
/**
|
3688
|
+
* This method marks a return as received, changing its status to `received`.
|
3689
|
+
*
|
3690
|
+
* @param {ReceiveOrderReturnDTO} returnData - The receival details.
|
3691
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3692
|
+
* @returns {Promise<ReturnDTO>} The received return.
|
3693
|
+
*
|
3694
|
+
* @example
|
3695
|
+
* const orderReturn = await orderModuleService.receiveReturn({
|
3696
|
+
* return_id: "123",
|
3697
|
+
* items: [
|
3698
|
+
* {
|
3699
|
+
* id: "123",
|
3700
|
+
* quantity:1
|
3701
|
+
* }
|
3702
|
+
* ]
|
3703
|
+
* })
|
3704
|
+
*/
|
1215
3705
|
receiveReturn(returnData: ReceiveOrderReturnDTO, sharedContext?: Context): Promise<ReturnDTO>;
|
3706
|
+
/**
|
3707
|
+
* This method creates a claim.
|
3708
|
+
*
|
3709
|
+
* @param {CreateOrderClaimDTO} claimData - The order claim to be created.
|
3710
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3711
|
+
* @returns {Promise<OrderClaimDTO>} The created claim.
|
3712
|
+
*
|
3713
|
+
* @example
|
3714
|
+
* const claim = await orderModuleService.createClaim({
|
3715
|
+
* order_id: "123",
|
3716
|
+
* type: "refund"
|
3717
|
+
* })
|
3718
|
+
*/
|
1216
3719
|
createClaim(claimData: CreateOrderClaimDTO, sharedContext?: Context): Promise<OrderClaimDTO>;
|
3720
|
+
/**
|
3721
|
+
* This method cancels a claim.
|
3722
|
+
*
|
3723
|
+
* @param {CancelOrderClaimDTO} data - The cancelation details.
|
3724
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3725
|
+
* @returns {Promise<OrderClaimDTO>} The canceled claim.
|
3726
|
+
*
|
3727
|
+
* @example
|
3728
|
+
* const claim = await orderModuleService.cancelClaim({
|
3729
|
+
* claim_id: "123",
|
3730
|
+
* })
|
3731
|
+
*/
|
1217
3732
|
cancelClaim(data: CancelOrderClaimDTO, sharedContext?: Context): Promise<OrderClaimDTO>;
|
3733
|
+
/**
|
3734
|
+
* This method creates an order exchange.
|
3735
|
+
*
|
3736
|
+
* @param {CreateOrderExchangeDTO} exchangeData - The order exchange to be created.
|
3737
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3738
|
+
* @returns {Promise<OrderExchangeDTO>} The created order exchange.
|
3739
|
+
*
|
3740
|
+
* @example
|
3741
|
+
* const exchange = await orderModuleService.createExchange({
|
3742
|
+
* order_id: "123",
|
3743
|
+
* additional_items: [
|
3744
|
+
* {
|
3745
|
+
* id: "123",
|
3746
|
+
* quantity: 1
|
3747
|
+
* }
|
3748
|
+
* ]
|
3749
|
+
* })
|
3750
|
+
*/
|
1218
3751
|
createExchange(exchangeData: CreateOrderExchangeDTO, sharedContext?: Context): Promise<OrderExchangeDTO>;
|
3752
|
+
/**
|
3753
|
+
* This method cancels an exchange.
|
3754
|
+
*
|
3755
|
+
* @param {CancelOrderExchangeDTO} data - The cancelation details.
|
3756
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
3757
|
+
* @returns {Promise<OrderExchangeDTO>} The canceled order exchange.
|
3758
|
+
*
|
3759
|
+
* @example
|
3760
|
+
* const exchange = await orderModuleService.cancelExchange({
|
3761
|
+
* exchange_id: "123"
|
3762
|
+
* })
|
3763
|
+
*/
|
1219
3764
|
cancelExchange(data: CancelOrderExchangeDTO, sharedContext?: Context): Promise<OrderExchangeDTO>;
|
1220
3765
|
}
|
1221
3766
|
//# sourceMappingURL=service.d.ts.map
|