@medusajs/order 0.1.3-snapshot-20240718083016 → 0.1.3-snapshot-20240719080828

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. package/dist/index.d.ts +6 -8
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +4 -26
  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/Migration20240219102530.js +38 -4
  8. package/dist/migrations/Migration20240219102530.js.map +1 -1
  9. package/dist/migrations/Migration20240604100512.d.ts +5 -0
  10. package/dist/migrations/Migration20240604100512.d.ts.map +1 -0
  11. package/dist/migrations/Migration20240604100512.js +364 -0
  12. package/dist/migrations/Migration20240604100512.js.map +1 -0
  13. package/dist/migrations/Migration20240715102100.d.ts +5 -0
  14. package/dist/migrations/Migration20240715102100.d.ts.map +1 -0
  15. package/dist/migrations/Migration20240715102100.js +15 -0
  16. package/dist/migrations/Migration20240715102100.js.map +1 -0
  17. package/dist/migrations/Migration20240715174100.d.ts +5 -0
  18. package/dist/migrations/Migration20240715174100.d.ts.map +1 -0
  19. package/dist/migrations/Migration20240715174100.js +21 -0
  20. package/dist/migrations/Migration20240715174100.js.map +1 -0
  21. package/dist/migrations/Migration20240716081800.d.ts +5 -0
  22. package/dist/migrations/Migration20240716081800.d.ts.map +1 -0
  23. package/dist/migrations/Migration20240716081800.js +67 -0
  24. package/dist/migrations/Migration20240716081800.js.map +1 -0
  25. package/dist/models/address.d.ts +2 -1
  26. package/dist/models/address.d.ts.map +1 -0
  27. package/dist/models/adjustment-line.d.ts +3 -1
  28. package/dist/models/adjustment-line.d.ts.map +1 -0
  29. package/dist/models/adjustment-line.js +5 -0
  30. package/dist/models/adjustment-line.js.map +1 -1
  31. package/dist/models/claim-item-image.d.ts +19 -0
  32. package/dist/models/claim-item-image.d.ts.map +1 -0
  33. package/dist/models/claim-item-image.js +109 -0
  34. package/dist/models/claim-item-image.js.map +1 -0
  35. package/dist/models/claim-item.d.ts +29 -0
  36. package/dist/models/claim-item.d.ts.map +1 -0
  37. package/dist/models/claim-item.js +156 -0
  38. package/dist/models/claim-item.js.map +1 -0
  39. package/dist/models/claim.d.ts +36 -0
  40. package/dist/models/claim.d.ts.map +1 -0
  41. package/dist/models/claim.js +195 -0
  42. package/dist/models/claim.js.map +1 -0
  43. package/dist/models/exchange-item.d.ts +24 -0
  44. package/dist/models/exchange-item.d.ts.map +1 -0
  45. package/dist/models/exchange-item.js +138 -0
  46. package/dist/models/exchange-item.js.map +1 -0
  47. package/dist/models/exchange.d.ts +34 -0
  48. package/dist/models/exchange.d.ts.map +1 -0
  49. package/dist/models/exchange.js +188 -0
  50. package/dist/models/exchange.js.map +1 -0
  51. package/dist/models/index.d.ts +9 -0
  52. package/dist/models/index.d.ts.map +1 -0
  53. package/dist/models/index.js +17 -1
  54. package/dist/models/index.js.map +1 -1
  55. package/dist/models/line-item-adjustment.d.ts +3 -1
  56. package/dist/models/line-item-adjustment.d.ts.map +1 -0
  57. package/dist/models/line-item-adjustment.js +3 -3
  58. package/dist/models/line-item-adjustment.js.map +1 -1
  59. package/dist/models/line-item-tax-line.d.ts +3 -1
  60. package/dist/models/line-item-tax-line.d.ts.map +1 -0
  61. package/dist/models/line-item-tax-line.js +3 -3
  62. package/dist/models/line-item-tax-line.js.map +1 -1
  63. package/dist/models/line-item.d.ts +3 -1
  64. package/dist/models/line-item.d.ts.map +1 -0
  65. package/dist/models/line-item.js +18 -4
  66. package/dist/models/line-item.js.map +1 -1
  67. package/dist/models/order-change-action.d.ts +15 -4
  68. package/dist/models/order-change-action.d.ts.map +1 -0
  69. package/dist/models/order-change-action.js +102 -7
  70. package/dist/models/order-change-action.js.map +1 -1
  71. package/dist/models/order-change.d.ts +17 -5
  72. package/dist/models/order-change.d.ts.map +1 -0
  73. package/dist/models/order-change.js +109 -4
  74. package/dist/models/order-change.js.map +1 -1
  75. package/dist/models/order-item.d.ts +5 -4
  76. package/dist/models/order-item.d.ts.map +1 -0
  77. package/dist/models/order-item.js +13 -13
  78. package/dist/models/order-item.js.map +1 -1
  79. package/dist/models/order-shipping-method.d.ts +14 -4
  80. package/dist/models/order-shipping-method.d.ts.map +1 -0
  81. package/dist/models/order-shipping-method.js +89 -13
  82. package/dist/models/order-shipping-method.js.map +1 -1
  83. package/dist/models/order-summary.d.ts +6 -7
  84. package/dist/models/order-summary.d.ts.map +1 -0
  85. package/dist/models/order-summary.js +9 -6
  86. package/dist/models/order-summary.js.map +1 -1
  87. package/dist/models/order.d.ts +6 -4
  88. package/dist/models/order.d.ts.map +1 -0
  89. package/dist/models/order.js +11 -1
  90. package/dist/models/order.js.map +1 -1
  91. package/dist/models/return-item.d.ts +29 -0
  92. package/dist/models/return-item.d.ts.map +1 -0
  93. package/dist/models/return-item.js +170 -0
  94. package/dist/models/return-item.js.map +1 -0
  95. package/dist/models/return-reason.d.ts +21 -0
  96. package/dist/models/return-reason.d.ts.map +1 -0
  97. package/dist/models/return-reason.js +120 -0
  98. package/dist/models/return-reason.js.map +1 -0
  99. package/dist/models/return.d.ts +39 -0
  100. package/dist/models/return.d.ts.map +1 -0
  101. package/dist/models/return.js +216 -0
  102. package/dist/models/return.js.map +1 -0
  103. package/dist/models/shipping-method-adjustment.d.ts +3 -1
  104. package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
  105. package/dist/models/shipping-method-adjustment.js +3 -3
  106. package/dist/models/shipping-method-adjustment.js.map +1 -1
  107. package/dist/models/shipping-method-tax-line.d.ts +3 -1
  108. package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
  109. package/dist/models/shipping-method-tax-line.js +3 -3
  110. package/dist/models/shipping-method-tax-line.js.map +1 -1
  111. package/dist/models/shipping-method.d.ts +2 -0
  112. package/dist/models/shipping-method.d.ts.map +1 -0
  113. package/dist/models/shipping-method.js +17 -4
  114. package/dist/models/shipping-method.js.map +1 -1
  115. package/dist/models/tax-line.d.ts +2 -0
  116. package/dist/models/tax-line.d.ts.map +1 -0
  117. package/dist/models/tax-line.js +7 -0
  118. package/dist/models/tax-line.js.map +1 -1
  119. package/dist/models/transaction.d.ts +15 -3
  120. package/dist/models/transaction.d.ts.map +1 -0
  121. package/dist/models/transaction.js +109 -4
  122. package/dist/models/transaction.js.map +1 -1
  123. package/dist/repositories/claim.d.ts +9 -0
  124. package/dist/repositories/claim.d.ts.map +1 -0
  125. package/dist/repositories/claim.js +11 -0
  126. package/dist/repositories/claim.js.map +1 -0
  127. package/dist/repositories/exchange.d.ts +9 -0
  128. package/dist/repositories/exchange.d.ts.map +1 -0
  129. package/dist/repositories/exchange.js +11 -0
  130. package/dist/repositories/exchange.js.map +1 -0
  131. package/dist/repositories/index.d.ts +4 -1
  132. package/dist/repositories/index.d.ts.map +1 -0
  133. package/dist/repositories/index.js +7 -16
  134. package/dist/repositories/index.js.map +1 -1
  135. package/dist/repositories/order.d.ts +1 -3
  136. package/dist/repositories/order.d.ts.map +1 -0
  137. package/dist/repositories/order.js +2 -85
  138. package/dist/repositories/order.js.map +1 -1
  139. package/dist/repositories/return.d.ts +9 -0
  140. package/dist/repositories/return.d.ts.map +1 -0
  141. package/dist/repositories/return.js +11 -0
  142. package/dist/repositories/return.js.map +1 -0
  143. package/dist/services/actions/cancel-claim.d.ts +3 -0
  144. package/dist/services/actions/cancel-claim.d.ts.map +1 -0
  145. package/dist/services/actions/cancel-claim.js +107 -0
  146. package/dist/services/actions/cancel-claim.js.map +1 -0
  147. package/dist/services/actions/cancel-exchange.d.ts +3 -0
  148. package/dist/services/actions/cancel-exchange.d.ts.map +1 -0
  149. package/dist/services/actions/cancel-exchange.js +92 -0
  150. package/dist/services/actions/cancel-exchange.js.map +1 -0
  151. package/dist/services/actions/cancel-fulfillment.d.ts +3 -0
  152. package/dist/services/actions/cancel-fulfillment.d.ts.map +1 -0
  153. package/dist/services/actions/cancel-fulfillment.js +32 -0
  154. package/dist/services/actions/cancel-fulfillment.js.map +1 -0
  155. package/dist/services/actions/cancel-return.d.ts +3 -0
  156. package/dist/services/actions/cancel-return.d.ts.map +1 -0
  157. package/dist/services/actions/cancel-return.js +72 -0
  158. package/dist/services/actions/cancel-return.js.map +1 -0
  159. package/dist/services/actions/create-claim.d.ts +3 -0
  160. package/dist/services/actions/create-claim.d.ts.map +1 -0
  161. package/dist/services/actions/create-claim.js +228 -0
  162. package/dist/services/actions/create-claim.js.map +1 -0
  163. package/dist/services/actions/create-exchange.d.ts +3 -0
  164. package/dist/services/actions/create-exchange.d.ts.map +1 -0
  165. package/dist/services/actions/create-exchange.js +193 -0
  166. package/dist/services/actions/create-exchange.js.map +1 -0
  167. package/dist/services/actions/create-return.d.ts +3 -0
  168. package/dist/services/actions/create-return.d.ts.map +1 -0
  169. package/dist/services/actions/create-return.js +102 -0
  170. package/dist/services/actions/create-return.js.map +1 -0
  171. package/dist/services/actions/index.d.ts +11 -0
  172. package/dist/services/actions/index.d.ts.map +1 -0
  173. package/dist/services/actions/index.js +27 -0
  174. package/dist/services/actions/index.js.map +1 -0
  175. package/dist/services/actions/receive-return.d.ts +3 -0
  176. package/dist/services/actions/receive-return.d.ts.map +1 -0
  177. package/dist/services/actions/receive-return.js +72 -0
  178. package/dist/services/actions/receive-return.js.map +1 -0
  179. package/dist/services/actions/register-fulfillment.d.ts +3 -0
  180. package/dist/services/actions/register-fulfillment.d.ts.map +1 -0
  181. package/dist/services/actions/register-fulfillment.js +30 -0
  182. package/dist/services/actions/register-fulfillment.js.map +1 -0
  183. package/dist/services/actions/register-shipment.d.ts +3 -0
  184. package/dist/services/actions/register-shipment.d.ts.map +1 -0
  185. package/dist/services/actions/register-shipment.js +38 -0
  186. package/dist/services/actions/register-shipment.js.map +1 -0
  187. package/dist/services/index.d.ts +1 -1
  188. package/dist/services/index.d.ts.map +1 -0
  189. package/dist/services/index.js +1 -3
  190. package/dist/services/index.js.map +1 -1
  191. package/dist/services/order-module-service.d.ts +138 -67
  192. package/dist/services/order-module-service.d.ts.map +1 -0
  193. package/dist/services/order-module-service.js +992 -240
  194. package/dist/services/order-module-service.js.map +1 -1
  195. package/dist/services/order-service.d.ts +5 -4
  196. package/dist/services/order-service.d.ts.map +1 -0
  197. package/dist/services/order-service.js +1 -1
  198. package/dist/services/order-service.js.map +1 -1
  199. package/dist/types/address.d.ts +1 -0
  200. package/dist/types/address.d.ts.map +1 -0
  201. package/dist/types/index.d.ts +3 -1
  202. package/dist/types/index.d.ts.map +1 -0
  203. package/dist/types/index.js +1 -0
  204. package/dist/types/index.js.map +1 -1
  205. package/dist/types/line-item-adjustment.d.ts +1 -0
  206. package/dist/types/line-item-adjustment.d.ts.map +1 -0
  207. package/dist/types/line-item-tax-line.d.ts +1 -0
  208. package/dist/types/line-item-tax-line.d.ts.map +1 -0
  209. package/dist/types/line-item.d.ts +1 -0
  210. package/dist/types/line-item.d.ts.map +1 -0
  211. package/dist/types/order-change.d.ts +6 -0
  212. package/dist/types/order-change.d.ts.map +1 -0
  213. package/dist/types/order-change.js +3 -0
  214. package/dist/types/order-change.js.map +1 -0
  215. package/dist/types/order-detail.d.ts +2 -1
  216. package/dist/types/order-detail.d.ts.map +1 -0
  217. package/dist/types/order.d.ts +3 -2
  218. package/dist/types/order.d.ts.map +1 -0
  219. package/dist/types/shipping-method-adjustment.d.ts +1 -0
  220. package/dist/types/shipping-method-adjustment.d.ts.map +1 -0
  221. package/dist/types/shipping-method-tax-line.d.ts +1 -0
  222. package/dist/types/shipping-method-tax-line.d.ts.map +1 -0
  223. package/dist/types/shipping-method.d.ts +4 -0
  224. package/dist/types/shipping-method.d.ts.map +1 -0
  225. package/dist/types/tax-line.d.ts +1 -0
  226. package/dist/types/tax-line.d.ts.map +1 -0
  227. package/dist/types/transaction.d.ts +1 -0
  228. package/dist/types/transaction.d.ts.map +1 -0
  229. package/dist/types/utils/index.d.ts +40 -21
  230. package/dist/types/utils/index.d.ts.map +1 -0
  231. package/dist/types/utils/index.js +0 -1
  232. package/dist/types/utils/index.js.map +1 -1
  233. package/dist/utils/actions/cancel-item-fulfillment.d.ts +2 -0
  234. package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +1 -0
  235. package/dist/utils/actions/cancel-item-fulfillment.js +34 -0
  236. package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -0
  237. package/dist/utils/actions/cancel-return.d.ts +1 -0
  238. package/dist/utils/actions/cancel-return.d.ts.map +1 -0
  239. package/dist/utils/actions/cancel-return.js +6 -10
  240. package/dist/utils/actions/cancel-return.js.map +1 -1
  241. package/dist/utils/actions/fulfill-item.d.ts +1 -0
  242. package/dist/utils/actions/fulfill-item.d.ts.map +1 -0
  243. package/dist/utils/actions/fulfill-item.js +6 -10
  244. package/dist/utils/actions/fulfill-item.js.map +1 -1
  245. package/dist/utils/actions/index.d.ts +4 -1
  246. package/dist/utils/actions/index.d.ts.map +1 -0
  247. package/dist/utils/actions/index.js +3 -1
  248. package/dist/utils/actions/index.js.map +1 -1
  249. package/dist/utils/actions/item-add.d.ts +1 -0
  250. package/dist/utils/actions/item-add.d.ts.map +1 -0
  251. package/dist/utils/actions/item-add.js +15 -24
  252. package/dist/utils/actions/item-add.js.map +1 -1
  253. package/dist/utils/actions/item-remove.d.ts +1 -0
  254. package/dist/utils/actions/item-remove.d.ts.map +1 -0
  255. package/dist/utils/actions/item-remove.js +8 -22
  256. package/dist/utils/actions/item-remove.js.map +1 -1
  257. package/dist/utils/actions/receive-damaged-return-item.d.ts +1 -0
  258. package/dist/utils/actions/receive-damaged-return-item.d.ts.map +1 -0
  259. package/dist/utils/actions/receive-damaged-return-item.js +9 -35
  260. package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
  261. package/dist/utils/actions/receive-return-item.d.ts +1 -0
  262. package/dist/utils/actions/receive-return-item.d.ts.map +1 -0
  263. package/dist/utils/actions/receive-return-item.js +7 -36
  264. package/dist/utils/actions/receive-return-item.js.map +1 -1
  265. package/dist/utils/actions/reinstate-item.d.ts +2 -0
  266. package/dist/utils/actions/reinstate-item.d.ts.map +1 -0
  267. package/dist/utils/actions/reinstate-item.js +32 -0
  268. package/dist/utils/actions/reinstate-item.js.map +1 -0
  269. package/dist/utils/actions/return-item.d.ts +1 -0
  270. package/dist/utils/actions/return-item.d.ts.map +1 -0
  271. package/dist/utils/actions/return-item.js +8 -12
  272. package/dist/utils/actions/return-item.js.map +1 -1
  273. package/dist/utils/actions/ship-item.d.ts +1 -0
  274. package/dist/utils/actions/ship-item.d.ts.map +1 -0
  275. package/dist/utils/actions/ship-item.js +6 -10
  276. package/dist/utils/actions/ship-item.js.map +1 -1
  277. package/dist/utils/actions/shipping-add.d.ts +1 -0
  278. package/dist/utils/actions/shipping-add.d.ts.map +1 -0
  279. package/dist/utils/actions/shipping-add.js +16 -16
  280. package/dist/utils/actions/shipping-add.js.map +1 -1
  281. package/dist/utils/actions/shipping-remove.d.ts +2 -0
  282. package/dist/utils/actions/shipping-remove.d.ts.map +1 -0
  283. package/dist/utils/actions/shipping-remove.js +25 -0
  284. package/dist/utils/actions/shipping-remove.js.map +1 -0
  285. package/dist/utils/actions/write-off-item.d.ts +1 -0
  286. package/dist/utils/actions/write-off-item.d.ts.map +1 -0
  287. package/dist/utils/actions/write-off-item.js +6 -10
  288. package/dist/utils/actions/write-off-item.js.map +1 -1
  289. package/dist/utils/apply-order-changes.d.ts +18 -0
  290. package/dist/utils/apply-order-changes.d.ts.map +1 -0
  291. package/dist/utils/apply-order-changes.js +95 -0
  292. package/dist/utils/apply-order-changes.js.map +1 -0
  293. package/dist/utils/base-repository-find.d.ts +3 -0
  294. package/dist/utils/base-repository-find.d.ts.map +1 -0
  295. package/dist/utils/base-repository-find.js +142 -0
  296. package/dist/utils/base-repository-find.js.map +1 -0
  297. package/dist/utils/calculate-order-change.d.ts +11 -5
  298. package/dist/utils/calculate-order-change.d.ts.map +1 -0
  299. package/dist/utils/calculate-order-change.js +57 -182
  300. package/dist/utils/calculate-order-change.js.map +1 -1
  301. package/dist/utils/index.d.ts +4 -1
  302. package/dist/utils/index.d.ts.map +1 -0
  303. package/dist/utils/index.js +3 -1
  304. package/dist/utils/index.js.map +1 -1
  305. package/dist/utils/set-action-reference.d.ts +2 -0
  306. package/dist/utils/set-action-reference.d.ts.map +1 -0
  307. package/dist/utils/set-action-reference.js +11 -0
  308. package/dist/utils/set-action-reference.js.map +1 -0
  309. package/dist/utils/transform-order.d.ts +4 -2
  310. package/dist/utils/transform-order.d.ts.map +1 -0
  311. package/dist/utils/transform-order.js +131 -17
  312. package/dist/utils/transform-order.js.map +1 -1
  313. package/package.json +8 -14
  314. package/dist/joiner-config.d.ts +0 -5
  315. package/dist/joiner-config.js +0 -36
  316. package/dist/joiner-config.js.map +0 -1
  317. package/dist/module-definition.d.ts +0 -2
  318. package/dist/module-definition.js +0 -59
  319. package/dist/module-definition.js.map +0 -1
  320. package/dist/scripts/bin/run-seed.d.ts +0 -3
  321. package/dist/scripts/bin/run-seed.js +0 -49
  322. package/dist/scripts/bin/run-seed.js.map +0 -1
  323. package/dist/services/order-change-service.d.ts +0 -15
  324. package/dist/services/order-change-service.js +0 -96
  325. package/dist/services/order-change-service.js.map +0 -1
  326. package/dist/utils/action-key.d.ts +0 -13
  327. package/dist/utils/action-key.js +0 -18
  328. package/dist/utils/action-key.js.map +0 -1
  329. package/dist/utils/actions/cancel.d.ts +0 -1
  330. package/dist/utils/actions/cancel.js +0 -8
  331. package/dist/utils/actions/cancel.js.map +0 -1
