@medusajs/order 0.1.3-snapshot-20240827104434 → 0.1.3-snapshot-20240904063643

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/dist/migrations/Migration20240827133639.d.ts +6 -0
  2. package/dist/migrations/Migration20240827133639.d.ts.map +1 -0
  3. package/dist/migrations/Migration20240827133639.js +17 -0
  4. package/dist/migrations/Migration20240827133639.js.map +1 -0
  5. package/dist/models/address.d.ts +1 -1
  6. package/dist/models/address.d.ts.map +1 -1
  7. package/dist/models/address.js +21 -21
  8. package/dist/models/address.js.map +1 -1
  9. package/dist/models/claim-item.d.ts +2 -2
  10. package/dist/models/claim-item.d.ts.map +1 -1
  11. package/dist/models/claim-item.js.map +1 -1
  12. package/dist/models/claim.d.ts +4 -4
  13. package/dist/models/claim.d.ts.map +1 -1
  14. package/dist/models/claim.js.map +1 -1
  15. package/dist/models/exchange-item.d.ts +2 -2
  16. package/dist/models/exchange-item.d.ts.map +1 -1
  17. package/dist/models/exchange-item.js.map +1 -1
  18. package/dist/models/exchange.d.ts +4 -4
  19. package/dist/models/exchange.d.ts.map +1 -1
  20. package/dist/models/exchange.js +1 -1
  21. package/dist/models/exchange.js.map +1 -1
  22. package/dist/models/index.d.ts +9 -9
  23. package/dist/models/index.d.ts.map +1 -1
  24. package/dist/models/index.js +10 -10
  25. package/dist/models/index.js.map +1 -1
  26. package/dist/models/line-item-adjustment.d.ts +3 -3
  27. package/dist/models/line-item-adjustment.d.ts.map +1 -1
  28. package/dist/models/line-item-adjustment.js +8 -8
  29. package/dist/models/line-item-adjustment.js.map +1 -1
  30. package/dist/models/line-item-tax-line.d.ts +3 -3
  31. package/dist/models/line-item-tax-line.d.ts.map +1 -1
  32. package/dist/models/line-item-tax-line.js +8 -8
  33. package/dist/models/line-item-tax-line.js.map +1 -1
  34. package/dist/models/line-item.d.ts +5 -5
  35. package/dist/models/line-item.d.ts.map +1 -1
  36. package/dist/models/line-item.js +35 -35
  37. package/dist/models/line-item.js.map +1 -1
  38. package/dist/models/order-change-action.d.ts.map +1 -1
  39. package/dist/models/order-change-action.js +6 -2
  40. package/dist/models/order-change-action.js.map +1 -1
  41. package/dist/models/order-item.d.ts +2 -2
  42. package/dist/models/order-item.d.ts.map +1 -1
  43. package/dist/models/order-item.js.map +1 -1
  44. package/dist/models/order-shipping-method.d.ts +3 -3
  45. package/dist/models/order-shipping-method.d.ts.map +1 -1
  46. package/dist/models/order-shipping-method.js +21 -21
  47. package/dist/models/order-shipping-method.js.map +1 -1
  48. package/dist/models/order.d.ts +7 -7
  49. package/dist/models/order.d.ts.map +1 -1
  50. package/dist/models/order.js.map +1 -1
  51. package/dist/models/return-item.d.ts +4 -2
  52. package/dist/models/return-item.d.ts.map +1 -1
  53. package/dist/models/return-item.js +9 -0
  54. package/dist/models/return-item.js.map +1 -1
  55. package/dist/models/return.d.ts +4 -4
  56. package/dist/models/return.d.ts.map +1 -1
  57. package/dist/models/return.js +1 -1
  58. package/dist/models/return.js.map +1 -1
  59. package/dist/models/shipping-method-adjustment.d.ts +3 -3
  60. package/dist/models/shipping-method-adjustment.d.ts.map +1 -1
  61. package/dist/models/shipping-method-adjustment.js +8 -8
  62. package/dist/models/shipping-method-adjustment.js.map +1 -1
  63. package/dist/models/shipping-method-tax-line.d.ts +3 -3
  64. package/dist/models/shipping-method-tax-line.d.ts.map +1 -1
  65. package/dist/models/shipping-method-tax-line.js +8 -8
  66. package/dist/models/shipping-method-tax-line.js.map +1 -1
  67. package/dist/models/shipping-method.d.ts +5 -5
  68. package/dist/models/shipping-method.d.ts.map +1 -1
  69. package/dist/models/shipping-method.js +20 -20
  70. package/dist/models/shipping-method.js.map +1 -1
  71. package/dist/models/transaction.d.ts +1 -1
  72. package/dist/models/transaction.d.ts.map +1 -1
  73. package/dist/models/transaction.js +24 -24
  74. package/dist/models/transaction.js.map +1 -1
  75. package/dist/services/actions/create-claim.js +5 -5
  76. package/dist/services/actions/create-claim.js.map +1 -1
  77. package/dist/services/actions/create-exchange.js +5 -5
  78. package/dist/services/actions/create-exchange.js.map +1 -1
  79. package/dist/services/actions/create-return.js +2 -2
  80. package/dist/services/actions/create-return.js.map +1 -1
  81. package/dist/services/order-module-service.d.ts +73 -79
  82. package/dist/services/order-module-service.d.ts.map +1 -1
  83. package/dist/services/order-module-service.js +126 -185
  84. package/dist/services/order-module-service.js.map +1 -1
  85. package/dist/utils/base-repository-find.d.ts.map +1 -1
  86. package/dist/utils/base-repository-find.js +7 -6
  87. package/dist/utils/base-repository-find.js.map +1 -1
  88. package/package.json +4 -4
