@medusajs/order 0.1.3-snapshot-20240704130951 → 0.1.3-snapshot-20240711051411

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +4 -23
  4. package/dist/index.js.map +1 -1
  5. package/dist/migrations/Migration20240219102530.d.ts +1 -0
  6. package/dist/migrations/Migration20240219102530.d.ts.map +1 -0
  7. package/dist/migrations/Migration20240604100512.d.ts +1 -0
  8. package/dist/migrations/Migration20240604100512.d.ts.map +1 -0
  9. package/dist/models/address.d.ts +2 -1
  10. package/dist/models/address.d.ts.map +1 -0
  11. package/dist/models/adjustment-line.d.ts +2 -1
  12. package/dist/models/adjustment-line.d.ts.map +1 -0
  13. package/dist/models/claim-item-image.d.ts +2 -1
  14. package/dist/models/claim-item-image.d.ts.map +1 -0
  15. package/dist/models/claim-item.d.ts +2 -1
  16. package/dist/models/claim-item.d.ts.map +1 -0
  17. package/dist/models/claim.d.ts +2 -1
  18. package/dist/models/claim.d.ts.map +1 -0
  19. package/dist/models/exchange-item.d.ts +2 -1
  20. package/dist/models/exchange-item.d.ts.map +1 -0
  21. package/dist/models/exchange.d.ts +2 -1
  22. package/dist/models/exchange.d.ts.map +1 -0
  23. package/dist/models/index.d.ts +1 -0
  24. package/dist/models/index.d.ts.map +1 -0
  25. package/dist/models/line-item-adjustment.d.ts +1 -0
  26. package/dist/models/line-item-adjustment.d.ts.map +1 -0
  27. package/dist/models/line-item-tax-line.d.ts +1 -0
  28. package/dist/models/line-item-tax-line.d.ts.map +1 -0
  29. package/dist/models/line-item.d.ts +2 -1
  30. package/dist/models/line-item.d.ts.map +1 -0
  31. package/dist/models/order-change-action.d.ts +2 -1
  32. package/dist/models/order-change-action.d.ts.map +1 -0
  33. package/dist/models/order-change.d.ts +3 -2
  34. package/dist/models/order-change.d.ts.map +1 -0
  35. package/dist/models/order-change.js +2 -1
  36. package/dist/models/order-change.js.map +1 -1
  37. package/dist/models/order-item.d.ts +2 -1
  38. package/dist/models/order-item.d.ts.map +1 -0
  39. package/dist/models/order-shipping-method.d.ts +2 -1
  40. package/dist/models/order-shipping-method.d.ts.map +1 -0
  41. package/dist/models/order-summary.d.ts +1 -0
  42. package/dist/models/order-summary.d.ts.map +1 -0
  43. package/dist/models/order.d.ts +2 -1
  44. package/dist/models/order.d.ts.map +1 -0
  45. package/dist/models/return-item.d.ts +2 -1
  46. package/dist/models/return-item.d.ts.map +1 -0
  47. package/dist/models/return-reason.d.ts +2 -1
  48. package/dist/models/return-reason.d.ts.map +1 -0
  49. package/dist/models/return.d.ts +2 -1
  50. package/dist/models/return.d.ts.map +1 -0
  51. package/dist/models/shipping-method-adjustment.d.ts +1 -0
  52. package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
  53. package/dist/models/shipping-method-tax-line.d.ts +1 -0
  54. package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
  55. package/dist/models/shipping-method.d.ts +1 -0
  56. package/dist/models/shipping-method.d.ts.map +1 -0
  57. package/dist/models/tax-line.d.ts +1 -0
  58. package/dist/models/tax-line.d.ts.map +1 -0
  59. package/dist/models/transaction.d.ts +2 -1
  60. package/dist/models/transaction.d.ts.map +1 -0
  61. package/dist/repositories/claim.d.ts +1 -0
  62. package/dist/repositories/claim.d.ts.map +1 -0
  63. package/dist/repositories/exchange.d.ts +1 -0
  64. package/dist/repositories/exchange.d.ts.map +1 -0
  65. package/dist/repositories/index.d.ts +1 -0
  66. package/dist/repositories/index.d.ts.map +1 -0
  67. package/dist/repositories/order.d.ts +1 -0
  68. package/dist/repositories/order.d.ts.map +1 -0
  69. package/dist/repositories/return.d.ts +1 -0
  70. package/dist/repositories/return.d.ts.map +1 -0
  71. package/dist/services/actions/cancel-claim.d.ts +1 -0
  72. package/dist/services/actions/cancel-claim.d.ts.map +1 -0
  73. package/dist/services/actions/cancel-claim.js +4 -5
  74. package/dist/services/actions/cancel-claim.js.map +1 -1
  75. package/dist/services/actions/cancel-exchange.d.ts +1 -0
  76. package/dist/services/actions/cancel-exchange.d.ts.map +1 -0
  77. package/dist/services/actions/cancel-exchange.js +3 -4
  78. package/dist/services/actions/cancel-exchange.js.map +1 -1
  79. package/dist/services/actions/cancel-fulfillment.d.ts +1 -0
  80. package/dist/services/actions/cancel-fulfillment.d.ts.map +1 -0
  81. package/dist/services/actions/cancel-fulfillment.js +1 -1
  82. package/dist/services/actions/cancel-fulfillment.js.map +1 -1
  83. package/dist/services/actions/cancel-return.d.ts +1 -0
  84. package/dist/services/actions/cancel-return.d.ts.map +1 -0
  85. package/dist/services/actions/cancel-return.js +2 -3
  86. package/dist/services/actions/cancel-return.js.map +1 -1
  87. package/dist/services/actions/create-claim.d.ts +1 -0
  88. package/dist/services/actions/create-claim.d.ts.map +1 -0
  89. package/dist/services/actions/create-claim.js +7 -7
  90. package/dist/services/actions/create-claim.js.map +1 -1
  91. package/dist/services/actions/create-exchange.d.ts +1 -0
  92. package/dist/services/actions/create-exchange.d.ts.map +1 -0
  93. package/dist/services/actions/create-exchange.js +6 -6
  94. package/dist/services/actions/create-exchange.js.map +1 -1
  95. package/dist/services/actions/create-return.d.ts +1 -0
  96. package/dist/services/actions/create-return.d.ts.map +1 -0
  97. package/dist/services/actions/create-return.js +2 -3
  98. package/dist/services/actions/create-return.js.map +1 -1
  99. package/dist/services/actions/index.d.ts +1 -0
  100. package/dist/services/actions/index.d.ts.map +1 -0
  101. package/dist/services/actions/receive-return.d.ts +1 -0
  102. package/dist/services/actions/receive-return.d.ts.map +1 -0
  103. package/dist/services/actions/receive-return.js +1 -2
  104. package/dist/services/actions/receive-return.js.map +1 -1
  105. package/dist/services/actions/register-fulfillment.d.ts +1 -0
  106. package/dist/services/actions/register-fulfillment.d.ts.map +1 -0
  107. package/dist/services/actions/register-fulfillment.js +1 -1
  108. package/dist/services/actions/register-fulfillment.js.map +1 -1
  109. package/dist/services/actions/register-shipment.d.ts +1 -0
  110. package/dist/services/actions/register-shipment.d.ts.map +1 -0
  111. package/dist/services/actions/register-shipment.js +1 -1
  112. package/dist/services/actions/register-shipment.js.map +1 -1
  113. package/dist/services/index.d.ts +1 -1
  114. package/dist/services/index.d.ts.map +1 -0
  115. package/dist/services/index.js +1 -3
  116. package/dist/services/index.js.map +1 -1
  117. package/dist/services/order-module-service.d.ts +6 -5
  118. package/dist/services/order-module-service.d.ts.map +1 -0
  119. package/dist/services/order-module-service.js +81 -9
  120. package/dist/services/order-module-service.js.map +1 -1
  121. package/dist/services/order-service.d.ts +1 -0
  122. package/dist/services/order-service.d.ts.map +1 -0
  123. package/dist/types/address.d.ts +1 -0
  124. package/dist/types/address.d.ts.map +1 -0
  125. package/dist/types/index.d.ts +1 -0
  126. package/dist/types/index.d.ts.map +1 -0
  127. package/dist/types/line-item-adjustment.d.ts +1 -0
  128. package/dist/types/line-item-adjustment.d.ts.map +1 -0
  129. package/dist/types/line-item-tax-line.d.ts +1 -0
  130. package/dist/types/line-item-tax-line.d.ts.map +1 -0
  131. package/dist/types/line-item.d.ts +1 -0
  132. package/dist/types/line-item.d.ts.map +1 -0
  133. package/dist/types/order-change.d.ts +1 -0
  134. package/dist/types/order-change.d.ts.map +1 -0
  135. package/dist/types/order-detail.d.ts +1 -0
  136. package/dist/types/order-detail.d.ts.map +1 -0
  137. package/dist/types/order.d.ts +1 -0
  138. package/dist/types/order.d.ts.map +1 -0
  139. package/dist/types/shipping-method-adjustment.d.ts +1 -0
  140. package/dist/types/shipping-method-adjustment.d.ts.map +1 -0
  141. package/dist/types/shipping-method-tax-line.d.ts +1 -0
  142. package/dist/types/shipping-method-tax-line.d.ts.map +1 -0
  143. package/dist/types/shipping-method.d.ts +1 -0
  144. package/dist/types/shipping-method.d.ts.map +1 -0
  145. package/dist/types/tax-line.d.ts +1 -0
  146. package/dist/types/tax-line.d.ts.map +1 -0
  147. package/dist/types/transaction.d.ts +1 -0
  148. package/dist/types/transaction.d.ts.map +1 -0
  149. package/dist/types/utils/index.d.ts +6 -0
  150. package/dist/types/utils/index.d.ts.map +1 -0
  151. package/dist/types/utils/index.js.map +1 -1
  152. package/dist/utils/actions/cancel-item-fulfillment.d.ts +1 -0
  153. package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +1 -0
  154. package/dist/utils/actions/cancel-item-fulfillment.js +4 -4
  155. package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -1
  156. package/dist/utils/actions/cancel-return.d.ts +1 -0
  157. package/dist/utils/actions/cancel-return.d.ts.map +1 -0
  158. package/dist/utils/actions/cancel-return.js +4 -4
  159. package/dist/utils/actions/cancel-return.js.map +1 -1
  160. package/dist/utils/actions/cancel.d.ts +1 -0
  161. package/dist/utils/actions/cancel.d.ts.map +1 -0
  162. package/dist/utils/actions/cancel.js +2 -2
  163. package/dist/utils/actions/cancel.js.map +1 -1
  164. package/dist/utils/actions/fulfill-item.d.ts +1 -0
  165. package/dist/utils/actions/fulfill-item.d.ts.map +1 -0
  166. package/dist/utils/actions/fulfill-item.js +4 -4
  167. package/dist/utils/actions/fulfill-item.js.map +1 -1
  168. package/dist/utils/actions/index.d.ts +1 -0
  169. package/dist/utils/actions/index.d.ts.map +1 -0
  170. package/dist/utils/actions/item-add.d.ts +1 -0
  171. package/dist/utils/actions/item-add.d.ts.map +1 -0
  172. package/dist/utils/actions/item-add.js +8 -7
  173. package/dist/utils/actions/item-add.js.map +1 -1
  174. package/dist/utils/actions/item-remove.d.ts +1 -0
  175. package/dist/utils/actions/item-remove.d.ts.map +1 -0
  176. package/dist/utils/actions/item-remove.js +4 -4
  177. package/dist/utils/actions/item-remove.js.map +1 -1
  178. package/dist/utils/actions/receive-damaged-return-item.d.ts +1 -0
  179. package/dist/utils/actions/receive-damaged-return-item.d.ts.map +1 -0
  180. package/dist/utils/actions/receive-damaged-return-item.js +4 -4
  181. package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
  182. package/dist/utils/actions/receive-return-item.d.ts +1 -0
  183. package/dist/utils/actions/receive-return-item.d.ts.map +1 -0
  184. package/dist/utils/actions/receive-return-item.js +4 -4
  185. package/dist/utils/actions/receive-return-item.js.map +1 -1
  186. package/dist/utils/actions/reinstate-item.d.ts +1 -0
  187. package/dist/utils/actions/reinstate-item.d.ts.map +1 -0
  188. package/dist/utils/actions/reinstate-item.js +4 -4
  189. package/dist/utils/actions/reinstate-item.js.map +1 -1
  190. package/dist/utils/actions/return-item.d.ts +1 -0
  191. package/dist/utils/actions/return-item.d.ts.map +1 -0
  192. package/dist/utils/actions/return-item.js +4 -4
  193. package/dist/utils/actions/return-item.js.map +1 -1
  194. package/dist/utils/actions/ship-item.d.ts +1 -0
  195. package/dist/utils/actions/ship-item.d.ts.map +1 -0
  196. package/dist/utils/actions/ship-item.js +4 -4
  197. package/dist/utils/actions/ship-item.js.map +1 -1
  198. package/dist/utils/actions/shipping-add.d.ts +1 -0
  199. package/dist/utils/actions/shipping-add.d.ts.map +1 -0
  200. package/dist/utils/actions/shipping-add.js +8 -10
  201. package/dist/utils/actions/shipping-add.js.map +1 -1
  202. package/dist/utils/actions/shipping-remove.d.ts +1 -0
  203. package/dist/utils/actions/shipping-remove.d.ts.map +1 -0
  204. package/dist/utils/actions/shipping-remove.js +2 -3
  205. package/dist/utils/actions/shipping-remove.js.map +1 -1
  206. package/dist/utils/actions/write-off-item.d.ts +1 -0
  207. package/dist/utils/actions/write-off-item.d.ts.map +1 -0
  208. package/dist/utils/actions/write-off-item.js +4 -4
  209. package/dist/utils/actions/write-off-item.js.map +1 -1
  210. package/dist/utils/apply-order-changes.d.ts +1 -0
  211. package/dist/utils/apply-order-changes.d.ts.map +1 -0
  212. package/dist/utils/apply-order-changes.js +3 -2
  213. package/dist/utils/apply-order-changes.js.map +1 -1
  214. package/dist/utils/base-repository-find.d.ts +1 -0
  215. package/dist/utils/base-repository-find.d.ts.map +1 -0
  216. package/dist/utils/calculate-order-change.d.ts +11 -2
  217. package/dist/utils/calculate-order-change.d.ts.map +1 -0
  218. package/dist/utils/calculate-order-change.js +11 -3
  219. package/dist/utils/calculate-order-change.js.map +1 -1
  220. package/dist/utils/index.d.ts +1 -1
  221. package/dist/utils/index.d.ts.map +1 -0
  222. package/dist/utils/index.js +0 -1
  223. package/dist/utils/index.js.map +1 -1
  224. package/dist/utils/set-action-reference.d.ts +3 -1
  225. package/dist/utils/set-action-reference.d.ts.map +1 -0
  226. package/dist/utils/set-action-reference.js +13 -2
  227. package/dist/utils/set-action-reference.js.map +1 -1
  228. package/dist/utils/transform-order.d.ts +1 -0
  229. package/dist/utils/transform-order.d.ts.map +1 -0
  230. package/package.json +6 -8
  231. package/dist/joiner-config.d.ts +0 -1
  232. package/dist/joiner-config.js +0 -7
  233. package/dist/joiner-config.js.map +0 -1
  234. package/dist/services/order-change-service.d.ts +0 -15
  235. package/dist/services/order-change-service.js +0 -97
  236. package/dist/services/order-change-service.js.map +0 -1
  237. package/dist/utils/action-key.d.ts +0 -16
  238. package/dist/utils/action-key.js +0 -21
  239. package/dist/utils/action-key.js.map +0 -1