@@ -3,9 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Transaction = exports.ShippingMethodTaxLine = exports.ShippingMethodAdjustment = exports.ShippingMethod = exports.OrderSummary = exports.OrderShippingMethod = exports.OrderItem = exports.OrderChangeAction = exports.OrderChange = exports.Order = exports.LineItemTaxLine = exports.LineItemAdjustment = exports.LineItem = exports.Address = void 0;
6
+ exports.Transaction = exports.ShippingMethodTaxLine = exports.ShippingMethodAdjustment = exports.ShippingMethod = exports.ReturnReason = exports.ReturnItem = exports.Return = exports.OrderSummary = exports.OrderShippingMethod = exports.OrderItem = exports.OrderChangeAction = exports.OrderChange = exports.Order = exports.LineItemTaxLine = exports.LineItemAdjustment = exports.LineItem = exports.ExchangeItem = exports.OrderExchange = exports.ClaimItemImage = exports.ClaimItem = exports.OrderClaim = exports.Address = void 0;
7
7
  var address_1 = require("./address");
8
8
  Object.defineProperty(exports, "Address", { enumerable: true, get: function () { return __importDefault(address_1).default; } });
9
+ var claim_1 = require("./claim");
10
+ Object.defineProperty(exports, "OrderClaim", { enumerable: true, get: function () { return __importDefault(claim_1).default; } });
11
+ var claim_item_1 = require("./claim-item");
12
+ Object.defineProperty(exports, "ClaimItem", { enumerable: true, get: function () { return __importDefault(claim_item_1).default; } });
13
+ var claim_item_image_1 = require("./claim-item-image");
14
+ Object.defineProperty(exports, "ClaimItemImage", { enumerable: true, get: function () { return __importDefault(claim_item_image_1).default; } });
15
+ var exchange_1 = require("./exchange");
16
+ Object.defineProperty(exports, "OrderExchange", { enumerable: true, get: function () { return __importDefault(exchange_1).default; } });
17
+ var exchange_item_1 = require("./exchange-item");
18
+ Object.defineProperty(exports, "ExchangeItem", { enumerable: true, get: function () { return __importDefault(exchange_item_1).default; } });
9
19
  var line_item_1 = require("./line-item");
