@medusajs/order 0.1.3 → 1.0.0-rc-20241001083650

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) 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/joiner-config.d.ts +2 -5
  6. package/dist/joiner-config.d.ts.map +1 -0
  7. package/dist/joiner-config.js +21 -28
  8. package/dist/joiner-config.js.map +1 -1
  9. package/dist/migrations/Migration20240219102530.d.ts +1 -0
  10. package/dist/migrations/Migration20240219102530.d.ts.map +1 -0
  11. package/dist/migrations/Migration20240219102530.js +53 -19
  12. package/dist/migrations/Migration20240219102530.js.map +1 -1
  13. package/dist/migrations/Migration20240604100512.d.ts +5 -0
  14. package/dist/migrations/Migration20240604100512.d.ts.map +1 -0
  15. package/dist/migrations/Migration20240604100512.js +371 -0
  16. package/dist/migrations/Migration20240604100512.js.map +1 -0
  17. package/dist/migrations/Migration20240715102100.d.ts +5 -0
  18. package/dist/migrations/Migration20240715102100.d.ts.map +1 -0
  19. package/dist/migrations/Migration20240715102100.js +15 -0
  20. package/dist/migrations/Migration20240715102100.js.map +1 -0
  21. package/dist/migrations/Migration20240715174100.d.ts +5 -0
  22. package/dist/migrations/Migration20240715174100.d.ts.map +1 -0
  23. package/dist/migrations/Migration20240715174100.js +21 -0
  24. package/dist/migrations/Migration20240715174100.js.map +1 -0
  25. package/dist/migrations/Migration20240716081800.d.ts +5 -0
  26. package/dist/migrations/Migration20240716081800.d.ts.map +1 -0
  27. package/dist/migrations/Migration20240716081800.js +67 -0
  28. package/dist/migrations/Migration20240716081800.js.map +1 -0
  29. package/dist/migrations/Migration20240801085921.d.ts +5 -0
  30. package/dist/migrations/Migration20240801085921.d.ts.map +1 -0
  31. package/dist/migrations/Migration20240801085921.js +30 -0
  32. package/dist/migrations/Migration20240801085921.js.map +1 -0
  33. package/dist/migrations/Migration20240821164505.d.ts +6 -0
  34. package/dist/migrations/Migration20240821164505.d.ts.map +1 -0
  35. package/dist/migrations/Migration20240821164505.js +26 -0
  36. package/dist/migrations/Migration20240821164505.js.map +1 -0
  37. package/dist/migrations/Migration20240821170920.d.ts +6 -0
  38. package/dist/migrations/Migration20240821170920.d.ts.map +1 -0
  39. package/dist/migrations/Migration20240821170920.js +18 -0
  40. package/dist/migrations/Migration20240821170920.js.map +1 -0
  41. package/dist/migrations/Migration20240827133639.d.ts +6 -0
  42. package/dist/migrations/Migration20240827133639.d.ts.map +1 -0
  43. package/dist/migrations/Migration20240827133639.js +17 -0
  44. package/dist/migrations/Migration20240827133639.js.map +1 -0
  45. package/dist/migrations/Migration20240902195921.d.ts +6 -0
  46. package/dist/migrations/Migration20240902195921.d.ts.map +1 -0
  47. package/dist/migrations/Migration20240902195921.js +16 -0
  48. package/dist/migrations/Migration20240902195921.js.map +1 -0
  49. package/dist/migrations/Migration20240913092514.d.ts +6 -0
  50. package/dist/migrations/Migration20240913092514.d.ts.map +1 -0
  51. package/dist/migrations/Migration20240913092514.js +17 -0
  52. package/dist/migrations/Migration20240913092514.js.map +1 -0
  53. package/dist/models/address.d.ts +4 -3
  54. package/dist/models/address.d.ts.map +1 -0
  55. package/dist/models/address.js +22 -22
  56. package/dist/models/address.js.map +1 -1
  57. package/dist/models/adjustment-line.d.ts +5 -3
  58. package/dist/models/adjustment-line.d.ts.map +1 -0
  59. package/dist/models/adjustment-line.js +6 -1
  60. package/dist/models/adjustment-line.js.map +1 -1
  61. package/dist/models/claim-item-image.d.ts +19 -0
  62. package/dist/models/claim-item-image.d.ts.map +1 -0
  63. package/dist/models/claim-item-image.js +109 -0
  64. package/dist/models/claim-item-image.js.map +1 -0
  65. package/dist/models/claim-item.d.ts +29 -0
  66. package/dist/models/claim-item.d.ts.map +1 -0
  67. package/dist/models/claim-item.js +157 -0
  68. package/dist/models/claim-item.js.map +1 -0
  69. package/dist/models/claim.d.ts +37 -0
  70. package/dist/models/claim.d.ts.map +1 -0
  71. package/dist/models/claim.js +201 -0
  72. package/dist/models/claim.js.map +1 -0
  73. package/dist/models/exchange-item.d.ts +24 -0
  74. package/dist/models/exchange-item.d.ts.map +1 -0
  75. package/dist/models/exchange-item.js +138 -0
  76. package/dist/models/exchange-item.js.map +1 -0
  77. package/dist/models/exchange.d.ts +35 -0
  78. package/dist/models/exchange.d.ts.map +1 -0
  79. package/dist/models/exchange.js +194 -0
  80. package/dist/models/exchange.js.map +1 -0
  81. package/dist/models/index.d.ts +18 -9
  82. package/dist/models/index.d.ts.map +1 -0
  83. package/dist/models/index.js +26 -10
  84. package/dist/models/index.js.map +1 -1
  85. package/dist/models/line-item-adjustment.d.ts +5 -3
  86. package/dist/models/line-item-adjustment.d.ts.map +1 -0
  87. package/dist/models/line-item-adjustment.js +12 -12
  88. package/dist/models/line-item-adjustment.js.map +1 -1
  89. package/dist/models/line-item-tax-line.d.ts +5 -3
  90. package/dist/models/line-item-tax-line.d.ts.map +1 -0
  91. package/dist/models/line-item-tax-line.js +12 -12
  92. package/dist/models/line-item-tax-line.js.map +1 -1
  93. package/dist/models/line-item.d.ts +11 -8
  94. package/dist/models/line-item.d.ts.map +1 -0
  95. package/dist/models/line-item.js +58 -39
  96. package/dist/models/line-item.js.map +1 -1
  97. package/dist/models/order-change-action.d.ts +17 -6
  98. package/dist/models/order-change-action.d.ts.map +1 -0
  99. package/dist/models/order-change-action.js +110 -8
  100. package/dist/models/order-change-action.js.map +1 -1
  101. package/dist/models/order-change.d.ts +18 -6
  102. package/dist/models/order-change.d.ts.map +1 -0
  103. package/dist/models/order-change.js +108 -6
  104. package/dist/models/order-change.js.map +1 -1
  105. package/dist/models/order-item.d.ts +10 -7
  106. package/dist/models/order-item.d.ts.map +1 -0
  107. package/dist/models/order-item.js +29 -19
  108. package/dist/models/order-item.js.map +1 -1
  109. package/dist/models/order-shipping-method.d.ts +17 -7
  110. package/dist/models/order-shipping-method.d.ts.map +1 -0
  111. package/dist/models/order-shipping-method.js +113 -33
  112. package/dist/models/order-shipping-method.js.map +1 -1
  113. package/dist/models/order-summary.d.ts +7 -8
  114. package/dist/models/order-summary.d.ts.map +1 -0
  115. package/dist/models/order-summary.js +14 -10
  116. package/dist/models/order-summary.js.map +1 -1
  117. package/dist/models/order.d.ts +13 -11
  118. package/dist/models/order.d.ts.map +1 -0
  119. package/dist/models/order.js +12 -2
  120. package/dist/models/order.js.map +1 -1
  121. package/dist/models/return-item.d.ts +31 -0
  122. package/dist/models/return-item.d.ts.map +1 -0
  123. package/dist/models/return-item.js +180 -0
  124. package/dist/models/return-item.js.map +1 -0
  125. package/dist/models/return-reason.d.ts +22 -0
  126. package/dist/models/return-reason.d.ts.map +1 -0
  127. package/dist/models/return-reason.js +122 -0
  128. package/dist/models/return-reason.js.map +1 -0
  129. package/dist/models/return.d.ts +41 -0
  130. package/dist/models/return.d.ts.map +1 -0
  131. package/dist/models/return.js +227 -0
  132. package/dist/models/return.js.map +1 -0
  133. package/dist/models/shipping-method-adjustment.d.ts +5 -3
  134. package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
  135. package/dist/models/shipping-method-adjustment.js +12 -12
  136. package/dist/models/shipping-method-adjustment.js.map +1 -1
  137. package/dist/models/shipping-method-tax-line.d.ts +5 -3
  138. package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
  139. package/dist/models/shipping-method-tax-line.js +12 -12
  140. package/dist/models/shipping-method-tax-line.js.map +1 -1
  141. package/dist/models/shipping-method.d.ts +10 -7
  142. package/dist/models/shipping-method.d.ts.map +1 -0
  143. package/dist/models/shipping-method.js +42 -24
  144. package/dist/models/shipping-method.js.map +1 -1
  145. package/dist/models/tax-line.d.ts +4 -2
  146. package/dist/models/tax-line.d.ts.map +1 -0
  147. package/dist/models/tax-line.js +8 -1
  148. package/dist/models/tax-line.js.map +1 -1
  149. package/dist/models/transaction.d.ts +18 -6
  150. package/dist/models/transaction.d.ts.map +1 -0
  151. package/dist/models/transaction.js +133 -24
  152. package/dist/models/transaction.js.map +1 -1
  153. package/dist/repositories/claim.d.ts +9 -0
  154. package/dist/repositories/claim.d.ts.map +1 -0
  155. package/dist/repositories/claim.js +11 -0
  156. package/dist/repositories/claim.js.map +1 -0
  157. package/dist/repositories/exchange.d.ts +9 -0
  158. package/dist/repositories/exchange.d.ts.map +1 -0
  159. package/dist/repositories/exchange.js +11 -0
  160. package/dist/repositories/exchange.js.map +1 -0
  161. package/dist/repositories/index.d.ts +5 -2
  162. package/dist/repositories/index.d.ts.map +1 -0
  163. package/dist/repositories/index.js +8 -17
  164. package/dist/repositories/index.js.map +1 -1
  165. package/dist/repositories/order.d.ts +2 -4
  166. package/dist/repositories/order.d.ts.map +1 -0
  167. package/dist/repositories/order.js +3 -86
  168. package/dist/repositories/order.js.map +1 -1
  169. package/dist/repositories/return.d.ts +9 -0
  170. package/dist/repositories/return.d.ts.map +1 -0
  171. package/dist/repositories/return.js +11 -0
  172. package/dist/repositories/return.js.map +1 -0
  173. package/dist/schema/index.d.ts +3 -0
  174. package/dist/schema/index.d.ts.map +1 -0
  175. package/dist/schema/index.js +556 -0
  176. package/dist/schema/index.js.map +1 -0
  177. package/dist/services/actions/cancel-claim.d.ts +3 -0
  178. package/dist/services/actions/cancel-claim.d.ts.map +1 -0
  179. package/dist/services/actions/cancel-claim.js +85 -0
  180. package/dist/services/actions/cancel-claim.js.map +1 -0
  181. package/dist/services/actions/cancel-exchange.d.ts +3 -0
  182. package/dist/services/actions/cancel-exchange.d.ts.map +1 -0
  183. package/dist/services/actions/cancel-exchange.js +71 -0
  184. package/dist/services/actions/cancel-exchange.js.map +1 -0
  185. package/dist/services/actions/cancel-fulfillment.d.ts +3 -0
  186. package/dist/services/actions/cancel-fulfillment.d.ts.map +1 -0
  187. package/dist/services/actions/cancel-fulfillment.js +31 -0
  188. package/dist/services/actions/cancel-fulfillment.js.map +1 -0
  189. package/dist/services/actions/cancel-return.d.ts +3 -0
  190. package/dist/services/actions/cancel-return.d.ts.map +1 -0
  191. package/dist/services/actions/cancel-return.js +69 -0
  192. package/dist/services/actions/cancel-return.js.map +1 -0
  193. package/dist/services/actions/create-claim.d.ts +3 -0
  194. package/dist/services/actions/create-claim.d.ts.map +1 -0
  195. package/dist/services/actions/create-claim.js +225 -0
  196. package/dist/services/actions/create-claim.js.map +1 -0
  197. package/dist/services/actions/create-exchange.d.ts +3 -0
  198. package/dist/services/actions/create-exchange.d.ts.map +1 -0
  199. package/dist/services/actions/create-exchange.js +191 -0
  200. package/dist/services/actions/create-exchange.js.map +1 -0
  201. package/dist/services/actions/create-return.d.ts +3 -0
  202. package/dist/services/actions/create-return.d.ts.map +1 -0
  203. package/dist/services/actions/create-return.js +100 -0
  204. package/dist/services/actions/create-return.js.map +1 -0
  205. package/dist/services/actions/index.d.ts +12 -0
  206. package/dist/services/actions/index.d.ts.map +1 -0
  207. package/dist/services/actions/index.js +28 -0
  208. package/dist/services/actions/index.js.map +1 -0
  209. package/dist/services/actions/receive-return.d.ts +3 -0
  210. package/dist/services/actions/receive-return.d.ts.map +1 -0
  211. package/dist/services/actions/receive-return.js +71 -0
  212. package/dist/services/actions/receive-return.js.map +1 -0
  213. package/dist/services/actions/register-delivery.d.ts +3 -0
  214. package/dist/services/actions/register-delivery.d.ts.map +1 -0
  215. package/dist/services/actions/register-delivery.js +29 -0
  216. package/dist/services/actions/register-delivery.js.map +1 -0
  217. package/dist/services/actions/register-fulfillment.d.ts +3 -0
  218. package/dist/services/actions/register-fulfillment.d.ts.map +1 -0
  219. package/dist/services/actions/register-fulfillment.js +29 -0
  220. package/dist/services/actions/register-fulfillment.js.map +1 -0
  221. package/dist/services/actions/register-shipment.d.ts +3 -0
  222. package/dist/services/actions/register-shipment.d.ts.map +1 -0
  223. package/dist/services/actions/register-shipment.js +37 -0
  224. package/dist/services/actions/register-shipment.js.map +1 -0
  225. package/dist/services/index.d.ts +1 -1
  226. package/dist/services/index.d.ts.map +1 -0
  227. package/dist/services/index.js +1 -3
  228. package/dist/services/index.js.map +1 -1
  229. package/dist/services/order-module-service.d.ts +191 -109
  230. package/dist/services/order-module-service.d.ts.map +1 -0
  231. package/dist/services/order-module-service.js +1165 -425
  232. package/dist/services/order-module-service.js.map +1 -1
  233. package/dist/services/order-service.d.ts +6 -5
  234. package/dist/services/order-service.d.ts.map +1 -0
  235. package/dist/services/order-service.js +2 -2
  236. package/dist/services/order-service.js.map +1 -1
  237. package/dist/tsconfig.tsbuildinfo +1 -0
  238. package/dist/types/address.d.ts +2 -1
  239. package/dist/types/address.d.ts.map +1 -0
  240. package/dist/types/index.d.ts +5 -2
  241. package/dist/types/index.d.ts.map +1 -0
  242. package/dist/types/index.js +2 -0
  243. package/dist/types/index.js.map +1 -1
  244. package/dist/types/line-item-adjustment.d.ts +2 -1
  245. package/dist/types/line-item-adjustment.d.ts.map +1 -0
  246. package/dist/types/line-item-tax-line.d.ts +1 -0
  247. package/dist/types/line-item-tax-line.d.ts.map +1 -0
  248. package/dist/types/line-item.d.ts +2 -1
  249. package/dist/types/line-item.d.ts.map +1 -0
  250. package/dist/types/order-change.d.ts +4 -0
  251. package/dist/types/order-change.d.ts.map +1 -0
  252. package/dist/types/order-change.js +3 -0
  253. package/dist/types/order-change.js.map +1 -0
  254. package/dist/types/order-detail.d.ts +3 -2
  255. package/dist/types/order-detail.d.ts.map +1 -0
  256. package/dist/types/order.d.ts +4 -3
  257. package/dist/types/order.d.ts.map +1 -0
  258. package/dist/types/return-reason.d.ts +5 -0
  259. package/dist/types/return-reason.d.ts.map +1 -0
  260. package/dist/types/return-reason.js +3 -0
  261. package/dist/types/return-reason.js.map +1 -0
  262. package/dist/types/shipping-method-adjustment.d.ts +2 -1
  263. package/dist/types/shipping-method-adjustment.d.ts.map +1 -0
  264. package/dist/types/shipping-method-tax-line.d.ts +1 -0
  265. package/dist/types/shipping-method-tax-line.d.ts.map +1 -0
  266. package/dist/types/shipping-method.d.ts +5 -1
  267. package/dist/types/shipping-method.d.ts.map +1 -0
  268. package/dist/types/tax-line.d.ts +2 -1
  269. package/dist/types/tax-line.d.ts.map +1 -0
  270. package/dist/types/transaction.d.ts +2 -1
  271. package/dist/types/transaction.d.ts.map +1 -0
  272. package/dist/types/utils/index.d.ts +41 -23
  273. package/dist/types/utils/index.d.ts.map +1 -0
  274. package/dist/types/utils/index.js +0 -1
  275. package/dist/types/utils/index.js.map +1 -1
  276. package/dist/utils/actions/cancel-item-fulfillment.d.ts +2 -0
  277. package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +1 -0
  278. package/dist/utils/actions/cancel-item-fulfillment.js +34 -0
  279. package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -0
  280. package/dist/utils/actions/cancel-return.d.ts +1 -0
  281. package/dist/utils/actions/cancel-return.d.ts.map +1 -0
  282. package/dist/utils/actions/cancel-return.js +9 -16
  283. package/dist/utils/actions/cancel-return.js.map +1 -1
  284. package/dist/utils/actions/deliver-item.d.ts +2 -0
  285. package/dist/utils/actions/deliver-item.d.ts.map +1 -0
  286. package/dist/utils/actions/deliver-item.js +38 -0
  287. package/dist/utils/actions/deliver-item.js.map +1 -0
  288. package/dist/utils/actions/fulfill-item.d.ts +1 -0
  289. package/dist/utils/actions/fulfill-item.d.ts.map +1 -0
  290. package/dist/utils/actions/fulfill-item.js +8 -12
  291. package/dist/utils/actions/fulfill-item.js.map +1 -1
  292. package/dist/utils/actions/index.d.ts +7 -1
  293. package/dist/utils/actions/index.d.ts.map +1 -0
  294. package/dist/utils/actions/index.js +6 -1
  295. package/dist/utils/actions/index.js.map +1 -1
  296. package/dist/utils/actions/item-add.d.ts +1 -0
  297. package/dist/utils/actions/item-add.d.ts.map +1 -0
  298. package/dist/utils/actions/item-add.js +17 -26
  299. package/dist/utils/actions/item-add.js.map +1 -1
  300. package/dist/utils/actions/item-remove.d.ts +1 -0
  301. package/dist/utils/actions/item-remove.d.ts.map +1 -0
  302. package/dist/utils/actions/item-remove.js +10 -30
  303. package/dist/utils/actions/item-remove.js.map +1 -1
  304. package/dist/utils/actions/item-update.d.ts +2 -0
  305. package/dist/utils/actions/item-update.d.ts.map +1 -0
  306. package/dist/utils/actions/item-update.js +37 -0
  307. package/dist/utils/actions/item-update.js.map +1 -0
  308. package/dist/utils/actions/receive-damaged-return-item.d.ts +1 -0
  309. package/dist/utils/actions/receive-damaged-return-item.d.ts.map +1 -0
  310. package/dist/utils/actions/receive-damaged-return-item.js +11 -37
  311. package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
  312. package/dist/utils/actions/receive-return-item.d.ts +1 -0
  313. package/dist/utils/actions/receive-return-item.d.ts.map +1 -0
  314. package/dist/utils/actions/receive-return-item.js +9 -38
  315. package/dist/utils/actions/receive-return-item.js.map +1 -1
  316. package/dist/utils/actions/reinstate-item.d.ts +2 -0
  317. package/dist/utils/actions/reinstate-item.d.ts.map +1 -0
  318. package/dist/utils/actions/reinstate-item.js +32 -0
  319. package/dist/utils/actions/reinstate-item.js.map +1 -0
  320. package/dist/utils/actions/return-item.d.ts +1 -0
  321. package/dist/utils/actions/return-item.d.ts.map +1 -0
  322. package/dist/utils/actions/return-item.js +10 -15
  323. package/dist/utils/actions/return-item.js.map +1 -1
  324. package/dist/utils/actions/ship-item.d.ts +1 -0
  325. package/dist/utils/actions/ship-item.d.ts.map +1 -0
  326. package/dist/utils/actions/ship-item.js +8 -12
  327. package/dist/utils/actions/ship-item.js.map +1 -1
  328. package/dist/utils/actions/shipping-add.d.ts +1 -0
  329. package/dist/utils/actions/shipping-add.d.ts.map +1 -0
  330. package/dist/utils/actions/shipping-add.js +18 -18
  331. package/dist/utils/actions/shipping-add.js.map +1 -1
  332. package/dist/utils/actions/shipping-remove.d.ts +2 -0
  333. package/dist/utils/actions/shipping-remove.d.ts.map +1 -0
  334. package/dist/utils/actions/shipping-remove.js +22 -0
  335. package/dist/utils/actions/shipping-remove.js.map +1 -0
  336. package/dist/utils/actions/write-off-item.d.ts +1 -0
  337. package/dist/utils/actions/write-off-item.d.ts.map +1 -0
  338. package/dist/utils/actions/write-off-item.js +8 -12
  339. package/dist/utils/actions/write-off-item.js.map +1 -1
  340. package/dist/utils/apply-order-changes.d.ts +18 -0
  341. package/dist/utils/apply-order-changes.d.ts.map +1 -0
  342. package/dist/utils/apply-order-changes.js +98 -0
  343. package/dist/utils/apply-order-changes.js.map +1 -0
  344. package/dist/utils/base-repository-find.d.ts +3 -0
  345. package/dist/utils/base-repository-find.d.ts.map +1 -0
  346. package/dist/utils/base-repository-find.js +154 -0
  347. package/dist/utils/base-repository-find.js.map +1 -0
  348. package/dist/utils/calculate-order-change.d.ts +12 -6
  349. package/dist/utils/calculate-order-change.d.ts.map +1 -0
  350. package/dist/utils/calculate-order-change.js +56 -187
  351. package/dist/utils/calculate-order-change.js.map +1 -1
  352. package/dist/utils/index.d.ts +4 -1
  353. package/dist/utils/index.d.ts.map +1 -0
  354. package/dist/utils/index.js +3 -1
  355. package/dist/utils/index.js.map +1 -1
  356. package/dist/utils/set-action-reference.d.ts +2 -0
  357. package/dist/utils/set-action-reference.d.ts.map +1 -0
  358. package/dist/utils/set-action-reference.js +10 -0
  359. package/dist/utils/set-action-reference.js.map +1 -0
  360. package/dist/utils/transform-order.d.ts +5 -4
  361. package/dist/utils/transform-order.d.ts.map +1 -0
  362. package/dist/utils/transform-order.js +138 -21
  363. package/dist/utils/transform-order.js.map +1 -1
  364. package/package.json +20 -21
  365. package/dist/module-definition.d.ts +0 -2
  366. package/dist/module-definition.js +0 -59
  367. package/dist/module-definition.js.map +0 -1
  368. package/dist/scripts/bin/run-seed.d.ts +0 -3
  369. package/dist/scripts/bin/run-seed.js +0 -49
  370. package/dist/scripts/bin/run-seed.js.map +0 -1
  371. package/dist/services/order-change-service.d.ts +0 -15
  372. package/dist/services/order-change-service.js +0 -96
  373. package/dist/services/order-change-service.js.map +0 -1
  374. package/dist/utils/action-key.d.ts +0 -13
  375. package/dist/utils/action-key.js +0 -18
  376. package/dist/utils/action-key.js.map +0 -1
  377. package/dist/utils/actions/cancel.d.ts +0 -1
  378. package/dist/utils/actions/cancel.js +0 -8
  379. package/dist/utils/actions/cancel.js.map +0 -1
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const utils_1 = require("@medusajs/framework/utils");
16
+ const core_1 = require("@mikro-orm/core");
17
+ const _models_1 = require(".");
18
+ const claim_1 = __importDefault(require("./claim"));
19
+ const exchange_1 = __importDefault(require("./exchange"));
20
+ const order_1 = __importDefault(require("./order"));
21
+ const order_shipping_method_1 = __importDefault(require("./order-shipping-method"));
22
+ const DisplayIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
+ tableName: "return",
24
+ columns: "display_id",
25
+ where: "deleted_at IS NOT NULL",
26
+ });
27
+ const ReturnDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
28
+ tableName: "return",
29
+ columns: "deleted_at",
30
+ where: "deleted_at IS NOT NULL",
31
+ });
32
+ const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
33
+ tableName: "return",
34
+ columns: ["order_id"],
35
+ where: "deleted_at IS NOT NULL",
36
+ });
37
+ const ExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
+ tableName: "return",
39
+ columns: ["exchange_id"],
40
+ where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
41
+ });
42
+ const ClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
43
+ tableName: "return",
44
+ columns: ["claim_id"],
45
+ where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
46
+ });
47
+ let Return = class Return {
48
+ constructor() {
49
+ this.exchange_id = null;
50
+ this.claim_id = null;
51
+ this.status = utils_1.ReturnStatus.OPEN;
52
+ this.location_id = null;
53
+ this.no_notification = null;
54
+ this.items = new core_1.Collection(this);
55
+ this.shipping_methods = new core_1.Collection(this);
56
+ this.transactions = new core_1.Collection(this);
57
+ this.created_by = null;
58
+ this.metadata = null;
59
+ this.deleted_at = null;
60
+ this.requested_at = null;
61
+ this.received_at = null;
62
+ this.canceled_at = null;
63
+ }
64
+ onCreate() {
65
+ this.id = (0, utils_1.generateEntityId)(this.id, "return");
66
+ }
67
+ onInit() {
68
+ this.id = (0, utils_1.generateEntityId)(this.id, "return");
69
+ }
70
+ };
71
+ __decorate([
72
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
73
+ __metadata("design:type", String)
74
+ ], Return.prototype, "id", void 0);
75
+ __decorate([
76
+ (0, core_1.ManyToOne)({
77
+ entity: () => order_1.default,
78
+ mapToPk: true,
79
+ fieldName: "order_id",
80
+ columnType: "text",
81
+ }),
82
+ OrderIdIndex.MikroORMIndex(),
83
+ __metadata("design:type", String)
84
+ ], Return.prototype, "order_id", void 0);
85
+ __decorate([
86
+ (0, core_1.ManyToOne)(() => order_1.default, {
87
+ persist: false,
88
+ }),
89
+ __metadata("design:type", Object)
90
+ ], Return.prototype, "order", void 0);
91
+ __decorate([
92
+ (0, core_1.OneToOne)({
93
+ entity: () => exchange_1.default,
94
+ fieldName: "exchange_id",
95
+ nullable: true,
96
+ }),
97
+ __metadata("design:type", Object)
98
+ ], Return.prototype, "exchange", void 0);
99
+ __decorate([
100
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
101
+ ExchangeIdIndex.MikroORMIndex(),
102
+ __metadata("design:type", Object)
103
+ ], Return.prototype, "exchange_id", void 0);
104
+ __decorate([
105
+ (0, core_1.OneToOne)({
106
+ entity: () => claim_1.default,
107
+ fieldName: "claim_id",
108
+ nullable: true,
109
+ }),
110
+ __metadata("design:type", Object)
111
+ ], Return.prototype, "claim", void 0);
112
+ __decorate([
113
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
114
+ ClaimIdIndex.MikroORMIndex(),
115
+ __metadata("design:type", Object)
116
+ ], Return.prototype, "claim_id", void 0);
117
+ __decorate([
118
+ (0, core_1.Property)({
119
+ columnType: "integer",
120
+ }),
121
+ __metadata("design:type", Number)
122
+ ], Return.prototype, "order_version", void 0);
123
+ __decorate([
124
+ (0, core_1.Property)({ autoincrement: true, primary: false }),
125
+ DisplayIdIndex.MikroORMIndex(),
126
+ __metadata("design:type", Number)
127
+ ], Return.prototype, "display_id", void 0);
128
+ __decorate([
129
+ (0, core_1.Enum)({ items: () => utils_1.ReturnStatus, default: utils_1.ReturnStatus.OPEN }),
130
+ __metadata("design:type", String)
131
+ ], Return.prototype, "status", void 0);
132
+ __decorate([
133
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
134
+ __metadata("design:type", Object)
135
+ ], Return.prototype, "location_id", void 0);
136
+ __decorate([
137
+ (0, core_1.Property)({ columnType: "boolean", nullable: true }),
138
+ __metadata("design:type", Object)
139
+ ], Return.prototype, "no_notification", void 0);
140
+ __decorate([
141
+ (0, utils_1.MikroOrmBigNumberProperty)({
142
+ nullable: true,
143
+ }),
144
+ __metadata("design:type", Object)
145
+ ], Return.prototype, "refund_amount", void 0);
146
+ __decorate([
147
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
148
+ __metadata("design:type", Object)
149
+ ], Return.prototype, "raw_refund_amount", void 0);
150
+ __decorate([
151
+ (0, core_1.OneToMany)(() => _models_1.ReturnItem, (itemDetail) => itemDetail.return, {
152
+ cascade: [core_1.Cascade.PERSIST],
153
+ }),
154
+ __metadata("design:type", Object)
155
+ ], Return.prototype, "items", void 0);
156
+ __decorate([
157
+ (0, core_1.OneToMany)(() => order_shipping_method_1.default, (shippingMethod) => shippingMethod.return, {
158
+ cascade: [core_1.Cascade.PERSIST],
159
+ }),
160
+ __metadata("design:type", Object)
161
+ ], Return.prototype, "shipping_methods", void 0);
162
+ __decorate([
163
+ (0, core_1.OneToMany)(() => _models_1.OrderTransaction, (transaction) => transaction.return, {
164
+ cascade: [core_1.Cascade.PERSIST],
165
+ }),
166
+ __metadata("design:type", Object)
167
+ ], Return.prototype, "transactions", void 0);
168
+ __decorate([
169
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
170
+ __metadata("design:type", Object)
171
+ ], Return.prototype, "created_by", void 0);
172
+ __decorate([
173
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
174
+ __metadata("design:type", Object)
175
+ ], Return.prototype, "metadata", void 0);
176
+ __decorate([
177
+ (0, core_1.Property)({
178
+ onCreate: () => new Date(),
179
+ columnType: "timestamptz",
180
+ defaultRaw: "now()",
181
+ }),
182
+ __metadata("design:type", Date)
183
+ ], Return.prototype, "created_at", void 0);
184
+ __decorate([
185
+ (0, core_1.Property)({
186
+ onCreate: () => new Date(),
187
+ onUpdate: () => new Date(),
188
+ columnType: "timestamptz",
189
+ defaultRaw: "now()",
190
+ }),
191
+ __metadata("design:type", Date)
192
+ ], Return.prototype, "updated_at", void 0);
193
+ __decorate([
194
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
195
+ ReturnDeletedAtIndex.MikroORMIndex(),
196
+ __metadata("design:type", Object)
197
+ ], Return.prototype, "deleted_at", void 0);
198
+ __decorate([
199
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
200
+ __metadata("design:type", Object)
201
+ ], Return.prototype, "requested_at", void 0);
202
+ __decorate([
203
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
204
+ __metadata("design:type", Object)
205
+ ], Return.prototype, "received_at", void 0);
206
+ __decorate([
207
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
208
+ __metadata("design:type", Object)
209
+ ], Return.prototype, "canceled_at", void 0);
210
+ __decorate([
211
+ (0, core_1.BeforeCreate)(),
212
+ __metadata("design:type", Function),
213
+ __metadata("design:paramtypes", []),
214
+ __metadata("design:returntype", void 0)
215
+ ], Return.prototype, "onCreate", null);
216
+ __decorate([
217
+ (0, core_1.OnInit)(),
218
+ __metadata("design:type", Function),
219
+ __metadata("design:paramtypes", []),
220
+ __metadata("design:returntype", void 0)
221
+ ], Return.prototype, "onInit", null);
222
+ Return = __decorate([
223
+ (0, core_1.Entity)({ tableName: "return" }),
224
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
225
+ ], Return);
226
+ exports.default = Return;
227
+ //# sourceMappingURL=return.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return.js","sourceRoot":"","sources":["../../src/models/return.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,qDAOkC;AAClC,0CAewB;AACxB,qCAAsD;AACtD,oDAA2B;AAC3B,0DAAiC;AACjC,oDAA2B;AAC3B,oFAAmD;AAInD,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,oBAAoB,GAAG,IAAA,sCAA8B,EAAC;IAC1D,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,IAAA,sCAA8B,EAAC;IACrD,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,KAAK,EAAE,oD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B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;0CAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,oBAAoB,CAAC,aAAa,EAAE;;0CACP;AAG9B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACxB;AAGhC;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACzB;AAG/B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACzB;AAG/B;IADC,IAAA,mBAAY,GAAE;;;;sCAGd;AAGD;IADC,IAAA,aAAM,GAAE;;;;oCAGR;AA7HkB,MAAM;IAF1B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC/B,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;GAC/B,MAAM,CA8H1B;kBA9HoB,MAAM"}
@@ -1,8 +1,10 @@
1
+ import { Rel } from "@mikro-orm/core";
1
2
  import AdjustmentLine from "./adjustment-line";
