@medusajs/order 0.1.3-snapshot-20240826184008 → 0.1.3-snapshot-20240829144419
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/migrations/Migration20240827133639.d.ts +6 -0
- package/dist/migrations/Migration20240827133639.d.ts.map +1 -0
- package/dist/migrations/Migration20240827133639.js +17 -0
- package/dist/migrations/Migration20240827133639.js.map +1 -0
- package/dist/models/address.d.ts +1 -1
- package/dist/models/address.d.ts.map +1 -1
- package/dist/models/address.js +21 -21
- package/dist/models/address.js.map +1 -1
- package/dist/models/claim-item.d.ts +2 -2
- package/dist/models/claim-item.d.ts.map +1 -1
- package/dist/models/claim-item.js.map +1 -1
- package/dist/models/claim.d.ts +4 -4
- package/dist/models/claim.d.ts.map +1 -1
- package/dist/models/claim.js.map +1 -1
- package/dist/models/exchange-item.d.ts +2 -2
- package/dist/models/exchange-item.d.ts.map +1 -1
- package/dist/models/exchange-item.js.map +1 -1
- package/dist/models/exchange.d.ts +4 -4
- package/dist/models/exchange.d.ts.map +1 -1
- package/dist/models/exchange.js +1 -1
- package/dist/models/exchange.js.map +1 -1
- package/dist/models/index.d.ts +9 -9
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +10 -10
- package/dist/models/index.js.map +1 -1
- package/dist/models/line-item-adjustment.d.ts +3 -3
- package/dist/models/line-item-adjustment.d.ts.map +1 -1
- package/dist/models/line-item-adjustment.js +8 -8
- package/dist/models/line-item-adjustment.js.map +1 -1
- package/dist/models/line-item-tax-line.d.ts +3 -3
- package/dist/models/line-item-tax-line.d.ts.map +1 -1
- package/dist/models/line-item-tax-line.js +8 -8
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +5 -5
- package/dist/models/line-item.d.ts.map +1 -1
- package/dist/models/line-item.js +35 -35
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/order-change-action.d.ts.map +1 -1
- package/dist/models/order-change-action.js +6 -2
- package/dist/models/order-change-action.js.map +1 -1
- package/dist/models/order-item.d.ts +2 -2
- package/dist/models/order-item.d.ts.map +1 -1
- package/dist/models/order-item.js.map +1 -1
- package/dist/models/order-shipping-method.d.ts +3 -3
- package/dist/models/order-shipping-method.d.ts.map +1 -1
- package/dist/models/order-shipping-method.js +21 -21
- package/dist/models/order-shipping-method.js.map +1 -1
- package/dist/models/order.d.ts +7 -7
- package/dist/models/order.d.ts.map +1 -1
- package/dist/models/order.js.map +1 -1
- package/dist/models/return-item.d.ts +4 -2
- package/dist/models/return-item.d.ts.map +1 -1
- package/dist/models/return-item.js +9 -0
- package/dist/models/return-item.js.map +1 -1
- package/dist/models/return.d.ts +4 -4
- package/dist/models/return.d.ts.map +1 -1
- package/dist/models/return.js +1 -1
- package/dist/models/return.js.map +1 -1
- package/dist/models/shipping-method-adjustment.d.ts +3 -3
- package/dist/models/shipping-method-adjustment.d.ts.map +1 -1
- package/dist/models/shipping-method-adjustment.js +8 -8
- package/dist/models/shipping-method-adjustment.js.map +1 -1
- package/dist/models/shipping-method-tax-line.d.ts +3 -3
- package/dist/models/shipping-method-tax-line.d.ts.map +1 -1
- package/dist/models/shipping-method-tax-line.js +8 -8
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/shipping-method.d.ts +5 -5
- package/dist/models/shipping-method.d.ts.map +1 -1
- package/dist/models/shipping-method.js +20 -20
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/transaction.d.ts +1 -1
- package/dist/models/transaction.d.ts.map +1 -1
- package/dist/models/transaction.js +24 -24
- package/dist/models/transaction.js.map +1 -1
- package/dist/services/actions/create-claim.js +5 -5
- package/dist/services/actions/create-claim.js.map +1 -1
- package/dist/services/actions/create-exchange.js +5 -5
- package/dist/services/actions/create-exchange.js.map +1 -1
- package/dist/services/actions/create-return.js +2 -2
- package/dist/services/actions/create-return.js.map +1 -1
- package/dist/services/order-module-service.d.ts +73 -79
- package/dist/services/order-module-service.d.ts.map +1 -1
- package/dist/services/order-module-service.js +121 -184
- package/dist/services/order-module-service.js.map +1 -1
- package/package.json +8 -8
@@ -42,19 +42,19 @@ const utils_2 = require("../utils");
|
|
42
42
|
const BundledActions = __importStar(require("./actions"));
|
43
43
|
const generateMethodForModels = {
|
44
44
|
Order: _models_1.Order,
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
OrderAddress: _models_1.OrderAddress,
|
46
|
+
OrderLineItem: _models_1.OrderLineItem,
|
47
|
+
OrderLineItemAdjustment: _models_1.OrderLineItemAdjustment,
|
48
|
+
OrderLineItemTaxLine: _models_1.OrderLineItemTaxLine,
|
49
|
+
OrderShippingMethod: _models_1.OrderShippingMethod,
|
50
|
+
OrderShippingMethodAdjustment: _models_1.OrderShippingMethodAdjustment,
|
51
|
+
OrderShippingMethodTaxLine: _models_1.OrderShippingMethodTaxLine,
|
52
|
+
OrderTransaction: _models_1.OrderTransaction,
|
53
53
|
OrderChange: _models_1.OrderChange,
|
54
54
|
OrderChangeAction: _models_1.OrderChangeAction,
|
55
55
|
OrderItem: _models_1.OrderItem,
|
56
56
|
OrderSummary: _models_1.OrderSummary,
|
57
|
-
|
57
|
+
OrderShipping: _models_1.OrderShipping,
|
58
58
|
ReturnReason: _models_1.ReturnReason,
|
59
59
|
Return: _models_1.Return,
|
60
60
|
ReturnItem: _models_1.ReturnItem,
|
@@ -66,25 +66,26 @@ const generateMethodForModels = {
|
|
66
66
|
};
|
67
67
|
// TODO: rm template args here, keep it for later to not collide with carlos work at least as little as possible
|
68
68
|
class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateMethodForModels) {
|
69
|
-
constructor({ baseRepository, orderService,
|
69
|
+
constructor({ baseRepository, orderService, orderAddressService, orderLineItemService, orderShippingMethodAdjustmentService, orderShippingMethodService, orderLineItemAdjustmentService, orderShippingMethodTaxLineService, orderLineItemTaxLineService, orderTransactionService, orderChangeService, orderChangeActionService, orderItemService, orderSummaryService, orderShippingService, returnReasonService, returnService, returnItemService, orderClaimService, orderExchangeService, }, moduleDeclaration) {
|
70
70
|
// @ts-ignore
|
71
71
|
super(...arguments);
|
72
72
|
this.moduleDeclaration = moduleDeclaration;
|
73
73
|
this.baseRepository_ = baseRepository;
|
74
74
|
this.orderService_ = orderService;
|
75
|
-
this.
|
76
|
-
this.
|
77
|
-
this.
|
78
|
-
|
79
|
-
this.
|
80
|
-
this.
|
81
|
-
this.
|
82
|
-
this.
|
75
|
+
this.orderAddressService_ = orderAddressService;
|
76
|
+
this.orderLineItemService_ = orderLineItemService;
|
77
|
+
this.orderShippingMethodAdjustmentService_ =
|
78
|
+
orderShippingMethodAdjustmentService;
|
79
|
+
this.orderShippingMethodService_ = orderShippingMethodService;
|
80
|
+
this.orderLineItemAdjustmentService_ = orderLineItemAdjustmentService;
|
81
|
+
this.orderShippingMethodTaxLineService_ = orderShippingMethodTaxLineService;
|
82
|
+
this.orderLineItemTaxLineService_ = orderLineItemTaxLineService;
|
83
|
+
this.orderTransactionService_ = orderTransactionService;
|
83
84
|
this.orderChangeService_ = orderChangeService;
|
84
85
|
this.orderChangeActionService_ = orderChangeActionService;
|
85
86
|
this.orderItemService_ = orderItemService;
|
86
87
|
this.orderSummaryService_ = orderSummaryService;
|
87
|
-
this.
|
88
|
+
this.orderShippingService_ = orderShippingService;
|
88
89
|
this.returnReasonService_ = returnReasonService;
|
89
90
|
this.returnService_ = returnService;
|
90
91
|
this.returnItemService_ = returnItemService;
|
@@ -331,7 +332,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
331
332
|
}
|
332
333
|
}
|
333
334
|
if (lineItemsToCreate.length) {
|
334
|
-
await this.
|
335
|
+
await this.createOrderLineItemsBulk_(lineItemsToCreate, sharedContext);
|
335
336
|
}
|
336
337
|
return createdOrders;
|
337
338
|
}
|
@@ -367,10 +368,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
367
368
|
const result = await this.orderService_.update(toUpdate, sharedContext);
|
368
369
|
return result;
|
369
370
|
}
|
370
|
-
async
|
371
|
+
async createOrderLineItems(orderIdOrData, data, sharedContext = {}) {
|
371
372
|
let items = [];
|
372
373
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
373
|
-
items = await this.
|
374
|
+
items = await this.createOrderLineItems_(orderIdOrData, data, sharedContext);
|
374
375
|
}
|
375
376
|
else {
|
376
377
|
const data = Array.isArray(orderIdOrData)
|
@@ -388,13 +389,13 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
388
389
|
version: mapOrderVersion[dt.order_id],
|
389
390
|
};
|
390
391
|
});
|
391
|
-
items = await this.
|
392
|
+
items = await this.createOrderLineItemsBulk_(lineItems, sharedContext);
|
392
393
|
}
|
393
394
|
return await this.baseRepository_.serialize(items, {
|
394
395
|
populate: true,
|
395
396
|
});
|
396
397
|
}
|
397
|
-
async
|
398
|
+
async createOrderLineItems_(orderId, items, sharedContext = {}) {
|
398
399
|
const order = await this.retrieveOrder(orderId, { select: ["id", "version"] }, sharedContext);
|
399
400
|
const toUpdate = items.map((item) => {
|
400
401
|
return {
|
@@ -403,11 +404,11 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
403
404
|
version: order.version,
|
404
405
|
};
|
405
406
|
});
|
406
|
-
return await this.
|
407
|
+
return await this.createOrderLineItemsBulk_(toUpdate, sharedContext);
|
407
408
|
}
|
408
|
-
async
|
409
|
+
async createOrderLineItemsBulk_(data, sharedContext = {}) {
|
409
410
|
const orderItemToCreate = [];
|
410
|
-
const lineItems = await this.
|
411
|
+
const lineItems = await this.orderLineItemService_.create(data, sharedContext);
|
411
412
|
for (let i = 0; i < lineItems.length; i++) {
|
412
413
|
const item = lineItems[i];
|
413
414
|
const toCreate = data[i];
|
@@ -425,10 +426,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
425
426
|
}
|
426
427
|
return lineItems;
|
427
428
|
}
|
428
|
-
async
|
429
|
+
async updateOrderLineItems(lineItemIdOrDataOrSelector, data, sharedContext = {}) {
|
429
430
|
let items = [];
|
430
431
|
if ((0, utils_1.isString)(lineItemIdOrDataOrSelector)) {
|
431
|
-
const item = await this.
|
432
|
+
const item = await this.updateOrderLineItem_(lineItemIdOrDataOrSelector, data, sharedContext);
|
432
433
|
return await this.baseRepository_.serialize(item, {
|
433
434
|
populate: true,
|
434
435
|
});
|
@@ -441,13 +442,13 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
441
442
|
data: data,
|
442
443
|
},
|
443
444
|
];
|
444
|
-
items = await this.
|
445
|
+
items = await this.updateOrderLineItemsWithSelector_(toUpdate, sharedContext);
|
445
446
|
return await this.baseRepository_.serialize(items, {
|
446
447
|
populate: true,
|
447
448
|
});
|
448
449
|
}
|
449
|
-
async
|
450
|
-
const [item] = await this.
|
450
|
+
async updateOrderLineItem_(lineItemId, data, sharedContext = {}) {
|
451
|
+
const [item] = await this.orderLineItemService_.update([{ id: lineItemId, ...data }], sharedContext);
|
451
452
|
if ("quantity" in data) {
|
452
453
|
await this.updateOrderItemWithSelector_([
|
453
454
|
{
|
@@ -458,11 +459,11 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
458
459
|
}
|
459
460
|
return item;
|
460
461
|
}
|
461
|
-
async
|
462
|
+
async updateOrderLineItemsWithSelector_(updates, sharedContext = {}) {
|
462
463
|
let toUpdate = [];
|
463
464
|
const detailsToUpdate = [];
|
464
465
|
for (const { selector, data } of updates) {
|
465
|
-
const items = await this.
|
466
|
+
const items = await this.listOrderLineItems({ ...selector }, {}, sharedContext);
|
466
467
|
items.forEach((item) => {
|
467
468
|
toUpdate.push({
|
468
469
|
...data,
|
@@ -479,7 +480,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
479
480
|
if (detailsToUpdate.length) {
|
480
481
|
await this.updateOrderItemWithSelector_(detailsToUpdate, sharedContext);
|
481
482
|
}
|
482
|
-
return await this.
|
483
|
+
return await this.orderLineItemService_.update(toUpdate, sharedContext);
|
483
484
|
}
|
484
485
|
async updateOrderItem(orderItemIdOrDataOrSelector, data, sharedContext = {}) {
|
485
486
|
let items = [];
|
@@ -519,28 +520,10 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
519
520
|
}
|
520
521
|
return await this.orderItemService_.update(toUpdate, sharedContext);
|
521
522
|
}
|
522
|
-
async
|
523
|
-
const input = Array.isArray(data) ? data : [data];
|
524
|
-
const addresses = await this.createAddresses_(input, sharedContext);
|
525
|
-
const result = await this.listAddresses({ id: addresses.map((p) => p.id) }, {}, sharedContext);
|
526
|
-
return (Array.isArray(data) ? result : result[0]);
|
527
|
-
}
|
528
|
-
async createAddresses_(data, sharedContext = {}) {
|
529
|
-
return await this.addressService_.create(data, sharedContext);
|
530
|
-
}
|
531
|
-
async updateAddresses(data, sharedContext = {}) {
|
532
|
-
const input = Array.isArray(data) ? data : [data];
|
533
|
-
const addresses = await this.updateAddresses_(input, sharedContext);
|
534
|
-
const result = await this.listAddresses({ id: addresses.map((p) => p.id) }, {}, sharedContext);
|
535
|
-
return (Array.isArray(data) ? result : result[0]);
|
536
|
-
}
|
537
|
-
async updateAddresses_(data, sharedContext = {}) {
|
538
|
-
return await this.addressService_.update(data, sharedContext);
|
539
|
-
}
|
540
|
-
async createShippingMethods(orderIdOrData, data, sharedContext = {}) {
|
523
|
+
async createOrderShippingMethods(orderIdOrData, data, sharedContext = {}) {
|
541
524
|
let methods;
|
542
525
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
543
|
-
methods = await this.
|
526
|
+
methods = await this.createOrderShippingMethods_(orderIdOrData, data, sharedContext);
|
544
527
|
}
|
545
528
|
else {
|
546
529
|
const data = Array.isArray(orderIdOrData)
|
@@ -562,11 +545,11 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
562
545
|
version: dt.version ?? mapOrderVersion[dt.order_id],
|
563
546
|
};
|
564
547
|
});
|
565
|
-
methods = await this.
|
548
|
+
methods = await this.createOrderShippingMethodsBulk_(orderShippingMethodData, sharedContext);
|
566
549
|
}
|
567
550
|
return await this.baseRepository_.serialize(methods, { populate: true });
|
568
551
|
}
|
569
|
-
async
|
552
|
+
async createOrderShippingMethods_(orderId, data, sharedContext = {}) {
|
570
553
|
const order = await this.retrieveOrder(orderId, { select: ["id", "version"] }, sharedContext);
|
571
554
|
const methods = data.map((methodData) => {
|
572
555
|
return {
|
@@ -578,41 +561,41 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
578
561
|
version: methodData.version ?? order.version ?? 1,
|
579
562
|
};
|
580
563
|
});
|
581
|
-
return await this.
|
564
|
+
return await this.createOrderShippingMethodsBulk_(methods, sharedContext);
|
582
565
|
}
|
583
|
-
async
|
584
|
-
const sm = await this.
|
566
|
+
async createOrderShippingMethodsBulk_(data, sharedContext = {}) {
|
567
|
+
const sm = await this.orderShippingService_.create(data, sharedContext);
|
585
568
|
return sm.map((s) => s.shipping_method);
|
586
569
|
}
|
587
570
|
// @ts-ignore
|
588
|
-
async
|
589
|
-
const rel = await super.
|
571
|
+
async softDeleteOrderShippingMethods(ids, config, sharedContext) {
|
572
|
+
const rel = await super.listOrderShippings({
|
590
573
|
shipping_method_id: ids,
|
591
574
|
}, {
|
592
575
|
select: ["id"],
|
593
576
|
}, sharedContext);
|
594
|
-
const
|
577
|
+
const orderShippingIds = rel.map((r) => r.id);
|
595
578
|
const [returned] = await (0, utils_1.promiseAll)([
|
596
|
-
super.
|
597
|
-
super.
|
579
|
+
super.softDeleteOrderShippingMethods(ids, config, sharedContext),
|
580
|
+
super.softDeleteOrderShippings(orderShippingIds, config, sharedContext),
|
598
581
|
]);
|
599
582
|
return returned;
|
600
583
|
}
|
601
584
|
// @ts-ignore
|
602
|
-
async
|
603
|
-
const rel = await super.
|
604
|
-
shipping_method_id:
|
585
|
+
async restoreOrderShippingMethods(ids, config, sharedContext) {
|
586
|
+
const rel = await super.listOrderShippings({
|
587
|
+
shipping_method_id: ids,
|
605
588
|
}, {
|
606
589
|
select: ["id"],
|
607
590
|
}, sharedContext);
|
608
|
-
const
|
591
|
+
const shippingIds = rel.map((r) => r.id);
|
609
592
|
const [returned] = await (0, utils_1.promiseAll)([
|
610
|
-
super.
|
611
|
-
super.
|
593
|
+
super.restoreOrderShippingMethods(ids, config, sharedContext),
|
594
|
+
super.restoreOrderShippings(shippingIds, config, sharedContext),
|
612
595
|
]);
|
613
596
|
return returned;
|
614
597
|
}
|
615
|
-
async
|
598
|
+
async createOrderLineItemAdjustments(orderIdOrData, adjustments, sharedContext = {}) {
|
616
599
|
let addedAdjustments = [];
|
617
600
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
618
601
|
const order = await this.retrieveOrder(orderIdOrData, { select: ["id"], relations: ["items.item"] }, sharedContext);
|
@@ -622,19 +605,19 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
622
605
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Line item with id ${adj.item_id} does not exist on order with id ${orderIdOrData}`);
|
623
606
|
}
|
624
607
|
}
|
625
|
-
addedAdjustments = await this.
|
608
|
+
addedAdjustments = await this.orderLineItemAdjustmentService_.create(adjustments, sharedContext);
|
626
609
|
}
|
627
610
|
else {
|
628
611
|
const data = Array.isArray(orderIdOrData)
|
629
612
|
? orderIdOrData
|
630
613
|
: [orderIdOrData];
|
631
|
-
addedAdjustments = await this.
|
614
|
+
addedAdjustments = await this.orderLineItemAdjustmentService_.create(data, sharedContext);
|
632
615
|
}
|
633
616
|
return await this.baseRepository_.serialize(addedAdjustments, {
|
634
617
|
populate: true,
|
635
618
|
});
|
636
619
|
}
|
637
|
-
async
|
620
|
+
async setOrderLineItemAdjustments(orderId, adjustments, sharedContext = {}) {
|
638
621
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["items.item.adjustments"] }, sharedContext);
|
639
622
|
const existingAdjustments = (order.items ?? [])
|
640
623
|
.map((item) => item.adjustments ?? [])
|
@@ -651,14 +634,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
651
634
|
}
|
652
635
|
});
|
653
636
|
if (toDelete.length) {
|
654
|
-
await this.
|
637
|
+
await this.orderLineItemAdjustmentService_.delete(toDelete, sharedContext);
|
655
638
|
}
|
656
|
-
let result = await this.
|
639
|
+
let result = await this.orderLineItemAdjustmentService_.upsert(adjustments, sharedContext);
|
657
640
|
return await this.baseRepository_.serialize(result, {
|
658
641
|
populate: true,
|
659
642
|
});
|
660
643
|
}
|
661
|
-
async
|
644
|
+
async setOrderShippingMethodAdjustments(orderId, adjustments, sharedContext = {}) {
|
662
645
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["shipping_methods.adjustments"] }, sharedContext);
|
663
646
|
const existingAdjustments = (order.shipping_methods ?? [])
|
664
647
|
.map((shippingMethod) => shippingMethod.adjustments ?? [])
|
@@ -675,14 +658,14 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
675
658
|
}
|
676
659
|
});
|
677
660
|
if (toDelete.length) {
|
678
|
-
await this.
|
661
|
+
await this.orderShippingMethodAdjustmentService_.delete(toDelete, sharedContext);
|
679
662
|
}
|
680
|
-
const result = await this.
|
663
|
+
const result = await this.orderShippingMethodAdjustmentService_.upsert(adjustments, sharedContext);
|
681
664
|
return await this.baseRepository_.serialize(result, {
|
682
665
|
populate: true,
|
683
666
|
});
|
684
667
|
}
|
685
|
-
async
|
668
|
+
async createOrderShippingMethodAdjustments(orderIdOrData, adjustments, sharedContext = {}) {
|
686
669
|
let addedAdjustments = [];
|
687
670
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
688
671
|
const order = await this.retrieveOrder(orderIdOrData, { select: ["id"], relations: ["shipping_methods"] }, sharedContext);
|
@@ -692,13 +675,15 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
692
675
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Shipping method with id ${adj.shipping_method_id} does not exist on order with id ${orderIdOrData}`);
|
693
676
|
}
|
694
677
|
}
|
695
|
-
addedAdjustments =
|
678
|
+
addedAdjustments =
|
679
|
+
await this.orderShippingMethodAdjustmentService_.create(adjustments, sharedContext);
|
696
680
|
}
|
697
681
|
else {
|
698
682
|
const data = Array.isArray(orderIdOrData)
|
699
683
|
? orderIdOrData
|
700
684
|
: [orderIdOrData];
|
701
|
-
addedAdjustments =
|
685
|
+
addedAdjustments =
|
686
|
+
await this.orderShippingMethodAdjustmentService_.create(data, sharedContext);
|
702
687
|
}
|
703
688
|
if ((0, utils_1.isObject)(orderIdOrData)) {
|
704
689
|
return await this.baseRepository_.serialize(addedAdjustments[0], {
|
@@ -709,17 +694,17 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
709
694
|
populate: true,
|
710
695
|
});
|
711
696
|
}
|
712
|
-
async
|
697
|
+
async createOrderLineItemTaxLines(orderIdOrData, taxLines, sharedContext = {}) {
|
713
698
|
let addedTaxLines;
|
714
699
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
715
700
|
const lines = Array.isArray(taxLines) ? taxLines : [taxLines];
|
716
|
-
addedTaxLines = await this.
|
701
|
+
addedTaxLines = await this.orderLineItemTaxLineService_.create(lines, sharedContext);
|
717
702
|
}
|
718
703
|
else {
|
719
704
|
const data = Array.isArray(orderIdOrData)
|
720
705
|
? orderIdOrData
|
721
706
|
: [orderIdOrData];
|
722
|
-
addedTaxLines = await this.
|
707
|
+
addedTaxLines = await this.orderLineItemTaxLineService_.create(data, sharedContext);
|
723
708
|
}
|
724
709
|
const serialized = await this.baseRepository_.serialize(addedTaxLines, {
|
725
710
|
populate: true,
|
@@ -729,7 +714,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
729
714
|
}
|
730
715
|
return serialized;
|
731
716
|
}
|
732
|
-
async
|
717
|
+
async setOrderLineItemTaxLines(orderId, taxLines, sharedContext = {}) {
|
733
718
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["items.item.tax_lines"] }, sharedContext);
|
734
719
|
const existingTaxLines = (order.items ?? [])
|
735
720
|
.map((item) => item.tax_lines ?? [])
|
@@ -745,21 +730,21 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
745
730
|
}
|
746
731
|
});
|
747
732
|
if (toDelete.length) {
|
748
|
-
await this.
|
733
|
+
await this.orderLineItemTaxLineService_.delete(toDelete, sharedContext);
|
749
734
|
}
|
750
|
-
const result = await this.
|
735
|
+
const result = await this.orderLineItemTaxLineService_.upsert(taxLines, sharedContext);
|
751
736
|
return await this.baseRepository_.serialize(result, {
|
752
737
|
populate: true,
|
753
738
|
});
|
754
739
|
}
|
755
|
-
async
|
740
|
+
async createOrderShippingMethodTaxLines(orderIdOrData, taxLines, sharedContext = {}) {
|
756
741
|
let addedTaxLines;
|
757
742
|
if ((0, utils_1.isString)(orderIdOrData)) {
|
758
743
|
const lines = Array.isArray(taxLines) ? taxLines : [taxLines];
|
759
|
-
addedTaxLines = await this.
|
744
|
+
addedTaxLines = await this.orderShippingMethodTaxLineService_.create(lines, sharedContext);
|
760
745
|
}
|
761
746
|
else {
|
762
|
-
addedTaxLines = await this.
|
747
|
+
addedTaxLines = await this.orderShippingMethodTaxLineService_.create(taxLines, sharedContext);
|
763
748
|
}
|
764
749
|
const serialized = await this.baseRepository_.serialize(addedTaxLines[0], {
|
765
750
|
populate: true,
|
@@ -769,7 +754,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
769
754
|
}
|
770
755
|
return serialized;
|
771
756
|
}
|
772
|
-
async
|
757
|
+
async setOrderShippingMethodTaxLines(orderId, taxLines, sharedContext = {}) {
|
773
758
|
const order = await this.retrieveOrder(orderId, { select: ["id"], relations: ["shipping_methods.tax_lines"] }, sharedContext);
|
774
759
|
const existingTaxLines = (order.shipping_methods ?? [])
|
775
760
|
.map((shippingMethod) => shippingMethod.tax_lines ?? [])
|
@@ -785,9 +770,9 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
785
770
|
}
|
786
771
|
});
|
787
772
|
if (toDelete.length) {
|
788
|
-
await this.
|
773
|
+
await this.orderShippingMethodTaxLineService_.delete(toDelete, sharedContext);
|
789
774
|
}
|
790
|
-
const result = await this.
|
775
|
+
const result = await this.orderShippingMethodTaxLineService_.upsert(taxLines, sharedContext);
|
791
776
|
return await this.baseRepository_.serialize(result, {
|
792
777
|
populate: true,
|
793
778
|
});
|
@@ -874,16 +859,6 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
874
859
|
return order;
|
875
860
|
}
|
876
861
|
const orderChange = await super.retrieveOrderChange(order.order_change.id, { relations: ["actions"] }, sharedContext);
|
877
|
-
orderChange.actions = orderChange.actions.map((action) => {
|
878
|
-
return {
|
879
|
-
...action,
|
880
|
-
version: orderChange.version,
|
881
|
-
order_id: orderChange.order_id,
|
882
|
-
return_id: orderChange.return_id,
|
883
|
-
claim_id: orderChange.claim_id,
|
884
|
-
exchange_id: orderChange.exchange_id,
|
885
|
-
};
|
886
|
-
});
|
887
862
|
const { itemsToUpsert, shippingMethodsToUpsert, calculatedOrders } = (0, utils_2.applyChangesToOrder)([order], { [order.id]: orderChange.actions }, { addActionReferenceToObject: true });
|
888
863
|
const calculated = calculatedOrders[order.id];
|
889
864
|
const addedItems = {};
|
@@ -900,7 +875,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
900
875
|
}
|
901
876
|
}
|
902
877
|
if (Object.keys(addedItems).length > 0) {
|
903
|
-
const addedItemDetails = await this.
|
878
|
+
const addedItemDetails = await this.listOrderLineItems({ id: Object.keys(addedItems) }, {
|
904
879
|
relations: ["adjustments", "tax_lines"],
|
905
880
|
}, sharedContext);
|
906
881
|
calculated.order.items.forEach((item, idx) => {
|
@@ -923,7 +898,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
923
898
|
});
|
924
899
|
}
|
925
900
|
if (Object.keys(addedShippingMethods).length > 0) {
|
926
|
-
const addedShippingDetails = await this.
|
901
|
+
const addedShippingDetails = await this.listOrderShippingMethods({ id: Object.keys(addedShippingMethods) }, {
|
927
902
|
relations: ["adjustments", "tax_lines"],
|
928
903
|
}, sharedContext);
|
929
904
|
calculated.order.shipping_methods.forEach((sm, idx) => {
|
@@ -986,16 +961,6 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
986
961
|
});
|
987
962
|
await this.orderChangeService_.update(updates, sharedContext);
|
988
963
|
const orderChanges = orderChange.map((change) => {
|
989
|
-
change.actions = change.actions.map((action) => {
|
990
|
-
return {
|
991
|
-
...action,
|
992
|
-
version: change.version,
|
993
|
-
order_id: change.order_id,
|
994
|
-
return_id: change.return_id,
|
995
|
-
claim_id: change.claim_id,
|
996
|
-
exchange_id: change.exchange_id,
|
997
|
-
};
|
998
|
-
});
|
999
964
|
return change.actions;
|
1000
965
|
});
|
1001
966
|
return await this.applyOrderChanges_(orderChanges.flat(), sharedContext);
|
@@ -1089,13 +1054,13 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
1089
1054
|
}, { select: ["id", "version"] }, sharedContext);
|
1090
1055
|
const orderItemIds = orderItems.map((summary) => summary.id);
|
1091
1056
|
await this.orderItemService_.softDelete(orderItemIds, sharedContext);
|
1092
|
-
// Shipping
|
1093
|
-
const
|
1057
|
+
// Order Shipping
|
1058
|
+
const orderShippings = await this.orderShippingService_.list({
|
1094
1059
|
order_id: order.id,
|
1095
1060
|
version: currentVersion,
|
1096
1061
|
}, { select: ["id", "version"] }, sharedContext);
|
1097
|
-
const
|
1098
|
-
await this.
|
1062
|
+
const orderShippingIds = orderShippings.map((sh) => sh.id);
|
1063
|
+
await this.orderShippingService_.softDelete(orderShippingIds, sharedContext);
|
1099
1064
|
// Order
|
1100
1065
|
await this.orderService_.update({
|
1101
1066
|
selector: {
|
@@ -1273,7 +1238,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
1273
1238
|
? this.orderSummaryService_.upsert(summariesToUpsert, sharedContext)
|
1274
1239
|
: null,
|
1275
1240
|
shippingMethodsToUpsert.length
|
1276
|
-
? this.
|
1241
|
+
? this.orderShippingService_.upsert(shippingMethodsToUpsert, sharedContext)
|
1277
1242
|
: null,
|
1278
1243
|
]);
|
1279
1244
|
return {
|
@@ -1281,7 +1246,7 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
1281
1246
|
shippingMethods: shippingMethodsToUpsert,
|
1282
1247
|
};
|
1283
1248
|
}
|
1284
|
-
async
|
1249
|
+
async addOrderTransactions(transactionData, sharedContext) {
|
1285
1250
|
const orders = await this.orderService_.list({
|
1286
1251
|
id: Array.isArray(transactionData)
|
1287
1252
|
? transactionData.map((t) => t.order_id)
|
@@ -1299,45 +1264,45 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
|
|
1299
1264
|
trx.version = order.version;
|
1300
1265
|
}
|
1301
1266
|
}
|
1302
|
-
const created = await this.
|
1267
|
+
const created = await this.orderTransactionService_.create(data, sharedContext);
|
1303
1268
|
await this.updateOrderPaidRefundableAmount_(created, false, sharedContext);
|
1304
1269
|
return await this.baseRepository_.serialize(!Array.isArray(transactionData) ? created[0] : created, {
|
1305
1270
|
populate: true,
|
1306
1271
|
});
|
1307
1272
|
}
|
1308
1273
|
// @ts-ignore
|
1309
|
-
async
|
1274
|
+
async deleteOrderTransactions(transactionIds, sharedContext) {
|
1310
1275
|
const data = Array.isArray(transactionIds)
|
1311
1276
|
? transactionIds
|
1312
1277
|
: [transactionIds];
|
1313
|
-
const transactions = await super.
|
1278
|
+
const transactions = await super.listOrderTransactions({
|
1314
1279
|
id: data,
|
1315
1280
|
}, {
|
1316
1281
|
select: ["order_id", "version", "amount"],
|
1317
1282
|
}, sharedContext);
|
1318
|
-
await this.
|
1283
|
+
await this.orderTransactionService_.delete(data, sharedContext);
|
1319
1284
|
await this.updateOrderPaidRefundableAmount_(transactions, true, sharedContext);
|
1320
1285
|
}
|
1321
1286
|
// @ts-ignore
|
1322
|
-
async
|
1323
|
-
const transactions = await super.
|
1287
|
+
async softDeleteOrderTransactions(transactionIds, config, sharedContext) {
|
1288
|
+
const transactions = await super.listOrderTransactions({
|
1324
1289
|
id: transactionIds,
|
1325
1290
|
}, {
|
1326
1291
|
select: ["order_id", "amount"],
|
1327
1292
|
}, sharedContext);
|
1328
|
-
const returned = await super.
|
1293
|
+
const returned = await super.softDeleteOrderTransactions(transactionIds, config, sharedContext);
|
1329
1294
|
await this.updateOrderPaidRefundableAmount_(transactions, true, sharedContext);
|
1330
1295
|
return returned;
|
1331
1296
|
}
|
1332
1297
|
// @ts-ignore
|
1333
|
-
async
|
1334
|
-
const transactions = await super.
|
1298
|
+
async restoreOrderTransactions(transactionIds, config, sharedContext) {
|
1299
|
+
const transactions = await super.listOrderTransactions({
|
1335
1300
|
id: transactionIds,
|
1336
1301
|
}, {
|
1337
1302
|
select: ["order_id", "amount"],
|
1338
1303
|
withDeleted: true,
|
1339
1304
|
}, sharedContext);
|
1340
|
-
const returned = await super.
|
1305
|
+
const returned = await super.restoreOrderTransactions(transactionIds, config, sharedContext);
|
1341
1306
|
await this.updateOrderPaidRefundableAmount_(transactions, false, sharedContext);
|
1342
1307
|
return returned;
|
1343
1308
|
}
|
@@ -1672,42 +1637,42 @@ __decorate([
|
|
1672
1637
|
__metadata("design:type", Function),
|
1673
1638
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1674
1639
|
__metadata("design:returntype", Promise)
|
1675
|
-
], OrderModuleService.prototype, "
|
1640
|
+
], OrderModuleService.prototype, "createOrderLineItems", null);
|
1676
1641
|
__decorate([
|
1677
1642
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1678
1643
|
__param(2, (0, utils_1.MedusaContext)()),
|
1679
1644
|
__metadata("design:type", Function),
|
1680
1645
|
__metadata("design:paramtypes", [String, Array, Object]),
|
1681
1646
|
__metadata("design:returntype", Promise)
|
1682
|
-
], OrderModuleService.prototype, "
|
1647
|
+
], OrderModuleService.prototype, "createOrderLineItems_", null);
|
1683
1648
|
__decorate([
|
1684
1649
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1685
1650
|
__param(1, (0, utils_1.MedusaContext)()),
|
1686
1651
|
__metadata("design:type", Function),
|
1687
1652
|
__metadata("design:paramtypes", [Array, Object]),
|
1688
1653
|
__metadata("design:returntype", Promise)
|
1689
|
-
], OrderModuleService.prototype, "
|
1654
|
+
], OrderModuleService.prototype, "createOrderLineItemsBulk_", null);
|
1690
1655
|
__decorate([
|
1691
1656
|
(0, utils_1.InjectManager)("baseRepository_"),
|
1692
1657
|
__param(2, (0, utils_1.MedusaContext)()),
|
1693
1658
|
__metadata("design:type", Function),
|
1694
1659
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1695
1660
|
__metadata("design:returntype", Promise)
|
1696
|
-
], OrderModuleService.prototype, "
|
1661
|
+
], OrderModuleService.prototype, "updateOrderLineItems", null);
|
1697
1662
|
__decorate([
|
1698
1663
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1699
1664
|
__param(2, (0, utils_1.MedusaContext)()),
|
1700
1665
|
__metadata("design:type", Function),
|
1701
1666
|
__metadata("design:paramtypes", [String, Object, Object]),
|
1702
1667
|
__metadata("design:returntype", Promise)
|
1703
|
-
], OrderModuleService.prototype, "
|
1668
|
+
], OrderModuleService.prototype, "updateOrderLineItem_", null);
|
1704
1669
|
__decorate([
|
1705
1670
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1706
1671
|
__param(1, (0, utils_1.MedusaContext)()),
|
1707
1672
|
__metadata("design:type", Function),
|
1708
1673
|
__metadata("design:paramtypes", [Array, Object]),
|
1709
1674
|
__metadata("design:returntype", Promise)
|
1710
|
-
], OrderModuleService.prototype, "
|
1675
|
+
], OrderModuleService.prototype, "updateOrderLineItemsWithSelector_", null);
|
1711
1676
|
__decorate([
|
1712
1677
|
(0, utils_1.InjectManager)("baseRepository_"),
|
1713
1678
|
__param(2, (0, utils_1.MedusaContext)()),
|
@@ -1729,55 +1694,27 @@ __decorate([
|
|
1729
1694
|
__metadata("design:paramtypes", [Array, Object]),
|
1730
1695
|
__metadata("design:returntype", Promise)
|
1731
1696
|
], OrderModuleService.prototype, "updateOrderItemWithSelector_", null);
|
1732
|
-
__decorate([
|
1733
|
-
(0, utils_1.InjectManager)("baseRepository_"),
|
1734
|
-
__param(1, (0, utils_1.MedusaContext)()),
|
1735
|
-
__metadata("design:type", Function),
|
1736
|
-
__metadata("design:paramtypes", [Object, Object]),
|
1737
|
-
__metadata("design:returntype", Promise)
|
1738
|
-
], OrderModuleService.prototype, "createAddresses", null);
|
1739
|
-
__decorate([
|
1740
|
-
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1741
|
-
__param(1, (0, utils_1.MedusaContext)()),
|
1742
|
-
__metadata("design:type", Function),
|
1743
|
-
__metadata("design:paramtypes", [Array, Object]),
|
1744
|
-
__metadata("design:returntype", Promise)
|
1745
|
-
], OrderModuleService.prototype, "createAddresses_", null);
|
1746
|
-
__decorate([
|
1747
|
-
(0, utils_1.InjectManager)("baseRepository_"),
|
1748
|
-
__param(1, (0, utils_1.MedusaContext)()),
|
1749
|
-
__metadata("design:type", Function),
|
1750
|
-
__metadata("design:paramtypes", [Object, Object]),
|
1751
|
-
__metadata("design:returntype", Promise)
|
1752
|
-
], OrderModuleService.prototype, "updateAddresses", null);
|
1753
|
-
__decorate([
|
1754
|
-
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1755
|
-
__param(1, (0, utils_1.MedusaContext)()),
|
1756
|
-
__metadata("design:type", Function),
|
1757
|
-
__metadata("design:paramtypes", [Array, Object]),
|
1758
|
-
__metadata("design:returntype", Promise)
|
1759
|
-
], OrderModuleService.prototype, "updateAddresses_", null);
|
1760
1697
|
__decorate([
|
1761
1698
|
(0, utils_1.InjectManager)("baseRepository_"),
|
1762
1699
|
__param(2, (0, utils_1.MedusaContext)()),
|
1763
1700
|
__metadata("design:type", Function),
|
1764
1701
|
__metadata("design:paramtypes", [Object, Array, Object]),
|
1765
1702
|
__metadata("design:returntype", Promise)
|
1766
|
-
], OrderModuleService.prototype, "
|
1703
|
+
], OrderModuleService.prototype, "createOrderShippingMethods", null);
|
1767
1704
|
__decorate([
|
1768
1705
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1769
1706
|
__param(2, (0, utils_1.MedusaContext)()),
|
1770
1707
|
__metadata("design:type", Function),
|
1771
1708
|
__metadata("design:paramtypes", [String, Array, Object]),
|
1772
1709
|
__metadata("design:returntype", Promise)
|
1773
|
-
], OrderModuleService.prototype, "
|
1710
|
+
], OrderModuleService.prototype, "createOrderShippingMethods_", null);
|
1774
1711
|
__decorate([
|
1775
1712
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1776
1713
|
__param(1, (0, utils_1.MedusaContext)()),
|
1777
1714
|
__metadata("design:type", Function),
|
1778
1715
|
__metadata("design:paramtypes", [Array, Object]),
|
1779
1716
|
__metadata("design:returntype", Promise)
|
1780
|
-
], OrderModuleService.prototype, "
|
1717
|
+
], OrderModuleService.prototype, "createOrderShippingMethodsBulk_", null);
|
1781
1718
|
__decorate([
|
1782
1719
|
(0, utils_1.InjectManager)("baseRepository_")
|
1783
1720
|
// @ts-ignore
|
@@ -1786,7 +1723,7 @@ __decorate([
|
|
1786
1723
|
__metadata("design:type", Function),
|
1787
1724
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1788
1725
|
__metadata("design:returntype", Promise)
|
1789
|
-
], OrderModuleService.prototype, "
|
1726
|
+
], OrderModuleService.prototype, "softDeleteOrderShippingMethods", null);
|
1790
1727
|
__decorate([
|
1791
1728
|
(0, utils_1.InjectManager)("baseRepository_")
|
1792
1729
|
// @ts-ignore
|
@@ -1795,63 +1732,63 @@ __decorate([
|
|
1795
1732
|
__metadata("design:type", Function),
|
1796
1733
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1797
1734
|
__metadata("design:returntype", Promise)
|
1798
|
-
], OrderModuleService.prototype, "
|
1735
|
+
], OrderModuleService.prototype, "restoreOrderShippingMethods", null);
|
1799
1736
|
__decorate([
|
1800
1737
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1801
1738
|
__param(2, (0, utils_1.MedusaContext)()),
|
1802
1739
|
__metadata("design:type", Function),
|
1803
1740
|
__metadata("design:paramtypes", [Object, Array, Object]),
|
1804
1741
|
__metadata("design:returntype", Promise)
|
1805
|
-
], OrderModuleService.prototype, "
|
1742
|
+
], OrderModuleService.prototype, "createOrderLineItemAdjustments", null);
|
1806
1743
|
__decorate([
|
1807
1744
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1808
1745
|
__param(2, (0, utils_1.MedusaContext)()),
|
1809
1746
|
__metadata("design:type", Function),
|
1810
1747
|
__metadata("design:paramtypes", [String, Array, Object]),
|
1811
1748
|
__metadata("design:returntype", Promise)
|
1812
|
-
], OrderModuleService.prototype, "
|
1749
|
+
], OrderModuleService.prototype, "setOrderLineItemAdjustments", null);
|
1813
1750
|
__decorate([
|
1814
1751
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1815
1752
|
__param(2, (0, utils_1.MedusaContext)()),
|
1816
1753
|
__metadata("design:type", Function),
|
1817
1754
|
__metadata("design:paramtypes", [String, Array, Object]),
|
1818
1755
|
__metadata("design:returntype", Promise)
|
1819
|
-
], OrderModuleService.prototype, "
|
1756
|
+
], OrderModuleService.prototype, "setOrderShippingMethodAdjustments", null);
|
1820
1757
|
__decorate([
|
1821
1758
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1822
1759
|
__param(2, (0, utils_1.MedusaContext)()),
|
1823
1760
|
__metadata("design:type", Function),
|
1824
1761
|
__metadata("design:paramtypes", [Object, Array, Object]),
|
1825
1762
|
__metadata("design:returntype", Promise)
|
1826
|
-
], OrderModuleService.prototype, "
|
1763
|
+
], OrderModuleService.prototype, "createOrderShippingMethodAdjustments", null);
|
1827
1764
|
__decorate([
|
1828
1765
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1829
1766
|
__param(2, (0, utils_1.MedusaContext)()),
|
1830
1767
|
__metadata("design:type", Function),
|
1831
1768
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1832
1769
|
__metadata("design:returntype", Promise)
|
1833
|
-
], OrderModuleService.prototype, "
|
1770
|
+
], OrderModuleService.prototype, "createOrderLineItemTaxLines", null);
|
1834
1771
|
__decorate([
|
1835
1772
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1836
1773
|
__param(2, (0, utils_1.MedusaContext)()),
|
1837
1774
|
__metadata("design:type", Function),
|
1838
1775
|
__metadata("design:paramtypes", [String, Array, Object]),
|
1839
1776
|
__metadata("design:returntype", Promise)
|
1840
|
-
], OrderModuleService.prototype, "
|
1777
|
+
], OrderModuleService.prototype, "setOrderLineItemTaxLines", null);
|
1841
1778
|
__decorate([
|
1842
1779
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1843
1780
|
__param(2, (0, utils_1.MedusaContext)()),
|
1844
1781
|
__metadata("design:type", Function),
|
1845
1782
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1846
1783
|
__metadata("design:returntype", Promise)
|
1847
|
-
], OrderModuleService.prototype, "
|
1784
|
+
], OrderModuleService.prototype, "createOrderShippingMethodTaxLines", null);
|
1848
1785
|
__decorate([
|
1849
1786
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1850
1787
|
__param(2, (0, utils_1.MedusaContext)()),
|
1851
1788
|
__metadata("design:type", Function),
|
1852
1789
|
__metadata("design:paramtypes", [String, Array, Object]),
|
1853
1790
|
__metadata("design:returntype", Promise)
|
1854
|
-
], OrderModuleService.prototype, "
|
1791
|
+
], OrderModuleService.prototype, "setOrderShippingMethodTaxLines", null);
|
1855
1792
|
__decorate([
|
1856
1793
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1857
1794
|
__param(1, (0, utils_1.MedusaContext)()),
|
@@ -1959,7 +1896,7 @@ __decorate([
|
|
1959
1896
|
__metadata("design:type", Function),
|
1960
1897
|
__metadata("design:paramtypes", [Object, Object]),
|
1961
1898
|
__metadata("design:returntype", Promise)
|
1962
|
-
], OrderModuleService.prototype, "
|
1899
|
+
], OrderModuleService.prototype, "addOrderTransactions", null);
|
1963
1900
|
__decorate([
|
1964
1901
|
(0, utils_1.InjectManager)("baseRepository_")
|
1965
1902
|
// @ts-ignore
|
@@ -1968,7 +1905,7 @@ __decorate([
|
|
1968
1905
|
__metadata("design:type", Function),
|
1969
1906
|
__metadata("design:paramtypes", [Object, Object]),
|
1970
1907
|
__metadata("design:returntype", Promise)
|
1971
|
-
], OrderModuleService.prototype, "
|
1908
|
+
], OrderModuleService.prototype, "deleteOrderTransactions", null);
|
1972
1909
|
__decorate([
|
1973
1910
|
(0, utils_1.InjectManager)("baseRepository_")
|
1974
1911
|
// @ts-ignore
|
@@ -1977,7 +1914,7 @@ __decorate([
|
|
1977
1914
|
__metadata("design:type", Function),
|
1978
1915
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1979
1916
|
__metadata("design:returntype", Promise)
|
1980
|
-
], OrderModuleService.prototype, "
|
1917
|
+
], OrderModuleService.prototype, "softDeleteOrderTransactions", null);
|
1981
1918
|
__decorate([
|
1982
1919
|
(0, utils_1.InjectManager)("baseRepository_")
|
1983
1920
|
// @ts-ignore
|
@@ -1986,7 +1923,7 @@ __decorate([
|
|
1986
1923
|
__metadata("design:type", Function),
|
1987
1924
|
__metadata("design:paramtypes", [Object, Object, Object]),
|
1988
1925
|
__metadata("design:returntype", Promise)
|
1989
|
-
], OrderModuleService.prototype, "
|
1926
|
+
], OrderModuleService.prototype, "restoreOrderTransactions", null);
|
1990
1927
|
__decorate([
|
1991
1928
|
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
1992
1929
|
__metadata("design:type", Function),
|