10
20
  Object.defineProperty(exports, "LineItem", { enumerable: true, get: function () { return __importDefault(line_item_1).default; } });
11
21
  var line_item_adjustment_1 = require("./line-item-adjustment");
@@ -24,6 +34,12 @@ var order_shipping_method_1 = require("./order-shipping-method");
24
34
  Object.defineProperty(exports, "OrderShippingMethod", { enumerable: true, get: function () { return __importDefault(order_shipping_method_1).default; } });
25
35
  var order_summary_1 = require("./order-summary");
26
36
  Object.defineProperty(exports, "OrderSummary", { enumerable: true, get: function () { return __importDefault(order_summary_1).default; } });
37
+ var return_1 = require("./return");
38
+ Object.defineProperty(exports, "Return", { enumerable: true, get: function () { return __importDefault(return_1).default; } });
39
+ var return_item_1 = require("./return-item");
40
+ Object.defineProperty(exports, "ReturnItem", { enumerable: true, get: function () { return __importDefault(return_item_1).default; } });
41
+ var return_reason_1 = require("./return-reason");
42
+ Object.defineProperty(exports, "ReturnReason", { enumerable: true, get: function () { return __importDefault(return_reason_1).default; } });
27
43
  var shipping_method_1 = require("./shipping-method");
28
44
  Object.defineProperty(exports, "ShippingMethod", { enumerable: true, get: function () { return __importDefault(shipping_method_1).default; } });