@@ -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
- Address: _models_1.Address,
46
- LineItem: _models_1.LineItem,
47
- LineItemAdjustment: _models_1.LineItemAdjustment,
48
- LineItemTaxLine: _models_1.LineItemTaxLine,
49
- ShippingMethod: _models_1.ShippingMethod,
50
- ShippingMethodAdjustment: _models_1.ShippingMethodAdjustment,
51
- ShippingMethodTaxLine: _models_1.ShippingMethodTaxLine,
52
- Transaction: _models_1.Transaction,
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
- OrderShippingMethod: _models_1.OrderShippingMethod,
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, addressService, lineItemService, shippingMethodAdjustmentService, shippingMethodService, lineItemAdjustmentService, shippingMethodTaxLineService, lineItemTaxLineService, transactionService, orderChangeService, orderChangeActionService, orderItemService, orderSummaryService, orderShippingMethodService, returnReasonService, returnService, returnItemService, orderClaimService, orderExchangeService, }, moduleDeclaration) {
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.addressService_ = addressService;
76
- this.lineItemService_ = lineItemService;
77
- this.shippingMethodAdjustmentService_ = shippingMethodAdjustmentService;
78
- this.shippingMethodService_ = shippingMethodService;
79
- this.lineItemAdjustmentService_ = lineItemAdjustmentService;
80
- this.shippingMethodTaxLineService_ = shippingMethodTaxLineService;
81
- this.lineItemTaxLineService_ = lineItemTaxLineService;
82
- this.transactionService_ = transactionService;
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.orderShippingMethodService_ = orderShippingMethodService;
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.createLineItemsBulk_(lineItemsToCreate, sharedContext);
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 createLineItems(orderIdOrData, data, sharedContext = {}) {
371
+ async createOrderLineItems(orderIdOrData, data, sharedContext = {}) {
371
372
  let items = [];
372
373
  if ((0, utils_1.isString)(orderIdOrData)) {
373
- items = await this.createLineItems_(orderIdOrData, data, sharedContext);
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.createLineItemsBulk_(lineItems, sharedContext);
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 createLineItems_(orderId, items, sharedContext = {}) {
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.createLineItemsBulk_(toUpdate, sharedContext);
407
+ return await this.createOrderLineItemsBulk_(toUpdate, sharedContext);
407
408
  }
408
- async createLineItemsBulk_(data, sharedContext = {}) {
409
+ async createOrderLineItemsBulk_(data, sharedContext = {}) {
409
410
  const orderItemToCreate = [];
410
- const lineItems = await this.lineItemService_.create(data, sharedContext);
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 updateLineItems(lineItemIdOrDataOrSelector, data, sharedContext = {}) {
429
+ async updateOrderLineItems(lineItemIdOrDataOrSelector, data, sharedContext = {}) {
429
430
  let items = [];
430
431
  if ((0, utils_1.isString)(lineItemIdOrDataOrSelector)) {
431
- const item = await this.updateLineItem_(lineItemIdOrDataOrSelector, data, sharedContext);
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.updateLineItemsWithSelector_(toUpdate, sharedContext);
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 updateLineItem_(lineItemId, data, sharedContext = {}) {
450
- const [item] = await this.lineItemService_.update([{ id: lineItemId, ...data }], sharedContext);
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 updateLineItemsWithSelector_(updates, sharedContext = {}) {
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.listLineItems({ ...selector }, {}, sharedContext);
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.lineItemService_.update(toUpdate, sharedContext);
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 createAddresses(data, sharedContext = {}) {
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.createShippingMethods_(orderIdOrData, data, sharedContext);
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.createShippingMethodsBulk_(orderShippingMethodData, sharedContext);
548
+ methods = await this.createOrderShippingMethodsBulk_(orderShippingMethodData, sharedContext);
566
549
  }
567
550
  return await this.baseRepository_.serialize(methods, { populate: true });
568
551
  }
569
- async createShippingMethods_(orderId, data, sharedContext = {}) {
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.createShippingMethodsBulk_(methods, sharedContext);
564
+ return await this.createOrderShippingMethodsBulk_(methods, sharedContext);
582
565
  }
583
- async createShippingMethodsBulk_(data, sharedContext = {}) {
584
- const sm = await this.orderShippingMethodService_.create(data, sharedContext);
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 softDeleteShippingMethods(ids, config, sharedContext) {
589
- const rel = await super.listOrderShippingMethods({
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 orderShippingMethodIds = rel.map((r) => r.id);
577
+ const orderShippingIds = rel.map((r) => r.id);
595
578
  const [returned] = await (0, utils_1.promiseAll)([
596
- super.softDeleteShippingMethods(ids, config, sharedContext),
597
- super.softDeleteOrderShippingMethods(orderShippingMethodIds, config, sharedContext),
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 restoreShippingMethods(transactionIds, config, sharedContext) {
603
- const rel = await super.listOrderShippingMethods({
604
- shipping_method_id: transactionIds,
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 orderShippingMethodIds = rel.map((r) => r.id);
591
+ const shippingIds = rel.map((r) => r.id);
609
592
  const [returned] = await (0, utils_1.promiseAll)([
610
- super.restoreShippingMethods(transactionIds, config, sharedContext),
611
- super.restoreOrderShippingMethods(orderShippingMethodIds, config, sharedContext),
593
+ super.restoreOrderShippingMethods(ids, config, sharedContext),
594
+ super.restoreOrderShippings(shippingIds, config, sharedContext),
612
595
  ]);
613
596
  return returned;
614
597
  }
615
- async createLineItemAdjustments(orderIdOrData, adjustments, sharedContext = {}) {
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.lineItemAdjustmentService_.create(adjustments, sharedContext);
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.lineItemAdjustmentService_.create(data, sharedContext);
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 setLineItemAdjustments(orderId, adjustments, sharedContext = {}) {
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.lineItemAdjustmentService_.delete(toDelete, sharedContext);
637
+ await this.orderLineItemAdjustmentService_.delete(toDelete, sharedContext);
655
638
  }
656
- let result = await this.lineItemAdjustmentService_.upsert(adjustments, sharedContext);
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 setShippingMethodAdjustments(orderId, adjustments, sharedContext = {}) {
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.shippingMethodAdjustmentService_.delete(toDelete, sharedContext);
661
+ await this.orderShippingMethodAdjustmentService_.delete(toDelete, sharedContext);
679
662
  }
680
- const result = await this.shippingMethodAdjustmentService_.upsert(adjustments, sharedContext);
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 createShippingMethodAdjustments(orderIdOrData, adjustments, sharedContext = {}) {
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 = await this.shippingMethodAdjustmentService_.create(adjustments, sharedContext);
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 = await this.shippingMethodAdjustmentService_.create(data, sharedContext);
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 createLineItemTaxLines(orderIdOrData, taxLines, sharedContext = {}) {
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.lineItemTaxLineService_.create(lines, sharedContext);
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.lineItemTaxLineService_.create(data, sharedContext);
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 setLineItemTaxLines(orderId, taxLines, sharedContext = {}) {
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.lineItemTaxLineService_.delete(toDelete, sharedContext);
733
+ await this.orderLineItemTaxLineService_.delete(toDelete, sharedContext);
749
734
  }
750
- const result = await this.lineItemTaxLineService_.upsert(taxLines, sharedContext);
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 createShippingMethodTaxLines(orderIdOrData, taxLines, sharedContext = {}) {
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.shippingMethodTaxLineService_.create(lines, sharedContext);
744
+ addedTaxLines = await this.orderShippingMethodTaxLineService_.create(lines, sharedContext);
760
745
  }
761
746
  else {
762
- addedTaxLines = await this.shippingMethodTaxLineService_.create(taxLines, sharedContext);
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 setShippingMethodTaxLines(orderId, taxLines, sharedContext = {}) {
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.shippingMethodTaxLineService_.delete(toDelete, sharedContext);
773
+ await this.orderShippingMethodTaxLineService_.delete(toDelete, sharedContext);
789
774
  }
790
- const result = await this.shippingMethodTaxLineService_.upsert(taxLines, sharedContext);
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.listLineItems({ id: Object.keys(addedItems) }, {
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.listShippingMethods({ id: Object.keys(addedShippingMethods) }, {
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 Methods
1093
- const orderShippingMethods = await this.orderShippingMethodService_.list({
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 orderShippingMethodIds = orderShippingMethods.map((summary) => summary.id);
1098
- await this.orderShippingMethodService_.softDelete(orderShippingMethodIds, sharedContext);
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.orderShippingMethodService_.upsert(shippingMethodsToUpsert, sharedContext)
1241
+ ? this.orderShippingService_.upsert(shippingMethodsToUpsert, sharedContext)
1277
1242
  : null,
1278
1243
  ]);
1279
1244
  return {
@@ -1281,12 +1246,13 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
1281
1246
  shippingMethods: shippingMethodsToUpsert,
1282
1247
  };
1283
1248
  }
1284
- async addTransactions(transactionData, sharedContext) {
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)
1288
1253
  : transactionData.order_id,
1289
1254
  }, {
1255
+ take: null,
1290
1256
  select: ["id", "version"],
1291
1257
  }, sharedContext);
1292
1258
  const data = Array.isArray(transactionData)
@@ -1299,52 +1265,55 @@ class OrderModuleService extends utils_1.ModulesSdkUtils.MedusaService(generateM
1299
1265
  trx.version = order.version;
1300
1266
  }
1301
1267
  }
1302
- const created = await this.transactionService_.create(data, sharedContext);
1268
+ const created = await this.orderTransactionService_.create(data, sharedContext);
1303
1269
  await this.updateOrderPaidRefundableAmount_(created, false, sharedContext);
1304
1270
  return await this.baseRepository_.serialize(!Array.isArray(transactionData) ? created[0] : created, {
1305
1271
  populate: true,
1306
1272
  });
1307
1273
  }
1308
1274
  // @ts-ignore
1309
- async deleteTransactions(transactionIds, sharedContext) {
1275
+ async deleteOrderTransactions(transactionIds, sharedContext) {
1310
1276
  const data = Array.isArray(transactionIds)
1311
1277
  ? transactionIds
1312
1278
  : [transactionIds];
1313
- const transactions = await super.listTransactions({
1279
+ const transactions = await super.listOrderTransactions({
1314
1280
  id: data,
1315
1281
  }, {
1316
1282
  select: ["order_id", "version", "amount"],
1283
+ take: null,
1317
1284
  }, sharedContext);
1318
- await this.transactionService_.delete(data, sharedContext);
1285
+ await this.orderTransactionService_.delete(data, sharedContext);
1319
1286
  await this.updateOrderPaidRefundableAmount_(transactions, true, sharedContext);
1320
1287
  }
1321
1288
  // @ts-ignore
1322
- async softDeleteTransactions(transactionIds, config, sharedContext) {
1323
- const transactions = await super.listTransactions({
1289
+ async softDeleteOrderTransactions(transactionIds, config, sharedContext) {
1290
+ const transactions = await super.listOrderTransactions({
1324
1291
  id: transactionIds,
1325
1292
  }, {
1293
+ take: null,
1326
1294
  select: ["order_id", "amount"],
1327
1295
  }, sharedContext);
1328
- const returned = await super.softDeleteTransactions(transactionIds, config, sharedContext);
1296
+ const returned = await super.softDeleteOrderTransactions(transactionIds, config, sharedContext);
1329
1297
  await this.updateOrderPaidRefundableAmount_(transactions, true, sharedContext);
1330
1298
  return returned;
1331
1299
  }
1332
1300
  // @ts-ignore
1333
- async restoreTransactions(transactionIds, config, sharedContext) {
1334
- const transactions = await super.listTransactions({
1301
+ async restoreOrderTransactions(transactionIds, config, sharedContext) {
1302
+ const transactions = await super.listOrderTransactions({
1335
1303
  id: transactionIds,
1336
1304
  }, {
1337
1305
  select: ["order_id", "amount"],
1338
1306
  withDeleted: true,
1307
+ take: null,
1339
1308
  }, sharedContext);
1340
- const returned = await super.restoreTransactions(transactionIds, config, sharedContext);
1309
+ const returned = await super.restoreOrderTransactions(transactionIds, config, sharedContext);
1341
1310
  await this.updateOrderPaidRefundableAmount_(transactions, false, sharedContext);
1342
1311
  return returned;
1343
1312
  }
1344
1313
  async updateOrderPaidRefundableAmount_(transactionData, isRemoved, sharedContext) {
1345
1314
  const summaries = await super.listOrderSummaries({
1346
1315
  order_id: transactionData.map((trx) => trx.order_id),
1347
- }, {}, sharedContext);
1316
+ }, { take: null }, sharedContext);
1348
1317
  summaries.forEach((summary) => {
1349
1318
  let trxs = transactionData.filter((trx) => trx.order_id === summary.order_id);
1350
1319
  if (!trxs.length) {
@@ -1672,42 +1641,42 @@ __decorate([
1672
1641
  __metadata("design:type", Function),
1673
1642
  __metadata("design:paramtypes", [Object, Object, Object]),
1674
1643
  __metadata("design:returntype", Promise)
1675
- ], OrderModuleService.prototype, "createLineItems", null);
1644
+ ], OrderModuleService.prototype, "createOrderLineItems", null);
1676
1645
  __decorate([
1677
1646
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1678
1647
  __param(2, (0, utils_1.MedusaContext)()),
1679
1648
  __metadata("design:type", Function),
1680
1649
  __metadata("design:paramtypes", [String, Array, Object]),
1681
1650
  __metadata("design:returntype", Promise)
1682
- ], OrderModuleService.prototype, "createLineItems_", null);
1651
+ ], OrderModuleService.prototype, "createOrderLineItems_", null);
1683
1652
  __decorate([
1684
1653
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1685
1654
  __param(1, (0, utils_1.MedusaContext)()),
1686
1655
  __metadata("design:type", Function),
1687
1656
  __metadata("design:paramtypes", [Array, Object]),
1688
1657
  __metadata("design:returntype", Promise)
1689
- ], OrderModuleService.prototype, "createLineItemsBulk_", null);
1658
+ ], OrderModuleService.prototype, "createOrderLineItemsBulk_", null);
1690
1659
  __decorate([
1691
1660
  (0, utils_1.InjectManager)("baseRepository_"),
1692
1661
  __param(2, (0, utils_1.MedusaContext)()),
1693
1662
  __metadata("design:type", Function),
1694
1663
  __metadata("design:paramtypes", [Object, Object, Object]),
1695
1664
  __metadata("design:returntype", Promise)
1696
- ], OrderModuleService.prototype, "updateLineItems", null);
1665
+ ], OrderModuleService.prototype, "updateOrderLineItems", null);
1697
1666
  __decorate([
1698
1667
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1699
1668
  __param(2, (0, utils_1.MedusaContext)()),
1700
1669
  __metadata("design:type", Function),
1701
1670
  __metadata("design:paramtypes", [String, Object, Object]),
1702
1671
  __metadata("design:returntype", Promise)
1703
- ], OrderModuleService.prototype, "updateLineItem_", null);
1672
+ ], OrderModuleService.prototype, "updateOrderLineItem_", null);
1704
1673
  __decorate([
1705
1674
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1706
1675
  __param(1, (0, utils_1.MedusaContext)()),
1707
1676
  __metadata("design:type", Function),
1708
1677
  __metadata("design:paramtypes", [Array, Object]),
1709
1678
  __metadata("design:returntype", Promise)
1710
- ], OrderModuleService.prototype, "updateLineItemsWithSelector_", null);
1679
+ ], OrderModuleService.prototype, "updateOrderLineItemsWithSelector_", null);
1711
1680
  __decorate([
1712
1681
  (0, utils_1.InjectManager)("baseRepository_"),
1713
1682
  __param(2, (0, utils_1.MedusaContext)()),
@@ -1729,55 +1698,27 @@ __decorate([
1729
1698
  __metadata("design:paramtypes", [Array, Object]),
1730
1699
  __metadata("design:returntype", Promise)
1731
1700
  ], 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
1701
  __decorate([
1761
1702
  (0, utils_1.InjectManager)("baseRepository_"),
1762
1703
  __param(2, (0, utils_1.MedusaContext)()),
1763
1704
  __metadata("design:type", Function),
1764
1705
  __metadata("design:paramtypes", [Object, Array, Object]),
1765
1706
  __metadata("design:returntype", Promise)
1766
- ], OrderModuleService.prototype, "createShippingMethods", null);
1707
+ ], OrderModuleService.prototype, "createOrderShippingMethods", null);
1767
1708
  __decorate([
1768
1709
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1769
1710
  __param(2, (0, utils_1.MedusaContext)()),
1770
1711
  __metadata("design:type", Function),
1771
1712
  __metadata("design:paramtypes", [String, Array, Object]),
1772
1713
  __metadata("design:returntype", Promise)
1773
- ], OrderModuleService.prototype, "createShippingMethods_", null);
1714
+ ], OrderModuleService.prototype, "createOrderShippingMethods_", null);
1774
1715
  __decorate([
1775
1716
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1776
1717
  __param(1, (0, utils_1.MedusaContext)()),
1777
1718
  __metadata("design:type", Function),
1778
1719
  __metadata("design:paramtypes", [Array, Object]),
1779
1720
  __metadata("design:returntype", Promise)
1780
- ], OrderModuleService.prototype, "createShippingMethodsBulk_", null);
1721
+ ], OrderModuleService.prototype, "createOrderShippingMethodsBulk_", null);
1781
1722
  __decorate([
1782
1723
  (0, utils_1.InjectManager)("baseRepository_")
1783
1724
  // @ts-ignore
@@ -1786,7 +1727,7 @@ __decorate([
1786
1727
  __metadata("design:type", Function),
1787
1728
  __metadata("design:paramtypes", [Object, Object, Object]),
1788
1729
  __metadata("design:returntype", Promise)
1789
- ], OrderModuleService.prototype, "softDeleteShippingMethods", null);
1730
+ ], OrderModuleService.prototype, "softDeleteOrderShippingMethods", null);
1790
1731
  __decorate([
1791
1732
  (0, utils_1.InjectManager)("baseRepository_")
1792
1733
  // @ts-ignore
@@ -1795,63 +1736,63 @@ __decorate([
1795
1736
  __metadata("design:type", Function),
1796
1737
  __metadata("design:paramtypes", [Object, Object, Object]),
1797
1738
  __metadata("design:returntype", Promise)
1798
- ], OrderModuleService.prototype, "restoreShippingMethods", null);
1739
+ ], OrderModuleService.prototype, "restoreOrderShippingMethods", null);
1799
1740
  __decorate([
1800
1741
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1801
1742
  __param(2, (0, utils_1.MedusaContext)()),
1802
1743
  __metadata("design:type", Function),
1803
1744
  __metadata("design:paramtypes", [Object, Array, Object]),
1804
1745
  __metadata("design:returntype", Promise)
1805
- ], OrderModuleService.prototype, "createLineItemAdjustments", null);
1746
+ ], OrderModuleService.prototype, "createOrderLineItemAdjustments", null);
1806
1747
  __decorate([
1807
1748
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1808
1749
  __param(2, (0, utils_1.MedusaContext)()),
1809
1750
  __metadata("design:type", Function),
1810
1751
  __metadata("design:paramtypes", [String, Array, Object]),
1811
1752
  __metadata("design:returntype", Promise)
1812
- ], OrderModuleService.prototype, "setLineItemAdjustments", null);
1753
+ ], OrderModuleService.prototype, "setOrderLineItemAdjustments", null);
1813
1754
  __decorate([
1814
1755
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1815
1756
  __param(2, (0, utils_1.MedusaContext)()),
1816
1757
  __metadata("design:type", Function),
1817
1758
  __metadata("design:paramtypes", [String, Array, Object]),
1818
1759
  __metadata("design:returntype", Promise)
1819
- ], OrderModuleService.prototype, "setShippingMethodAdjustments", null);
1760
+ ], OrderModuleService.prototype, "setOrderShippingMethodAdjustments", null);
1820
1761
  __decorate([
1821
1762
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1822
1763
  __param(2, (0, utils_1.MedusaContext)()),
1823
1764
  __metadata("design:type", Function),
1824
1765
  __metadata("design:paramtypes", [Object, Array, Object]),
1825
1766
  __metadata("design:returntype", Promise)
1826
- ], OrderModuleService.prototype, "createShippingMethodAdjustments", null);
1767
+ ], OrderModuleService.prototype, "createOrderShippingMethodAdjustments", null);
1827
1768
  __decorate([
1828
1769
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1829
1770
  __param(2, (0, utils_1.MedusaContext)()),
1830
1771
  __metadata("design:type", Function),
1831
1772
  __metadata("design:paramtypes", [Object, Object, Object]),
1832
1773
  __metadata("design:returntype", Promise)
1833
- ], OrderModuleService.prototype, "createLineItemTaxLines", null);
1774
+ ], OrderModuleService.prototype, "createOrderLineItemTaxLines", null);
1834
1775
  __decorate([
1835
1776
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1836
1777
  __param(2, (0, utils_1.MedusaContext)()),
1837
1778
  __metadata("design:type", Function),
1838
1779
  __metadata("design:paramtypes", [String, Array, Object]),
1839
1780
  __metadata("design:returntype", Promise)
1840
- ], OrderModuleService.prototype, "setLineItemTaxLines", null);
1781
+ ], OrderModuleService.prototype, "setOrderLineItemTaxLines", null);
1841
1782
  __decorate([
1842
1783
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1843
1784
  __param(2, (0, utils_1.MedusaContext)()),
1844
1785
  __metadata("design:type", Function),
1845
1786
  __metadata("design:paramtypes", [Object, Object, Object]),
1846
1787
  __metadata("design:returntype", Promise)
1847
- ], OrderModuleService.prototype, "createShippingMethodTaxLines", null);
1788
+ ], OrderModuleService.prototype, "createOrderShippingMethodTaxLines", null);
1848
1789
  __decorate([
1849
1790
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1850
1791
  __param(2, (0, utils_1.MedusaContext)()),
1851
1792
  __metadata("design:type", Function),
1852
1793
  __metadata("design:paramtypes", [String, Array, Object]),
1853
1794
  __metadata("design:returntype", Promise)
1854
- ], OrderModuleService.prototype, "setShippingMethodTaxLines", null);
1795
+ ], OrderModuleService.prototype, "setOrderShippingMethodTaxLines", null);
1855
1796
  __decorate([
1856
1797
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1857
1798
  __param(1, (0, utils_1.MedusaContext)()),
@@ -1959,7 +1900,7 @@ __decorate([
1959
1900
  __metadata("design:type", Function),
1960
1901
  __metadata("design:paramtypes", [Object, Object]),
1961
1902
  __metadata("design:returntype", Promise)
1962
- ], OrderModuleService.prototype, "addTransactions", null);
1903
+ ], OrderModuleService.prototype, "addOrderTransactions", null);
1963
1904
  __decorate([
1964
1905
  (0, utils_1.InjectManager)("baseRepository_")
1965
1906
  // @ts-ignore
@@ -1968,7 +1909,7 @@ __decorate([
1968
1909
  __metadata("design:type", Function),
1969
1910
  __metadata("design:paramtypes", [Object, Object]),
1970
1911
  __metadata("design:returntype", Promise)
1971
- ], OrderModuleService.prototype, "deleteTransactions", null);
1912
+ ], OrderModuleService.prototype, "deleteOrderTransactions", null);
1972
1913
  __decorate([
1973
1914
  (0, utils_1.InjectManager)("baseRepository_")
1974
1915
  // @ts-ignore
@@ -1977,7 +1918,7 @@ __decorate([
1977
1918
  __metadata("design:type", Function),
1978
1919
  __metadata("design:paramtypes", [Object, Object, Object]),
1979
1920
  __metadata("design:returntype", Promise)
1980
- ], OrderModuleService.prototype, "softDeleteTransactions", null);
1921
+ ], OrderModuleService.prototype, "softDeleteOrderTransactions", null);
1981
1922
  __decorate([
1982
1923
  (0, utils_1.InjectManager)("baseRepository_")
1983
1924
  // @ts-ignore
@@ -1986,7 +1927,7 @@ __decorate([
1986
1927
  __metadata("design:type", Function),
1987
1928
  __metadata("design:paramtypes", [Object, Object, Object]),
1988
1929
  __metadata("design:returntype", Promise)
1989
- ], OrderModuleService.prototype, "restoreTransactions", null);
1930
+ ], OrderModuleService.prototype, "restoreOrderTransactions", null);
1990
1931
  __decorate([
1991
1932
  (0, utils_1.InjectTransactionManager)("baseRepository_"),
1992
1933
  __metadata("design:type", Function),