2
- import ShippingMethod from "./shipping-method";
3
- export default class ShippingMethodAdjustment extends AdjustmentLine {
4
- shipping_method: ShippingMethod;
3
+ import OrderShippingMethod from "./shipping-method";
4
+ export default class OrderShippingMethodAdjustment extends AdjustmentLine {
5
+ shipping_method: Rel<OrderShippingMethod>;
5
6
  shipping_method_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
8
9
  }
10
+ //# sourceMappingURL=shipping-method-adjustment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method-adjustment.d.ts","sourceRoot":"","sources":["../../src/models/shipping-method-adjustment.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,mBAAmB,MAAM,mBAAmB,CAAA;AAQnD,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,cAAc;IAIvE,eAAe,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAUzC,kBAAkB,EAAE,MAAM,CAAA;IAG1B,QAAQ;IAMR,MAAM;CAIP"}
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const utils_1 = require("@medusajs/utils");
15
+ const utils_1 = require("@medusajs/framework/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
17
  const adjustment_line_1 = __importDefault(require("./adjustment-line"));
18
18
  const shipping_method_1 = __importDefault(require("./shipping-method"));
@@ -20,22 +20,22 @@ const ShippingMethodIdIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
20
  tableName: "order_shipping_method_adjustment",
21
21
  columns: "shipping_method_id",
22
22
  });