29
45
  var shipping_method_adjustment_1 = require("./shipping-method-adjustment");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,qCAA8C;AAArC,mHAAA,OAAO,OAAW;AAC3B,yCAAiD;AAAxC,sHAAA,OAAO,OAAY;AAC5B,+DAAsE;AAA7D,2IAAA,OAAO,OAAsB;AACtC,2DAAiE;AAAxD,sIAAA,OAAO,OAAmB;AACnC,iCAA0C;AAAjC,+GAAA,OAAO,OAAS;AACzB,+CAAuD;AAA9C,4HAAA,OAAO,OAAe;AAC/B,6DAAoE;AAA3D,yIAAA,OAAO,OAAqB;AACrC,2CAAmD;AAA1C,wHAAA,OAAO,OAAa;AAC7B,iEAAwE;AAA/D,6IAAA,OAAO,OAAuB;AACvC,iDAAyD;AAAhD,8HAAA,OAAO,OAAgB;AAChC,qDAA6D;AAApD,kIAAA,OAAO,OAAkB;AAClC,2EAAkF;AAAzE,uJAAA,OAAO,OAA4B;AAC5C,uEAA6E;AAApE,kJAAA,OAAO,OAAyB;AACzC,6CAAsD;AAA7C,2HAAA,OAAO,OAAe"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,qCAA8C;AAArC,mHAAA,OAAO,OAAW;AAC3B,iCAA+C;AAAtC,oHAAA,OAAO,OAAc;AAC9B,2CAAmD;AAA1C,wHAAA,OAAO,OAAa;AAC7B,uDAA8D;AAArD,mIAAA,OAAO,OAAkB;AAClC,uCAAqD;AAA5C,0HAAA,OAAO,OAAiB;AACjC,iDAAyD;AAAhD,8HAAA,OAAO,OAAgB;AAChC,yCAAiD;AAAxC,sHAAA,OAAO,OAAY;AAC5B,+DAAsE;AAA7D,2IAAA,OAAO,OAAsB;AACtC,2DAAiE;AAAxD,sIAAA,OAAO,OAAmB;AACnC,iCAA0C;AAAjC,+GAAA,OAAO,OAAS;AACzB,+CAAuD;AAA9C,4HAAA,OAAO,OAAe;AAC/B,6DAAoE;AAA3D,yIAAA,OAAO,OAAqB;AACrC,2CAAmD;AAA1C,wHAAA,OAAO,OAAa;AAC7B,iEAAwE;AAA/D,6IAAA,OAAO,OAAuB;AACvC,iDAAyD;AAAhD,8HAAA,OAAO,OAAgB;AAChC,mCAA4C;AAAnC,iHAAA,OAAO,OAAU;AAC1B,6CAAqD;AAA5C,0HAAA,OAAO,OAAc;AAC9B,iDAAyD;AAAhD,8HAAA,OAAO,OAAgB;AAChC,qDAA6D;AAApD,kIAAA,OAAO,OAAkB;AAClC,2EAAkF;AAAzE,uJAAA,OAAO,OAA4B;AAC5C,uEAA6E;AAApE,kJAAA,OAAO,OAAyB;AACzC,6CAAsD;AAA7C,2HAAA,OAAO,OAAe"}
