@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 @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AQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACrC;AAGZ;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACH;AAO/C;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;kDAAA;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;kDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;kDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;8CAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;4CAIR;AAtFkB,cAAc;IADlC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,CAAC;GACD,cAAc,CAuFlC;kBAvFoB,cAAc"}
@@ -0,0 +1,37 @@
1
+ import { BigNumberRawValue, DAL } from "@medusajs/framework/types";
2
+ import { BigNumber, ClaimType } from "@medusajs/framework/utils";
3
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
4
+ import ClaimItem from "./claim-item";
5
+ import Order from "./order";
6
+ import OrderShipping from "./order-shipping-method";
7
+ import Return from "./return";
8
+ import OrderTransaction from "./transaction";
9
+ type OptionalOrderClaimProps = DAL.ModelDateColumns;
10
+ export default class OrderClaim {
11
+ [OptionalProps]?: OptionalOrderClaimProps;
12
+ id: string;
13
+ order_id: string;
14
+ order: Rel<Order>;
15
+ return: Rel<Return>;
16
+ return_id: string | null;
17
+ order_version: number;
18
+ display_id: number;
19
+ type: Rel<ClaimType>;
20
+ no_notification: boolean | null;
21
+ refund_amount: BigNumber | number;
22
+ raw_refund_amount: BigNumberRawValue;
23
+ additional_items: Collection<ClaimItem, object>;
24
+ claim_items: Collection<ClaimItem, object>;
25
+ shipping_methods: Collection<OrderShipping, object>;
26
+ transactions: Collection<OrderTransaction, object>;
27
+ created_by: string | null;
28
+ metadata: Record<string, unknown> | null;
29
+ created_at: Date;
30
+ updated_at: Date;
31
+ deleted_at: Date | null;
32
+ canceled_at: Date | null;
33
+ onCreate(): void;
34
+ onInit(): void;
35
+ }
36
+ export {};
37
+ //# sourceMappingURL=claim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/models/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EACL,SAAS,EACT,SAAS,EAKV,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,UAAU,EAQV,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,aAAa,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,gBAAgB,MAAM,eAAe,CAAA;AAE5C,KAAK,uBAAuB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AA4BnD,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,CAAC,aAAa,CAAC,CAAC,EAAE,uBAAuB,CAAA;IAGzC,EAAE,EAAE,MAAM,CAAA;IASV,QAAQ,EAAE,MAAM,CAAA;IAKhB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IASjB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAInB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAK/B,aAAa,EAAE,MAAM,CAAA;IAIrB,UAAU,EAAE,MAAM,CAAA;IAGlB,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IAGpB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAO;IAKtC,aAAa,EAAE,SAAS,GAAG,MAAM,CAAA;IAGjC,iBAAiB,EAAE,iBAAiB,CAAA;IAKpC,gBAAgB,gCAAuC;IAKvD,WAAW,gCAAuC;IAKlD,gBAAgB,oCAA2C;IAK3D,YAAY,uCAAyC;IAGrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAO;IAGhC,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,WAAW,EAAE,IAAI,GAAG,IAAI,CAAO;IAG/B,QAAQ;IAKR,MAAM;CAGP"}
@@ -0,0 +1,201 @@
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 claim_item_1 = __importDefault(require("./claim-item"));
18
+ const order_1 = __importDefault(require("./order"));
19
+ const order_shipping_method_1 = __importDefault(require("./order-shipping-method"));
20
+ const return_1 = __importDefault(require("./return"));
21
+ const transaction_1 = __importDefault(require("./transaction"));
22
+ const DisplayIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
+ tableName: "order_claim",
24
+ columns: "display_id",
25
+ where: "deleted_at IS NOT NULL",
26
+ });
27
+ const OrderClaimDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
28
+ tableName: "order_claim",
29
+ columns: "deleted_at",
30
+ where: "deleted_at IS NOT NULL",
31
+ });
32
+ const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
33
+ tableName: "order_claim",
34
+ columns: ["order_id"],
35
+ where: "deleted_at IS NOT NULL",
36
+ });
37
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
+ tableName: "order_claim",
39
+ columns: "return_id",
40
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
41
+ });
42
+ let OrderClaim = class OrderClaim {
43
+ constructor() {
44
+ this.return_id = null;
45
+ this.no_notification = null;
46
+ this.additional_items = new core_1.Collection(this);
47
+ this.claim_items = new core_1.Collection(this);
48
+ this.shipping_methods = new core_1.Collection(this);
49
+ this.transactions = new core_1.Collection(this);
50
+ this.created_by = null;
51
+ this.metadata = null;
52
+ this.deleted_at = null;
53
+ this.canceled_at = null;
54
+ }
55
+ onCreate() {
56
+ this.id = (0, utils_1.generateEntityId)(this.id, "claim");
57
+ }
58
+ onInit() {
59
+ this.id = (0, utils_1.generateEntityId)(this.id, "claim");
60
+ }
61
+ };
62
+ __decorate([
63
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
64
+ __metadata("design:type", String)
65
+ ], OrderClaim.prototype, "id", void 0);
66
+ __decorate([
67
+ (0, core_1.ManyToOne)({
68
+ entity: () => order_1.default,
69
+ mapToPk: true,
70
+ fieldName: "order_id",
71
+ columnType: "text",
72
+ }),
73
+ OrderIdIndex.MikroORMIndex(),
74
+ __metadata("design:type", String)
75
+ ], OrderClaim.prototype, "order_id", void 0);
76
+ __decorate([
77
+ (0, core_1.ManyToOne)(() => order_1.default, {
78
+ persist: false,
79
+ }),
80
+ __metadata("design:type", Object)
81
+ ], OrderClaim.prototype, "order", void 0);
82
+ __decorate([
83
+ (0, core_1.OneToOne)({
84
+ entity: () => return_1.default,
85
+ mappedBy: (ret) => ret.claim,
86
+ fieldName: "return_id",
87
+ nullable: true,
88
+ owner: true,
89
+ }),
90
+ __metadata("design:type", Object)
91
+ ], OrderClaim.prototype, "return", void 0);
92
+ __decorate([
93
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
94
+ ReturnIdIndex.MikroORMIndex(),
95
+ __metadata("design:type", Object)
96
+ ], OrderClaim.prototype, "return_id", void 0);
97
+ __decorate([
98
+ (0, core_1.Property)({
99
+ columnType: "integer",
100
+ }),
101
+ __metadata("design:type", Number)
102
+ ], OrderClaim.prototype, "order_version", void 0);
103
+ __decorate([
104
+ (0, core_1.Property)({ autoincrement: true, primary: false }),
105
+ DisplayIdIndex.MikroORMIndex(),
106
+ __metadata("design:type", Number)
107
+ ], OrderClaim.prototype, "display_id", void 0);
108
+ __decorate([
109
+ (0, core_1.Enum)({ items: () => utils_1.ClaimType }),
110
+ __metadata("design:type", Object)
111
+ ], OrderClaim.prototype, "type", void 0);
112
+ __decorate([
113
+ (0, core_1.Property)({ columnType: "boolean", nullable: true }),
114
+ __metadata("design:type", Object)
115
+ ], OrderClaim.prototype, "no_notification", void 0);
116
+ __decorate([
117
+ (0, utils_1.MikroOrmBigNumberProperty)({
118
+ nullable: true,
119
+ }),
120
+ __metadata("design:type", Object)
121
+ ], OrderClaim.prototype, "refund_amount", void 0);
122
+ __decorate([
123
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
124
+ __metadata("design:type", Object)
125
+ ], OrderClaim.prototype, "raw_refund_amount", void 0);
126
+ __decorate([
127
+ (0, core_1.OneToMany)(() => claim_item_1.default, (item) => item.claim, {
128
+ cascade: [core_1.Cascade.PERSIST],
129
+ }),
130
+ __metadata("design:type", Object)
131
+ ], OrderClaim.prototype, "additional_items", void 0);
132
+ __decorate([
133
+ (0, core_1.OneToMany)(() => claim_item_1.default, (item) => item.claim, {
134
+ cascade: [core_1.Cascade.PERSIST],
135
+ }),
136
+ __metadata("design:type", Object)
137
+ ], OrderClaim.prototype, "claim_items", void 0);
138
+ __decorate([
139
+ (0, core_1.OneToMany)(() => order_shipping_method_1.default, (shippingMethod) => shippingMethod.claim, {
140
+ cascade: [core_1.Cascade.PERSIST],
141
+ }),
142
+ __metadata("design:type", Object)
143
+ ], OrderClaim.prototype, "shipping_methods", void 0);
144
+ __decorate([
145
+ (0, core_1.OneToMany)(() => transaction_1.default, (transaction) => transaction.claim, {
146
+ cascade: [core_1.Cascade.PERSIST],
147
+ }),
148
+ __metadata("design:type", Object)
149
+ ], OrderClaim.prototype, "transactions", void 0);
150
+ __decorate([
151
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
152
+ __metadata("design:type", Object)
153
+ ], OrderClaim.prototype, "created_by", void 0);
154
+ __decorate([
155
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
156
+ __metadata("design:type", Object)
157
+ ], OrderClaim.prototype, "metadata", void 0);
158
+ __decorate([
159
+ (0, core_1.Property)({
160
+ onCreate: () => new Date(),
161
+ columnType: "timestamptz",
162
+ defaultRaw: "now()",
163
+ }),
164
+ __metadata("design:type", Date)
165
+ ], OrderClaim.prototype, "created_at", void 0);
166
+ __decorate([
167
+ (0, core_1.Property)({
168
+ onCreate: () => new Date(),
169
+ onUpdate: () => new Date(),
170
+ columnType: "timestamptz",
171
+ defaultRaw: "now()",
172
+ }),
173
+ __metadata("design:type", Date)
174
+ ], OrderClaim.prototype, "updated_at", void 0);
175
+ __decorate([
176
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
177
+ OrderClaimDeletedAtIndex.MikroORMIndex(),
178
+ __metadata("design:type", Object)
179
+ ], OrderClaim.prototype, "deleted_at", void 0);
180
+ __decorate([
181
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
182
+ __metadata("design:type", Object)
183
+ ], OrderClaim.prototype, "canceled_at", void 0);
184
+ __decorate([
185
+ (0, core_1.BeforeCreate)(),
186
+ __metadata("design:type", Function),
187
+ __metadata("design:paramtypes", []),
188
+ __metadata("design:returntype", void 0)
189
+ ], OrderClaim.prototype, "onCreate", null);
190
+ __decorate([
191
+ (0, core_1.OnInit)(),
192
+ __metadata("design:type", Function),
193
+ __metadata("design:paramtypes", []),
194
+ __metadata("design:returntype", void 0)
195
+ ], OrderClaim.prototype, "onInit", null);
196
+ OrderClaim = __decorate([
197
+ (0, core_1.Entity)({ tableName: "order_claim" }),
198
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
199
+ ], OrderClaim);
200
+ exports.default = OrderClaim;
201
+ //# sourceMappingURL=claim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/models/claim.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,qDAOkC;AAClC,0CAewB;AACxB,8DAAoC;AACpC,oDAA2B;AAC3B,oFAAmD;AACnD,sDAA6B;AAC7B,gEAA4C;AAI5C,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,wBAAwB,GAAG,IAAA,sCAA8B,EAAC;IAC9D,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,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,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,wBAAwB,CAAC,aAAa,EAAE;;8CACX;AAG9B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACzB;AAG/B;IADC,IAAA,mBAAY,GAAE;;;;0CAGd;AAGD;IADC,IAAA,aAAM,GAAE;;;;wCAGR;AAhHkB,UAAU;IAF9B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;IACpC,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;GAC/B,UAAU,CAiH9B;kBAjHoB,UAAU"}
@@ -0,0 +1,24 @@
1
+ import { BigNumberRawValue, DAL } from "@medusajs/framework/types";
2
+ import { OptionalProps } from "@mikro-orm/core";
3
+ import Exchange from "./exchange";
4
+ import OrderLineItem from "./line-item";
5
+ type OptionalLineItemProps = DAL.ModelDateColumns;
6
+ export default class OrderExchangeItem {
7
+ [OptionalProps]?: OptionalLineItemProps;
8
+ id: string;
9
+ quantity: Number | number;
10
+ raw_quantity: BigNumberRawValue;
11
+ exchange_id: string;
12
+ exchange: Exchange;
13
+ item_id: string;
14
+ item: OrderLineItem;
15
+ note: string;
16
+ metadata: Record<string, unknown> | null;
17
+ created_at: Date;
18
+ updated_at: Date;
19
+ deleted_at: Date | null;
20
+ onCreate(): void;
21
+ onInit(): void;
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=exchange-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange-item.d.ts","sourceRoot":"","sources":["../../src/models/exchange-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAA;AAMlE,OAAO,EAKL,aAAa,EAGd,MAAM,iBAAiB,CAAA;AACxB,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,aAAa,MAAM,aAAa,CAAA;AAEvC,KAAK,qBAAqB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AAqBjD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,CAAC,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAA;IAGvC,EAAE,EAAE,MAAM,CAAA;IAGV,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;IAGzB,YAAY,EAAE,iBAAiB,CAAA;IAS/B,WAAW,EAAE,MAAM,CAAA;IAKnB,QAAQ,EAAE,QAAQ,CAAA;IASlB,OAAO,EAAE,MAAM,CAAA;IAKf,IAAI,EAAE,aAAa,CAAA;IAGnB,IAAI,EAAE,MAAM,CAAA;IAGZ,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;IAMR,MAAM;CAIP"}
@@ -0,0 +1,138 @@
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 exchange_1 = __importDefault(require("./exchange"));
18
+ const line_item_1 = __importDefault(require("./line-item"));
19
+ const ExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
+ tableName: "order_exchange_item",
21
+ columns: "exchange_id",
22
+ where: "deleted_at IS NOT NULL",
23
+ });
24
+ const ItemIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
25
+ tableName: "order_exchange_item",
26
+ columns: "item_id",
27
+ where: "deleted_at IS NOT NULL",
28
+ });
29
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
30
+ tableName: "order_claim_item_image",
31
+ columns: "deleted_at",
32
+ where: "deleted_at IS NOT NULL",
33
+ });
34
+ let OrderExchangeItem = class OrderExchangeItem {
35
+ constructor() {
36
+ this.metadata = null;
37
+ this.deleted_at = null;
38
+ }
39
+ onCreate() {
40
+ this.id = (0, utils_1.generateEntityId)(this.id, "oexcitem");
41
+ this.exchange_id ??= this.exchange?.id;
42
+ }
43
+ onInit() {
44
+ this.id = (0, utils_1.generateEntityId)(this.id, "oexcitem");
45
+ this.exchange_id ??= this.exchange?.id;
46
+ }
47
+ };
48
+ __decorate([
49
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
50
+ __metadata("design:type", String)
51
+ ], OrderExchangeItem.prototype, "id", void 0);
52
+ __decorate([
53
+ (0, utils_1.MikroOrmBigNumberProperty)(),
54
+ __metadata("design:type", Number)
55
+ ], OrderExchangeItem.prototype, "quantity", void 0);
56
+ __decorate([
57
+ (0, core_1.Property)({ columnType: "jsonb" }),
58
+ __metadata("design:type", Object)
59
+ ], OrderExchangeItem.prototype, "raw_quantity", void 0);
60
+ __decorate([
61
+ (0, core_1.ManyToOne)(() => exchange_1.default, {
62
+ columnType: "text",
63
+ fieldName: "exchange_id",
64
+ mapToPk: true,
65
+ onDelete: "cascade",
66
+ }),
67
+ ExchangeIdIndex.MikroORMIndex(),
68
+ __metadata("design:type", String)
69
+ ], OrderExchangeItem.prototype, "exchange_id", void 0);
70
+ __decorate([
71
+ (0, core_1.ManyToOne)(() => exchange_1.default, {
72
+ persist: false,
73
+ }),
74
+ __metadata("design:type", exchange_1.default)
75
+ ], OrderExchangeItem.prototype, "exchange", void 0);
76
+ __decorate([
77
+ (0, core_1.ManyToOne)({
78
+ entity: () => line_item_1.default,
79
+ fieldName: "item_id",
80
+ mapToPk: true,
81
+ columnType: "text",
82
+ }),
83
+ ItemIdIndex.MikroORMIndex(),
84
+ __metadata("design:type", String)
85
+ ], OrderExchangeItem.prototype, "item_id", void 0);
86
+ __decorate([
87
+ (0, core_1.ManyToOne)(() => line_item_1.default, {
88
+ persist: false,
89
+ }),
90
+ __metadata("design:type", line_item_1.default)
91
+ ], OrderExchangeItem.prototype, "item", void 0);
92
+ __decorate([
93
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
94
+ __metadata("design:type", String)
95
+ ], OrderExchangeItem.prototype, "note", void 0);
96
+ __decorate([
97
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
98
+ __metadata("design:type", Object)
99
+ ], OrderExchangeItem.prototype, "metadata", void 0);
100
+ __decorate([
101
+ (0, core_1.Property)({
102
+ onCreate: () => new Date(),
103
+ columnType: "timestamptz",
104
+ defaultRaw: "now()",
105
+ }),
106
+ __metadata("design:type", Date)
107
+ ], OrderExchangeItem.prototype, "created_at", void 0);
108
+ __decorate([
109
+ (0, core_1.Property)({
110
+ onCreate: () => new Date(),
111
+ onUpdate: () => new Date(),
112
+ columnType: "timestamptz",
113
+ defaultRaw: "now()",
114
+ }),
115
+ __metadata("design:type", Date)
116
+ ], OrderExchangeItem.prototype, "updated_at", void 0);
117
+ __decorate([
118
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
119
+ DeletedAtIndex.MikroORMIndex(),
120
+ __metadata("design:type", Object)
121
+ ], OrderExchangeItem.prototype, "deleted_at", void 0);
122
+ __decorate([
123
+ (0, core_1.BeforeCreate)(),
124
+ __metadata("design:type", Function),
125
+ __metadata("design:paramtypes", []),
126
+ __metadata("design:returntype", void 0)
127
+ ], OrderExchangeItem.prototype, "onCreate", null);
128
+ __decorate([
129
+ (0, core_1.OnInit)(),
130
+ __metadata("design:type", Function),
131
+ __metadata("design:paramtypes", []),
132
+ __metadata("design:returntype", void 0)
133
+ ], OrderExchangeItem.prototype, "onInit", null);
134
+ OrderExchangeItem = __decorate([
135
+ (0, core_1.Entity)({ tableName: "order_exchange_item" })
136
+ ], OrderExchangeItem);
137
+ exports.default = OrderExchangeItem;
138
+ //# sourceMappingURL=exchange-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange-item.js","sourceRoot":"","sources":["../../src/models/exchange-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,qDAIkC;AAClC,0CAQwB;AACxB,0DAAiC;AACjC,4DAAuC;AAIvC,MAAM,eAAe,GAAG,IAAA,sCAA8B,EAAC;IACrD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,IAAA,sCAA8B,EAAC;IACjD,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,wBAAwB;IACnC,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAGa,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QA4Cb,aAAQ,GAAmC,IAAI,CAAA;QAmB/C,eAAU,GAAgB,IAAI,CAAA;IAahC,CAAC;IAVC,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,QAAQ,E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E,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACH;AAO/C;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;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;;;;iDAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;+CAIR;AA3EkB,iBAAiB;IADrC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;GACxB,iBAAiB,CA4ErC;kBA5EoB,iBAAiB"}
@@ -0,0 +1,35 @@
1
+ import { BigNumberRawValue, DAL } from "@medusajs/framework/types";
2
+ import { BigNumber } from "@medusajs/framework/utils";
3
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
4
+ import { OrderExchangeItem, OrderTransaction } from ".";
5
+ import Order from "./order";
6
+ import OrderShipping from "./order-shipping-method";
7
+ import Return from "./return";
8
+ type OptionalOrderExchangeProps = DAL.ModelDateColumns;
9
+ export default class OrderExchange {
10
+ [OptionalProps]?: OptionalOrderExchangeProps;
11
+ id: string;
12
+ order_id: string;
13
+ order: Rel<Order>;
14
+ return: Rel<Return>;
15
+ return_id: string | null;
16
+ order_version: number;
17
+ display_id: number;
18
+ no_notification: boolean | null;
19
+ difference_due: BigNumber | number;
20
+ raw_difference_due: BigNumberRawValue;
21
+ allow_backorder: boolean;
22
+ additional_items: Collection<OrderExchangeItem, object>;
23
+ shipping_methods: Collection<OrderShipping, object>;
24
+ transactions: Collection<OrderTransaction, object>;
25
+ created_by: string | null;
26
+ metadata: Record<string, unknown> | null;
27
+ created_at: Date;
28
+ updated_at: Date;
29
+ deleted_at: Date | null;
30
+ canceled_at: Date | null;
31
+ onCreate(): void;
32
+ onInit(): void;
33
+ }
34
+ export {};
35
+ //# sourceMappingURL=exchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../src/models/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EACL,SAAS,EAKV,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,UAAU,EAOV,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,aAAa,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,KAAK,0BAA0B,GAAG,GAAG,CAAC,gBAAgB,CAAA;AA4BtD,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,CAAC,aAAa,CAAC,CAAC,EAAE,0BAA0B,CAAA;IAG5C,EAAE,EAAE,MAAM,CAAA;IASV,QAAQ,EAAE,MAAM,CAAA;IAKhB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IASjB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAInB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAK/B,aAAa,EAAE,MAAM,CAAA;IAIrB,UAAU,EAAE,MAAM,CAAA;IAGlB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAO;IAKtC,cAAc,EAAE,SAAS,GAAG,MAAM,CAAA;IAGlC,kBAAkB,EAAE,iBAAiB,CAAA;IAGrC,eAAe,EAAE,OAAO,CAAQ;IAKhC,gBAAgB,wCAA+C;IAK/D,gBAAgB,oCAA2C;IAK3D,YAAY,uCAAyC;IAGrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAO;IAGhC,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,WAAW,EAAE,IAAI,GAAG,IAAI,CAAO;IAG/B,QAAQ;IAKR,MAAM;CAGP"}
@@ -0,0 +1,194 @@
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 order_1 = __importDefault(require("./order"));
19
+ const order_shipping_method_1 = __importDefault(require("./order-shipping-method"));
20
+ const return_1 = __importDefault(require("./return"));
21
+ const DisplayIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
22
+ tableName: "order_exchange",
23
+ columns: "display_id",
24
+ where: "deleted_at IS NOT NULL",
25
+ });
26
+ const OrderExchangeDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
27
+ tableName: "order_exchange",
28
+ columns: "deleted_at",
29
+ where: "deleted_at IS NOT NULL",
30
+ });
31
+ const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
32
+ tableName: "order_exchange",
33
+ columns: ["order_id"],
34
+ where: "deleted_at IS NOT NULL",
35
+ });
36
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
37
+ tableName: "order_exchange",
38
+ columns: "return_id",
39
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
40
+ });
41
+ let OrderExchange = class OrderExchange {
42
+ constructor() {
43
+ this.return_id = null;
44
+ this.no_notification = null;
45
+ this.allow_backorder = false;
46
+ this.additional_items = new core_1.Collection(this);
47
+ this.shipping_methods = new core_1.Collection(this);
48
+ this.transactions = new core_1.Collection(this);
49
+ this.created_by = null;
50
+ this.metadata = null;
51
+ this.deleted_at = null;
52
+ this.canceled_at = null;
53
+ }
54
+ onCreate() {
55
+ this.id = (0, utils_1.generateEntityId)(this.id, "oexc");
56
+ }
57
+ onInit() {
58
+ this.id = (0, utils_1.generateEntityId)(this.id, "oexc");
59
+ }
60
+ };
61
+ __decorate([
62
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
63
+ __metadata("design:type", String)
64
+ ], OrderExchange.prototype, "id", void 0);
65
+ __decorate([
66
+ (0, core_1.ManyToOne)({
67
+ entity: () => order_1.default,
68
+ mapToPk: true,
69
+ fieldName: "order_id",
70
+ columnType: "text",
71
+ }),
72
+ OrderIdIndex.MikroORMIndex(),
73
+ __metadata("design:type", String)
74
+ ], OrderExchange.prototype, "order_id", void 0);
75
+ __decorate([
76
+ (0, core_1.ManyToOne)(() => order_1.default, {
77
+ persist: false,
78
+ }),
79
+ __metadata("design:type", Object)
80
+ ], OrderExchange.prototype, "order", void 0);
81
+ __decorate([
82
+ (0, core_1.OneToOne)({
83
+ entity: () => return_1.default,
84
+ mappedBy: (ret) => ret.exchange,
85
+ fieldName: "return_id",
86
+ nullable: true,
87
+ owner: true,
88
+ }),
89
+ __metadata("design:type", Object)
90
+ ], OrderExchange.prototype, "return", void 0);
91
+ __decorate([
92
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
93
+ ReturnIdIndex.MikroORMIndex(),
94
+ __metadata("design:type", Object)
95
+ ], OrderExchange.prototype, "return_id", void 0);
96
+ __decorate([
97
+ (0, core_1.Property)({
98
+ columnType: "integer",
99
+ }),
100
+ __metadata("design:type", Number)
101
+ ], OrderExchange.prototype, "order_version", void 0);
102
+ __decorate([
103
+ (0, core_1.Property)({ autoincrement: true, primary: false }),
104
+ DisplayIdIndex.MikroORMIndex(),
105
+ __metadata("design:type", Number)
106
+ ], OrderExchange.prototype, "display_id", void 0);
107
+ __decorate([
108
+ (0, core_1.Property)({ columnType: "boolean", nullable: true }),
109
+ __metadata("design:type", Object)
110
+ ], OrderExchange.prototype, "no_notification", void 0);
111
+ __decorate([
112
+ (0, utils_1.MikroOrmBigNumberProperty)({
113
+ nullable: true,
114
+ }),
115
+ __metadata("design:type", Object)
116
+ ], OrderExchange.prototype, "difference_due", void 0);
117
+ __decorate([
118
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
119
+ __metadata("design:type", Object)
120
+ ], OrderExchange.prototype, "raw_difference_due", void 0);
121
+ __decorate([
122
+ (0, core_1.Property)({ columnType: "boolean", default: false }),
123
+ __metadata("design:type", Boolean)
124
+ ], OrderExchange.prototype, "allow_backorder", void 0);
125
+ __decorate([
126
+ (0, core_1.OneToMany)(() => _models_1.OrderExchangeItem, (item) => item.exchange, {
127
+ cascade: [core_1.Cascade.PERSIST],
128
+ }),
129
+ __metadata("design:type", Object)
130
+ ], OrderExchange.prototype, "additional_items", void 0);
131
+ __decorate([
132
+ (0, core_1.OneToMany)(() => order_shipping_method_1.default, (shippingMethod) => shippingMethod.exchange, {
133
+ cascade: [core_1.Cascade.PERSIST],
134
+ }),
135
+ __metadata("design:type", Object)
136
+ ], OrderExchange.prototype, "shipping_methods", void 0);
137
+ __decorate([
138
+ (0, core_1.OneToMany)(() => _models_1.OrderTransaction, (transaction) => transaction.exchange, {
139
+ cascade: [core_1.Cascade.PERSIST],
140
+ }),
141
+ __metadata("design:type", Object)
142
+ ], OrderExchange.prototype, "transactions", void 0);
143
+ __decorate([
144
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
145
+ __metadata("design:type", Object)
146
+ ], OrderExchange.prototype, "created_by", void 0);
147
+ __decorate([
148
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
149
+ __metadata("design:type", Object)
150
+ ], OrderExchange.prototype, "metadata", void 0);
151
+ __decorate([
152
+ (0, core_1.Property)({
153
+ onCreate: () => new Date(),
154
+ columnType: "timestamptz",
155
+ defaultRaw: "now()",
156
+ }),
157
+ __metadata("design:type", Date)
158
+ ], OrderExchange.prototype, "created_at", void 0);
159
+ __decorate([
160
+ (0, core_1.Property)({
161
+ onCreate: () => new Date(),
162
+ onUpdate: () => new Date(),
163
+ columnType: "timestamptz",
164
+ defaultRaw: "now()",
165
+ }),
166
+ __metadata("design:type", Date)
167
+ ], OrderExchange.prototype, "updated_at", void 0);
168
+ __decorate([
169
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
170
+ OrderExchangeDeletedAtIndex.MikroORMIndex(),
171
+ __metadata("design:type", Object)
172
+ ], OrderExchange.prototype, "deleted_at", void 0);
173
+ __decorate([
174
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
175
+ __metadata("design:type", Object)
176
+ ], OrderExchange.prototype, "canceled_at", void 0);
177
+ __decorate([
178
+ (0, core_1.BeforeCreate)(),
179
+ __metadata("design:type", Function),
180
+ __metadata("design:paramtypes", []),
181
+ __metadata("design:returntype", void 0)
182
+ ], OrderExchange.prototype, "onCreate", null);
183
+ __decorate([
184
+ (0, core_1.OnInit)(),
185
+ __metadata("design:type", Function),
186
+ __metadata("design:paramtypes", []),
187
+ __metadata("design:returntype", void 0)
188
+ ], OrderExchange.prototype, "onInit", null);
189
+ OrderExchange = __decorate([
190
+ (0, core_1.Entity)({ tableName: "order_exchange" }),
191
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
192
+ ], OrderExchange);
193
+ exports.default = OrderExchange;
194
+ //# sourceMappingURL=exchange.js.map