23
- let ShippingMethodAdjustment = class ShippingMethodAdjustment extends adjustment_line_1.default {
23
+ let OrderShippingMethodAdjustment = class OrderShippingMethodAdjustment extends adjustment_line_1.default {
24
24
  onCreate() {
25
25
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmadj");
26
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
26
+ this.shipping_method_id ??= this.shipping_method?.id;
27
27
  }
28
28
  onInit() {
29
29
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmadj");
30
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
30
+ this.shipping_method_id ??= this.shipping_method?.id;
31
31
  }
32
32
  };
33
33
  __decorate([
34
34
  (0, core_1.ManyToOne)(() => shipping_method_1.default, {
35
35
  persist: false,
36
36
  }),
37
- __metadata("design:type", shipping_method_1.default)
38
- ], ShippingMethodAdjustment.prototype, "shipping_method", void 0);
37
+ __metadata("design:type", Object)
38
+ ], OrderShippingMethodAdjustment.prototype, "shipping_method", void 0);
39
39
  __decorate([
40
40
  (0, core_1.ManyToOne)({
41
41
  entity: () => shipping_method_1.default,
@@ -46,21 +46,21 @@ __decorate([
46
46
  }),
47
47
  ShippingMethodIdIdIndex.MikroORMIndex(),
48
48
  __metadata("design:type", String)
49
- ], ShippingMethodAdjustment.prototype, "shipping_method_id", void 0);
49
+ ], OrderShippingMethodAdjustment.prototype, "shipping_method_id", void 0);
50
50
  __decorate([
51
51
  (0, core_1.BeforeCreate)(),
52
52
  __metadata("design:type", Function),
53
53
  __metadata("design:paramtypes", []),
54
54
  __metadata("design:returntype", void 0)
55
- ], ShippingMethodAdjustment.prototype, "onCreate", null);
55
+ ], OrderShippingMethodAdjustment.prototype, "onCreate", null);
56
56
  __decorate([
57
57
  (0, core_1.OnInit)(),
58
58
  __metadata("design:type", Function),
59
59
  __metadata("design:paramtypes", []),
60
60
  __metadata("design:returntype", void 0)
61
- ], ShippingMethodAdjustment.prototype, "onInit", null);
62
- ShippingMethodAdjustment = __decorate([
61
+ ], OrderShippingMethodAdjustment.prototype, "onInit", null);
62
+ OrderShippingMethodAdjustment = __decorate([
63
63
  (0, core_1.Entity)({ tableName: "order_shipping_method_adjustment" })
64
- ], ShippingMethodAdjustment);
65
- exports.default = ShippingMethodAdjustment;
64
+ ], OrderShippingMethodAdjustment);
65
+ exports.default = OrderShippingMethodAdjustment;
66
66
  //# sourceMappingURL=shipping-method-adjustment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shipping-method-adjustment.js","sourceRoot":"","sources":["../../src/models/shipping-method-adjustment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,0CAAyE;AACzE,wEAA8C;AAC9C,wEAA8C;AAE9C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./shipping-method";