@@ -1,8 +1,10 @@
1
+ import { Rel } from "@mikro-orm/core";
1
2
  import AdjustmentLine from "./adjustment-line";
2
3
  import LineItem from "./line-item";
3
4
  export default class LineItemAdjustment extends AdjustmentLine {
4
- item: LineItem;
5
+ item: Rel<LineItem>;
5
6
  item_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
8
9
  }
10
+ //# sourceMappingURL=line-item-adjustment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-item-adjustment.d.ts","sourceRoot":"","sources":["../../src/models/line-item-adjustment.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,QAAQ,MAAM,aAAa,CAAA;AAQlC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,cAAc;IAI5D,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IAUnB,OAAO,EAAE,MAAM,CAAA;IAGf,QAAQ;IAMR,MAAM;CAIP"}
@@ -23,18 +23,18 @@ const ItemIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
23
  let LineItemAdjustment = class LineItemAdjustment extends adjustment_line_1.default {
24
24
  onCreate() {
25
25
  this.id = (0, utils_1.generateEntityId)(this.id, "ordliadj");
26
- this.item_id ?? (this.item_id = this.item?.id);
26
+ this.item_id ??= this.item?.id;
27
27
  }
28
28
  onInit() {
29
29
  this.id = (0, utils_1.generateEntityId)(this.id, "ordliadj");
30
- this.item_id ?? (this.item_id = this.item?.id);
30
+ this.item_id ??= this.item?.id;
31
31
  }
32
32
  };
33
33
  __decorate([
34
34
  (0, core_1.ManyToOne)(() => line_item_1.default, {
35
35
  persist: false,
36
36
  }),
37
- __metadata("design:type", line_item_1.default)
37
+ __metadata("design:type", Object)
38
38
  ], LineItemAdjustment.prototype, "item", void 0);
