@medusajs/order 2.11.0-snapshot-20250829134337 → 2.11.0-snapshot-20251016104801
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/migrations/Migration20240219102530.d.ts +1 -1
- package/dist/migrations/Migration20240219102530.d.ts.map +1 -1
- package/dist/migrations/Migration20240219102530.js +1 -1
- package/dist/migrations/Migration20240219102530.js.map +1 -1
- package/dist/migrations/Migration20240604100512.d.ts +1 -1
- package/dist/migrations/Migration20240604100512.d.ts.map +1 -1
- package/dist/migrations/Migration20240604100512.js +1 -1
- package/dist/migrations/Migration20240604100512.js.map +1 -1
- package/dist/migrations/Migration20240715102100.d.ts +1 -1
- package/dist/migrations/Migration20240715102100.d.ts.map +1 -1
- package/dist/migrations/Migration20240715102100.js +1 -1
- package/dist/migrations/Migration20240715102100.js.map +1 -1
- package/dist/migrations/Migration20240715174100.d.ts +1 -1
- package/dist/migrations/Migration20240715174100.d.ts.map +1 -1
- package/dist/migrations/Migration20240715174100.js +1 -1
- package/dist/migrations/Migration20240715174100.js.map +1 -1
- package/dist/migrations/Migration20240716081800.d.ts +1 -1
- package/dist/migrations/Migration20240716081800.d.ts.map +1 -1
- package/dist/migrations/Migration20240716081800.js +1 -1
- package/dist/migrations/Migration20240716081800.js.map +1 -1
- package/dist/migrations/Migration20240801085921.d.ts +1 -1
- package/dist/migrations/Migration20240801085921.d.ts.map +1 -1
- package/dist/migrations/Migration20240801085921.js +1 -1
- package/dist/migrations/Migration20240801085921.js.map +1 -1
- package/dist/migrations/Migration20240821164505.d.ts +1 -1
- package/dist/migrations/Migration20240821164505.d.ts.map +1 -1
- package/dist/migrations/Migration20240821164505.js +1 -1
- package/dist/migrations/Migration20240821164505.js.map +1 -1
- package/dist/migrations/Migration20240821170920.d.ts +1 -1
- package/dist/migrations/Migration20240821170920.d.ts.map +1 -1
- package/dist/migrations/Migration20240821170920.js +1 -1
- package/dist/migrations/Migration20240821170920.js.map +1 -1
- package/dist/migrations/Migration20240827133639.d.ts +1 -1
- package/dist/migrations/Migration20240827133639.d.ts.map +1 -1
- package/dist/migrations/Migration20240827133639.js +1 -1
- package/dist/migrations/Migration20240827133639.js.map +1 -1
- package/dist/migrations/Migration20240902195921.d.ts +1 -1
- package/dist/migrations/Migration20240902195921.d.ts.map +1 -1
- package/dist/migrations/Migration20240902195921.js +1 -1
- package/dist/migrations/Migration20240902195921.js.map +1 -1
- package/dist/migrations/Migration20240913092514.d.ts +1 -1
- package/dist/migrations/Migration20240913092514.d.ts.map +1 -1
- package/dist/migrations/Migration20240913092514.js +1 -1
- package/dist/migrations/Migration20240913092514.js.map +1 -1
- package/dist/migrations/Migration20240930122627.d.ts +1 -1
- package/dist/migrations/Migration20240930122627.d.ts.map +1 -1
- package/dist/migrations/Migration20240930122627.js +1 -1
- package/dist/migrations/Migration20240930122627.js.map +1 -1
- package/dist/migrations/Migration20241014142943.d.ts +1 -1
- package/dist/migrations/Migration20241014142943.d.ts.map +1 -1
- package/dist/migrations/Migration20241014142943.js +1 -1
- package/dist/migrations/Migration20241014142943.js.map +1 -1
- package/dist/migrations/Migration20241106085223.d.ts +1 -1
- package/dist/migrations/Migration20241106085223.d.ts.map +1 -1
- package/dist/migrations/Migration20241106085223.js +1 -1
- package/dist/migrations/Migration20241106085223.js.map +1 -1
- package/dist/migrations/Migration20241129124827.d.ts +1 -1
- package/dist/migrations/Migration20241129124827.d.ts.map +1 -1
- package/dist/migrations/Migration20241129124827.js +1 -1
- package/dist/migrations/Migration20241129124827.js.map +1 -1
- package/dist/migrations/Migration20241217162224.d.ts +1 -1
- package/dist/migrations/Migration20241217162224.d.ts.map +1 -1
- package/dist/migrations/Migration20241217162224.js +1 -1
- package/dist/migrations/Migration20241217162224.js.map +1 -1
- package/dist/migrations/Migration20250326151554.d.ts +1 -1
- package/dist/migrations/Migration20250326151554.d.ts.map +1 -1
- package/dist/migrations/Migration20250326151554.js +1 -1
- package/dist/migrations/Migration20250326151554.js.map +1 -1
- package/dist/migrations/Migration20250522181137.d.ts +1 -1
- package/dist/migrations/Migration20250522181137.d.ts.map +1 -1
- package/dist/migrations/Migration20250522181137.js +1 -1
- package/dist/migrations/Migration20250522181137.js.map +1 -1
- package/dist/migrations/Migration20250702095353.d.ts +1 -1
- package/dist/migrations/Migration20250702095353.d.ts.map +1 -1
- package/dist/migrations/Migration20250702095353.js +1 -1
- package/dist/migrations/Migration20250702095353.js.map +1 -1
- package/dist/migrations/Migration20250704120229.d.ts +1 -1
- package/dist/migrations/Migration20250704120229.d.ts.map +1 -1
- package/dist/migrations/Migration20250704120229.js +1 -1
- package/dist/migrations/Migration20250704120229.js.map +1 -1
- package/dist/migrations/Migration20250910130000.d.ts +6 -0
- package/dist/migrations/Migration20250910130000.d.ts.map +1 -0
- package/dist/migrations/Migration20250910130000.js +239 -0
- package/dist/migrations/Migration20250910130000.js.map +1 -0
- package/dist/models/claim-item-image.js +1 -1
- package/dist/models/claim-item-image.js.map +1 -1
- package/dist/models/claim-item.js +2 -2
- package/dist/models/claim-item.js.map +1 -1
- package/dist/models/claim.js +3 -3
- package/dist/models/claim.js.map +1 -1
- package/dist/models/credit-line.js +1 -1
- package/dist/models/credit-line.js.map +1 -1
- package/dist/models/exchange-item.js +2 -2
- package/dist/models/exchange-item.js.map +1 -1
- package/dist/models/exchange.js +3 -3
- package/dist/models/exchange.js.map +1 -1
- package/dist/models/line-item.js +3 -3
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/order-change-action.js +6 -6
- package/dist/models/order-change-action.js.map +1 -1
- package/dist/models/order-change.js +6 -6
- package/dist/models/order-change.js.map +1 -1
- package/dist/models/order-item.js +3 -3
- package/dist/models/order-item.js.map +1 -1
- package/dist/models/order-shipping-method.js +6 -6
- package/dist/models/order-shipping-method.js.map +1 -1
- package/dist/models/order-summary.js +1 -1
- package/dist/models/order-summary.js.map +1 -1
- package/dist/models/order.js +8 -8
- package/dist/models/order.js.map +1 -1
- package/dist/models/return-item.js +3 -3
- package/dist/models/return-item.js.map +1 -1
- package/dist/models/return-reason.js +2 -2
- package/dist/models/return-reason.js.map +1 -1
- package/dist/models/return.js +4 -4
- package/dist/models/return.js.map +1 -1
- package/dist/models/transaction.js +7 -7
- package/dist/models/transaction.js.map +1 -1
- package/dist/services/actions/cancel-return.d.ts.map +1 -1
- package/dist/services/actions/cancel-return.js +1 -0
- package/dist/services/actions/cancel-return.js.map +1 -1
- package/dist/services/actions/create-return.d.ts.map +1 -1
- package/dist/services/actions/create-return.js +1 -0
- package/dist/services/actions/create-return.js.map +1 -1
- package/dist/services/order-module-service.d.ts +40 -56
- package/dist/services/order-module-service.d.ts.map +1 -1
- package/dist/services/order-module-service.js +510 -269
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/services/order-service.d.ts +5 -44
- package/dist/services/order-service.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/base-repository-find.d.ts.map +1 -1
- package/dist/utils/base-repository-find.js +1 -6
- package/dist/utils/base-repository-find.js.map +1 -1
- package/dist/utils/calculate-order-change.d.ts.map +1 -1
- package/dist/utils/calculate-order-change.js +1 -18
- package/dist/utils/calculate-order-change.js.map +1 -1
- package/package.json +10 -18
|
@@ -35,9 +35,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
35
35
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const core_1 = require("@medusajs/framework/mikro-orm/core");
|
|
38
39
|
const types_1 = require("@medusajs/framework/types");
|
|
39
40
|
const utils_1 = require("@medusajs/framework/utils");
|
|
40
|
-
const core_1 = require("@mikro-orm/core");
|
|
41
41
|
const _models_1 = require("../models");
|
|
42
42
|
const joiner_config_1 = require("../joiner-config");
|
|
43
43
|
const utils_2 = require("../utils");
|
|
@@ -70,11 +70,15 @@ const generateMethodForModels = {
|
|
|
70
70
|
{
|
|
71
71
|
const MikroORMEntity = (0, utils_1.toMikroORMEntity)(_models_1.OrderChangeAction);
|
|
72
72
|
MikroORMEntity.prototype["onInit_OrderChangeAction"] = function () {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
if (this.order_change) {
|
|
74
|
+
this.version ??= this.order_change.version ?? null;
|
|
75
|
+
this.order_id ??= this.order_change.order_id ?? null;
|
|
76
|
+
this.claim_id ??= this.order_change.claim_id ?? null;
|
|
77
|
+
this.exchange_id ??= this.order_change.exchange_id ?? null;
|
|
78
|
+
}
|
|
79
|
+
if (!this.claim_id &&
|
|
80
|
+
!this.exchange_id &&
|
|
81
|
+
(this.return || this.order_change)) {
|
|
78
82
|
this.return_id = this.return?.id ?? this.order_change?.return_id ?? null;
|
|
79
83
|
}
|
|
80
84
|
};
|
|
@@ -84,12 +88,9 @@ const generateMethodForModels = {
|
|
|
84
88
|
{
|
|
85
89
|
const MikroORMEntity = (0, utils_1.toMikroORMEntity)(_models_1.OrderShipping);
|
|
86
90
|
MikroORMEntity.prototype["onInit_OrderShipping"] = function () {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.claim ??= (0, core_1.rel)((0, utils_1.toMikroORMEntity)(_models_1.OrderClaim), this.claim?.id ?? null);
|
|
91
|
-
this.exchange ??= (0, core_1.rel)((0, utils_1.toMikroORMEntity)(_models_1.OrderExchange), this.exchange?.id ?? null);
|
|
92
|
-
this.shipping_method ??= (0, core_1.rel)((0, utils_1.toMikroORMEntity)(_models_1.OrderShippingMethod), this.shipping_method?.id ?? null);
|
|
91
|
+
if (this.order) {
|
|
92
|
+
this.version ??= this.order.version ?? null;
|
|
93
|
+
}
|
|
93
94
|
};
|
|
94
95
|
(0, core_1.OnInit)()(MikroORMEntity.prototype, "onInit_OrderShipping");
|
|
95
96
|
(0, core_1.BeforeCreate)()(MikroORMEntity.prototype, "onInit_OrderShipping");
|
|
@@ -97,9 +98,9 @@ const generateMethodForModels = {
|
|
|
97
98
|
{
|
|
98
99
|
const MikroORMEntity = (0, utils_1.toMikroORMEntity)(_models_1.OrderItem);
|
|
99
100
|
MikroORMEntity.prototype["onInit_OrderItem"] = function () {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
if (this.order) {
|
|
102
|
+
this.version ??= this.order.version ?? null;
|
|
103
|
+
}
|
|
103
104
|
};
|
|
104
105
|
(0, core_1.OnInit)()(MikroORMEntity.prototype, "onInit_OrderItem");
|
|
105
106
|
(0, core_1.BeforeCreate)()(MikroORMEntity.prototype, "onInit_OrderItem");
|
|
@@ -145,6 +146,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
145
146
|
"discount_tax_total",
|
|
146
147
|
"original_total",
|
|
147
148
|
"original_tax_total",
|
|
149
|
+
"pending_difference",
|
|
148
150
|
"item_total",
|
|
149
151
|
"item_subtotal",
|
|
150
152
|
"item_tax_total",
|
|
@@ -157,9 +159,13 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
157
159
|
"original_shipping_tax_total",
|
|
158
160
|
"original_shipping_subtotal",
|
|
159
161
|
"original_shipping_total",
|
|
162
|
+
"original_total",
|
|
163
|
+
"original_subtotal",
|
|
164
|
+
"original_tax_total",
|
|
160
165
|
"credit_line_total",
|
|
161
166
|
"credit_line_tax_total",
|
|
162
167
|
"credit_line_subtotal",
|
|
168
|
+
"refundable_amount",
|
|
163
169
|
];
|
|
164
170
|
const includeTotals = (config?.select ?? []).some((field) => totalFields.includes(field));
|
|
165
171
|
if (includeTotals) {
|
|
@@ -201,6 +207,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
201
207
|
}
|
|
202
208
|
// @ts-expect-error
|
|
203
209
|
async listOrders(filters, config, sharedContext) {
|
|
210
|
+
const orders = await this.listOrders_(filters, config, sharedContext);
|
|
211
|
+
return this.baseRepository_.serialize(orders);
|
|
212
|
+
}
|
|
213
|
+
async listOrders_(filters, config, sharedContext) {
|
|
204
214
|
config ??= {};
|
|
205
215
|
const includeTotals = this.shouldIncludeTotals(config);
|
|
206
216
|
const orders = await super.listOrders(filters, config, sharedContext);
|
|
@@ -457,9 +467,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
457
467
|
// @ts-expect-error
|
|
458
468
|
async updateOrders(dataOrIdOrSelector, data, sharedContext = {}) {
|
|
459
469
|
const result = await this.updateOrders_(dataOrIdOrSelector, data, sharedContext);
|
|
460
|
-
const serializedResult = await this.baseRepository_.serialize(result
|
|
461
|
-
populate: true,
|
|
462
|
-
});
|
|
470
|
+
const serializedResult = await this.baseRepository_.serialize(result);
|
|
463
471
|
return (0, utils_1.isString)(dataOrIdOrSelector) ? serializedResult[0] : serializedResult;
|
|
464
472
|
}
|
|
465
473
|
async updateOrders_(dataOrIdOrSelector, data, sharedContext = {}) {
|
|
@@ -498,7 +506,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
498
506
|
? orderIdOrData
|
|
499
507
|
: [orderIdOrData];
|
|
500
508
|
const allOrderIds = data.map((dt) => dt.order_id);
|
|
501
|
-
const order = await this.
|
|
509
|
+
const order = await this.listOrders_({ id: allOrderIds }, { select: ["id", "version"] }, sharedContext);
|
|
502
510
|
const mapOrderVersion = order.reduce((acc, curr) => {
|
|
503
511
|
acc[curr.id] = curr.version;
|
|
504
512
|
return acc;
|
|
@@ -511,9 +519,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
511
519
|
});
|
|
512
520
|
items = await this.createOrderLineItemsBulk_(lineItems, sharedContext);
|
|
513
521
|
}
|
|
514
|
-
return await this.baseRepository_.serialize(items
|
|
515
|
-
populate: true,
|
|
516
|
-
});
|
|
522
|
+
return await this.baseRepository_.serialize(items);
|
|
517
523
|
}
|
|
518
524
|
async createOrderLineItems_(orderId, items, sharedContext = {}) {
|
|
519
525
|
const order = await this.retrieveOrder(orderId, { select: ["id", "version"] }, sharedContext);
|
|
@@ -551,9 +557,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
551
557
|
let items = [];
|
|
552
558
|
if ((0, utils_1.isString)(lineItemIdOrDataOrSelector)) {
|
|
553
559
|
const item = await this.updateOrderLineItem_(lineItemIdOrDataOrSelector, data, sharedContext);
|
|
554
|
-
return await this.baseRepository_.serialize(item
|
|
555
|
-
populate: true,
|
|
556
|
-
});
|
|
560
|
+
return await this.baseRepository_.serialize(item);
|
|
557
561
|
}
|
|
558
562
|
const toUpdate = Array.isArray(lineItemIdOrDataOrSelector)
|
|
559
563
|
? lineItemIdOrDataOrSelector
|
|
@@ -564,9 +568,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
564
568
|
},
|
|
565
569
|
];
|
|
566
570
|
items = await this.updateOrderLineItemsWithSelector_(toUpdate, sharedContext);
|
|
567
|
-
return await this.baseRepository_.serialize(items
|
|
568
|
-
populate: true,
|
|
569
|
-
});
|
|
571
|
+
return await this.baseRepository_.serialize(items);
|
|
570
572
|
}
|
|
571
573
|
async updateOrderLineItem_(lineItemId, data, sharedContext = {}) {
|
|
572
574
|
const [item] = await this.orderLineItemService_.update([{ id: lineItemId, ...data }], sharedContext);
|
|
@@ -584,7 +586,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
584
586
|
let toUpdate = [];
|
|
585
587
|
const detailsToUpdate = [];
|
|
586
588
|
for (const { selector, data } of updates) {
|
|
587
|
-
const items = await this.
|
|
589
|
+
const items = await this.orderLineItemService_.list({ ...selector }, {}, sharedContext);
|
|
588
590
|
items.forEach((item) => {
|
|
589
591
|
toUpdate.push({
|
|
590
592
|
...data,
|
|
@@ -607,9 +609,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
607
609
|
let items = [];
|
|
608
610
|
if ((0, utils_1.isString)(orderItemIdOrDataOrSelector)) {
|
|
609
611
|
const item = await this.updateOrderItem_(orderItemIdOrDataOrSelector, data, sharedContext);
|
|
610
|
-
return await this.baseRepository_.serialize(item
|
|
611
|
-
populate: true,
|
|
612
|
-
});
|
|
612
|
+
return await this.baseRepository_.serialize(item);
|
|
613
613
|
}
|
|
614
614
|
const toUpdate = Array.isArray(orderItemIdOrDataOrSelector)
|
|
615
615
|
? orderItemIdOrDataOrSelector
|
|
@@ -620,9 +620,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
620
620
|
},
|
|
621
621
|
];
|
|
622
622
|
items = await this.updateOrderItemWithSelector_(toUpdate, sharedContext);
|
|
623
|
-
return await this.baseRepository_.serialize(items
|
|
624
|
-
populate: true,
|
|
625
|
-
});
|
|
623
|
+
return await this.baseRepository_.serialize(items);
|
|
626
624
|
}
|
|
627
625
|
async updateOrderItem_(orderItemId, data, sharedContext = {}) {
|
|
628
626
|
const [detail] = await this.orderItemService_.update([{ id: orderItemId, ...data }], sharedContext);
|
|
@@ -631,7 +629,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
631
629
|
async updateOrderItemWithSelector_(updates, sharedContext = {}) {
|
|
632
630
|
let toUpdate = [];
|
|
633
631
|
for (const { selector, data } of updates) {
|
|
634
|
-
const details = await this.
|
|
632
|
+
const details = await this.orderItemService_.list({ ...selector }, {}, sharedContext);
|
|
635
633
|
details.forEach((detail) => {
|
|
636
634
|
toUpdate.push({
|
|
637
635
|
...data,
|
|
@@ -652,7 +650,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
652
650
|
? orderIdOrData
|
|
653
651
|
: [orderIdOrData];
|
|
654
652
|
const allOrderIds = data.map((dt) => dt.order_id);
|
|
655
|
-
const order = await this.
|
|
653
|
+
const order = await this.listOrders_({ id: allOrderIds }, { select: ["id", "version"] }, sharedContext);
|
|
656
654
|
const mapOrderVersion = order.reduce((acc, curr) => {
|
|
657
655
|
acc[curr.id] = curr.version;
|
|
658
656
|
return acc;
|
|
@@ -669,7 +667,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
669
667
|
});
|
|
670
668
|
methods = await this.createOrderShippingMethodsBulk_(orderShippingMethodData, sharedContext);
|
|
671
669
|
}
|
|
672
|
-
return await this.baseRepository_.serialize(methods
|
|
670
|
+
return await this.baseRepository_.serialize(methods);
|
|
673
671
|
}
|
|
674
672
|
async createOrderShippingMethods_(orderId, data, sharedContext = {}) {
|
|
675
673
|
const order = await this.retrieveOrder(orderId, { select: ["id", "version"] }, sharedContext);
|
|
@@ -690,7 +688,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
690
688
|
return sm.map((s) => s.shipping_method);
|
|
691
689
|
}
|
|
692
690
|
// @ts-ignore
|
|
693
|
-
async softDeleteOrderShippingMethods(ids, config, sharedContext) {
|
|
691
|
+
async softDeleteOrderShippingMethods(ids, config, sharedContext = {}) {
|
|
692
|
+
return await this.softDeleteOrderShippingMethods_(ids, config, sharedContext);
|
|
693
|
+
}
|
|
694
|
+
async softDeleteOrderShippingMethods_(ids, config, sharedContext = {}) {
|
|
694
695
|
const rel = await super.listOrderShippings({
|
|
695
696
|
shipping_method_id: ids,
|
|
696
697
|
}, {
|
|
@@ -704,7 +705,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
704
705
|
return returned;
|
|
705
706
|
}
|
|
706
707
|
// @ts-ignore
|
|
707
|
-
async restoreOrderShippingMethods(ids, config, sharedContext) {
|
|
708
|
+
async restoreOrderShippingMethods(ids, config, sharedContext = {}) {
|
|
709
|
+
return await this.restoreOrderShippingMethods_(ids, config, sharedContext);
|
|
710
|
+
}
|
|
711
|
+
async restoreOrderShippingMethods_(ids, config, sharedContext = {}) {
|
|
708
712
|
const rel = await super.listOrderShippings({
|
|
709
713
|
shipping_method_id: ids,
|
|
710
714
|
}, {
|
|
@@ -719,6 +723,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
719
723
|
}
|
|
720
724
|
// @ts-expect-error
|
|
721
725
|
async createOrderLineItemAdjustments(orderIdOrData, adjustments, sharedContext = {}) {
|
|
726
|
+
const addedAdjustments = await this.createOrderLineItemAdjustments_(orderIdOrData, adjustments, sharedContext);
|
|
727
|
+
return await this.baseRepository_.serialize(addedAdjustments);
|
|
728
|
+
}
|
|
729
|
+
async createOrderLineItemAdjustments_(orderIdOrData, adjustments, sharedContext = {}) {
|
|
722
730
|
let addedAdjustments = [];
|
|
723
731
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
|
724
732
|
const order = await this.retrieveOrder(orderIdOrData, { select: ["id"], relations: ["items.item"] }, sharedContext);
|
|
@@ -736,17 +744,20 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
736
744
|
: [orderIdOrData];
|
|
737
745
|
addedAdjustments = await this.orderLineItemAdjustmentService_.create(data, sharedContext);
|
|
738
746
|
}
|
|
739
|
-
return
|
|
740
|
-
populate: true,
|
|
741
|
-
});
|
|
747
|
+
return addedAdjustments;
|
|
742
748
|
}
|
|
743
749
|
async upsertOrderLineItemAdjustments(adjustments, sharedContext = {}) {
|
|
744
|
-
let result = await this.
|
|
745
|
-
return await this.baseRepository_.serialize(result
|
|
746
|
-
|
|
747
|
-
|
|
750
|
+
let result = await this.upsertOrderLineItemAdjustments_(adjustments, sharedContext);
|
|
751
|
+
return await this.baseRepository_.serialize(result);
|
|
752
|
+
}
|
|
753
|
+
async upsertOrderLineItemAdjustments_(adjustments, sharedContext = {}) {
|
|
754
|
+
return await this.orderLineItemAdjustmentService_.upsert(adjustments, sharedContext);
|
|
748
755
|
}
|
|
749
756
|
async setOrderLineItemAdjustments(orderId, adjustments, sharedContext = {}) {
|
|
757
|
+
const result = await this.setOrderLineItemAdjustments_(orderId, adjustments, sharedContext);
|
|
758
|
+
return await this.baseRepository_.serialize(result);
|
|
759
|
+
}
|
|
760
|
+
async setOrderLineItemAdjustments_(orderId, adjustments, sharedContext = {}) {
|
|
750
761
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["items.item.adjustments"] }, sharedContext);
|
|
751
762
|
const existingAdjustments = (order.items ?? [])
|
|
752
763
|
.map((item) => item.adjustments ?? [])
|
|
@@ -765,18 +776,21 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
765
776
|
if (toDelete.length) {
|
|
766
777
|
await this.orderLineItemAdjustmentService_.delete(toDelete, sharedContext);
|
|
767
778
|
}
|
|
768
|
-
|
|
769
|
-
return
|
|
770
|
-
populate: true,
|
|
771
|
-
});
|
|
779
|
+
const result = await this.orderLineItemAdjustmentService_.upsert(adjustments, sharedContext);
|
|
780
|
+
return result;
|
|
772
781
|
}
|
|
773
782
|
async upsertOrderShippingMethodAdjustments(adjustments, sharedContext = {}) {
|
|
774
|
-
const result = await this.
|
|
775
|
-
return await this.baseRepository_.serialize(result
|
|
776
|
-
|
|
777
|
-
|
|
783
|
+
const result = await this.upsertOrderShippingMethodAdjustments_(adjustments, sharedContext);
|
|
784
|
+
return await this.baseRepository_.serialize(result);
|
|
785
|
+
}
|
|
786
|
+
async upsertOrderShippingMethodAdjustments_(adjustments, sharedContext = {}) {
|
|
787
|
+
return await this.orderShippingMethodAdjustmentService_.upsert(adjustments, sharedContext);
|
|
778
788
|
}
|
|
779
789
|
async setOrderShippingMethodAdjustments(orderId, adjustments, sharedContext = {}) {
|
|
790
|
+
const result = await this.setOrderShippingMethodAdjustments_(orderId, adjustments, sharedContext);
|
|
791
|
+
return await this.baseRepository_.serialize(result);
|
|
792
|
+
}
|
|
793
|
+
async setOrderShippingMethodAdjustments_(orderId, adjustments, sharedContext = {}) {
|
|
780
794
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["shipping_methods.adjustments"] }, sharedContext);
|
|
781
795
|
const existingAdjustments = (order.shipping_methods ?? [])
|
|
782
796
|
.map((shippingMethod) => shippingMethod.adjustments ?? [])
|
|
@@ -796,12 +810,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
796
810
|
await this.orderShippingMethodAdjustmentService_.delete(toDelete, sharedContext);
|
|
797
811
|
}
|
|
798
812
|
const result = await this.orderShippingMethodAdjustmentService_.upsert(adjustments, sharedContext);
|
|
799
|
-
return
|
|
800
|
-
populate: true,
|
|
801
|
-
});
|
|
813
|
+
return result;
|
|
802
814
|
}
|
|
803
815
|
// @ts-expect-error
|
|
804
816
|
async createOrderShippingMethodAdjustments(orderIdOrData, adjustments, sharedContext = {}) {
|
|
817
|
+
const addedAdjustments = await this.createOrderShippingMethodAdjustments_(orderIdOrData, adjustments, sharedContext);
|
|
818
|
+
return await this.baseRepository_.serialize(addedAdjustments);
|
|
819
|
+
}
|
|
820
|
+
async createOrderShippingMethodAdjustments_(orderIdOrData, adjustments, sharedContext = {}) {
|
|
805
821
|
let addedAdjustments = [];
|
|
806
822
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
|
807
823
|
const order = await this.retrieveOrder(orderIdOrData, { select: ["id"], relations: ["shipping_methods"] }, sharedContext);
|
|
@@ -822,16 +838,20 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
822
838
|
await this.orderShippingMethodAdjustmentService_.create(data, sharedContext);
|
|
823
839
|
}
|
|
824
840
|
if ((0, utils_1.isObject)(orderIdOrData)) {
|
|
825
|
-
return
|
|
826
|
-
populate: true,
|
|
827
|
-
});
|
|
841
|
+
return addedAdjustments[0];
|
|
828
842
|
}
|
|
829
|
-
return
|
|
830
|
-
populate: true,
|
|
831
|
-
});
|
|
843
|
+
return addedAdjustments;
|
|
832
844
|
}
|
|
833
845
|
// @ts-expect-error
|
|
834
846
|
async createOrderLineItemTaxLines(orderIdOrData, taxLines, sharedContext = {}) {
|
|
847
|
+
const addedTaxLines = await this.createOrderLineItemTaxLines_(orderIdOrData, taxLines, sharedContext);
|
|
848
|
+
const serialized = await this.baseRepository_.serialize(addedTaxLines);
|
|
849
|
+
if ((0, utils_1.isObject)(orderIdOrData)) {
|
|
850
|
+
return serialized[0];
|
|
851
|
+
}
|
|
852
|
+
return serialized;
|
|
853
|
+
}
|
|
854
|
+
async createOrderLineItemTaxLines_(orderIdOrData, taxLines, sharedContext = {}) {
|
|
835
855
|
let addedTaxLines;
|
|
836
856
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
|
837
857
|
const lines = Array.isArray(taxLines) ? taxLines : [taxLines];
|
|
@@ -843,21 +863,24 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
843
863
|
: [orderIdOrData];
|
|
844
864
|
addedTaxLines = await this.orderLineItemTaxLineService_.create(data, sharedContext);
|
|
845
865
|
}
|
|
846
|
-
const serialized = await this.baseRepository_.serialize(addedTaxLines, {
|
|
847
|
-
populate: true,
|
|
848
|
-
});
|
|
849
866
|
if ((0, utils_1.isObject)(orderIdOrData)) {
|
|
850
|
-
return
|
|
867
|
+
return addedTaxLines[0];
|
|
851
868
|
}
|
|
852
|
-
return
|
|
869
|
+
return addedTaxLines;
|
|
853
870
|
}
|
|
854
871
|
async upsertOrderLineItemTaxLines(taxLines, sharedContext = {}) {
|
|
872
|
+
const result = await this.upsertOrderLineItemTaxLines_(taxLines, sharedContext);
|
|
873
|
+
return await this.baseRepository_.serialize(result);
|
|
874
|
+
}
|
|
875
|
+
async upsertOrderLineItemTaxLines_(taxLines, sharedContext = {}) {
|
|
855
876
|
const result = await this.orderLineItemTaxLineService_.upsert(taxLines, sharedContext);
|
|
856
|
-
return
|
|
857
|
-
populate: true,
|
|
858
|
-
});
|
|
877
|
+
return result;
|
|
859
878
|
}
|
|
860
879
|
async setOrderLineItemTaxLines(orderId, taxLines, sharedContext = {}) {
|
|
880
|
+
const result = await this.setOrderLineItemTaxLines_(orderId, taxLines, sharedContext);
|
|
881
|
+
return await this.baseRepository_.serialize(result);
|
|
882
|
+
}
|
|
883
|
+
async setOrderLineItemTaxLines_(orderId, taxLines, sharedContext = {}) {
|
|
861
884
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["items.item.tax_lines"] }, sharedContext);
|
|
862
885
|
const existingTaxLines = (order.items ?? [])
|
|
863
886
|
.map((item) => item.tax_lines ?? [])
|
|
@@ -876,12 +899,18 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
876
899
|
await this.orderLineItemTaxLineService_.delete(toDelete, sharedContext);
|
|
877
900
|
}
|
|
878
901
|
const result = await this.orderLineItemTaxLineService_.upsert(taxLines, sharedContext);
|
|
879
|
-
return
|
|
880
|
-
populate: true,
|
|
881
|
-
});
|
|
902
|
+
return result;
|
|
882
903
|
}
|
|
883
904
|
// @ts-expect-error
|
|
884
905
|
async createOrderShippingMethodTaxLines(orderIdOrData, taxLines, sharedContext = {}) {
|
|
906
|
+
const addedTaxLines = await this.createOrderShippingMethodTaxLines_(orderIdOrData, taxLines, sharedContext);
|
|
907
|
+
const serialized = await this.baseRepository_.serialize(addedTaxLines);
|
|
908
|
+
if ((0, utils_1.isObject)(orderIdOrData)) {
|
|
909
|
+
return serialized[0];
|
|
910
|
+
}
|
|
911
|
+
return serialized;
|
|
912
|
+
}
|
|
913
|
+
async createOrderShippingMethodTaxLines_(orderIdOrData, taxLines, sharedContext = {}) {
|
|
885
914
|
let addedTaxLines;
|
|
886
915
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
|
887
916
|
const lines = Array.isArray(taxLines) ? taxLines : [taxLines];
|
|
@@ -890,21 +919,17 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
890
919
|
else {
|
|
891
920
|
addedTaxLines = await this.orderShippingMethodTaxLineService_.create(taxLines, sharedContext);
|
|
892
921
|
}
|
|
893
|
-
|
|
894
|
-
populate: true,
|
|
895
|
-
});
|
|
896
|
-
if ((0, utils_1.isObject)(orderIdOrData)) {
|
|
897
|
-
return serialized[0];
|
|
898
|
-
}
|
|
899
|
-
return serialized;
|
|
922
|
+
return addedTaxLines;
|
|
900
923
|
}
|
|
901
924
|
async upsertOrderShippingMethodTaxLines(taxLines, sharedContext = {}) {
|
|
902
925
|
const result = await this.orderShippingMethodTaxLineService_.upsert(taxLines, sharedContext);
|
|
903
|
-
return await this.baseRepository_.serialize(result
|
|
904
|
-
populate: true,
|
|
905
|
-
});
|
|
926
|
+
return await this.baseRepository_.serialize(result);
|
|
906
927
|
}
|
|
907
928
|
async setOrderShippingMethodTaxLines(orderId, taxLines, sharedContext = {}) {
|
|
929
|
+
const result = await this.setOrderShippingMethodTaxLines_(orderId, taxLines, sharedContext);
|
|
930
|
+
return await this.baseRepository_.serialize(result);
|
|
931
|
+
}
|
|
932
|
+
async setOrderShippingMethodTaxLines_(orderId, taxLines, sharedContext = {}) {
|
|
908
933
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["shipping_methods.tax_lines"] }, sharedContext);
|
|
909
934
|
const existingTaxLines = (order.shipping_methods ?? [])
|
|
910
935
|
.map((shippingMethod) => shippingMethod.tax_lines ?? [])
|
|
@@ -923,32 +948,24 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
923
948
|
await this.orderShippingMethodTaxLineService_.delete(toDelete, sharedContext);
|
|
924
949
|
}
|
|
925
950
|
const result = await this.orderShippingMethodTaxLineService_.upsert(taxLines, sharedContext);
|
|
926
|
-
return
|
|
927
|
-
populate: true,
|
|
928
|
-
});
|
|
951
|
+
return result;
|
|
929
952
|
}
|
|
930
953
|
// @ts-expect-error
|
|
931
|
-
async createReturns(data, sharedContext) {
|
|
954
|
+
async createReturns(data, sharedContext = {}) {
|
|
932
955
|
const created = await this.createOrderRelatedEntity_(data, this.returnService_, sharedContext);
|
|
933
|
-
return await this.baseRepository_.serialize(!Array.isArray(data) ? created[0] : created
|
|
934
|
-
populate: true,
|
|
935
|
-
});
|
|
956
|
+
return await this.baseRepository_.serialize(!Array.isArray(data) ? created[0] : created);
|
|
936
957
|
}
|
|
937
958
|
// @ts-expect-error
|
|
938
|
-
async createOrderClaims(data, sharedContext) {
|
|
959
|
+
async createOrderClaims(data, sharedContext = {}) {
|
|
939
960
|
const created = await this.createOrderRelatedEntity_(data, this.orderClaimService_, sharedContext);
|
|
940
|
-
return await this.baseRepository_.serialize(!Array.isArray(data) ? created[0] : created
|
|
941
|
-
populate: true,
|
|
942
|
-
});
|
|
961
|
+
return await this.baseRepository_.serialize(!Array.isArray(data) ? created[0] : created);
|
|
943
962
|
}
|
|
944
963
|
// @ts-expect-error
|
|
945
|
-
async createOrderExchanges(data, sharedContext) {
|
|
964
|
+
async createOrderExchanges(data, sharedContext = {}) {
|
|
946
965
|
const created = await this.createOrderRelatedEntity_(data, this.orderExchangeService_, sharedContext);
|
|
947
|
-
return await this.baseRepository_.serialize(!Array.isArray(data) ? created[0] : created
|
|
948
|
-
populate: true,
|
|
949
|
-
});
|
|
966
|
+
return await this.baseRepository_.serialize(!Array.isArray(data) ? created[0] : created);
|
|
950
967
|
}
|
|
951
|
-
async createOrderRelatedEntity_(data, service, sharedContext) {
|
|
968
|
+
async createOrderRelatedEntity_(data, service, sharedContext = {}) {
|
|
952
969
|
const data_ = Array.isArray(data) ? data : [data];
|
|
953
970
|
const inputDataMap = data_.reduce((acc, curr) => {
|
|
954
971
|
acc[curr.order_id] = curr;
|
|
@@ -966,17 +983,15 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
966
983
|
}
|
|
967
984
|
return await service.create(data_, sharedContext);
|
|
968
985
|
}
|
|
969
|
-
async createOrderChange(data, sharedContext) {
|
|
986
|
+
async createOrderChange(data, sharedContext = {}) {
|
|
970
987
|
const changes = await this.createOrderChange_(data, sharedContext);
|
|
971
|
-
return await this.baseRepository_.serialize(Array.isArray(data) ? changes : changes[0]
|
|
972
|
-
populate: true,
|
|
973
|
-
});
|
|
988
|
+
return await this.baseRepository_.serialize(Array.isArray(data) ? changes : changes[0]);
|
|
974
989
|
}
|
|
975
|
-
async createOrderChange_(data, sharedContext) {
|
|
990
|
+
async createOrderChange_(data, sharedContext = {}) {
|
|
976
991
|
const dataArr = Array.isArray(data) ? data : [data];
|
|
977
992
|
const orderIds = [];
|
|
978
993
|
const dataMap = {};
|
|
979
|
-
const orderChanges = await this.
|
|
994
|
+
const orderChanges = await this.orderChangeService_.list({
|
|
980
995
|
order_id: dataArr.map((data) => data.order_id),
|
|
981
996
|
status: [utils_1.OrderChangeStatus.PENDING, utils_1.OrderChangeStatus.REQUESTED],
|
|
982
997
|
}, {}, sharedContext);
|
|
@@ -1003,7 +1018,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1003
1018
|
});
|
|
1004
1019
|
return await this.orderChangeService_.create(input, sharedContext);
|
|
1005
1020
|
}
|
|
1006
|
-
async previewOrderChange(orderId, sharedContext) {
|
|
1021
|
+
async previewOrderChange(orderId, sharedContext = {}) {
|
|
1007
1022
|
const order = await this.retrieveOrder(orderId, {
|
|
1008
1023
|
select: ["id", "version", "items.detail", "summary", "total"],
|
|
1009
1024
|
relations: ["transactions", "credit_lines"],
|
|
@@ -1021,7 +1036,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1021
1036
|
(0, utils_1.createRawPropertiesFromBigNumber)(calcOrder);
|
|
1022
1037
|
return calcOrder;
|
|
1023
1038
|
}
|
|
1024
|
-
async includeTaxLinesAndAdjustementsToPreview(order, itemsToUpsert, shippingMethodsToUpsert, sharedContext) {
|
|
1039
|
+
async includeTaxLinesAndAdjustementsToPreview(order, itemsToUpsert, shippingMethodsToUpsert, sharedContext = {}) {
|
|
1025
1040
|
const addedItems = {};
|
|
1026
1041
|
const addedShippingMethods = {};
|
|
1027
1042
|
for (const item of order.items) {
|
|
@@ -1097,7 +1112,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1097
1112
|
});
|
|
1098
1113
|
}
|
|
1099
1114
|
}
|
|
1100
|
-
async cancelOrderChange(orderChangeIdOrData, sharedContext) {
|
|
1115
|
+
async cancelOrderChange(orderChangeIdOrData, sharedContext = {}) {
|
|
1101
1116
|
const data = Array.isArray(orderChangeIdOrData)
|
|
1102
1117
|
? orderChangeIdOrData
|
|
1103
1118
|
: [orderChangeIdOrData];
|
|
@@ -1114,7 +1129,11 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1114
1129
|
});
|
|
1115
1130
|
await this.orderChangeService_.update(updates, sharedContext);
|
|
1116
1131
|
}
|
|
1117
|
-
async confirmOrderChange(orderChangeIdOrData, sharedContext) {
|
|
1132
|
+
async confirmOrderChange(orderChangeIdOrData, sharedContext = {}) {
|
|
1133
|
+
const result = await this.confirmOrderChange_(orderChangeIdOrData, sharedContext);
|
|
1134
|
+
return await this.baseRepository_.serialize(result);
|
|
1135
|
+
}
|
|
1136
|
+
async confirmOrderChange_(orderChangeIdOrData, sharedContext = {}) {
|
|
1118
1137
|
const data = Array.isArray(orderChangeIdOrData)
|
|
1119
1138
|
? orderChangeIdOrData
|
|
1120
1139
|
: [orderChangeIdOrData];
|
|
@@ -1135,7 +1154,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1135
1154
|
});
|
|
1136
1155
|
return await this.applyOrderChanges_(orderChanges.flat(), sharedContext);
|
|
1137
1156
|
}
|
|
1138
|
-
async declineOrderChange(orderChangeIdOrData, sharedContext) {
|
|
1157
|
+
async declineOrderChange(orderChangeIdOrData, sharedContext = {}) {
|
|
1158
|
+
await this.declineOrderChange_(orderChangeIdOrData, sharedContext);
|
|
1159
|
+
}
|
|
1160
|
+
async declineOrderChange_(orderChangeIdOrData, sharedContext = {}) {
|
|
1139
1161
|
const data = Array.isArray(orderChangeIdOrData)
|
|
1140
1162
|
? orderChangeIdOrData
|
|
1141
1163
|
: [orderChangeIdOrData];
|
|
@@ -1152,11 +1174,15 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1152
1174
|
});
|
|
1153
1175
|
await this.orderChangeService_.update(updates, sharedContext);
|
|
1154
1176
|
}
|
|
1155
|
-
async registerOrderChange(data, sharedContext) {
|
|
1177
|
+
async registerOrderChange(data, sharedContext = {}) {
|
|
1178
|
+
const result = await this.registerOrderChange_(data, sharedContext);
|
|
1179
|
+
return await this.baseRepository_.serialize(result);
|
|
1180
|
+
}
|
|
1181
|
+
async registerOrderChange_(data, sharedContext = {}) {
|
|
1156
1182
|
const inputData = Array.isArray(data) ? data : [data];
|
|
1157
1183
|
const orders = await this.orderService_.list({ id: inputData.map((d) => d.order_id) }, { select: ["id", "version"] }, sharedContext);
|
|
1158
1184
|
const orderVersionsMap = new Map(orders.map((o) => [o.id, o.version]));
|
|
1159
|
-
const changes =
|
|
1185
|
+
const changes = await this.orderChangeService_.create(inputData.map((d) => ({
|
|
1160
1186
|
order_id: d.order_id,
|
|
1161
1187
|
change_type: d.change_type,
|
|
1162
1188
|
internal_note: d.internal_note,
|
|
@@ -1175,10 +1201,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1175
1201
|
applied: true,
|
|
1176
1202
|
},
|
|
1177
1203
|
],
|
|
1178
|
-
})), sharedContext)
|
|
1179
|
-
return
|
|
1204
|
+
})), sharedContext);
|
|
1205
|
+
return changes;
|
|
1206
|
+
}
|
|
1207
|
+
async applyPendingOrderActions(orderId, sharedContext = {}) {
|
|
1208
|
+
const result = await this.applyPendingOrderActions_(orderId, sharedContext);
|
|
1209
|
+
return await this.baseRepository_.serialize(result);
|
|
1180
1210
|
}
|
|
1181
|
-
async
|
|
1211
|
+
async applyPendingOrderActions_(orderId, sharedContext = {}) {
|
|
1182
1212
|
const orderIds = Array.isArray(orderId) ? orderId : [orderId];
|
|
1183
1213
|
const orders = await this.orderService_.list({ id: orderIds }, {
|
|
1184
1214
|
select: ["id", "version"],
|
|
@@ -1211,7 +1241,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1211
1241
|
}, sharedContext);
|
|
1212
1242
|
return await this.applyOrderChanges_(changes, sharedContext);
|
|
1213
1243
|
}
|
|
1214
|
-
async revertLastVersion(orderId, sharedContext) {
|
|
1244
|
+
async revertLastVersion(orderId, sharedContext = {}) {
|
|
1215
1245
|
const order = await super.retrieveOrder(orderId, {
|
|
1216
1246
|
select: ["id", "version"],
|
|
1217
1247
|
}, sharedContext);
|
|
@@ -1220,7 +1250,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1220
1250
|
}
|
|
1221
1251
|
return await this.revertLastChange_(order, sharedContext);
|
|
1222
1252
|
}
|
|
1223
|
-
async undoLastChange(orderId, lastOrderChange, sharedContext) {
|
|
1253
|
+
async undoLastChange(orderId, lastOrderChange, sharedContext = {}) {
|
|
1224
1254
|
const order = await super.retrieveOrder(orderId, {
|
|
1225
1255
|
select: ["id", "version"],
|
|
1226
1256
|
}, sharedContext);
|
|
@@ -1229,7 +1259,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1229
1259
|
}
|
|
1230
1260
|
return await this.undoLastChange_(order, lastOrderChange, sharedContext);
|
|
1231
1261
|
}
|
|
1232
|
-
async undoLastChange_(order, lastOrderChange, sharedContext) {
|
|
1262
|
+
async undoLastChange_(order, lastOrderChange, sharedContext = {}) {
|
|
1233
1263
|
const currentVersion = order.version;
|
|
1234
1264
|
const updatePromises = [];
|
|
1235
1265
|
// Order Changes
|
|
@@ -1289,7 +1319,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1289
1319
|
}, sharedContext));
|
|
1290
1320
|
await (0, utils_1.promiseAll)(updatePromises);
|
|
1291
1321
|
}
|
|
1292
|
-
async revertLastChange_(order, sharedContext) {
|
|
1322
|
+
async revertLastChange_(order, sharedContext = {}) {
|
|
1293
1323
|
const currentVersion = order.version;
|
|
1294
1324
|
const updatePromises = [];
|
|
1295
1325
|
// Order Changes
|
|
@@ -1421,7 +1451,12 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1421
1451
|
}
|
|
1422
1452
|
return orderChanges;
|
|
1423
1453
|
}
|
|
1424
|
-
async addOrderAction(data, sharedContext) {
|
|
1454
|
+
async addOrderAction(data, sharedContext = {}) {
|
|
1455
|
+
const actions = await this.addOrderAction_(data, sharedContext);
|
|
1456
|
+
const serializedActions = await this.baseRepository_.serialize(actions);
|
|
1457
|
+
return Array.isArray(data) ? serializedActions : serializedActions[0];
|
|
1458
|
+
}
|
|
1459
|
+
async addOrderAction_(data, sharedContext = {}) {
|
|
1425
1460
|
let dataArr = Array.isArray(data) ? data : [data];
|
|
1426
1461
|
const orderChangeMap = {};
|
|
1427
1462
|
const orderChangeIds = dataArr
|
|
@@ -1444,10 +1479,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1444
1479
|
});
|
|
1445
1480
|
}
|
|
1446
1481
|
}
|
|
1447
|
-
const actions =
|
|
1448
|
-
return
|
|
1482
|
+
const actions = await this.orderChangeActionService_.create(dataArr, sharedContext);
|
|
1483
|
+
return actions;
|
|
1449
1484
|
}
|
|
1450
|
-
async applyOrderChanges_(changeActions, sharedContext) {
|
|
1485
|
+
async applyOrderChanges_(changeActions, sharedContext = {}) {
|
|
1451
1486
|
const actionsMap = {};
|
|
1452
1487
|
const ordersIds = [];
|
|
1453
1488
|
const usedActions = [];
|
|
@@ -1474,7 +1509,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1474
1509
|
credit_lines: [],
|
|
1475
1510
|
};
|
|
1476
1511
|
}
|
|
1477
|
-
let orders = await this.
|
|
1512
|
+
let orders = await this.listOrders_({ id: (0, utils_1.deduplicate)(ordersIds) }, {
|
|
1478
1513
|
select: ["id", "version", "items.detail", "summary", "total"],
|
|
1479
1514
|
relations: ["transactions", "credit_lines"],
|
|
1480
1515
|
}, sharedContext);
|
|
@@ -1511,7 +1546,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1511
1546
|
credit_lines: createdOrderCreditLines ?? [],
|
|
1512
1547
|
};
|
|
1513
1548
|
}
|
|
1514
|
-
async addOrderTransactions(transactionData, sharedContext) {
|
|
1549
|
+
async addOrderTransactions(transactionData, sharedContext = {}) {
|
|
1550
|
+
const created = await this.addOrderTransactions_(transactionData, sharedContext);
|
|
1551
|
+
const serializedTransactions = await this.baseRepository_.serialize(created);
|
|
1552
|
+
return Array.isArray(transactionData)
|
|
1553
|
+
? serializedTransactions
|
|
1554
|
+
: serializedTransactions[0];
|
|
1555
|
+
}
|
|
1556
|
+
async addOrderTransactions_(transactionData, sharedContext = {}) {
|
|
1515
1557
|
const orders = await this.orderService_.list({
|
|
1516
1558
|
id: Array.isArray(transactionData)
|
|
1517
1559
|
? transactionData.map((t) => t.order_id)
|
|
@@ -1531,12 +1573,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1531
1573
|
}
|
|
1532
1574
|
const created = (await this.orderTransactionService_.create(data, sharedContext));
|
|
1533
1575
|
await this.updateOrderPaidRefundableAmount_(created, false, sharedContext);
|
|
1534
|
-
return
|
|
1535
|
-
populate: true,
|
|
1536
|
-
});
|
|
1576
|
+
return created;
|
|
1537
1577
|
}
|
|
1538
1578
|
// @ts-ignore
|
|
1539
|
-
async deleteOrderTransactions(transactionIds, sharedContext) {
|
|
1579
|
+
async deleteOrderTransactions(transactionIds, sharedContext = {}) {
|
|
1540
1580
|
const data = Array.isArray(transactionIds)
|
|
1541
1581
|
? transactionIds
|
|
1542
1582
|
: [transactionIds];
|
|
@@ -1549,7 +1589,11 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1549
1589
|
await this.updateOrderPaidRefundableAmount_(transactions, true, sharedContext);
|
|
1550
1590
|
}
|
|
1551
1591
|
// @ts-ignore
|
|
1552
|
-
async softDeleteOrderTransactions(transactionIds, config, sharedContext) {
|
|
1592
|
+
async softDeleteOrderTransactions(transactionIds, config, sharedContext = {}) {
|
|
1593
|
+
const returned = await this.softDeleteOrderTransactions_(transactionIds, config, sharedContext);
|
|
1594
|
+
return returned;
|
|
1595
|
+
}
|
|
1596
|
+
async softDeleteOrderTransactions_(transactionIds, config, sharedContext = {}) {
|
|
1553
1597
|
const transactions = await super.listOrderTransactions({
|
|
1554
1598
|
id: transactionIds,
|
|
1555
1599
|
}, {
|
|
@@ -1560,7 +1604,11 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1560
1604
|
return returned;
|
|
1561
1605
|
}
|
|
1562
1606
|
// @ts-ignore
|
|
1563
|
-
async restoreOrderTransactions(transactionIds, config, sharedContext) {
|
|
1607
|
+
async restoreOrderTransactions(transactionIds, config, sharedContext = {}) {
|
|
1608
|
+
const returned = await this.restoreOrderTransactions_(transactionIds, config, sharedContext);
|
|
1609
|
+
return returned;
|
|
1610
|
+
}
|
|
1611
|
+
async restoreOrderTransactions_(transactionIds, config, sharedContext = {}) {
|
|
1564
1612
|
const transactions = await super.listOrderTransactions({
|
|
1565
1613
|
id: transactionIds,
|
|
1566
1614
|
}, {
|
|
@@ -1571,8 +1619,8 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1571
1619
|
await this.updateOrderPaidRefundableAmount_(transactions, false, sharedContext);
|
|
1572
1620
|
return returned;
|
|
1573
1621
|
}
|
|
1574
|
-
async updateOrderPaidRefundableAmount_(transactionData, isRemoved, sharedContext) {
|
|
1575
|
-
const summaries = await
|
|
1622
|
+
async updateOrderPaidRefundableAmount_(transactionData, isRemoved, sharedContext = {}) {
|
|
1623
|
+
const summaries = await this.listOrderSummaries({
|
|
1576
1624
|
order_id: transactionData.map((trx) => trx.order_id),
|
|
1577
1625
|
version: transactionData[0].version,
|
|
1578
1626
|
}, {}, sharedContext);
|
|
@@ -1599,9 +1647,13 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1599
1647
|
(0, utils_1.createRawPropertiesFromBigNumber)(summaries);
|
|
1600
1648
|
await this.orderSummaryService_.update(summaries, sharedContext);
|
|
1601
1649
|
}
|
|
1602
|
-
async archive(orderId, sharedContext) {
|
|
1650
|
+
async archive(orderId, sharedContext = {}) {
|
|
1651
|
+
const orders = await this.archive_(orderId, sharedContext);
|
|
1652
|
+
return await this.baseRepository_.serialize(Array.isArray(orderId) ? orders : orders[0]);
|
|
1653
|
+
}
|
|
1654
|
+
async archive_(orderId, sharedContext = {}) {
|
|
1603
1655
|
const orderIds = Array.isArray(orderId) ? orderId : [orderId];
|
|
1604
|
-
const orders = await this.
|
|
1656
|
+
const orders = await this.listOrders_({
|
|
1605
1657
|
id: orderIds,
|
|
1606
1658
|
}, {}, sharedContext);
|
|
1607
1659
|
const notAllowed = [];
|
|
@@ -1624,11 +1676,15 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1624
1676
|
status: utils_1.OrderStatus.ARCHIVED,
|
|
1625
1677
|
};
|
|
1626
1678
|
}), sharedContext);
|
|
1627
|
-
return
|
|
1679
|
+
return orders;
|
|
1628
1680
|
}
|
|
1629
|
-
async completeOrder(orderId, sharedContext) {
|
|
1681
|
+
async completeOrder(orderId, sharedContext = {}) {
|
|
1682
|
+
const orders = await this.completeOrder_(orderId, sharedContext);
|
|
1683
|
+
return await this.baseRepository_.serialize(Array.isArray(orderId) ? orders : orders[0]);
|
|
1684
|
+
}
|
|
1685
|
+
async completeOrder_(orderId, sharedContext = {}) {
|
|
1630
1686
|
const orderIds = Array.isArray(orderId) ? orderId : [orderId];
|
|
1631
|
-
const orders = await this.
|
|
1687
|
+
const orders = await this.listOrders_({
|
|
1632
1688
|
id: orderIds,
|
|
1633
1689
|
}, {}, sharedContext);
|
|
1634
1690
|
const notAllowed = [];
|
|
@@ -1647,11 +1703,15 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1647
1703
|
status: utils_1.OrderStatus.COMPLETED,
|
|
1648
1704
|
};
|
|
1649
1705
|
}), sharedContext);
|
|
1650
|
-
return
|
|
1706
|
+
return orders;
|
|
1707
|
+
}
|
|
1708
|
+
async cancel(orderId, sharedContext = {}) {
|
|
1709
|
+
const orders = await this.cancel_(orderId, sharedContext);
|
|
1710
|
+
return await this.baseRepository_.serialize(Array.isArray(orderId) ? orders : orders[0]);
|
|
1651
1711
|
}
|
|
1652
|
-
async
|
|
1712
|
+
async cancel_(orderId, sharedContext = {}) {
|
|
1653
1713
|
const orderIds = Array.isArray(orderId) ? orderId : [orderId];
|
|
1654
|
-
const orders = await this.
|
|
1714
|
+
const orders = await this.listOrders_({
|
|
1655
1715
|
id: orderIds,
|
|
1656
1716
|
}, {}, sharedContext);
|
|
1657
1717
|
const canceled_at = new Date();
|
|
@@ -1666,10 +1726,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1666
1726
|
canceled_at,
|
|
1667
1727
|
};
|
|
1668
1728
|
}), sharedContext);
|
|
1669
|
-
return
|
|
1729
|
+
return orders;
|
|
1670
1730
|
}
|
|
1671
1731
|
// ------------------- Bundled Order Actions
|
|
1672
|
-
async createReturn(data, sharedContext) {
|
|
1732
|
+
async createReturn(data, sharedContext = {}) {
|
|
1733
|
+
const ret = await this.createReturn_(data, sharedContext);
|
|
1734
|
+
return await this.baseRepository_.serialize(ret);
|
|
1735
|
+
}
|
|
1736
|
+
async createReturn_(data, sharedContext = {}) {
|
|
1673
1737
|
const ret = await BundledActions.createReturn.bind(this)(data, sharedContext);
|
|
1674
1738
|
return await this.retrieveReturn(ret.id, {
|
|
1675
1739
|
relations: [
|
|
@@ -1680,9 +1744,9 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1680
1744
|
],
|
|
1681
1745
|
}, sharedContext);
|
|
1682
1746
|
}
|
|
1683
|
-
async receiveReturn(data, sharedContext) {
|
|
1747
|
+
async receiveReturn(data, sharedContext = {}) {
|
|
1684
1748
|
const ret = await this.receiveReturn_(data, sharedContext);
|
|
1685
|
-
|
|
1749
|
+
const returned = await this.retrieveReturn(ret[0].id, {
|
|
1686
1750
|
relations: [
|
|
1687
1751
|
"items",
|
|
1688
1752
|
"items.item",
|
|
@@ -1691,13 +1755,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1691
1755
|
"shipping_methods.adjustments",
|
|
1692
1756
|
],
|
|
1693
1757
|
});
|
|
1758
|
+
return await this.baseRepository_.serialize(returned);
|
|
1694
1759
|
}
|
|
1695
|
-
async receiveReturn_(data, sharedContext) {
|
|
1760
|
+
async receiveReturn_(data, sharedContext = {}) {
|
|
1696
1761
|
return await BundledActions.receiveReturn.bind(this)(data, sharedContext);
|
|
1697
1762
|
}
|
|
1698
|
-
async cancelReturn(data, sharedContext) {
|
|
1763
|
+
async cancelReturn(data, sharedContext = {}) {
|
|
1699
1764
|
const ret = await this.cancelReturn_(data, sharedContext);
|
|
1700
|
-
|
|
1765
|
+
const returned = await this.retrieveReturn(ret.id, {
|
|
1701
1766
|
relations: [
|
|
1702
1767
|
"items",
|
|
1703
1768
|
"shipping_methods",
|
|
@@ -1705,11 +1770,12 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1705
1770
|
"shipping_methods.adjustments",
|
|
1706
1771
|
],
|
|
1707
1772
|
});
|
|
1773
|
+
return await this.baseRepository_.serialize(returned);
|
|
1708
1774
|
}
|
|
1709
|
-
async cancelReturn_(data, sharedContext) {
|
|
1775
|
+
async cancelReturn_(data, sharedContext = {}) {
|
|
1710
1776
|
return await BundledActions.cancelReturn.bind(this)(data, sharedContext);
|
|
1711
1777
|
}
|
|
1712
|
-
async createClaim(data, sharedContext) {
|
|
1778
|
+
async createClaim(data, sharedContext = {}) {
|
|
1713
1779
|
const ret = await this.createClaim_(data, sharedContext);
|
|
1714
1780
|
const claim = await this.retrieveOrderClaim(ret.id, {
|
|
1715
1781
|
relations: [
|
|
@@ -1725,23 +1791,22 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1725
1791
|
"transactions",
|
|
1726
1792
|
],
|
|
1727
1793
|
}, sharedContext);
|
|
1728
|
-
return await this.baseRepository_.serialize(claim
|
|
1729
|
-
populate: true,
|
|
1730
|
-
});
|
|
1794
|
+
return await this.baseRepository_.serialize(claim);
|
|
1731
1795
|
}
|
|
1732
|
-
async createClaim_(data, sharedContext) {
|
|
1796
|
+
async createClaim_(data, sharedContext = {}) {
|
|
1733
1797
|
return await BundledActions.createClaim.bind(this)(data, sharedContext);
|
|
1734
1798
|
}
|
|
1735
|
-
async cancelClaim(data, sharedContext) {
|
|
1799
|
+
async cancelClaim(data, sharedContext = {}) {
|
|
1736
1800
|
const ret = await this.cancelClaim_(data, sharedContext);
|
|
1737
|
-
|
|
1801
|
+
const claim = await this.retrieveOrderClaim(ret.id, {
|
|
1738
1802
|
relations: ["additional_items", "claim_items", "return", "return.items"],
|
|
1739
1803
|
});
|
|
1804
|
+
return await this.baseRepository_.serialize(claim);
|
|
1740
1805
|
}
|
|
1741
|
-
async cancelClaim_(data, sharedContext) {
|
|
1806
|
+
async cancelClaim_(data, sharedContext = {}) {
|
|
1742
1807
|
return await BundledActions.cancelClaim.bind(this)(data, sharedContext);
|
|
1743
1808
|
}
|
|
1744
|
-
async createExchange(data, sharedContext) {
|
|
1809
|
+
async createExchange(data, sharedContext = {}) {
|
|
1745
1810
|
const ret = await this.createExchange_(data, sharedContext);
|
|
1746
1811
|
const exchange = await this.retrieveOrderExchange(ret.id, {
|
|
1747
1812
|
relations: [
|
|
@@ -1755,12 +1820,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1755
1820
|
"transactions",
|
|
1756
1821
|
],
|
|
1757
1822
|
}, sharedContext);
|
|
1758
|
-
return await this.baseRepository_.serialize(exchange
|
|
1759
|
-
populate: true,
|
|
1760
|
-
});
|
|
1823
|
+
return await this.baseRepository_.serialize(exchange);
|
|
1761
1824
|
}
|
|
1762
1825
|
// @ts-expect-error
|
|
1763
1826
|
async updateReturnReasons(idOrSelector, data, sharedContext = {}) {
|
|
1827
|
+
const reasons = await this.updateReturnReasons_(idOrSelector, data, sharedContext);
|
|
1828
|
+
return await this.baseRepository_.serialize((0, utils_1.isString)(idOrSelector) ? reasons[0] : reasons);
|
|
1829
|
+
}
|
|
1830
|
+
async updateReturnReasons_(idOrSelector, data, sharedContext = {}) {
|
|
1764
1831
|
let normalizedInput = [];
|
|
1765
1832
|
if ((0, utils_1.isString)(idOrSelector)) {
|
|
1766
1833
|
// Check if the return reason exists in the first place
|
|
@@ -1775,34 +1842,32 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1775
1842
|
}));
|
|
1776
1843
|
}
|
|
1777
1844
|
const reasons = await this.returnReasonService_.update(normalizedInput, sharedContext);
|
|
1778
|
-
|
|
1779
|
-
return (0, utils_1.isString)(idOrSelector)
|
|
1780
|
-
? updatedReturnReasons[0]
|
|
1781
|
-
: updatedReturnReasons;
|
|
1845
|
+
return reasons;
|
|
1782
1846
|
}
|
|
1783
|
-
async createExchange_(data, sharedContext) {
|
|
1847
|
+
async createExchange_(data, sharedContext = {}) {
|
|
1784
1848
|
return await BundledActions.createExchange.bind(this)(data, sharedContext);
|
|
1785
1849
|
}
|
|
1786
|
-
async cancelExchange(data, sharedContext) {
|
|
1850
|
+
async cancelExchange(data, sharedContext = {}) {
|
|
1787
1851
|
const ret = await this.cancelExchange_(data, sharedContext);
|
|
1788
|
-
|
|
1852
|
+
const exchange = await this.retrieveOrderExchange(ret.id, {
|
|
1789
1853
|
relations: ["additional_items", "return", "return.items"],
|
|
1790
1854
|
});
|
|
1855
|
+
return await this.baseRepository_.serialize(exchange);
|
|
1791
1856
|
}
|
|
1792
|
-
async cancelExchange_(data, sharedContext) {
|
|
1857
|
+
async cancelExchange_(data, sharedContext = {}) {
|
|
1793
1858
|
return await BundledActions.cancelExchange.bind(this)(data, sharedContext);
|
|
1794
1859
|
}
|
|
1795
|
-
async registerFulfillment(data, sharedContext) {
|
|
1796
|
-
|
|
1860
|
+
async registerFulfillment(data, sharedContext = {}) {
|
|
1861
|
+
await BundledActions.registerFulfillment.bind(this)(data, sharedContext);
|
|
1797
1862
|
}
|
|
1798
|
-
async cancelFulfillment(data, sharedContext) {
|
|
1799
|
-
|
|
1863
|
+
async cancelFulfillment(data, sharedContext = {}) {
|
|
1864
|
+
await BundledActions.cancelFulfillment.bind(this)(data, sharedContext);
|
|
1800
1865
|
}
|
|
1801
|
-
async registerShipment(data, sharedContext) {
|
|
1802
|
-
|
|
1866
|
+
async registerShipment(data, sharedContext = {}) {
|
|
1867
|
+
await BundledActions.registerShipment.bind(this)(data, sharedContext);
|
|
1803
1868
|
}
|
|
1804
|
-
async registerDelivery(data, sharedContext) {
|
|
1805
|
-
|
|
1869
|
+
async registerDelivery(data, sharedContext = {}) {
|
|
1870
|
+
await BundledActions.registerDelivery.bind(this)(data, sharedContext);
|
|
1806
1871
|
}
|
|
1807
1872
|
// @ts-expect-error
|
|
1808
1873
|
async createReturnItems(data, sharedContext) {
|
|
@@ -1810,80 +1875,15 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
|
1810
1875
|
}
|
|
1811
1876
|
}
|
|
1812
1877
|
exports.default = OrderModuleService;
|
|
1813
|
-
__decorate([
|
|
1814
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1815
|
-
__metadata("design:type", Function),
|
|
1816
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
1817
|
-
__metadata("design:returntype", Promise)
|
|
1818
|
-
], OrderModuleService.prototype, "retrieveOrder", null);
|
|
1819
|
-
__decorate([
|
|
1820
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1821
|
-
__metadata("design:type", Function),
|
|
1822
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1823
|
-
__metadata("design:returntype", Promise)
|
|
1824
|
-
], OrderModuleService.prototype, "listOrders", null);
|
|
1825
|
-
__decorate([
|
|
1826
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1827
|
-
__metadata("design:type", Function),
|
|
1828
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1829
|
-
__metadata("design:returntype", Promise)
|
|
1830
|
-
], OrderModuleService.prototype, "listAndCountOrders", null);
|
|
1831
|
-
__decorate([
|
|
1832
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1833
|
-
__metadata("design:type", Function),
|
|
1834
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
1835
|
-
__metadata("design:returntype", Promise)
|
|
1836
|
-
], OrderModuleService.prototype, "retrieveReturn", null);
|
|
1837
|
-
__decorate([
|
|
1838
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1839
|
-
__metadata("design:type", Function),
|
|
1840
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1841
|
-
__metadata("design:returntype", Promise)
|
|
1842
|
-
], OrderModuleService.prototype, "listReturns", null);
|
|
1843
|
-
__decorate([
|
|
1844
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1845
|
-
__metadata("design:type", Function),
|
|
1846
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1847
|
-
__metadata("design:returntype", Promise)
|
|
1848
|
-
], OrderModuleService.prototype, "listAndCountReturns", null);
|
|
1849
|
-
__decorate([
|
|
1850
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1851
|
-
__metadata("design:type", Function),
|
|
1852
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
1853
|
-
__metadata("design:returntype", Promise)
|
|
1854
|
-
], OrderModuleService.prototype, "retrieveOrderClaim", null);
|
|
1855
|
-
__decorate([
|
|
1856
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1857
|
-
__metadata("design:type", Function),
|
|
1858
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1859
|
-
__metadata("design:returntype", Promise)
|
|
1860
|
-
], OrderModuleService.prototype, "listOrderClaims", null);
|
|
1861
|
-
__decorate([
|
|
1862
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1863
|
-
__metadata("design:type", Function),
|
|
1864
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1865
|
-
__metadata("design:returntype", Promise)
|
|
1866
|
-
], OrderModuleService.prototype, "listAndCountOrderClaims", null);
|
|
1867
|
-
__decorate([
|
|
1868
|
-
__param(2, (0, utils_1.MedusaContext)()),
|
|
1869
|
-
__metadata("design:type", Function),
|
|
1870
|
-
__metadata("design:paramtypes", [String, Object, Object]),
|
|
1871
|
-
__metadata("design:returntype", Promise)
|
|
1872
|
-
], OrderModuleService.prototype, "retrieveOrderExchange", null);
|
|
1873
1878
|
__decorate([
|
|
1874
1879
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
1875
1880
|
__metadata("design:type", Function),
|
|
1876
1881
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1877
1882
|
__metadata("design:returntype", Promise)
|
|
1878
|
-
], OrderModuleService.prototype, "
|
|
1883
|
+
], OrderModuleService.prototype, "listOrders_", null);
|
|
1879
1884
|
__decorate([
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
1883
|
-
__metadata("design:returntype", Promise)
|
|
1884
|
-
], OrderModuleService.prototype, "listAndCountOrderExchanges", null);
|
|
1885
|
-
__decorate([
|
|
1886
|
-
(0, utils_1.InjectManager)()
|
|
1885
|
+
(0, utils_1.InjectManager)(),
|
|
1886
|
+
(0, utils_1.EmitEvents)()
|
|
1887
1887
|
// @ts-expect-error
|
|
1888
1888
|
,
|
|
1889
1889
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -1906,7 +1906,8 @@ __decorate([
|
|
|
1906
1906
|
__metadata("design:returntype", Promise)
|
|
1907
1907
|
], OrderModuleService.prototype, "createOrderAddresses_", null);
|
|
1908
1908
|
__decorate([
|
|
1909
|
-
(0, utils_1.InjectTransactionManager)()
|
|
1909
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
1910
|
+
(0, utils_1.EmitEvents)()
|
|
1910
1911
|
// @ts-expect-error
|
|
1911
1912
|
,
|
|
1912
1913
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -1915,7 +1916,8 @@ __decorate([
|
|
|
1915
1916
|
__metadata("design:returntype", Promise)
|
|
1916
1917
|
], OrderModuleService.prototype, "deleteOrders", null);
|
|
1917
1918
|
__decorate([
|
|
1918
|
-
(0, utils_1.InjectManager)()
|
|
1919
|
+
(0, utils_1.InjectManager)(),
|
|
1920
|
+
(0, utils_1.EmitEvents)()
|
|
1919
1921
|
// @ts-expect-error
|
|
1920
1922
|
,
|
|
1921
1923
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -1931,7 +1933,8 @@ __decorate([
|
|
|
1931
1933
|
__metadata("design:returntype", Promise)
|
|
1932
1934
|
], OrderModuleService.prototype, "updateOrders_", null);
|
|
1933
1935
|
__decorate([
|
|
1934
|
-
(0, utils_1.InjectManager)()
|
|
1936
|
+
(0, utils_1.InjectManager)(),
|
|
1937
|
+
(0, utils_1.EmitEvents)()
|
|
1935
1938
|
// @ts-expect-error
|
|
1936
1939
|
,
|
|
1937
1940
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -1954,7 +1957,8 @@ __decorate([
|
|
|
1954
1957
|
__metadata("design:returntype", Promise)
|
|
1955
1958
|
], OrderModuleService.prototype, "createOrderLineItemsBulk_", null);
|
|
1956
1959
|
__decorate([
|
|
1957
|
-
(0, utils_1.InjectManager)()
|
|
1960
|
+
(0, utils_1.InjectManager)(),
|
|
1961
|
+
(0, utils_1.EmitEvents)()
|
|
1958
1962
|
// @ts-expect-error
|
|
1959
1963
|
,
|
|
1960
1964
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -1978,6 +1982,7 @@ __decorate([
|
|
|
1978
1982
|
], OrderModuleService.prototype, "updateOrderLineItemsWithSelector_", null);
|
|
1979
1983
|
__decorate([
|
|
1980
1984
|
(0, utils_1.InjectManager)(),
|
|
1985
|
+
(0, utils_1.EmitEvents)(),
|
|
1981
1986
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
1982
1987
|
__metadata("design:type", Function),
|
|
1983
1988
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
@@ -1998,7 +2003,8 @@ __decorate([
|
|
|
1998
2003
|
__metadata("design:returntype", Promise)
|
|
1999
2004
|
], OrderModuleService.prototype, "updateOrderItemWithSelector_", null);
|
|
2000
2005
|
__decorate([
|
|
2001
|
-
(0, utils_1.InjectManager)()
|
|
2006
|
+
(0, utils_1.InjectManager)(),
|
|
2007
|
+
(0, utils_1.EmitEvents)()
|
|
2002
2008
|
// @ts-expect-error
|
|
2003
2009
|
,
|
|
2004
2010
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2021,7 +2027,8 @@ __decorate([
|
|
|
2021
2027
|
__metadata("design:returntype", Promise)
|
|
2022
2028
|
], OrderModuleService.prototype, "createOrderShippingMethodsBulk_", null);
|
|
2023
2029
|
__decorate([
|
|
2024
|
-
(0, utils_1.InjectManager)()
|
|
2030
|
+
(0, utils_1.InjectManager)(),
|
|
2031
|
+
(0, utils_1.EmitEvents)()
|
|
2025
2032
|
// @ts-ignore
|
|
2026
2033
|
,
|
|
2027
2034
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2030,7 +2037,15 @@ __decorate([
|
|
|
2030
2037
|
__metadata("design:returntype", Promise)
|
|
2031
2038
|
], OrderModuleService.prototype, "softDeleteOrderShippingMethods", null);
|
|
2032
2039
|
__decorate([
|
|
2033
|
-
(0, utils_1.
|
|
2040
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2041
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2042
|
+
__metadata("design:type", Function),
|
|
2043
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2044
|
+
__metadata("design:returntype", Promise)
|
|
2045
|
+
], OrderModuleService.prototype, "softDeleteOrderShippingMethods_", null);
|
|
2046
|
+
__decorate([
|
|
2047
|
+
(0, utils_1.InjectManager)(),
|
|
2048
|
+
(0, utils_1.EmitEvents)()
|
|
2034
2049
|
// @ts-ignore
|
|
2035
2050
|
,
|
|
2036
2051
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2039,7 +2054,15 @@ __decorate([
|
|
|
2039
2054
|
__metadata("design:returntype", Promise)
|
|
2040
2055
|
], OrderModuleService.prototype, "restoreOrderShippingMethods", null);
|
|
2041
2056
|
__decorate([
|
|
2042
|
-
(0, utils_1.InjectTransactionManager)()
|
|
2057
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2058
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2059
|
+
__metadata("design:type", Function),
|
|
2060
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2061
|
+
__metadata("design:returntype", Promise)
|
|
2062
|
+
], OrderModuleService.prototype, "restoreOrderShippingMethods_", null);
|
|
2063
|
+
__decorate([
|
|
2064
|
+
(0, utils_1.InjectManager)(),
|
|
2065
|
+
(0, utils_1.EmitEvents)()
|
|
2043
2066
|
// @ts-expect-error
|
|
2044
2067
|
,
|
|
2045
2068
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2049,6 +2072,14 @@ __decorate([
|
|
|
2049
2072
|
], OrderModuleService.prototype, "createOrderLineItemAdjustments", null);
|
|
2050
2073
|
__decorate([
|
|
2051
2074
|
(0, utils_1.InjectTransactionManager)(),
|
|
2075
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2076
|
+
__metadata("design:type", Function),
|
|
2077
|
+
__metadata("design:paramtypes", [Object, Array, Object]),
|
|
2078
|
+
__metadata("design:returntype", Promise)
|
|
2079
|
+
], OrderModuleService.prototype, "createOrderLineItemAdjustments_", null);
|
|
2080
|
+
__decorate([
|
|
2081
|
+
(0, utils_1.InjectManager)(),
|
|
2082
|
+
(0, utils_1.EmitEvents)(),
|
|
2052
2083
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2053
2084
|
__metadata("design:type", Function),
|
|
2054
2085
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -2056,6 +2087,14 @@ __decorate([
|
|
|
2056
2087
|
], OrderModuleService.prototype, "upsertOrderLineItemAdjustments", null);
|
|
2057
2088
|
__decorate([
|
|
2058
2089
|
(0, utils_1.InjectTransactionManager)(),
|
|
2090
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2091
|
+
__metadata("design:type", Function),
|
|
2092
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
2093
|
+
__metadata("design:returntype", Promise)
|
|
2094
|
+
], OrderModuleService.prototype, "upsertOrderLineItemAdjustments_", null);
|
|
2095
|
+
__decorate([
|
|
2096
|
+
(0, utils_1.InjectManager)(),
|
|
2097
|
+
(0, utils_1.EmitEvents)(),
|
|
2059
2098
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
2060
2099
|
__metadata("design:type", Function),
|
|
2061
2100
|
__metadata("design:paramtypes", [String, Array, Object]),
|
|
@@ -2063,6 +2102,14 @@ __decorate([
|
|
|
2063
2102
|
], OrderModuleService.prototype, "setOrderLineItemAdjustments", null);
|
|
2064
2103
|
__decorate([
|
|
2065
2104
|
(0, utils_1.InjectTransactionManager)(),
|
|
2105
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2106
|
+
__metadata("design:type", Function),
|
|
2107
|
+
__metadata("design:paramtypes", [String, Array, Object]),
|
|
2108
|
+
__metadata("design:returntype", Promise)
|
|
2109
|
+
], OrderModuleService.prototype, "setOrderLineItemAdjustments_", null);
|
|
2110
|
+
__decorate([
|
|
2111
|
+
(0, utils_1.InjectManager)(),
|
|
2112
|
+
(0, utils_1.EmitEvents)(),
|
|
2066
2113
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2067
2114
|
__metadata("design:type", Function),
|
|
2068
2115
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -2070,13 +2117,29 @@ __decorate([
|
|
|
2070
2117
|
], OrderModuleService.prototype, "upsertOrderShippingMethodAdjustments", null);
|
|
2071
2118
|
__decorate([
|
|
2072
2119
|
(0, utils_1.InjectTransactionManager)(),
|
|
2120
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2121
|
+
__metadata("design:type", Function),
|
|
2122
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
2123
|
+
__metadata("design:returntype", Promise)
|
|
2124
|
+
], OrderModuleService.prototype, "upsertOrderShippingMethodAdjustments_", null);
|
|
2125
|
+
__decorate([
|
|
2126
|
+
(0, utils_1.InjectManager)(),
|
|
2127
|
+
(0, utils_1.EmitEvents)(),
|
|
2073
2128
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
2074
2129
|
__metadata("design:type", Function),
|
|
2075
2130
|
__metadata("design:paramtypes", [String, Array, Object]),
|
|
2076
2131
|
__metadata("design:returntype", Promise)
|
|
2077
2132
|
], OrderModuleService.prototype, "setOrderShippingMethodAdjustments", null);
|
|
2078
2133
|
__decorate([
|
|
2079
|
-
(0, utils_1.InjectTransactionManager)()
|
|
2134
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2135
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2136
|
+
__metadata("design:type", Function),
|
|
2137
|
+
__metadata("design:paramtypes", [String, Array, Object]),
|
|
2138
|
+
__metadata("design:returntype", Promise)
|
|
2139
|
+
], OrderModuleService.prototype, "setOrderShippingMethodAdjustments_", null);
|
|
2140
|
+
__decorate([
|
|
2141
|
+
(0, utils_1.InjectManager)(),
|
|
2142
|
+
(0, utils_1.EmitEvents)()
|
|
2080
2143
|
// @ts-expect-error
|
|
2081
2144
|
,
|
|
2082
2145
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2085,7 +2148,15 @@ __decorate([
|
|
|
2085
2148
|
__metadata("design:returntype", Promise)
|
|
2086
2149
|
], OrderModuleService.prototype, "createOrderShippingMethodAdjustments", null);
|
|
2087
2150
|
__decorate([
|
|
2088
|
-
(0, utils_1.InjectTransactionManager)()
|
|
2151
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2152
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2153
|
+
__metadata("design:type", Function),
|
|
2154
|
+
__metadata("design:paramtypes", [Object, Array, Object]),
|
|
2155
|
+
__metadata("design:returntype", Promise)
|
|
2156
|
+
], OrderModuleService.prototype, "createOrderShippingMethodAdjustments_", null);
|
|
2157
|
+
__decorate([
|
|
2158
|
+
(0, utils_1.InjectManager)(),
|
|
2159
|
+
(0, utils_1.EmitEvents)()
|
|
2089
2160
|
// @ts-expect-error
|
|
2090
2161
|
,
|
|
2091
2162
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2095,6 +2166,14 @@ __decorate([
|
|
|
2095
2166
|
], OrderModuleService.prototype, "createOrderLineItemTaxLines", null);
|
|
2096
2167
|
__decorate([
|
|
2097
2168
|
(0, utils_1.InjectTransactionManager)(),
|
|
2169
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2170
|
+
__metadata("design:type", Function),
|
|
2171
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2172
|
+
__metadata("design:returntype", Promise)
|
|
2173
|
+
], OrderModuleService.prototype, "createOrderLineItemTaxLines_", null);
|
|
2174
|
+
__decorate([
|
|
2175
|
+
(0, utils_1.InjectManager)(),
|
|
2176
|
+
(0, utils_1.EmitEvents)(),
|
|
2098
2177
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2099
2178
|
__metadata("design:type", Function),
|
|
2100
2179
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -2102,13 +2181,29 @@ __decorate([
|
|
|
2102
2181
|
], OrderModuleService.prototype, "upsertOrderLineItemTaxLines", null);
|
|
2103
2182
|
__decorate([
|
|
2104
2183
|
(0, utils_1.InjectTransactionManager)(),
|
|
2184
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2185
|
+
__metadata("design:type", Function),
|
|
2186
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
2187
|
+
__metadata("design:returntype", Promise)
|
|
2188
|
+
], OrderModuleService.prototype, "upsertOrderLineItemTaxLines_", null);
|
|
2189
|
+
__decorate([
|
|
2190
|
+
(0, utils_1.InjectManager)(),
|
|
2191
|
+
(0, utils_1.EmitEvents)(),
|
|
2105
2192
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
2106
2193
|
__metadata("design:type", Function),
|
|
2107
2194
|
__metadata("design:paramtypes", [String, Array, Object]),
|
|
2108
2195
|
__metadata("design:returntype", Promise)
|
|
2109
2196
|
], OrderModuleService.prototype, "setOrderLineItemTaxLines", null);
|
|
2110
2197
|
__decorate([
|
|
2111
|
-
(0, utils_1.InjectTransactionManager)()
|
|
2198
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2199
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2200
|
+
__metadata("design:type", Function),
|
|
2201
|
+
__metadata("design:paramtypes", [String, Array, Object]),
|
|
2202
|
+
__metadata("design:returntype", Promise)
|
|
2203
|
+
], OrderModuleService.prototype, "setOrderLineItemTaxLines_", null);
|
|
2204
|
+
__decorate([
|
|
2205
|
+
(0, utils_1.InjectManager)(),
|
|
2206
|
+
(0, utils_1.EmitEvents)()
|
|
2112
2207
|
// @ts-expect-error
|
|
2113
2208
|
,
|
|
2114
2209
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2118,20 +2213,37 @@ __decorate([
|
|
|
2118
2213
|
], OrderModuleService.prototype, "createOrderShippingMethodTaxLines", null);
|
|
2119
2214
|
__decorate([
|
|
2120
2215
|
(0, utils_1.InjectTransactionManager)(),
|
|
2216
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2217
|
+
__metadata("design:type", Function),
|
|
2218
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2219
|
+
__metadata("design:returntype", Promise)
|
|
2220
|
+
], OrderModuleService.prototype, "createOrderShippingMethodTaxLines_", null);
|
|
2221
|
+
__decorate([
|
|
2222
|
+
(0, utils_1.InjectManager)(),
|
|
2223
|
+
(0, utils_1.EmitEvents)(),
|
|
2121
2224
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2122
2225
|
__metadata("design:type", Function),
|
|
2123
2226
|
__metadata("design:paramtypes", [Array, Object]),
|
|
2124
2227
|
__metadata("design:returntype", Promise)
|
|
2125
2228
|
], OrderModuleService.prototype, "upsertOrderShippingMethodTaxLines", null);
|
|
2126
2229
|
__decorate([
|
|
2127
|
-
(0, utils_1.
|
|
2230
|
+
(0, utils_1.InjectManager)(),
|
|
2231
|
+
(0, utils_1.EmitEvents)(),
|
|
2128
2232
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
2129
2233
|
__metadata("design:type", Function),
|
|
2130
2234
|
__metadata("design:paramtypes", [String, Array, Object]),
|
|
2131
2235
|
__metadata("design:returntype", Promise)
|
|
2132
2236
|
], OrderModuleService.prototype, "setOrderShippingMethodTaxLines", null);
|
|
2133
2237
|
__decorate([
|
|
2134
|
-
(0, utils_1.InjectTransactionManager)()
|
|
2238
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2239
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2240
|
+
__metadata("design:type", Function),
|
|
2241
|
+
__metadata("design:paramtypes", [String, Array, Object]),
|
|
2242
|
+
__metadata("design:returntype", Promise)
|
|
2243
|
+
], OrderModuleService.prototype, "setOrderShippingMethodTaxLines_", null);
|
|
2244
|
+
__decorate([
|
|
2245
|
+
(0, utils_1.InjectManager)(),
|
|
2246
|
+
(0, utils_1.EmitEvents)()
|
|
2135
2247
|
// @ts-expect-error
|
|
2136
2248
|
,
|
|
2137
2249
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -2140,7 +2252,8 @@ __decorate([
|
|
|
2140
2252
|
__metadata("design:returntype", Promise)
|
|
2141
2253
|
], OrderModuleService.prototype, "createReturns", null);
|
|
2142
2254
|
__decorate([
|
|
2143
|
-
(0, utils_1.
|
|
2255
|
+
(0, utils_1.InjectManager)(),
|
|
2256
|
+
(0, utils_1.EmitEvents)()
|
|
2144
2257
|
// @ts-expect-error
|
|
2145
2258
|
,
|
|
2146
2259
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -2149,7 +2262,8 @@ __decorate([
|
|
|
2149
2262
|
__metadata("design:returntype", Promise)
|
|
2150
2263
|
], OrderModuleService.prototype, "createOrderClaims", null);
|
|
2151
2264
|
__decorate([
|
|
2152
|
-
(0, utils_1.
|
|
2265
|
+
(0, utils_1.InjectManager)(),
|
|
2266
|
+
(0, utils_1.EmitEvents)()
|
|
2153
2267
|
// @ts-expect-error
|
|
2154
2268
|
,
|
|
2155
2269
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -2159,12 +2273,14 @@ __decorate([
|
|
|
2159
2273
|
], OrderModuleService.prototype, "createOrderExchanges", null);
|
|
2160
2274
|
__decorate([
|
|
2161
2275
|
(0, utils_1.InjectTransactionManager)(),
|
|
2276
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2162
2277
|
__metadata("design:type", Function),
|
|
2163
2278
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2164
2279
|
__metadata("design:returntype", Promise)
|
|
2165
2280
|
], OrderModuleService.prototype, "createOrderRelatedEntity_", null);
|
|
2166
2281
|
__decorate([
|
|
2167
2282
|
(0, utils_1.InjectManager)(),
|
|
2283
|
+
(0, utils_1.EmitEvents)(),
|
|
2168
2284
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2169
2285
|
__metadata("design:type", Function),
|
|
2170
2286
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2179,12 +2295,14 @@ __decorate([
|
|
|
2179
2295
|
], OrderModuleService.prototype, "createOrderChange_", null);
|
|
2180
2296
|
__decorate([
|
|
2181
2297
|
(0, utils_1.InjectManager)(),
|
|
2298
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2182
2299
|
__metadata("design:type", Function),
|
|
2183
2300
|
__metadata("design:paramtypes", [String, Object]),
|
|
2184
2301
|
__metadata("design:returntype", Promise)
|
|
2185
2302
|
], OrderModuleService.prototype, "previewOrderChange", null);
|
|
2186
2303
|
__decorate([
|
|
2187
2304
|
(0, utils_1.InjectTransactionManager)(),
|
|
2305
|
+
(0, utils_1.EmitEvents)(),
|
|
2188
2306
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2189
2307
|
__metadata("design:type", Function),
|
|
2190
2308
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2192,6 +2310,7 @@ __decorate([
|
|
|
2192
2310
|
], OrderModuleService.prototype, "cancelOrderChange", null);
|
|
2193
2311
|
__decorate([
|
|
2194
2312
|
(0, utils_1.InjectManager)(),
|
|
2313
|
+
(0, utils_1.EmitEvents)(),
|
|
2195
2314
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2196
2315
|
__metadata("design:type", Function),
|
|
2197
2316
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2203,22 +2322,55 @@ __decorate([
|
|
|
2203
2322
|
__metadata("design:type", Function),
|
|
2204
2323
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2205
2324
|
__metadata("design:returntype", Promise)
|
|
2325
|
+
], OrderModuleService.prototype, "confirmOrderChange_", null);
|
|
2326
|
+
__decorate([
|
|
2327
|
+
(0, utils_1.InjectManager)(),
|
|
2328
|
+
(0, utils_1.EmitEvents)(),
|
|
2329
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2330
|
+
__metadata("design:type", Function),
|
|
2331
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2332
|
+
__metadata("design:returntype", Promise)
|
|
2206
2333
|
], OrderModuleService.prototype, "declineOrderChange", null);
|
|
2334
|
+
__decorate([
|
|
2335
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2336
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2337
|
+
__metadata("design:type", Function),
|
|
2338
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2339
|
+
__metadata("design:returntype", Promise)
|
|
2340
|
+
], OrderModuleService.prototype, "declineOrderChange_", null);
|
|
2207
2341
|
__decorate([
|
|
2208
2342
|
(0, utils_1.InjectManager)(),
|
|
2343
|
+
(0, utils_1.EmitEvents)(),
|
|
2344
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2209
2345
|
__metadata("design:type", Function),
|
|
2210
2346
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2211
2347
|
__metadata("design:returntype", Promise)
|
|
2212
2348
|
], OrderModuleService.prototype, "registerOrderChange", null);
|
|
2349
|
+
__decorate([
|
|
2350
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2351
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2352
|
+
__metadata("design:type", Function),
|
|
2353
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2354
|
+
__metadata("design:returntype", Promise)
|
|
2355
|
+
], OrderModuleService.prototype, "registerOrderChange_", null);
|
|
2213
2356
|
__decorate([
|
|
2214
2357
|
(0, utils_1.InjectManager)(),
|
|
2358
|
+
(0, utils_1.EmitEvents)(),
|
|
2215
2359
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2216
2360
|
__metadata("design:type", Function),
|
|
2217
2361
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2218
2362
|
__metadata("design:returntype", Promise)
|
|
2219
2363
|
], OrderModuleService.prototype, "applyPendingOrderActions", null);
|
|
2364
|
+
__decorate([
|
|
2365
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2366
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2367
|
+
__metadata("design:type", Function),
|
|
2368
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2369
|
+
__metadata("design:returntype", Promise)
|
|
2370
|
+
], OrderModuleService.prototype, "applyPendingOrderActions_", null);
|
|
2220
2371
|
__decorate([
|
|
2221
2372
|
(0, utils_1.InjectManager)(),
|
|
2373
|
+
(0, utils_1.EmitEvents)(),
|
|
2222
2374
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2223
2375
|
__metadata("design:type", Function),
|
|
2224
2376
|
__metadata("design:paramtypes", [String, Object]),
|
|
@@ -2226,6 +2378,7 @@ __decorate([
|
|
|
2226
2378
|
], OrderModuleService.prototype, "revertLastVersion", null);
|
|
2227
2379
|
__decorate([
|
|
2228
2380
|
(0, utils_1.InjectManager)(),
|
|
2381
|
+
(0, utils_1.EmitEvents)(),
|
|
2229
2382
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
2230
2383
|
__metadata("design:type", Function),
|
|
2231
2384
|
__metadata("design:paramtypes", [String, Object, Object]),
|
|
@@ -2233,18 +2386,21 @@ __decorate([
|
|
|
2233
2386
|
], OrderModuleService.prototype, "undoLastChange", null);
|
|
2234
2387
|
__decorate([
|
|
2235
2388
|
(0, utils_1.InjectTransactionManager)(),
|
|
2389
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2236
2390
|
__metadata("design:type", Function),
|
|
2237
2391
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2238
2392
|
__metadata("design:returntype", Promise)
|
|
2239
2393
|
], OrderModuleService.prototype, "undoLastChange_", null);
|
|
2240
2394
|
__decorate([
|
|
2241
2395
|
(0, utils_1.InjectTransactionManager)(),
|
|
2396
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2242
2397
|
__metadata("design:type", Function),
|
|
2243
2398
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2244
2399
|
__metadata("design:returntype", Promise)
|
|
2245
2400
|
], OrderModuleService.prototype, "revertLastChange_", null);
|
|
2246
2401
|
__decorate([
|
|
2247
|
-
(0, utils_1.
|
|
2402
|
+
(0, utils_1.InjectManager)(),
|
|
2403
|
+
(0, utils_1.EmitEvents)(),
|
|
2248
2404
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2249
2405
|
__metadata("design:type", Function),
|
|
2250
2406
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2252,19 +2408,36 @@ __decorate([
|
|
|
2252
2408
|
], OrderModuleService.prototype, "addOrderAction", null);
|
|
2253
2409
|
__decorate([
|
|
2254
2410
|
(0, utils_1.InjectTransactionManager)(),
|
|
2411
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2412
|
+
__metadata("design:type", Function),
|
|
2413
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2414
|
+
__metadata("design:returntype", Promise)
|
|
2415
|
+
], OrderModuleService.prototype, "addOrderAction_", null);
|
|
2416
|
+
__decorate([
|
|
2417
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2418
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2255
2419
|
__metadata("design:type", Function),
|
|
2256
2420
|
__metadata("design:paramtypes", [Array, Object]),
|
|
2257
2421
|
__metadata("design:returntype", Promise)
|
|
2258
2422
|
], OrderModuleService.prototype, "applyOrderChanges_", null);
|
|
2259
2423
|
__decorate([
|
|
2260
2424
|
(0, utils_1.InjectManager)(),
|
|
2425
|
+
(0, utils_1.EmitEvents)(),
|
|
2261
2426
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2262
2427
|
__metadata("design:type", Function),
|
|
2263
2428
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2264
2429
|
__metadata("design:returntype", Promise)
|
|
2265
2430
|
], OrderModuleService.prototype, "addOrderTransactions", null);
|
|
2266
2431
|
__decorate([
|
|
2267
|
-
(0, utils_1.
|
|
2432
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2433
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2434
|
+
__metadata("design:type", Function),
|
|
2435
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2436
|
+
__metadata("design:returntype", Promise)
|
|
2437
|
+
], OrderModuleService.prototype, "addOrderTransactions_", null);
|
|
2438
|
+
__decorate([
|
|
2439
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2440
|
+
(0, utils_1.EmitEvents)()
|
|
2268
2441
|
// @ts-ignore
|
|
2269
2442
|
,
|
|
2270
2443
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -2273,7 +2446,8 @@ __decorate([
|
|
|
2273
2446
|
__metadata("design:returntype", Promise)
|
|
2274
2447
|
], OrderModuleService.prototype, "deleteOrderTransactions", null);
|
|
2275
2448
|
__decorate([
|
|
2276
|
-
(0, utils_1.InjectManager)()
|
|
2449
|
+
(0, utils_1.InjectManager)(),
|
|
2450
|
+
(0, utils_1.EmitEvents)()
|
|
2277
2451
|
// @ts-ignore
|
|
2278
2452
|
,
|
|
2279
2453
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2282,7 +2456,15 @@ __decorate([
|
|
|
2282
2456
|
__metadata("design:returntype", Promise)
|
|
2283
2457
|
], OrderModuleService.prototype, "softDeleteOrderTransactions", null);
|
|
2284
2458
|
__decorate([
|
|
2285
|
-
(0, utils_1.
|
|
2459
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2460
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2461
|
+
__metadata("design:type", Function),
|
|
2462
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2463
|
+
__metadata("design:returntype", Promise)
|
|
2464
|
+
], OrderModuleService.prototype, "softDeleteOrderTransactions_", null);
|
|
2465
|
+
__decorate([
|
|
2466
|
+
(0, utils_1.InjectManager)(),
|
|
2467
|
+
(0, utils_1.EmitEvents)()
|
|
2286
2468
|
// @ts-ignore
|
|
2287
2469
|
,
|
|
2288
2470
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2292,12 +2474,21 @@ __decorate([
|
|
|
2292
2474
|
], OrderModuleService.prototype, "restoreOrderTransactions", null);
|
|
2293
2475
|
__decorate([
|
|
2294
2476
|
(0, utils_1.InjectTransactionManager)(),
|
|
2477
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2478
|
+
__metadata("design:type", Function),
|
|
2479
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2480
|
+
__metadata("design:returntype", Promise)
|
|
2481
|
+
], OrderModuleService.prototype, "restoreOrderTransactions_", null);
|
|
2482
|
+
__decorate([
|
|
2483
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2484
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2295
2485
|
__metadata("design:type", Function),
|
|
2296
2486
|
__metadata("design:paramtypes", [Array, Boolean, Object]),
|
|
2297
2487
|
__metadata("design:returntype", Promise)
|
|
2298
2488
|
], OrderModuleService.prototype, "updateOrderPaidRefundableAmount_", null);
|
|
2299
2489
|
__decorate([
|
|
2300
|
-
(0, utils_1.
|
|
2490
|
+
(0, utils_1.InjectManager)(),
|
|
2491
|
+
(0, utils_1.EmitEvents)(),
|
|
2301
2492
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2302
2493
|
__metadata("design:type", Function),
|
|
2303
2494
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2309,6 +2500,14 @@ __decorate([
|
|
|
2309
2500
|
__metadata("design:type", Function),
|
|
2310
2501
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2311
2502
|
__metadata("design:returntype", Promise)
|
|
2503
|
+
], OrderModuleService.prototype, "archive_", null);
|
|
2504
|
+
__decorate([
|
|
2505
|
+
(0, utils_1.InjectManager)(),
|
|
2506
|
+
(0, utils_1.EmitEvents)(),
|
|
2507
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2508
|
+
__metadata("design:type", Function),
|
|
2509
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2510
|
+
__metadata("design:returntype", Promise)
|
|
2312
2511
|
], OrderModuleService.prototype, "completeOrder", null);
|
|
2313
2512
|
__decorate([
|
|
2314
2513
|
(0, utils_1.InjectTransactionManager)(),
|
|
@@ -2316,6 +2515,14 @@ __decorate([
|
|
|
2316
2515
|
__metadata("design:type", Function),
|
|
2317
2516
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2318
2517
|
__metadata("design:returntype", Promise)
|
|
2518
|
+
], OrderModuleService.prototype, "completeOrder_", null);
|
|
2519
|
+
__decorate([
|
|
2520
|
+
(0, utils_1.InjectManager)(),
|
|
2521
|
+
(0, utils_1.EmitEvents)(),
|
|
2522
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2523
|
+
__metadata("design:type", Function),
|
|
2524
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2525
|
+
__metadata("design:returntype", Promise)
|
|
2319
2526
|
], OrderModuleService.prototype, "cancel", null);
|
|
2320
2527
|
__decorate([
|
|
2321
2528
|
(0, utils_1.InjectTransactionManager)(),
|
|
@@ -2323,9 +2530,25 @@ __decorate([
|
|
|
2323
2530
|
__metadata("design:type", Function),
|
|
2324
2531
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2325
2532
|
__metadata("design:returntype", Promise)
|
|
2533
|
+
], OrderModuleService.prototype, "cancel_", null);
|
|
2534
|
+
__decorate([
|
|
2535
|
+
(0, utils_1.InjectManager)(),
|
|
2536
|
+
(0, utils_1.EmitEvents)(),
|
|
2537
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2538
|
+
__metadata("design:type", Function),
|
|
2539
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2540
|
+
__metadata("design:returntype", Promise)
|
|
2326
2541
|
], OrderModuleService.prototype, "createReturn", null);
|
|
2542
|
+
__decorate([
|
|
2543
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2544
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
2545
|
+
__metadata("design:type", Function),
|
|
2546
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
2547
|
+
__metadata("design:returntype", Promise)
|
|
2548
|
+
], OrderModuleService.prototype, "createReturn_", null);
|
|
2327
2549
|
__decorate([
|
|
2328
2550
|
(0, utils_1.InjectManager)(),
|
|
2551
|
+
(0, utils_1.EmitEvents)(),
|
|
2329
2552
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2330
2553
|
__metadata("design:type", Function),
|
|
2331
2554
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2340,6 +2563,7 @@ __decorate([
|
|
|
2340
2563
|
], OrderModuleService.prototype, "receiveReturn_", null);
|
|
2341
2564
|
__decorate([
|
|
2342
2565
|
(0, utils_1.InjectManager)(),
|
|
2566
|
+
(0, utils_1.EmitEvents)(),
|
|
2343
2567
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2344
2568
|
__metadata("design:type", Function),
|
|
2345
2569
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2354,6 +2578,7 @@ __decorate([
|
|
|
2354
2578
|
], OrderModuleService.prototype, "cancelReturn_", null);
|
|
2355
2579
|
__decorate([
|
|
2356
2580
|
(0, utils_1.InjectManager)(),
|
|
2581
|
+
(0, utils_1.EmitEvents)(),
|
|
2357
2582
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2358
2583
|
__metadata("design:type", Function),
|
|
2359
2584
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2368,6 +2593,7 @@ __decorate([
|
|
|
2368
2593
|
], OrderModuleService.prototype, "createClaim_", null);
|
|
2369
2594
|
__decorate([
|
|
2370
2595
|
(0, utils_1.InjectManager)(),
|
|
2596
|
+
(0, utils_1.EmitEvents)(),
|
|
2371
2597
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2372
2598
|
__metadata("design:type", Function),
|
|
2373
2599
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2382,13 +2608,15 @@ __decorate([
|
|
|
2382
2608
|
], OrderModuleService.prototype, "cancelClaim_", null);
|
|
2383
2609
|
__decorate([
|
|
2384
2610
|
(0, utils_1.InjectManager)(),
|
|
2611
|
+
(0, utils_1.EmitEvents)(),
|
|
2385
2612
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2386
2613
|
__metadata("design:type", Function),
|
|
2387
2614
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2388
2615
|
__metadata("design:returntype", Promise)
|
|
2389
2616
|
], OrderModuleService.prototype, "createExchange", null);
|
|
2390
2617
|
__decorate([
|
|
2391
|
-
(0, utils_1.InjectManager)()
|
|
2618
|
+
(0, utils_1.InjectManager)(),
|
|
2619
|
+
(0, utils_1.EmitEvents)()
|
|
2392
2620
|
// @ts-expect-error
|
|
2393
2621
|
,
|
|
2394
2622
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
@@ -2396,6 +2624,13 @@ __decorate([
|
|
|
2396
2624
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2397
2625
|
__metadata("design:returntype", Promise)
|
|
2398
2626
|
], OrderModuleService.prototype, "updateReturnReasons", null);
|
|
2627
|
+
__decorate([
|
|
2628
|
+
(0, utils_1.InjectTransactionManager)(),
|
|
2629
|
+
__param(2, (0, utils_1.MedusaContext)()),
|
|
2630
|
+
__metadata("design:type", Function),
|
|
2631
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
2632
|
+
__metadata("design:returntype", Promise)
|
|
2633
|
+
], OrderModuleService.prototype, "updateReturnReasons_", null);
|
|
2399
2634
|
__decorate([
|
|
2400
2635
|
(0, utils_1.InjectTransactionManager)(),
|
|
2401
2636
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
@@ -2405,6 +2640,7 @@ __decorate([
|
|
|
2405
2640
|
], OrderModuleService.prototype, "createExchange_", null);
|
|
2406
2641
|
__decorate([
|
|
2407
2642
|
(0, utils_1.InjectManager)(),
|
|
2643
|
+
(0, utils_1.EmitEvents)(),
|
|
2408
2644
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2409
2645
|
__metadata("design:type", Function),
|
|
2410
2646
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2419,6 +2655,7 @@ __decorate([
|
|
|
2419
2655
|
], OrderModuleService.prototype, "cancelExchange_", null);
|
|
2420
2656
|
__decorate([
|
|
2421
2657
|
(0, utils_1.InjectTransactionManager)(),
|
|
2658
|
+
(0, utils_1.EmitEvents)(),
|
|
2422
2659
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2423
2660
|
__metadata("design:type", Function),
|
|
2424
2661
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2426,6 +2663,7 @@ __decorate([
|
|
|
2426
2663
|
], OrderModuleService.prototype, "registerFulfillment", null);
|
|
2427
2664
|
__decorate([
|
|
2428
2665
|
(0, utils_1.InjectTransactionManager)(),
|
|
2666
|
+
(0, utils_1.EmitEvents)(),
|
|
2429
2667
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2430
2668
|
__metadata("design:type", Function),
|
|
2431
2669
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2433,6 +2671,7 @@ __decorate([
|
|
|
2433
2671
|
], OrderModuleService.prototype, "cancelFulfillment", null);
|
|
2434
2672
|
__decorate([
|
|
2435
2673
|
(0, utils_1.InjectTransactionManager)(),
|
|
2674
|
+
(0, utils_1.EmitEvents)(),
|
|
2436
2675
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2437
2676
|
__metadata("design:type", Function),
|
|
2438
2677
|
__metadata("design:paramtypes", [Object, Object]),
|
|
@@ -2440,13 +2679,15 @@ __decorate([
|
|
|
2440
2679
|
], OrderModuleService.prototype, "registerShipment", null);
|
|
2441
2680
|
__decorate([
|
|
2442
2681
|
(0, utils_1.InjectTransactionManager)(),
|
|
2682
|
+
(0, utils_1.EmitEvents)(),
|
|
2443
2683
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
2444
2684
|
__metadata("design:type", Function),
|
|
2445
2685
|
__metadata("design:paramtypes", [Object, Object]),
|
|
2446
2686
|
__metadata("design:returntype", Promise)
|
|
2447
2687
|
], OrderModuleService.prototype, "registerDelivery", null);
|
|
2448
2688
|
__decorate([
|
|
2449
|
-
(0, utils_1.InjectManager)()
|
|
2689
|
+
(0, utils_1.InjectManager)(),
|
|
2690
|
+
(0, utils_1.EmitEvents)()
|
|
2450
2691
|
// @ts-expect-error
|
|
2451
2692
|
,
|
|
2452
2693
|
__metadata("design:type", Function),
|