1
+ import { Rel } from "@mikro-orm/core";
2
+ import OrderShippingMethod from "./shipping-method";
2
3
  import TaxLine from "./tax-line";
3
- export default class ShippingMethodTaxLine extends TaxLine {
4
- shipping_method: ShippingMethod;
4
+ export default class OrderShippingMethodTaxLine extends TaxLine {
5
+ shipping_method: Rel<OrderShippingMethod>;
5
6
  shipping_method_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
8
9
  }
10
+ //# sourceMappingURL=shipping-method-tax-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method-tax-line.d.ts","sourceRoot":"","sources":["../../src/models/shipping-method-tax-line.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,mBAAmB,MAAM,mBAAmB,CAAA;AACnD,OAAO,OAAO,MAAM,YAAY,CAAA;AAQhC,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,OAAO;IAI7D,eAAe,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAUzC,kBAAkB,EAAE,MAAM,CAAA;IAG1B,QAAQ;IAMR,MAAM;CAIP"}
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const utils_1 = require("@medusajs/utils");
15
+ const utils_1 = require("@medusajs/framework/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
17
  const shipping_method_1 = __importDefault(require("./shipping-method"));
18
18
  const tax_line_1 = __importDefault(require("./tax-line"));
@@ -20,22 +20,22 @@ const ShippingMethodIdIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
20
  tableName: "order_shipping_method_tax_line",
21
21
  columns: "shipping_method_id",
22
22
  });