39
39
  __decorate([
40
40
  (0, core_1.ManyToOne)({
@@ -1 +1 @@
1
- {"version":3,"file":"line-item-adjustment.js","sourceRoot":"","sources":["../../src/models/line-item-adjustment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,0CAAyE;AACzE,wEAA8C;AAC9C,4DAAkC;AAElC,MAAM,WAAW,GAAG,IAAA,sCAA8B,EAAC;IACjD,SAAS,EAAE,4BAA4B;IACvC,OAAO,EAAE,SAAS;CACnB,CAAC,CAAA;AAGa,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,yBAAc;IAiB5D,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,CAAC,IAAI,EAAE,EAAE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AC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;CACF,CAAA;AAvBC;IAHC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,mBAAQ,EAAE;QACzB,OAAO,EAAE,KAAK;KACf,CAAC;;gDACiB;AAUnB;IARC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,mBAAQ;QACtB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,SAAS;QACpB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,IAAI;KACd,CAAC;IACD,WAAW,CAAC,aAAa,EAAE;;mDACb;AAGf;IADC,IAAA,mBAAY,GAAE;;;;kDAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;gDAIR;AA1BkB,kBAAkB;IADtC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAC;GAC/B,kBAAkB,CA2BtC;kBA3BoB,kBAAkB"}
@@ -1,8 +1,10 @@
1
+ import { Rel } from "@mikro-orm/core";
1
2
  import LineItem from "./line-item";
2
3
  import TaxLine from "./tax-line";
3
4
  export default class LineItemTaxLine extends TaxLine {
4
- item: LineItem;
5
+ item: Rel<LineItem>;
5
6
  item_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
8
9
  }
10
+ //# sourceMappingURL=line-item-tax-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-item-tax-line.d.ts","sourceRoot":"","sources":["../../src/models/line-item-tax-line.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,OAAO,MAAM,YAAY,CAAA;AAQhC,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAKlD,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IAUnB,OAAO,EAAE,MAAM,CAAA;IAGf,QAAQ;IAMR,MAAM;CAIP"}
@@ -23,11 +23,11 @@ const ItemIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
23
  let LineItemTaxLine = class LineItemTaxLine extends tax_line_1.default {
24
24
  onCreate() {
25
25
  this.id = (0, utils_1.generateEntityId)(this.id, "ordlitxl");
26
- this.item_id ?? (this.item_id = this.item?.id);
26
+ this.item_id ??= this.item?.id;
27
27
  }
28
28
  onInit() {
29
29
  this.id = (0, utils_1.generateEntityId)(this.id, "ordlitxl");
30
- this.item_id ?? (this.item_id = this.item?.id);
30
+ this.item_id ??= this.item?.id;
31
31
  }
32
32
  };
33
33
  __decorate([
@@ -35,7 +35,7 @@ __decorate([
35
35
  fieldName: "item_id",
36
36
  persist: false,
37
37
  }),
38
- __metadata("design:type", line_item_1.default)
38
+ __metadata("design:type", Object)
39
39
  ], LineItemTaxLine.prototype, "item", void 0);
40
40
  __decorate([
41
41
  (0, core_1.ManyToOne)({
@@ -1 +1 @@
1
- {"version":3,"file":"line-item-tax-line.js","sourceRoot":"","sources":["../../src/models/line-item-tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,0CAMwB;AACxB,4DAAkC;AAClC,0DAAgC;AAEhC,MAAM,WAAW,GAAG,IAAA,sCAA8B,EAAC;IACjD,SAAS,EAAE,0BAA0B;IACrC,OAAO,EAAE,SAAS;CACnB,CAAC,CAAA;AAGa,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,kBAAO;IAkBlD,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KA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D,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAA;IAChC,CAAC;CACF,CAAA;AAvBC;IAJC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,mBAAQ,EAAE;QACzB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,KAAK;KACf,CAAC;;6CACiB;AAUnB;IARC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,mBAAQ;QACtB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,CAAC,cAAO,CAAC,OAAO,EAAE,cAAO,CAAC,MAAM,CAAC;QAC1C,OAAO,EAAE,IAAI;KACd,CAAC;IACD,WAAW,CAAC,aAAa,EAAE;;gDACb;AAGf;IADC,IAAA,mBAAY,GAAE;;;;+CAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;6CAIR;AA3BkB,eAAe;IADnC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC;GAC7B,eAAe,CA4BnC;kBA5BoB,eAAe"}
@@ -3,7 +3,7 @@ import { BigNumber } from "@medusajs/utils";
3
3
  import { Collection, OptionalProps } from "@mikro-orm/core";
4
4
  import LineItemAdjustment from "./line-item-adjustment";
5
5
  import LineItemTaxLine from "./line-item-tax-line";
6
- type OptionalLineItemProps = "is_discoutable" | "is_tax_inclusive" | "compare_at_unit_price" | "requires_shipping" | DAL.EntityDateColumns;
6
+ type OptionalLineItemProps = DAL.ModelDateColumns;
7
7
  export default class LineItem {
8
8
  [OptionalProps]?: OptionalLineItemProps;
9
9
  id: string;
@@ -34,7 +34,9 @@ export default class LineItem {
34
34
  metadata: Record<string, unknown> | null;
35
35
  created_at: Date;
36
36
  updated_at: Date;
37
+ deleted_at: Date | null;
37
38
  onCreate(): void;
38
39
  onInit(): void;
39
40
  }
40
41
  export {};
42
+ //# sourceMappingURL=line-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-item.d.ts","sourceRoot":"","sources":["../../src/models/line-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EACL,SAAS,EAKV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,UAAU,EAKV,aAAa,EAId,MAAM,iBAAiB,CAAA;AACxB,OAAO,kBAAkB,MAAM,wBAAwB,CAAA;AACvD,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAElD,KAAK,qBAAqB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AAsBjD,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,CAAC,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAA;IAGvC,EAAE,EAAE,MAAM,CAAA;IAGV,KAAK,EAAE,MAAM,CAAA;IAGb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAO;IAG9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAO/B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAO;IAOhC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAO;IAGhC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAO;IAGnC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAO;IAGzC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAO;IAGtC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAO;IAGlC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAO;IAGxC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAO;IAGpC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAO;IAGjC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAO;IAGrC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAO;IAGnC,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAG5D,iBAAiB,EAAE,OAAO,CAAO;IAGjC,eAAe,EAAE,OAAO,CAAO;IAG/B,gBAAgB,EAAE,OAAO,CAAQ;IAKjC,qBAAqB,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAAO;IAGxD,yBAAyB,EAAE,iBAAiB,GAAG,IAAI,CAAO;IAK1D,UAAU,EAAE,SAAS,GAAG,MAAM,CAAA;IAG9B,cAAc,EAAE,iBAAiB,CAAA;IAKjC,SAAS,sCAA6C;IAKtD,WAAW,yCAAgD;IAG3D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAO/C,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAKR,MAAM;CAGP"}
@@ -16,13 +16,20 @@ const utils_1 = require("@medusajs/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
17
  const line_item_adjustment_1 = __importDefault(require("./line-item-adjustment"));
18
18
  const line_item_tax_line_1 = __importDefault(require("./line-item-tax-line"));
19
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
+ tableName: "order_line_item",
21
+ columns: "deleted_at",
22
+ where: "deleted_at IS NOT NULL",
23
+ });
19
24
  const ProductIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
25
  tableName: "order_line_item",
21
26
  columns: "product_id",
27
+ where: "deleted_at IS NOT NULL",
22
28
  });
23
29
  const VariantIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
24
30
  tableName: "order_line_item",
25
31
  columns: "variant_id",
32
+ where: "deleted_at IS NOT NULL",
26
33
  });
27
34
  let LineItem = class LineItem {
28
35
  constructor() {
@@ -48,6 +55,7 @@ let LineItem = class LineItem {
48
55
  this.tax_lines = new core_1.Collection(this);
49
56
  this.adjustments = new core_1.Collection(this);
50
57
  this.metadata = null;
58
+ this.deleted_at = null;
51
59
  }
52
60
  onCreate() {
53
61
  this.id = (0, utils_1.generateEntityId)(this.id, "ordli");
@@ -130,15 +138,15 @@ __decorate([
130
138
  ], LineItem.prototype, "variant_option_values", void 0);
131
139
  __decorate([
132
140
  (0, core_1.Property)({ columnType: "boolean" }),
133
- __metadata("design:type", Object)
141
+ __metadata("design:type", Boolean)
134
142
  ], LineItem.prototype, "requires_shipping", void 0);
135
143
  __decorate([
136
144
  (0, core_1.Property)({ columnType: "boolean" }),
137
- __metadata("design:type", Object)
145
+ __metadata("design:type", Boolean)
138
146
  ], LineItem.prototype, "is_discountable", void 0);
139
147
  __decorate([
140
148
  (0, core_1.Property)({ columnType: "boolean" }),
141
- __metadata("design:type", Object)
149
+ __metadata("design:type", Boolean)
142
150
  ], LineItem.prototype, "is_tax_inclusive", void 0);
143
151
  __decorate([
144
152
  (0, utils_1.MikroOrmBigNumberProperty)({
@@ -193,6 +201,11 @@ __decorate([
193
201
  }),
194
202
  __metadata("design:type", Date)
195
203
  ], LineItem.prototype, "updated_at", void 0);
204
+ __decorate([
205
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
206
+ DeletedAtIndex.MikroORMIndex(),
207
+ __metadata("design:type", Object)
208
+ ], LineItem.prototype, "deleted_at", void 0);
196
209
  __decorate([
197
210
  (0, core_1.BeforeCreate)(),
198
211
  __metadata("design:type", Function),
@@ -206,7 +219,8 @@ __decorate([
206
219
  __metadata("design:returntype", void 0)
207
220
  ], LineItem.prototype, "onInit", null);
208
221
  LineItem = __decorate([
209
- (0, core_1.Entity)({ tableName: "order_line_item" })
222
+ (0, core_1.Entity)({ tableName: "order_line_item" }),
223
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
210
224
  ], LineItem);
211
225
  exports.default = LineItem;
212
226
  //# sourceMappingURL=line-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-item.js","sourceRoot":"","sources":["../../src/models/line-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CAUwB;AACxB,kFAAuD;AACvD,8EAAkD;AASlD,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,iBAAiB;IAC5B,OAAO,EAAE,YAAY;CACtB,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,iBAAiB;IAC5B,OAAO,EAAE,YAAY;CACtB,CAAC,CAAA;AAGa,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAAd;QAUb,aAAQ,GAAkB,IAAI,CAAA;QAG9B,cAAS,GAAkB,IAAI,CAAA;QAO/B,eAAU,GAAkB,IAAI,CAAA;QAOhC,eAAU,GAAkB,IAAI,CAAA;QAGhC,kBAAa,GAAkB,IAAI,CAAA;QAGnC,wBAAmB,GAAkB,IAAI,CAAA;QAGzC,qBAAgB,GAAkB,IAAI,CAAA;QAGtC,iBAAY,GAAkB,IAAI,CAAA;QAGlC,uBAAkB,GAAkB,IAAI,CAAA;QAGxC,mBAAc,GAAkB,IAAI,CAAA;QAGpC,gBAAW,GAAkB,IAAI,CAAA;QAGjC,oBAAe,GAAkB,IAAI,CAAA;QAGrC,kBAAa,GAAkB,IAAI,CAAA;QAGnC,0BAAqB,GAAmC,IAAI,CAAA;QAG5D,sBAAiB,GAAG,IAAI,CAAA;QAGxB,oBAAe,GAAG,IAAI,CAAA;QAGtB,qBAAgB,GAAG,KAAK,CAAA;QAKxB,0BAAqB,GAA+B,IAAI,CAAA;QAGxD,8BAAyB,GAA6B,IAAI,CAAA;QAa1D,cAAS,GAAG,IAAI,iBA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A,aAAM,EAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IACxC,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;GAC/B,QAAQ,CA6H5B;kBA7HoB,QAAQ"}
@@ -1,18 +1,27 @@
1
1
  import { BigNumberRawValue, DAL } from "@medusajs/types";
2
2
  import { BigNumber } from "@medusajs/utils";
3
- import { OptionalProps } from "@mikro-orm/core";
3
+ import { OptionalProps, Rel } from "@mikro-orm/core";
4
+ import OrderClaim from "./claim";
5
+ import OrderExchange from "./exchange";
4
6
  import Order from "./order";
5
7
  import OrderChange from "./order-change";
6
- type OptionalLineItemProps = DAL.EntityDateColumns;
8
+ import Return from "./return";
9
+ type OptionalLineItemProps = DAL.ModelDateColumns;
7
10
  export default class OrderChangeAction {
8
11
  [OptionalProps]?: OptionalLineItemProps;
9
12
  id: string;
10
13
  ordering: number;
11
14
  order_id: string | null;
12
- order: Order | null;
15
+ order: Rel<Order> | null;
16
+ return_id: string | null;
17
+ return: Return;
18
+ claim_id: string | null;
19
+ claim: OrderClaim;
20
+ exchange_id: string | null;
21
+ exchange: OrderExchange;
13
22
  version: number | null;
14
23
  order_change_id: string | null;
15
- order_change: OrderChange | null;
24
+ order_change: Rel<OrderChange> | null;
16
25
  reference: string | null;
17
26
  reference_id: string | null;
18
27
  action: string;
@@ -23,7 +32,9 @@ export default class OrderChangeAction {
23
32
  applied: boolean;
24
33
  created_at: Date;
25
34
  updated_at: Date;
35
+ deleted_at: Date | null;
26
36
  onCreate(): void;
27
37
  onInit(): void;
28
38
  }
29
39
  export {};
40
+ //# sourceMappingURL=order-change-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-change-action.d.ts","sourceRoot":"","sources":["../../src/models/order-change-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EACL,SAAS,EAKV,MAAM,iBAAiB,CAAA;AACxB,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AAG,IAAI,CAAO;IAMnC,OAAO,EAAE,OAAO,CAAQ;IAOxB,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAYR,MAAM;CAUP"}
@@ -14,24 +14,53 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const utils_1 = require("@medusajs/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
+ const claim_1 = __importDefault(require("./claim"));
18
+ const exchange_1 = __importDefault(require("./exchange"));
17
19
  const order_1 = __importDefault(require("./order"));
18
20
  const order_change_1 = __importDefault(require("./order-change"));
21
+ const return_1 = __importDefault(require("./return"));
19
22
  const OrderChangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
23
  tableName: "order_change_action",
21
24
  columns: "order_change_id",
25
+ where: "deleted_at IS NOT NULL",
22
26
  });
23
27
  const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
24
28
  tableName: "order_change_action",
25
29
  columns: "order_id",
30
+ where: "deleted_at IS NOT NULL",
31
+ });
32
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
33
+ tableName: "order_change_action",
34
+ columns: "return_id",
35
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
36
+ });
37
+ const OrderClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
+ tableName: "order_change_action",
39
+ columns: "claim_id",
40
+ where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
41
+ });
42
+ const OrderExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
43
+ tableName: "order_change_action",
44
+ columns: "exchange_id",
45
+ where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
46
+ });
47
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
48
+ tableName: "order_change_action",
49
+ columns: "deleted_at",
50
+ where: "deleted_at IS NOT NULL",
26
51
  });
27
52
  const ActionOrderingIndex = (0, utils_1.createPsqlIndexStatementHelper)({
28
53
  tableName: "order_change_action",
29
54
  columns: "ordering",
55
+ where: "deleted_at IS NOT NULL",
30
56
  });
31
57
  let OrderChangeAction = class OrderChangeAction {
32
58
  constructor() {
33
59
  this.order_id = null;
34
60
  this.order = null;
61
+ this.return_id = null;
62
+ this.claim_id = null;
63
+ this.exchange_id = null;
35
64
  this.version = null;
36
65
  this.order_change = null;
37
66
  this.reference = null;
@@ -41,18 +70,27 @@ let OrderChangeAction = class OrderChangeAction {
41
70
  this.raw_amount = null;
42
71
  this.internal_note = null;
43
72
  this.applied = false;
73
+ this.deleted_at = null;
44
74
  }
45
75
  onCreate() {
46
76
  this.id = (0, utils_1.generateEntityId)(this.id, "ordchact");
47
- this.order_id ?? (this.order_id = this.order?.id ?? this.order_change?.order_id ?? null);
48
- this.order_change_id ?? (this.order_change_id = this.order_change?.id ?? null);
49
- this.version ?? (this.version = this.order_change?.version ?? null);
77
+ this.order_id ??= this.order?.id ?? this.order_change?.order_id ?? null;
78
+ this.return_id ??= this.return?.id ?? this.order_change?.return_id ?? null;
79
+ this.claim_id ??= this.claim?.id ?? this.order_change?.claim_id ?? null;
80
+ this.exchange_id ??=
81
+ this.exchange?.id ?? this.order_change?.exchange_id ?? null;
82
+ this.order_change_id ??= this.order_change?.id ?? null;
83
+ this.version ??= this.order_change?.version ?? null;
50
84
  }
51
85
  onInit() {
52
86
  this.id = (0, utils_1.generateEntityId)(this.id, "ordchact");
53
- this.order_id ?? (this.order_id = this.order?.id ?? this.order_change?.order_id ?? null);
54
- this.order_change_id ?? (this.order_change_id = this.order_change?.id ?? null);
55
- this.version ?? (this.version = this.order_change?.version ?? null);
87
+ this.order_id ??= this.order?.id ?? this.order_change?.order_id ?? null;
88
+ this.return_id ??= this.return?.id ?? this.order_change?.return_id ?? null;
89
+ this.claim_id ??= this.claim?.id ?? this.order_change?.claim_id ?? null;
90
+ this.exchange_id ??=
91
+ this.exchange?.id ?? this.order_change?.exchange_id ?? null;
92
+ this.order_change_id ??= this.order_change?.id ?? null;
93
+ this.version ??= this.order_change?.version ?? null;
56
94
  }
57
95
  };
58
96
  __decorate([
@@ -83,6 +121,57 @@ __decorate([
83
121
  }),
84
122
  __metadata("design:type", Object)
85
123
  ], OrderChangeAction.prototype, "order", void 0);
124
+ __decorate([
125
+ (0, core_1.ManyToOne)({
126
+ entity: () => return_1.default,
127
+ mapToPk: true,
128
+ fieldName: "return_id",
129
+ columnType: "text",
130
+ nullable: true,
131
+ }),
132
+ ReturnIdIndex.MikroORMIndex(),
133
+ __metadata("design:type", Object)
134
+ ], OrderChangeAction.prototype, "return_id", void 0);
135
+ __decorate([
136
+ (0, core_1.ManyToOne)(() => return_1.default, {
137
+ persist: false,
138
+ }),
139
+ __metadata("design:type", return_1.default)
140
+ ], OrderChangeAction.prototype, "return", void 0);
141
+ __decorate([
142
+ (0, core_1.ManyToOne)({
143
+ entity: () => claim_1.default,
144
+ mapToPk: true,
145
+ fieldName: "claim_id",
146
+ columnType: "text",
147
+ nullable: true,
148
+ }),
149
+ OrderClaimIdIndex.MikroORMIndex(),
150
+ __metadata("design:type", Object)
151
+ ], OrderChangeAction.prototype, "claim_id", void 0);
152
+ __decorate([
153
+ (0, core_1.ManyToOne)(() => claim_1.default, {
154
+ persist: false,
155
+ }),
156
+ __metadata("design:type", claim_1.default)
157
+ ], OrderChangeAction.prototype, "claim", void 0);
158
+ __decorate([
159
+ (0, core_1.ManyToOne)({
160
+ entity: () => exchange_1.default,
161
+ mapToPk: true,
162
+ fieldName: "exchange_id",
163
+ columnType: "text",
164
+ nullable: true,
165
+ }),
166
+ OrderExchangeIdIndex.MikroORMIndex(),
167
+ __metadata("design:type", Object)
168
+ ], OrderChangeAction.prototype, "exchange_id", void 0);
169
+ __decorate([
170
+ (0, core_1.ManyToOne)(() => exchange_1.default, {
171
+ persist: false,
172
+ }),
173
+ __metadata("design:type", exchange_1.default)
174
+ ], OrderChangeAction.prototype, "exchange", void 0);
86
175
  __decorate([
87
176
  (0, core_1.Property)({ columnType: "integer", nullable: true }),
88
177
  __metadata("design:type", Object)
@@ -167,6 +256,11 @@ __decorate([
167
256
  }),
168
257
  __metadata("design:type", Date)
169
258
  ], OrderChangeAction.prototype, "updated_at", void 0);
259
+ __decorate([
260
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
261
+ DeletedAtIndex.MikroORMIndex(),
262
+ __metadata("design:type", Object)
263
+ ], OrderChangeAction.prototype, "deleted_at", void 0);
170
264
  __decorate([
171
265
  (0, core_1.BeforeCreate)(),
172
266
  __metadata("design:type", Function),
@@ -180,7 +274,8 @@ __decorate([
180
274
  __metadata("design:returntype", void 0)
181
275
  ], OrderChangeAction.prototype, "onInit", null);
182
276
  OrderChangeAction = __decorate([
183
- (0, core_1.Entity)({ tableName: "order_change_action" })
277
+ (0, core_1.Entity)({ tableName: "order_change_action" }),
278
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
184
279
  ], OrderChangeAction);
185
280
  exports.default = OrderChangeAction;
186
281
  //# sourceMappingURL=order-change-action.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"order-change-action.js","sourceRoot":"","sources":["../../src/models/order-change-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CAQwB;AACxB,oDAA2B;AAC3B,kEAAwC;AAIxC,MAAM,kBAAkB,GAAG,IAAA,sCAA8B,EAAC;IACxD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,UAAU;CACpB,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAAC;IACzD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,UAAU;CACpB,CAAC,CAAA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AE,CAAC;GACxB,iBAAiB,CAiHrC;kBAjHoB,iBAAiB"}
1
+ {"version":3,"file":"order-change-action.js","sourceRoot":"","sources":["../../src/models/order-change-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAMwB;AACxB,0CAUwB;AACxB,oDAAgC;AAChC,0DAAsC;AACtC,oDAA2B;AAC3B,kEAAwC;AACxC,sDAA6B;AAI7B,MAAM,kBAAkB,GAAG,IAAA,sCAA8B,EAAC;IACxD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC;IACnD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,kDAAkD;CAC1D,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG,IAAA,sCAA8B,EAAC;IACvD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,iDAAiD;CACzD,CAAC,CAAA;AAEF,MAAM,oBAAoB,GAAG,IAAA,sCAA8B,EAAC;IAC1D,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,oDAAoD;CAC5D,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAAC;IACzD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,wBAAwB;CAChC,CAAC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AAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;qDAAA;AAQhB;IANC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;qDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;qDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;iDAUd;AAGD;IADC,IAAA,aAAM,GAAE;;;;+CAUR;AAzKkB,iBAAiB;IAFrC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;IAC5C,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;GAC/B,iBAAiB,CA0KrC;kBA1KoB,iBAAiB"}
@@ -1,15 +1,25 @@
1
1
  import { DAL } from "@medusajs/types";
2
- import { OrderChangeStatus } from "@medusajs/utils";
3
- import { Collection, OptionalProps } from "@mikro-orm/core";
2
+ import { OrderChangeStatus, OrderChangeType } from "@medusajs/utils";
3
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
4
+ import OrderClaim from "./claim";
5
+ import OrderExchange from "./exchange";
4
6
  import Order from "./order";
5
7
  import OrderChangeAction from "./order-change-action";
6
- type OptionalLineItemProps = DAL.EntityDateColumns;
8
+ import Return from "./return";
9
+ type OptionalLineItemProps = DAL.ModelDateColumns;
7
10
  export default class OrderChange {
8
11
  [OptionalProps]?: OptionalLineItemProps;
9
12
  id: string;
10
13
  order_id: string;
11
- order: Order;
14
+ order: Rel<Order>;
15
+ return_id: string | null;
16
+ return: Rel<Return>;
17
+ claim_id: string | null;
18
+ claim: OrderClaim;
19
+ exchange_id: string | null;
20
+ exchange: OrderExchange;
12
21
  version: number;
22
+ change_type: OrderChangeType | null;
13
23
  actions: Collection<OrderChangeAction, object>;
14
24
  description: string | null;
15
25
  status: OrderChangeStatus;
@@ -24,10 +34,12 @@ export default class OrderChange {
24
34
  metadata: Record<string, unknown> | null;
25
35
  declined_at?: Date;
26
36
  canceled_by: string | null;
27
- canceled_at?: Date;
37
+ canceled_at?: Date | null;
28
38
  created_at: Date;
29
39
  updated_at: Date;
40
+ deleted_at: Date | null;
30
41
  onCreate(): void;
31
42
  onInit(): void;
32
43
  }
33
44
  export {};
45
+ //# sourceMappingURL=order-change.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-change.d.ts","sourceRoot":"","sources":["../../src/models/order-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAIL,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,UAAU,EAOV,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AAExB,OAAO,UAAU,MAAM,SAAS,CAAA;AAChC,OAAO,aAAa,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,iBAAiB,MAAM,uBAAuB,CAAA;AACrD,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,KAAK,qBAAqB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AAqDjD,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,CAAC,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAA;IAGvC,EAAE,EAAE,MAAM,CAAA;IAUV,QAAQ,EAAE,MAAM,CAAA;IAKhB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAUjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAK/B,MAAM,EAAE,GAAG,CAAC,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