@@ -20,3 +20,4 @@ export interface CreateOrderItemDTO extends PartialUpsertOrderItemDTO {
20
20
  export interface UpdateOrderItemDTO extends PartialUpsertOrderItemDTO, Partial<CreateOrderItemDTO> {
21
21
  id: string;
22
22
  }
23
+ //# sourceMappingURL=order-detail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-detail.d.ts","sourceRoot":"","sources":["../../src/types/order-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,kBAAkB,CAAC,EAAE,cAAc,CAAA;IACnC,yBAAyB,CAAC,EAAE,cAAc,CAAA;IAC1C,wBAAwB,CAAC,EAAE,cAAc,CAAA;IACzC,yBAAyB,CAAC,EAAE,cAAc,CAAA;IAC1C,oBAAoB,CAAC,EAAE,cAAc,CAAA;IAErC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C;AAED,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,cAAc,CAAA;CACzB;AAED,MAAM,WAAW,kBACf,SAAQ,yBAAyB,EAC/B,OAAO,CAAC,kBAAkB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAA;CACX"}
@@ -21,3 +21,4 @@ export interface UpdateOrderDTO {
21
21
  no_notification?: boolean;
22
22
  metadata?: Record<string, unknown> | null;
23
23
  }
24
+ //# sourceMappingURL=order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/types/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C"}
@@ -1,3 +1,4 @@
1
1
  import { OrderTypes } from "@medusajs/types";
2
2
  export type CreateOrderShippingMethodAdjustmentDTO = OrderTypes.CreateOrderShippingMethodAdjustmentDTO;
3
3
  export type UpdateOrderShippingMethodAdjustmentDTO = OrderTypes.UpdateOrderShippingMethodAdjustmentDTO;
4
+ //# sourceMappingURL=shipping-method-adjustment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method-adjustment.d.ts","sourceRoot":"","sources":["../../src/types/shipping-method-adjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,sCAAsC,GAChD,UAAU,CAAC,sCAAsC,CAAA;AAEnD,MAAM,MAAM,sCAAsC,GAChD,UAAU,CAAC,sCAAsC,CAAA"}
@@ -5,3 +5,4 @@ export interface CreateOrderShippingMethodTaxLineDTO extends CreateOrderTaxLineD
5
5
  export interface UpdateOrderShippingMethodTaxLineDTO extends UpdateOrderTaxLineDTO {
6
6
  shipping_method_id: string;
7
7
  }
8
+ //# sourceMappingURL=shipping-method-tax-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method-tax-line.d.ts","sourceRoot":"","sources":["../../src/types/shipping-method-tax-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEzE,MAAM,WAAW,mCACf,SAAQ,qBAAqB;IAC7B,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,mCACf,SAAQ,qBAAqB;IAC7B,kBAAkB,EAAE,MAAM,CAAA;CAC3B"}
@@ -17,3 +17,4 @@ export interface UpdateOrderShippingMethodDTO {
17
17
  amount?: BigNumberInput;
18
18
  data?: Record<string, unknown>;
19
19
  }
20
+ //# sourceMappingURL=shipping-method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method.d.ts","sourceRoot":"","sources":["../../src/types/shipping-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAA;IACV,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B"}
@@ -1,3 +1,4 @@
1
1
  import { OrderTypes } from "@medusajs/types";
2
2
  export type CreateOrderTaxLineDTO = OrderTypes.CreateOrderTaxLineDTO;
3
3
  export type UpdateOrderTaxLineDTO = OrderTypes.UpdateOrderTaxLineDTO;
4
+ //# sourceMappingURL=tax-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-line.d.ts","sourceRoot":"","sources":["../../src/types/tax-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,qBAAqB,CAAA;AAEpE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,qBAAqB,CAAA"}
@@ -1,2 +1,3 @@
1
1
  import { OrderTypes } from "@medusajs/types";
2
2
  export type OrderTransactionDTO = OrderTypes.OrderTransactionDTO;
3
+ //# sourceMappingURL=transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/types/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,mBAAmB,CAAA"}
@@ -15,6 +15,7 @@ export type VirtualOrder = {
15
15
  return_id?: string;
16
16
  claim_id?: string;
17
17
  exchange_id?: string;
18
+ item_id?: string;
18
19
  quantity: BigNumberInput;
19
20
  shipped_quantity: BigNumberInput;
20
21
  fulfilled_quantity: BigNumberInput;
@@ -93,6 +94,10 @@ export type OrderReferences = {
93
94
  transactions: OrderTransaction[];
94
95
  type: ActionTypeDefinition;
95
96
  actions: InternalOrderChangeEvent[];
97
+ options?: {
98
+ addActionReferenceToObject?: boolean;
99
+ [key: string]: unknown;
100
+ };
96
101
  };
97
102
  export interface ActionTypeDefinition {
98
103
  isDeduction?: boolean;
@@ -105,3 +110,4 @@ export interface ActionTypeDefinition {
105
110
  validate?: (obj: OrderReferences) => void;
106
111
  [key: string]: unknown;
107
112
  }
113
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IAEV,KAAK,EAAE;QACL,EAAE,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,EAAE,YAAY,CAAA;IACrB,SAAS,CAAC,EAAE,wBAAwB,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,wBAAwB,CAAA;IAChC,cAAc,CAAC,EAAE,wBAAwB,EAAE,CAAA;IAC3C,YAAY,EAAE,YAAY,CAAA;IAC1B,OAAO,EAAE,sBAAsB,CAAA;IAC/B,YAAY,EAAE,gBAAgB,EAAE,CAAA;IAChC,IAAI,EAAE,oBAAoB,CAAA;IAC1B,OAAO,EAAE,wBAAwB,EAAE,CAAA;IACnC,OAAO,CAAC,EAAE;QACR,0BAA0B,CAAC,EAAE,OAAO,CAAA;QACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;CACF,CAAA;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,cAAc,GAAG,IAAI,CAAA;IAC3D,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,cAAc,GAAG,IAAI,CAAA;IACxD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAA;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/utils/index.ts"],"names":[],"mappings":";;;AAyDA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACf,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/utils/index.ts"],"names":[],"mappings":";;;AA0DA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACf,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=cancel-item-fulfillment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-item-fulfillment.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/cancel-item-fulfillment.ts"],"names":[],"mappings":""}
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
- const action_key_1 = require("../action-key");
5
4
  const calculate_order_change_1 = require("../calculate-order-change");
6
5
  const set_action_reference_1 = require("../set-action-reference");
7
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.CANCEL_ITEM_FULFILLMENT, {
8
- operation({ action, currentOrder }) {
6
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.CANCEL_ITEM_FULFILLMENT, {
7
+ operation({ action, currentOrder, options }) {
9
8
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
10
9
  existing.detail.fulfilled_quantity ??= 0;
11
10
  existing.detail.fulfilled_quantity = utils_1.MathBN.sub(existing.detail.fulfilled_quantity, action.details.quantity);
12
- (0, set_action_reference_1.setActionReference)(existing, action);
11
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
13
12
  },
14
13
  revert({ action, currentOrder }) {
15
14
  const existing = currentOrder.items.find((item) => item.id === action.reference_id);
16
15
  existing.detail.fulfilled_quantity = utils_1.MathBN.add(existing.detail.fulfilled_quantity, action.details.quantity);
16
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
17
17
  },
18
18
  validate({ action, currentOrder }) {
19
19
  const refId = action.details?.reference_id;
@@ -1 +1 @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AC;YACtB,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,2BAA2B,CAC5B,CAAA;QACH,CAAC;QAED,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,CAAA;QAErE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,YAAY,KAAK,cAAc,CAChC,CAAA;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,uCAAuC,KAAK,eAAe,CAC5D,CAAA;QACH,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,2BAA2B,KAAK,0BAA0B,CAC3D,CAAA;QACH,CAAC;QAED,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,CACvB,MAAM,CAAC,OAAO,EAAE,QAAQ,EACxB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CACpC,CAAA;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,6DAA6D,KAAK,GAAG,CACtE,CAAA;QACH,CAAC;IACH,CAAC;CACF,CACF,CAAA"}
1
+ {"version":3,"file":"cancel-item-fulfillment.js","sourceRoot":"","sources":["../../../src/utils/actions/cancel-item-fulfillment.ts"],"names":[],"mappings":";;AAAA,2CAKwB;AACxB,sEAAiE;AACjE,kEAGgC;AAEhC,8CAAqB,CAAC,kBAAkB,CACtC,wBAAgB,CAA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Q,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,CAAA;QAErE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,YAAY,KAAK,cAAc,CAChC,CAAA;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,uCAAuC,KAAK,eAAe,CAC5D,CAAA;QACH,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,2BAA2B,KAAK,0BAA0B,CAC3D,CAAA;QACH,CAAC;QAED,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,CACvB,MAAM,CAAC,OAAO,EAAE,QAAQ,EACxB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CACpC,CAAA;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,6DAA6D,KAAK,GAAG,CACtE,CAAA;QACH,CAAC;IACH,CAAC;CACF,CACF,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=cancel-return.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-return.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/cancel-return.ts"],"names":[],"mappings":""}
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
- const action_key_1 = require("../action-key");
5
4
  const calculate_order_change_1 = require("../calculate-order-change");
6
5
  const set_action_reference_1 = require("../set-action-reference");
7
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.CANCEL_RETURN_ITEM, {
8
- operation({ action, currentOrder }) {
6
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.CANCEL_RETURN_ITEM, {
7
+ operation({ action, currentOrder, options }) {
9
8
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
10
9
  existing.detail.return_requested_quantity ??= 0;
11
10
  existing.detail.return_requested_quantity = utils_1.MathBN.sub(existing.detail.return_requested_quantity, action.details.quantity);
12
- (0, set_action_reference_1.setActionReference)(existing, action);
11
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
13
12
  return action.details.unit_price * action.details.quantity;
14
13
  },
15
14
  revert({ action, currentOrder }) {
16
15
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
17
16
  existing.detail.return_requested_quantity = utils_1.MathBN.add(existing.detail.return_requested_quantity, action.details.quantity);
17
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
18
18
  },
19
19
  validate({ action, currentOrder }) {
20
20
  const refId = action.details?.reference_id;
@@ -1 +1 @@
1
- {"version":3,"file":"cancel-return.js","sourceRoot":"","sources":["../../../src/utils/actions/cancel-return.ts"],"names":[],"mappings":";;AAAA,2CAAgE;AAChE,8CAAgD;AAChD,sEAAiE;AACjE,kEAA4D;AAE5D,8CAAqB,CAAC,kBAAkB,CAAC,6BAAgB,CAAC,kBAAkB,EAAE;IAC5E,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAChC,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CACjD,CAAA;QAEF,QAAQ,CAAC,MAAM,CAAC,yBAAyB,KAAK,CAAC,CAAA;QAE/C,QAAQ,CAAC,MAAM,CAA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H,CAAC;QAED,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,CAAA;QAErE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,YAAY,KAAK,cAAc,CAChC,CAAA;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,qCAAqC,KAAK,eAAe,CAC1D,CAAA;QACH,CAAC;QAED,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,CACvB,MAAM,CAAC,OAAO,EAAE,QAAQ,EACxB,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAC3C,CAAA;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,uEAAuE,KAAK,GAAG,CAChF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=cancel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/cancel.ts"],"names":[],"mappings":""}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const action_key_1 = require("../action-key");
3
+ const utils_1 = require("@medusajs/utils");
4
4
  const calculate_order_change_1 = require("../calculate-order-change");
5
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.CANCEL, {
5
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.CANCEL, {
6
6
  void: true,
7
7
  });
8
8
  //# sourceMappingURL=cancel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../src/utils/actions/cancel.ts"],"names":[],"mappings":";;AAAA,8CAAgD;AAChD,sEAAiE;AAEjE,8CAAqB,CAAC,kBAAkB,CAAC,6BAAgB,CAAC,MAAM,EAAE;IAChE,IAAI,EAAE,IAAI;CACX,CAAC,CAAA"}
1
+ {"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../src/utils/actions/cancel.ts"],"names":[],"mappings":";;AAAA,2CAAkD;AAClD,sEAAiE;AAEjE,8CAAqB,CAAC,kBAAkB,CAAC,wBAAgB,CAAC,MAAM,EAAE;IAChE,IAAI,EAAE,IAAI;CACX,CAAC,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=fulfill-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fulfill-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/fulfill-item.ts"],"names":[],"mappings":""}
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
- const action_key_1 = require("../action-key");
5
4
  const calculate_order_change_1 = require("../calculate-order-change");
6
5
  const set_action_reference_1 = require("../set-action-reference");
7
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.FULFILL_ITEM, {
8
- operation({ action, currentOrder }) {
6
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.FULFILL_ITEM, {
7
+ operation({ action, currentOrder, options }) {
9
8
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
10
9
  existing.detail.fulfilled_quantity ??= 0;
11
10
  existing.detail.fulfilled_quantity = utils_1.MathBN.add(existing.detail.fulfilled_quantity, action.details.quantity);
12
- (0, set_action_reference_1.setActionReference)(existing, action);
11
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
13
12
  },
14
13
  revert({ action, currentOrder }) {
15
14
  const existing = currentOrder.items.find((item) => item.id === action.reference_id);
16
15
  existing.detail.fulfilled_quantity = utils_1.MathBN.sub(existing.detail.fulfilled_quantity, action.details.quantity);
16
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
17
17
  },
18
18
  validate({ action, currentOrder }) {
19
19
  const refId = action.details?.reference_id;
@@ -1 +1 @@
1
- {"version":3,"file":"fulfill-item.js","sourceRoot":"","sources":["../../../src/utils/actions/fulfill-item.ts"],"names":[],"mappings":";;AAAA,2CAAgE;AAChE,8CAAgD;AAChD,sEAAiE;AACjE,kEAA4D;AAE5D,8CAAqB,CAAC,kBAAkB,CAAC,6BAAgB,CAAC,YAAY,EAAE;IACtE,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAChC,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CACjD,CAAA;QAEF,QAAQ,CAAC,MAAM,CAAC,kBAAkB,KAAK,CAAC,CAAA;QAExC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,GAAG,cAAM,CAAC,GAAG,CAC7C,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAClC,MAAM,CAAC,OAAO,CAAC,QAAQ,CACxB,CAAA;QAED,IAAA,yCAAkB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IACtC,CAAC;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,YAAY,CACzC,CAAA;QAEF,QAAQ,CAAC,MAAM,CAAC,kBAAkB,GAAG,cAAM,CAAC,GAAG,CAC7C,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAClC,MAAM,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EAC9B,4DAA4D,KAAK,GAAG,CACrE,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -11,3 +11,4 @@ export * from "./ship-item";
11
11
  export * from "./shipping-add";
12
12
  export * from "./shipping-remove";
13
13
  export * from "./write-off-item";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=item-add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-add.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/item-add.ts"],"names":[],"mappings":""}
@@ -1,20 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
- const action_key_1 = require("../action-key");
5
4
  const calculate_order_change_1 = require("../calculate-order-change");
6
5
  const set_action_reference_1 = require("../set-action-reference");
7
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.ITEM_ADD, {
8
- operation({ action, currentOrder }) {
9
- const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
6
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.ITEM_ADD, {
7
+ operation({ action, currentOrder, options }) {
8
+ let existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
10
9
  if (existing) {
11
10
  existing.detail.quantity ??= 0;
12
11
  existing.quantity = utils_1.MathBN.add(existing.quantity, action.details.quantity);
13
12
  existing.detail.quantity = utils_1.MathBN.add(existing.detail.quantity, action.details.quantity);
14
- (0, set_action_reference_1.setActionReference)(existing, action);
15
13
  }
16
14
  else {
17
- currentOrder.items.push({
15
+ existing = {
18
16
  id: action.details.reference_id,
19
17
  order_id: currentOrder.id,
20
18
  return_id: action.details.return_id,
@@ -22,8 +20,10 @@ calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.C
22
20
  exchange_id: action.details.exchange_id,
23
21
  unit_price: action.details.unit_price,
24
22
  quantity: action.details.quantity,
25
- });
23
+ };
24
+ currentOrder.items.push(existing);
26
25
  }
26
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
27
27
  return utils_1.MathBN.mult(action.details.unit_price, action.details.quantity);
28
28
  },
29
29
  revert({ action, currentOrder }) {
@@ -35,6 +35,7 @@ calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.C
35
35
  if (utils_1.MathBN.lte(existing.quantity, 0)) {
36
36
  currentOrder.items.splice(existingIndex, 1);
37
37
  }
38
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
38
39
  }
39
40
  },
40
41
  validate({ action }) {
@@ -1 +1 @@
1
- {"version":3,"file":"item-add.js","sourceRoot":"","sources":["../../../src/utils/actions/item-add.ts"],"names":[],"mappings":";;AAAA,2CAAgE;AAEhE,8CAAgD;AAChD,sEAAiE;AACjE,kEAA4D;AAE5D,8CAAqB,CAAC,kBAAkB,CAAC,6BAAgB,CAAC,QAAQ,EAAE;IAClE,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAChC,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CAClD,CAAA;QAED,IAAI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IAAA,iBAAS,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAA,iBAAS,EAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,sBAAsB,KAAK,+CAA+C,CAC3E,CAAA;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,oBAAoB,KAAK,eAAe,CACzC,CAAA;QACH,CAAC;QAED,IAAI,cAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,oBAAoB,KAAK,0BAA0B,CACpD,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=item-remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-remove.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/item-remove.ts"],"names":[],"mappings":""}
@@ -1,18 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
- const action_key_1 = require("../action-key");
5
4
  const calculate_order_change_1 = require("../calculate-order-change");
6
5
  const set_action_reference_1 = require("../set-action-reference");
7
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.ITEM_REMOVE, {
6
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.ITEM_REMOVE, {
8
7
  isDeduction: true,
9
- operation({ action, currentOrder }) {
8
+ operation({ action, currentOrder, options }) {
10
9
  const existingIndex = currentOrder.items.findIndex((item) => item.id === action.details.reference_id);
11
10
  const existing = currentOrder.items[existingIndex];
12
11
  existing.detail.quantity ??= 0;
13
12
  existing.quantity = utils_1.MathBN.sub(existing.quantity, action.details.quantity);
14
13
  existing.detail.quantity = utils_1.MathBN.sub(existing.detail.quantity, action.details.quantity);
15
- (0, set_action_reference_1.setActionReference)(existing, action);
14
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
16
15
  if (utils_1.MathBN.lte(existing.quantity, 0)) {
17
16
  currentOrder.items.splice(existingIndex, 1);
18
17
  }
@@ -23,6 +22,7 @@ calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.C
23
22
  if (existing) {
24
23
  existing.quantity = utils_1.MathBN.add(existing.quantity, action.details.quantity);
25
24
  existing.detail.quantity = utils_1.MathBN.add(existing.detail.quantity, action.details.quantity);
25
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
26
26
  }
27
27
  else {
28
28
  currentOrder.items.push({
@@ -1 +1 @@
1
- {"version":3,"file":"item-remove.js","sourceRoot":"","sources":["../../../src/utils/actions/item-remove.ts"],"names":[],"mappings":";;AAAA,2CAAgE;AAEhE,8CAAgD;AAChD,sEAAiE;AACjE,kEAA4D;AAE5D,8CAAqB,CAAC,kBAAkB,CAAC,6BAAgB,CAAC,WAAW,EAAE;IACrE,WAAW,EAAE,IAAI;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAChC,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC,SAAS,CAChD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CAClD,CAAA;QAED,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAElD,QAAQ,CAAC,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAA;QAE9B,QAAQ,CAAC,QAAQ,GAAG,cAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,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,QAAQ,CAAC,QAAQ,EACjB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CACpC,CAAA;QAED,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;QACjE,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,sCAAsC,KAAK,GAAG,CAC/C,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=receive-damaged-return-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receive-damaged-return-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/receive-damaged-return-item.ts"],"names":[],"mappings":""}
@@ -2,20 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
4
  const _types_1 = require("../../types");
5
- const action_key_1 = require("../action-key");
6
5
  const calculate_order_change_1 = require("../calculate-order-change");
7
6
  const set_action_reference_1 = require("../set-action-reference");
8
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.RECEIVE_DAMAGED_RETURN_ITEM, {
7
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.RECEIVE_DAMAGED_RETURN_ITEM, {
9
8
  isDeduction: true,
10
9
  commitsAction: "return_item",
11
- operation({ action, currentOrder, previousEvents }) {
10
+ operation({ action, currentOrder, previousEvents, options }) {
12
11
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
13
12
  let toReturn = action.details.quantity;
14
13
  existing.detail.return_dismissed_quantity ??= 0;
15
14
  existing.detail.return_requested_quantity ??= 0;
16
15
  existing.detail.return_dismissed_quantity = utils_1.MathBN.add(existing.detail.return_dismissed_quantity, toReturn);
17
16
  existing.detail.return_requested_quantity = utils_1.MathBN.sub(existing.detail.return_requested_quantity, toReturn);
18
- (0, set_action_reference_1.setActionReference)(existing, action);
17
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
19
18
  if (previousEvents) {
20
19
  for (const previousEvent of previousEvents) {
21
20
  previousEvent.original_ = JSON.parse(JSON.stringify(previousEvent));
@@ -33,6 +32,7 @@ calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.C
33
32
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
34
33
  existing.detail.return_dismissed_quantity = utils_1.MathBN.sub(existing.detail.return_dismissed_quantity, action.details.quantity);
35
34
  existing.detail.return_requested_quantity = utils_1.MathBN.add(existing.detail.return_requested_quantity, action.details.quantity);
35
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
36
36
  if (previousEvents) {
37
37
  for (const previousEvent of previousEvents) {
38
38
  if (!previousEvent.original_) {
@@ -1 +1 @@
1
- {"version":3,"file":"receive-damaged-return-item.js","sourceRoot":"","sources":["../../../src/utils/actions/receive-damaged-return-item.ts"],"names":[],"mappings":";;AAAA,2CAAgE;AAChE,mCAAqC;AACrC,8CAAgD;AAChD,sEAAiE;AACjE,kEAA4D;AAE5D,8CAAqB,CAAC,kBAAkB,CACtC,6BAAgB,CAAC,2BAA2B,EAC5C;IACE,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE;QAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CACjD,CAAA;QAEF,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAA;QAEtC,QAAQ,CAAC,MAAM,CAAC,yBAAyB,KAAK,CAAC,CAAA;QAC/C,QAAQ,CAAC,MAAM,CAAC,yBAAyB,KAAK,CAAC,CAAA;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AC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,YAAY,KAAK,cAAc,CAChC,CAAA;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,8BAA8B,KAAK,eAAe,CACnD,CAAA;QACH,CAAC;QAED,MAAM,iBAAiB,GAAG,QAAQ,EAAE,MAAM,CAAC,yBAAyB,IAAI,CAAC,CAAA;QACzE,IAAI,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,iBAAiB,EAAE,CAAC;YACjD,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,6EAA6E,KAAK,GAAG,CACtF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CACF,CAAA"}
1
+ {"version":3,"file":"receive-damaged-return-item.js","sourceRoot":"","sources":["../../../src/utils/actions/receive-damaged-return-item.ts"],"names":[],"mappings":";;AAAA,2CAKwB;AACxB,mCAAqC;AACrC,sEAAiE;AACjE,kEAGgC;AAEhC,8CAAqB,CAAC,kBAAkB,CACtC,wBAAgB,CAAC,2BAA2B,EAC5C;IACE,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE;QACzD,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,CACjD,CAAA;QAEF,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAA;QAEtC,QAAQ,CAAC,MAAM,CAAC,yBAAyB,KAAK,CAAC,CAAA;QAC/C,QAAQ,CAAC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KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,CAAA;QAErE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,YAAY,KAAK,cAAc,CAChC,CAAA;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,8BAA8B,KAAK,eAAe,CACnD,CAAA;QACH,CAAC;QAED,MAAM,iBAAiB,GAAG,QAAQ,EAAE,MAAM,CAAC,yBAAyB,IAAI,CAAC,CAAA;QACzE,IAAI,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,iBAAiB,EAAE,CAAC;YACjD,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,6EAA6E,KAAK,GAAG,CACtF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CACF,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=receive-return-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receive-return-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/receive-return-item.ts"],"names":[],"mappings":""}
@@ -2,20 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
4
  const _types_1 = require("../../types");
5
- const action_key_1 = require("../action-key");
6
5
  const calculate_order_change_1 = require("../calculate-order-change");
7
6
  const set_action_reference_1 = require("../set-action-reference");
8
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.RECEIVE_RETURN_ITEM, {
7
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.RECEIVE_RETURN_ITEM, {
9
8
  isDeduction: true,
10
9
  commitsAction: "return_item",
11
- operation({ action, currentOrder, previousEvents }) {
10
+ operation({ action, currentOrder, previousEvents, options }) {
12
11
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
13
12
  let toReturn = action.details.quantity;
14
13
  existing.detail.return_received_quantity ??= 0;
15
14
  existing.detail.return_requested_quantity ??= 0;
16
15
  existing.detail.return_received_quantity = utils_1.MathBN.add(existing.detail.return_received_quantity, toReturn);
17
16
  existing.detail.return_requested_quantity = utils_1.MathBN.sub(existing.detail.return_requested_quantity, toReturn);
18
- (0, set_action_reference_1.setActionReference)(existing, action);
17
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
19
18
  if (previousEvents) {
20
19
  for (const previousEvent of previousEvents) {
21
20
  previousEvent.original_ = JSON.parse(JSON.stringify(previousEvent));
@@ -33,6 +32,7 @@ calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.C
33
32
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
34
33
  existing.detail.return_received_quantity = utils_1.MathBN.sub(existing.detail.return_received_quantity, action.details.quantity);
35
34
  existing.detail.return_requested_quantity = utils_1.MathBN.add(existing.detail.return_requested_quantity, action.details.quantity);
35
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
36
36
  if (previousEvents) {
37
37
  for (const previousEvent of previousEvents) {
38
38
  if (!previousEvent.original_) {
@@ -1 +1 @@
1
- {"version":3,"file":"receive-return-item.js","sourceRoot":"","sources":["../../../src/utils/actions/receive-return-item.ts"],"names":[],"mappings":";;AAAA,2CAKwB;AACxB,mCAAqC;AACrC,8CAAgD;AAChD,sEAAiE;AACjE,kEAA4D;AAE5D,8CAAqB,CAAC,kBAAkB,CAAC,6BAAgB,CAAC,mBAAmB,EAAE;IAC7E,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE;QAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,KA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,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=reinstate-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reinstate-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/reinstate-item.ts"],"names":[],"mappings":""}
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/utils");
4
- const action_key_1 = require("../action-key");
5
4
  const calculate_order_change_1 = require("../calculate-order-change");
6
5
  const set_action_reference_1 = require("../set-action-reference");
7
- calculate_order_change_1.OrderChangeProcessing.registerActionType(action_key_1.ChangeActionType.REINSTATE_ITEM, {
8
- operation({ action, currentOrder }) {
6
+ calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.REINSTATE_ITEM, {
7
+ operation({ action, currentOrder, options }) {
9
8
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
10
9
  existing.detail.written_off_quantity ??= 0;
11
10
  existing.detail.written_off_quantity = utils_1.MathBN.sub(existing.detail.written_off_quantity, action.details.quantity);
12
- (0, set_action_reference_1.setActionReference)(existing, action);
11
+ (0, set_action_reference_1.setActionReference)(existing, action, options);
13
12
  },
14
13
  revert({ action, currentOrder }) {
15
14
  const existing = currentOrder.items.find((item) => item.id === action.details.reference_id);
16
15
  existing.detail.written_off_quantity = utils_1.MathBN.add(existing.detail.written_off_quantity, action.details.quantity);
16
+ (0, set_action_reference_1.unsetActionReference)(existing, action);
17
17
  },
18
18
  validate({ action, currentOrder }) {
19
19
  const refId = action.details?.reference_id;
@@ -1 +1 @@
1
- {"version":3,"file":"reinstate-item.js","sourceRoot":"","sources":["../../../src/utils/actions/reinstate-item.ts"],"names":[],"mappings":";;AAAA,2CAAgE;AAChE,8CAAgD;AAChD,sEAAiE;AACjE,kEAA4D;AAE5D,8CAAqB,CAAC,kBAAkB,CAAC,6BAAg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,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,8BAA8B,KAAK,eAAe,CACnD,CAAA;QACH,CAAC;QAED,MAAM,iBAAiB,GAAG,QAAS,CAAC,QAAQ,IAAI,CAAC,CAAA;QACjD,MAAM,OAAO,GAAG,cAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAA;QACtE,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,kDAAkD,CACnD,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=return-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return-item.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/return-item.ts"],"names":[],"mappings":""}