23
- let ShippingMethodTaxLine = class ShippingMethodTaxLine extends tax_line_1.default {
23
+ let OrderShippingMethodTaxLine = class OrderShippingMethodTaxLine extends tax_line_1.default {
24
24
  onCreate() {
25
25
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmtxl");
26
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
26
+ this.shipping_method_id ??= this.shipping_method?.id;
27
27
  }
28
28
  onInit() {
29
29
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmtxl");
30
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
30
+ this.shipping_method_id ??= this.shipping_method?.id;
31
31
  }
32
32
  };
33
33
  __decorate([
34
34
  (0, core_1.ManyToOne)(() => shipping_method_1.default, {
35
35
  persist: false,
36
36
  }),
37
- __metadata("design:type", shipping_method_1.default)
38
- ], ShippingMethodTaxLine.prototype, "shipping_method", void 0);
37
+ __metadata("design:type", Object)
38
+ ], OrderShippingMethodTaxLine.prototype, "shipping_method", void 0);
39
39
  __decorate([
40
40
  (0, core_1.ManyToOne)({
41
41
  entity: () => shipping_method_1.default,
@@ -46,21 +46,21 @@ __decorate([
46
46
  }),
47
47
  ShippingMethodIdIdIndex.MikroORMIndex(),
48
48
  __metadata("design:type", String)
49
- ], ShippingMethodTaxLine.prototype, "shipping_method_id", void 0);
49
+ ], OrderShippingMethodTaxLine.prototype, "shipping_method_id", void 0);
50
50
  __decorate([
51
51
  (0, core_1.BeforeCreate)(),
52
52
  __metadata("design:type", Function),
53
53
  __metadata("design:paramtypes", []),
54
54
  __metadata("design:returntype", void 0)
55
- ], ShippingMethodTaxLine.prototype, "onCreate", null);
55
+ ], OrderShippingMethodTaxLine.prototype, "onCreate", null);
56
56
  __decorate([
57
57
  (0, core_1.OnInit)(),
58
58
  __metadata("design:type", Function),
59
59
  __metadata("design:paramtypes", []),
60
60
  __metadata("design:returntype", void 0)
61
- ], ShippingMethodTaxLine.prototype, "onInit", null);
62
- ShippingMethodTaxLine = __decorate([
61
+ ], OrderShippingMethodTaxLine.prototype, "onInit", null);
62
+ OrderShippingMethodTaxLine = __decorate([
63
63
  (0, core_1.Entity)({ tableName: "order_shipping_method_tax_line" })
64
- ], ShippingMethodTaxLine);
65
- exports.default = ShippingMethodTaxLine;
64
+ ], OrderShippingMethodTaxLine);
65
+ exports.default = OrderShippingMethodTaxLine;
66
66
  //# sourceMappingURL=shipping-method-tax-line.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shipping-method-tax-line.js","sourceRoot":"","sources":["../../src/models/shipping-method-tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,0CAAyE;AACzE,wEAA8C;AAC9C,0DAAgC;AAEhC,MAAM,uBAAuB,GAAG,IAAA,sCAA8B,EAAC;IAC7D,SAAS,EAAE,gCAAgC;IAC3C,OAAO,EAAE,oBAAoB;CAC9B,CAAC,CAAA;AAGa,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,kBAAO;IAiBxD,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,kBAAkB,KAAvB,IAAI,CAAC,kBAAkB,GAAK,IAAI,CAAC,eAAe,EAAE,EAAE,EAAA;IACtD,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,kBAAkB,KAAvB,IAAI,CAAC,kBAAkB,GAAK,IAAI,CAAC,eAAe,EAAE,EAAE,EAAA;IACtD,CAAC;CACF,CAAA;AAvBC;IAHC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,yBAAc,EAAE;QAC/B,OAAO,EAAE,KAAK;KACf,CAAC;8BACe,yBAAc;8DAAA;AAU/B;IARC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,yBAAc;QAC5B,SAAS,EAAE,oBAAoB;QAC/B,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE,I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EAAE,MAAM;QAClB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,uBAAuB,CAAC,aAAa,EAAE;;sEACd;AAG1B;IADC,IAAA,mBAAY,GAAE;;;;0DAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;wDAIR;AA1BkB,0BAA0B;IAD9C,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,gCAAgC,EAAE,CAAC;GACnC,0BAA0B,CA2B9C;kBA3BoB,0BAA0B"}
@@ -1,22 +1,25 @@
1
- import { BigNumberRawValue } from "@medusajs/types";
2
- import { BigNumber } from "@medusajs/utils";
1
+ import { BigNumberRawValue } from "@medusajs/framework/types";
2
+ import { BigNumber } from "@medusajs/framework/utils";
3
3
  import { Collection } from "@mikro-orm/core";
4
- import ShippingMethodAdjustment from "./shipping-method-adjustment";
5
- import ShippingMethodTaxLine from "./shipping-method-tax-line";
6
- export default class ShippingMethod {
4
+ import OrderShippingMethodAdjustment from "./shipping-method-adjustment";
5
+ import OrderShippingMethodTaxLine from "./shipping-method-tax-line";
6
+ export default class OrderShippingMethod {
7
7
  id: string;
8
8
  name: string;
9
9
  description: string | null;
10
10
  amount: BigNumber | number;
11
11
  raw_amount: BigNumberRawValue;
12
12
  is_tax_inclusive: boolean;
13
+ is_custom_amount: boolean;
13
14
  shipping_option_id: string | null;
14
15
  data: Record<string, unknown> | null;
15
16
  metadata: Record<string, unknown> | null;
16
- tax_lines: Collection<ShippingMethodTaxLine, object>;
17
- adjustments: Collection<ShippingMethodAdjustment, object>;
17
+ tax_lines: Collection<OrderShippingMethodTaxLine, object>;
18
+ adjustments: Collection<OrderShippingMethodAdjustment, object>;
18
19
  created_at: Date;
19
20
  updated_at: Date;
21
+ deleted_at: Date | null;
20
22
  onCreate(): void;
21
23
  onInit(): void;
22
24
  }
25
+ //# sourceMappingURL=shipping-method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method.d.ts","sourceRoot":"","sources":["../../src/models/shipping-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EACL,SAAS,EAKV,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,UAAU,EAQX,MAAM,iBAAiB,CAAA;AACxB,OAAO,6BAA6B,MAAM,8BAA8B,CAAA;AACxE,OAAO,0BAA0B,MAAM,4BAA4B,CAAA;AAgBnE,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAEtC,EAAE,EAAE,MAAM,CAAA;IAGV,IAAI,EAAE,MAAM,CAAA;IAGZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAO;IAGjC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;IAG1B,UAAU,EAAE,iBAAiB,CAAA;IAG7B,gBAAgB,EAAE,OAAO,CAAQ;IAGjC,gBAAgB,EAAE,OAAO,CAAQ;IAOjC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAO;IAGxC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAG3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAS/C,SAAS,iDAAwD;IASjE,WAAW,oDAA2D;IAOtE,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAIR,MAAM;CAGP"}
@@ -12,23 +12,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const utils_1 = require("@medusajs/utils");
15
+ const utils_1 = require("@medusajs/framework/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
17
  const shipping_method_adjustment_1 = __importDefault(require("./shipping-method-adjustment"));
18
18
  const shipping_method_tax_line_1 = __importDefault(require("./shipping-method-tax-line"));
19
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
+ tableName: "order_shipping_method",
21
+ columns: "deleted_at",
22
+ where: "deleted_at IS NOT NULL",
23
+ });
19
24
  const ShippingOptionIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
25
  tableName: "order_shipping_method",
21
26
  columns: "shipping_option_id",
27
+ where: "deleted_at IS NOT NULL",
22
28
  });
23
- let ShippingMethod = class ShippingMethod {
29
+ let OrderShippingMethod = class OrderShippingMethod {
24
30
  constructor() {
25
31
  this.description = null;
26
32
  this.is_tax_inclusive = false;
33
+ this.is_custom_amount = false;
27
34
  this.shipping_option_id = null;
28
35
  this.data = null;
29
36
  this.metadata = null;
30
37
  this.tax_lines = new core_1.Collection(this);
31
38
  this.adjustments = new core_1.Collection(this);
39
+ this.deleted_at = null;
32
40
  }
33
41
  onCreate() {
34
42
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsm");
@@ -40,27 +48,31 @@ let ShippingMethod = class ShippingMethod {
40
48
  __decorate([
41
49
  (0, core_1.PrimaryKey)({ columnType: "text" }),
42
50
  __metadata("design:type", String)
43
- ], ShippingMethod.prototype, "id", void 0);
51
+ ], OrderShippingMethod.prototype, "id", void 0);
44
52
  __decorate([
45
53
  (0, core_1.Property)({ columnType: "text" }),
46
54
  __metadata("design:type", String)
47
- ], ShippingMethod.prototype, "name", void 0);
55
+ ], OrderShippingMethod.prototype, "name", void 0);
48
56
  __decorate([
49
57
  (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
50
58
  __metadata("design:type", Object)
51
- ], ShippingMethod.prototype, "description", void 0);
59
+ ], OrderShippingMethod.prototype, "description", void 0);
52
60
  __decorate([
53
61
  (0, utils_1.MikroOrmBigNumberProperty)(),
54
62
  __metadata("design:type", Object)
55
- ], ShippingMethod.prototype, "amount", void 0);
63
+ ], OrderShippingMethod.prototype, "amount", void 0);
56
64
  __decorate([
57
65
  (0, core_1.Property)({ columnType: "jsonb" }),
58
66
  __metadata("design:type", Object)
59
- ], ShippingMethod.prototype, "raw_amount", void 0);
67
+ ], OrderShippingMethod.prototype, "raw_amount", void 0);
60
68
  __decorate([
61
69
  (0, core_1.Property)({ columnType: "boolean" }),
62
- __metadata("design:type", Object)
63
- ], ShippingMethod.prototype, "is_tax_inclusive", void 0);
70
+ __metadata("design:type", Boolean)
71
+ ], OrderShippingMethod.prototype, "is_tax_inclusive", void 0);
72
+ __decorate([
73
+ (0, core_1.Property)({ columnType: "boolean", default: false }),
74
+ __metadata("design:type", Boolean)
75
+ ], OrderShippingMethod.prototype, "is_custom_amount", void 0);
64
76
  __decorate([
65
77
  (0, core_1.Property)({
66
78
  columnType: "text",
@@ -68,27 +80,27 @@ __decorate([
68
80
  }),
69
81
  ShippingOptionIdIndex.MikroORMIndex(),
70
82
  __metadata("design:type", Object)
71
- ], ShippingMethod.prototype, "shipping_option_id", void 0);
83
+ ], OrderShippingMethod.prototype, "shipping_option_id", void 0);
72
84
  __decorate([
73
85
  (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
74
86
  __metadata("design:type", Object)
75
- ], ShippingMethod.prototype, "data", void 0);
87
+ ], OrderShippingMethod.prototype, "data", void 0);
76
88
  __decorate([
77
89
  (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
78
90
  __metadata("design:type", Object)
79
- ], ShippingMethod.prototype, "metadata", void 0);
91
+ ], OrderShippingMethod.prototype, "metadata", void 0);
80
92
  __decorate([
81
93
  (0, core_1.OneToMany)(() => shipping_method_tax_line_1.default, (taxLine) => taxLine.shipping_method, {
82
- cascade: [core_1.Cascade.PERSIST],
94
+ cascade: [core_1.Cascade.PERSIST, "soft-remove"],
83
95
  }),
84
96
  __metadata("design:type", Object)
85
- ], ShippingMethod.prototype, "tax_lines", void 0);
97
+ ], OrderShippingMethod.prototype, "tax_lines", void 0);
86
98
  __decorate([
87
99
  (0, core_1.OneToMany)(() => shipping_method_adjustment_1.default, (adjustment) => adjustment.shipping_method, {
88
- cascade: [core_1.Cascade.PERSIST],
100
+ cascade: [core_1.Cascade.PERSIST, "soft-remove"],
89
101
  }),
90
102
  __metadata("design:type", Object)
91
- ], ShippingMethod.prototype, "adjustments", void 0);
103
+ ], OrderShippingMethod.prototype, "adjustments", void 0);
92
104
  __decorate([
93
105
  (0, core_1.Property)({
94
106
  onCreate: () => new Date(),
@@ -96,7 +108,7 @@ __decorate([
96
108
  defaultRaw: "now()",
97
109
  }),
98
110
  __metadata("design:type", Date)
99
- ], ShippingMethod.prototype, "created_at", void 0);
111
+ ], OrderShippingMethod.prototype, "created_at", void 0);
100
112
  __decorate([
101
113
  (0, core_1.Property)({
102
114
  onCreate: () => new Date(),
@@ -105,21 +117,27 @@ __decorate([
105
117
  defaultRaw: "now()",
106
118
  }),
107
119
  __metadata("design:type", Date)
108
- ], ShippingMethod.prototype, "updated_at", void 0);
120
+ ], OrderShippingMethod.prototype, "updated_at", void 0);
121
+ __decorate([
122
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
123
+ DeletedAtIndex.MikroORMIndex(),
124
+ __metadata("design:type", Object)
125
+ ], OrderShippingMethod.prototype, "deleted_at", void 0);
109
126
  __decorate([
110
127
  (0, core_1.BeforeCreate)(),
111
128
  __metadata("design:type", Function),
112
129
  __metadata("design:paramtypes", []),
113
130
  __metadata("design:returntype", void 0)
114
- ], ShippingMethod.prototype, "onCreate", null);
131
+ ], OrderShippingMethod.prototype, "onCreate", null);
115
132
  __decorate([
116
133
  (0, core_1.OnInit)(),
117
134
  __metadata("design:type", Function),
118
135
  __metadata("design:paramtypes", []),
119
136
  __metadata("design:returntype", void 0)
120
- ], ShippingMethod.prototype, "onInit", null);
121
- ShippingMethod = __decorate([
122
- (0, core_1.Entity)({ tableName: "order_shipping_method" })
123
- ], ShippingMethod);
124
- exports.default = ShippingMethod;
137
+ ], OrderShippingMethod.prototype, "onInit", null);
138
+ OrderShippingMethod = __decorate([
139
+ (0, core_1.Entity)({ tableName: "order_shipping_method" }),
140
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
141
+ ], OrderShippingMethod);
142
+ exports.default = OrderShippingMethod;
125
143
  //# sourceMappingURL=shipping-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shipping-method.js","sourceRoot":"","sources":["../../src/models/shipping-method.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CASwB;AACxB,8FAAmE;AACnE,0FAA8D;AAE9D,MAAM,qBAAqB,GAAG,IAAA,sCAA8B,EAAC;IAC3D,SAAS,EAAE,uBAAuB;IAClC,OAAO,EAAE,oBAAoB;CAC9B,CAAC,CAAA;AAGa,IAAM,cAAc,GAApB,MAAM,cAAc;IAApB;QAQb,gBAAW,GAAkB,IAAI,CAAA;QASjC,qBAAgB,GAAG,KAAK,CAAA;QAOxB,uBAAkB,GAAkB,IAAI,CAAA;QAGxC,SAAI,GAAmC,IAAI,CAAA;QAG3C,aAAQ,GAAmC,IAAI,CAAA;QAS/C,cAAS,GAAG,IAAI,iBAAU,CAAwB,IAAI,CAAC,CAAA;QASvD,gBAAW,GAAG,IAAI,iBAAU,CAA2B,IAAI,CAAC,CAAA;IAyB9D,CAAC;IAPC,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAvEC;IADC,IAAA,iBAAU,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;0CACzB;AAGV;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;4CACrB;AAGZ;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CA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CAA6B,EACnC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,eAAe,EAC1C;QACE,OAAO,EAAE,CAAC,cAAO,CAAC,OAAO,EAAE,aAAwB,CAAC;KACrD,CACF;;wDACqE;AAOtE;IALC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;uDAAA;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;uDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;uDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;mDAGd;AAED;IADC,IAAA,aAAM,GAAE;;;;iDAGR;AA/EkB,mBAAmB;IAFvC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IAC9C,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;GAC/B,mBAAmB,CAgFvC;kBAhFoB,mBAAmB"}
@@ -1,5 +1,5 @@
1
- import { BigNumberRawValue } from "@medusajs/types";
2
- import { BigNumber } from "@medusajs/utils";
1
+ import { BigNumberRawValue } from "@medusajs/framework/types";
2
+ import { BigNumber } from "@medusajs/framework/utils";
3
3
  /**
4
4
  * As per the Mikro ORM docs, superclasses should use the abstract class definition
5
5
  * Source: https://mikro-orm.io/docs/inheritance-mapping
@@ -14,4 +14,6 @@ export default abstract class TaxLine {
14
14
  provider_id?: string | null;
15
15
  created_at: Date;
16
16
  updated_at: Date;
17
+ deleted_at: Date | null;
17
18
  }
19
+ //# sourceMappingURL=tax-line.d.ts.map