@medusajs/order 0.1.3 → 1.0.0-rc-20241003153304

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 +25 -26
  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 @@
1
+ {"version":3,"file":"tax-line.d.ts","sourceRoot":"","sources":["../../src/models/tax-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,SAAS,EAA6B,MAAM,2BAA2B,CAAA;AAGhF;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,OAAO;IAEnC,EAAE,EAAE,MAAM,CAAA;IAGV,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAM3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAG3B,IAAI,EAAE,MAAM,CAAA;IAGZ,IAAI,EAAE,SAAS,GAAG,MAAM,CAAA;IAGxB,QAAQ,EAAE,iBAAiB,CAAA;IAG3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAO3B,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAGhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;CAC/B"}
@@ -9,13 +9,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const utils_1 = require("@medusajs/utils");
12
+ const utils_1 = require("@medusajs/framework/utils");
13
13
  const core_1 = require("@mikro-orm/core");
14
14
  /**
15
15
  * As per the Mikro ORM docs, superclasses should use the abstract class definition
16
16
  * Source: https://mikro-orm.io/docs/inheritance-mapping
17
17
  */
18
18
  class TaxLine {
19
+ constructor() {
20
+ this.deleted_at = null;
21
+ }
19
22
  }
20
23
  exports.default = TaxLine;
21
24
  __decorate([
@@ -66,4 +69,8 @@ __decorate([
66
69
  }),
67
70
  __metadata("design:type", Date)
68
71
  ], TaxLine.prototype, "updated_at", void 0);
72
+ __decorate([
73
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
74
+ __metadata("design:type", Object)
75
+ ], TaxLine.prototype, "deleted_at", void 0);
69
76
  //# sourceMappingURL=tax-line.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tax-line.js","sourceRoot":"","sources":["../../src/models/tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAAoE;AACpE,0CAAsD;AAEtD;;;GAGG;AACH,MAA8B,OAAO;CAuCpC;AAvCD,0BAuCC;AArCC;IADC,IAAA,iBAAU,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;mCACzB;AAGV;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACtB;AAM3B;IAJC,IAAA,eAAQ,EAAC;QACR,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC;;4CACyB;AAG3B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;qCACrB;AAGZ;IADC,IAAA,iCAAyB,GAAE;;qCACJ;AAGxB;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;yCACP;AAG3B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACtB;AAO3B;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;2CAAA;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;2CAAA"}
1
+ {"version":3,"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AE,IAAI,EAAE,CAAC;;2CAC1B"}
@@ -1,13 +1,23 @@
1
- import { BigNumberRawValue, DAL } from "@medusajs/types";
2
- import { BigNumber } from "@medusajs/utils";
3
- import { OptionalProps } from "@mikro-orm/core";
1
+ import { BigNumberRawValue, DAL } from "@medusajs/framework/types";
2
+ import { BigNumber } from "@medusajs/framework/utils";
3
+ import { OptionalProps, Rel } from "@mikro-orm/core";
4
+ import Claim from "./claim";
5
+ import Exchange from "./exchange";
4
6
  import Order from "./order";
5
- type OptionalLineItemProps = DAL.EntityDateColumns;
6
- export default class Transaction {
7
+ import Return from "./return";
8
+ type OptionalLineItemProps = DAL.ModelDateColumns;
9
+ export default class OrderTransaction {
7
10
  [OptionalProps]?: OptionalLineItemProps;
8
11
  id: string;
9
12
  order_id: string;
10
- order: Order;
13
+ order: Rel<Order>;
14
+ return_id: string | null;
15
+ return: Rel<Return>;
16
+ exchange_id: string | null;
17
+ exchange: Rel<Exchange>;
18
+ claim_id: string | null;
19
+ claim: Rel<Claim>;
20
+ version: number;
11
21
  amount: BigNumber | number;
12
22
  raw_amount: BigNumberRawValue;
13
23
  currency_code: string;
@@ -15,7 +25,9 @@ export default class Transaction {
15
25
  reference_id: string | null;
16
26
  created_at: Date;
17
27
  updated_at: Date;
28
+ deleted_at: Date | null;
18
29
  onCreate(): void;
19
30
  onInit(): void;
20
31
  }
21
32
  export {};
33
+ //# sourceMappingURL=transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/models/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EACL,SAAS,EAKV,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAML,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,KAAK,qBAAqB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AAuDjD,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,CAAC,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAA;IAGvC,EAAE,EAAE,MAAM,CAAA;IAUV,QAAQ,EAAE,MAAM,CAAA;IAKhB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAUjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAM/B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAUnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAM1B,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IAUvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAMvB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAMjB,OAAO,EAAE,MAAM,CAAI;IAGnB,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;IAG1B,UAAU,EAAE,iBAAiB,CAAA;IAI7B,aAAa,EAAE,MAAM,CAAA;IAMrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAO/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAO;IAOlC,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IASR,MAAM;CAOP"}
@@ -12,39 +12,80 @@ 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
+ const claim_1 = __importDefault(require("./claim"));
18
+ const exchange_1 = __importDefault(require("./exchange"));
17
19
  const order_1 = __importDefault(require("./order"));
20
+ const return_1 = __importDefault(require("./return"));
21
+ const tableName = "order_transaction";
18
22
  const ReferenceIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
19
- tableName: "order_transaction",
23
+ tableName,
20
24
  columns: "reference_id",
25
+ where: "deleted_at IS NOT NULL",
21
26
  });
22
27
  const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
- tableName: "order_transaction",
28
+ tableName,
24
29
  columns: "order_id",
30
+ where: "deleted_at IS NOT NULL",
31
+ });
32
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
33
+ tableName,
34
+ columns: "return_id",
35
+ where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
36
+ });
37
+ const ExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
+ tableName,
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,
44
+ columns: ["claim_id"],
45
+ where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
25
46
  });
26
47
  const CurrencyCodeIndex = (0, utils_1.createPsqlIndexStatementHelper)({
27
- tableName: "order_transaction",
48
+ tableName,
28
49
  columns: "currency_code",
50
+ where: "deleted_at IS NOT NULL",
29
51
  });
30
- let Transaction = class Transaction {
52
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
53
+ tableName,
54
+ columns: "deleted_at",
55
+ where: "deleted_at IS NOT NULL",
56
+ });
57
+ const OrderIdVersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
58
+ tableName,
59
+ columns: ["order_id", "version"],
60
+ where: "deleted_at IS NOT NULL",
61
+ });
62
+ let OrderTransaction = class OrderTransaction {
31
63
  constructor() {
64
+ this.return_id = null;
65
+ this.version = 1;
32
66
  this.reference = null;
33
67
  this.reference_id = null;
68
+ this.deleted_at = null;
34
69
  }
35
70
  onCreate() {
36
71
  this.id = (0, utils_1.generateEntityId)(this.id, "ordtrx");
37
- this.order_id ?? (this.order_id = this.order?.id);
72
+ this.order_id ??= this.order?.id;
73
+ this.return_id ??= this.return?.id;
74
+ this.claim_id ??= this.claim?.id;
75
+ this.exchange_id ??= this.exchange?.id;
38
76
  }
39
77
  onInit() {
40
78
  this.id = (0, utils_1.generateEntityId)(this.id, "ordtrx");
41
- this.order_id ?? (this.order_id = this.order?.id);
79
+ this.order_id ??= this.order?.id;
80
+ this.return_id ??= this.return?.id;
81
+ this.claim_id ??= this.claim?.id;
82
+ this.exchange_id ??= this.exchange?.id;
42
83
  }
43
84
  };
44
85
  __decorate([
45
86
  (0, core_1.PrimaryKey)({ columnType: "text" }),
46
87
  __metadata("design:type", String)
47
- ], Transaction.prototype, "id", void 0);
88
+ ], OrderTransaction.prototype, "id", void 0);
48
89
  __decorate([
49
90
  (0, core_1.ManyToOne)({
50
91
  entity: () => order_1.default,
@@ -55,33 +96,94 @@ __decorate([
55
96
  }),
56
97
  OrderIdIndex.MikroORMIndex(),
57
98
  __metadata("design:type", String)
58
- ], Transaction.prototype, "order_id", void 0);
99
+ ], OrderTransaction.prototype, "order_id", void 0);
59
100
  __decorate([
60
101
  (0, core_1.ManyToOne)(() => order_1.default, {
61
102
  persist: false,
62
103
  }),
63
- __metadata("design:type", order_1.default)
64
- ], Transaction.prototype, "order", void 0);
104
+ __metadata("design:type", Object)
105
+ ], OrderTransaction.prototype, "order", void 0);
106
+ __decorate([
107
+ (0, core_1.ManyToOne)({
108
+ entity: () => return_1.default,
109
+ mapToPk: true,
110
+ fieldName: "return_id",
111
+ columnType: "text",
112
+ nullable: true,
113
+ }),
114
+ ReturnIdIndex.MikroORMIndex(),
115
+ __metadata("design:type", Object)
116
+ ], OrderTransaction.prototype, "return_id", void 0);
117
+ __decorate([
118
+ (0, core_1.ManyToOne)(() => return_1.default, {
119
+ persist: false,
120
+ nullable: true,
121
+ }),
122
+ __metadata("design:type", Object)
123
+ ], OrderTransaction.prototype, "return", void 0);
124
+ __decorate([
125
+ (0, core_1.ManyToOne)({
126
+ entity: () => exchange_1.default,
127
+ mapToPk: true,
128
+ fieldName: "exchange_id",
129
+ columnType: "text",
130
+ nullable: true,
131
+ }),
132
+ ExchangeIdIndex.MikroORMIndex(),
133
+ __metadata("design:type", Object)
134
+ ], OrderTransaction.prototype, "exchange_id", void 0);
135
+ __decorate([
136
+ (0, core_1.ManyToOne)(() => exchange_1.default, {
137
+ persist: false,
138
+ nullable: true,
139
+ }),
140
+ __metadata("design:type", Object)
141
+ ], OrderTransaction.prototype, "exchange", void 0);
142
+ __decorate([
143
+ (0, core_1.ManyToOne)({
144
+ entity: () => claim_1.default,
145
+ mapToPk: true,
146
+ fieldName: "claim_id",
147
+ columnType: "text",
148
+ nullable: true,
149
+ }),
150
+ ClaimIdIndex.MikroORMIndex(),
151
+ __metadata("design:type", Object)
152
+ ], OrderTransaction.prototype, "claim_id", void 0);
153
+ __decorate([
154
+ (0, core_1.ManyToOne)(() => claim_1.default, {
155
+ persist: false,
156
+ nullable: true,
157
+ }),
158
+ __metadata("design:type", Object)
159
+ ], OrderTransaction.prototype, "claim", void 0);
160
+ __decorate([
161
+ (0, core_1.Property)({
162
+ columnType: "integer",
163
+ defaultRaw: "1",
164
+ }),
165
+ __metadata("design:type", Number)
166
+ ], OrderTransaction.prototype, "version", void 0);
65
167
  __decorate([
66
168
  (0, utils_1.MikroOrmBigNumberProperty)(),
67
169
  __metadata("design:type", Object)
68
- ], Transaction.prototype, "amount", void 0);
170
+ ], OrderTransaction.prototype, "amount", void 0);
69
171
  __decorate([
70
172
  (0, core_1.Property)({ columnType: "jsonb" }),
71
173
  __metadata("design:type", Object)
72
- ], Transaction.prototype, "raw_amount", void 0);
174
+ ], OrderTransaction.prototype, "raw_amount", void 0);
73
175
  __decorate([
74
176
  (0, core_1.Property)({ columnType: "text" }),
75
177
  CurrencyCodeIndex.MikroORMIndex(),
76
178
  __metadata("design:type", String)
77
- ], Transaction.prototype, "currency_code", void 0);
179
+ ], OrderTransaction.prototype, "currency_code", void 0);
78
180
  __decorate([
79
181
  (0, core_1.Property)({
80
182
  columnType: "text",
81
183
  nullable: true,
82
184
  }),
83
185
  __metadata("design:type", Object)
84
- ], Transaction.prototype, "reference", void 0);
186
+ ], OrderTransaction.prototype, "reference", void 0);
85
187
  __decorate([
86
188
  (0, core_1.Property)({
87
189
  columnType: "text",
@@ -89,7 +191,7 @@ __decorate([
89
191
  }),
90
192
  ReferenceIdIndex.MikroORMIndex(),
91
193
  __metadata("design:type", Object)
92
- ], Transaction.prototype, "reference_id", void 0);
194
+ ], OrderTransaction.prototype, "reference_id", void 0);
93
195
  __decorate([
94
196
  (0, core_1.Property)({
95
197
  onCreate: () => new Date(),
@@ -97,7 +199,7 @@ __decorate([
97
199
  defaultRaw: "now()",
98
200
  }),
99
201
  __metadata("design:type", Date)
100
- ], Transaction.prototype, "created_at", void 0);
202
+ ], OrderTransaction.prototype, "created_at", void 0);
101
203
  __decorate([
102
204
  (0, core_1.Property)({
103
205
  onCreate: () => new Date(),
@@ -106,21 +208,28 @@ __decorate([
106
208
  defaultRaw: "now()",
107
209
  }),
108
210
  __metadata("design:type", Date)
109
- ], Transaction.prototype, "updated_at", void 0);
211
+ ], OrderTransaction.prototype, "updated_at", void 0);
212
+ __decorate([
213
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
214
+ DeletedAtIndex.MikroORMIndex(),
215
+ __metadata("design:type", Object)
216
+ ], OrderTransaction.prototype, "deleted_at", void 0);
110
217
  __decorate([
111
218
  (0, core_1.BeforeCreate)(),
112
219
  __metadata("design:type", Function),
113
220
  __metadata("design:paramtypes", []),
114
221
  __metadata("design:returntype", void 0)
115
- ], Transaction.prototype, "onCreate", null);
222
+ ], OrderTransaction.prototype, "onCreate", null);
116
223
  __decorate([
117
224
  (0, core_1.OnInit)(),
118
225
  __metadata("design:type", Function),
119
226
  __metadata("design:paramtypes", []),
120
227
  __metadata("design:returntype", void 0)
121
- ], Transaction.prototype, "onInit", null);
122
- Transaction = __decorate([
123
- (0, core_1.Entity)({ tableName: "order_transaction" })
124
- ], Transaction);
125
- exports.default = Transaction;
228
+ ], OrderTransaction.prototype, "onInit", null);
229
+ OrderTransaction = __decorate([
230
+ (0, core_1.Entity)({ tableName }),
231
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions),
232
+ OrderIdVersionIndex.MikroORMIndex()
233
+ ], OrderTransaction);
234
+ exports.default = OrderTransaction;
126
235
  //# sourceMappingURL=transaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/models/transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CAQwB;AACxB,oDAA2B;AAI3B,MAAM,gBAAgB,GAAG,IAAA,sCAA8B,EAAC;IACtD,SAAS,EAAE,mBAAmB;IAC9B,OAAO,EAAE,cAAc;CACxB,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,mBAAmB;IAC9B,OAAO,EAAE,UAAU;CACpB,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG,IAAA,sCAA8B,EAAC;IACvD,SAAS,EAAE,mBAAmB;IAC9B,OAAO,EAAE,eAAe;CACzB,CAAC,CAAA;AAGa,IAAM,WAAW,GAAjB,MAAM,WAAW;IAAjB;QAmCb,cAAS,GAAkB,IAAI,CAAA;QAO/B,iBAAY,GAAkB,IAAI,CAAA;IA4BpC,CAAC;IAVC,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC7C,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,CAAC,KAAK,EAAE,EAAE,EAAA;IAClC,CAAC;IAGD,MAAM;QACJ,IAAI,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AAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;oDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;oDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;gDAOd;AAGD;IADC,IAAA,aAAM,GAAE;;;;8CAOR;AArIkB,gBAAgB;IAHpC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,CAAC;IACrB,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;IACnD,mBAAmB,CAAC,aAAa,EAAE;GACf,gBAAgB,CAsIpC;kBAtIoB,gBAAgB"}
@@ -0,0 +1,9 @@
1
+ import { DALUtils } from "@medusajs/framework/utils";
2
+ import { OrderClaim } from "../models";
3
+ declare const OrderClaimRepository_base: new ({ manager }: {
4
+ manager: any;
5
+ }) => DALUtils.MikroOrmBaseRepository<OrderClaim>;
6
+ export declare class OrderClaimRepository extends OrderClaimRepository_base {
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=claim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/repositories/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;;;;AAGpC,qBAAa,oBAAqB,SAAQ,yBAEzC;CAAG"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderClaimRepository = void 0;
4
+ const utils_1 = require("@medusajs/framework/utils");
5
+ const _models_1 = require("../models");
6
+ const base_repository_find_1 = require("../utils/base-repository-find");
7
+ class OrderClaimRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.OrderClaim) {
8
+ }
9
+ exports.OrderClaimRepository = OrderClaimRepository;
10
+ (0, base_repository_find_1.setFindMethods)(OrderClaimRepository, _models_1.OrderClaim);
11
+ //# sourceMappingURL=claim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/repositories/claim.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,qCAAoC;AACpC,wEAA8D;AAE9D,MAAa,oBAAqB,SAAQ,gBAAQ,CAAC,6BAA6B,CAC9E,oBAAU,CACX;CAAG;AAFJ,oDAEI;AAEJ,IAAA,qCAAc,EAAC,oBAAoB,EAAE,oBAAU,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { DALUtils } from "@medusajs/framework/utils";
2
+ import { OrderExchange } from "../models";
3
+ declare const OrderExchangeRepository_base: new ({ manager }: {
4
+ manager: any;
5
+ }) => DALUtils.MikroOrmBaseRepository<OrderExchange>;
6
+ export declare class OrderExchangeRepository extends OrderExchangeRepository_base {
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=exchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../src/repositories/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;;;;AAGvC,qBAAa,uBAAwB,SAAQ,4BAE5C;CAAG"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderExchangeRepository = void 0;
4
+ const utils_1 = require("@medusajs/framework/utils");
5
+ const _models_1 = require("../models");
6
+ const base_repository_find_1 = require("../utils/base-repository-find");
7
+ class OrderExchangeRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.OrderExchange) {
8
+ }
9
+ exports.OrderExchangeRepository = OrderExchangeRepository;
10
+ (0, base_repository_find_1.setFindMethods)(OrderExchangeRepository, _models_1.OrderExchange);
11
+ //# sourceMappingURL=exchange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/repositories/exchange.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,qCAAuC;AACvC,wEAA8D;AAE9D,MAAa,uBAAwB,SAAQ,gBAAQ,CAAC,6BAA6B,CACjF,uBAAa,CACd;CAAG;AAFJ,0DAEI;AAEJ,IAAA,qCAAc,EAAC,uBAAuB,EAAE,uBAAa,CAAC,CAAA"}
@@ -1,2 +1,5 @@
1
- export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils";
2
- export * from "./order";
1
+ export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/framework/utils";
2
+ export { OrderClaimRepository } from "./claim";
3
+ export { OrderRepository } from "./order";
4
+ export { ReturnRepository } from "./return";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA"}
@@ -1,21 +1,12 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.BaseRepository = void 0;
18
- var utils_1 = require("@medusajs/utils");
3
+ exports.ReturnRepository = exports.OrderRepository = exports.OrderClaimRepository = exports.BaseRepository = void 0;
4
+ var utils_1 = require("@medusajs/framework/utils");
19
5
  Object.defineProperty(exports, "BaseRepository", { enumerable: true, get: function () { return utils_1.MikroOrmBaseRepository; } });
20
- __exportStar(require("./order"), exports);
6
+ var claim_1 = require("./claim");
7
+ Object.defineProperty(exports, "OrderClaimRepository", { enumerable: true, get: function () { return claim_1.OrderClaimRepository; } });
8
+ var order_1 = require("./order");
9
+ Object.defineProperty(exports, "OrderRepository", { enumerable: true, get: function () { return order_1.OrderRepository; } });
10
+ var return_1 = require("./return");
11
+ Object.defineProperty(exports, "ReturnRepository", { enumerable: true, get: function () { return return_1.ReturnRepository; } });
21
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAA0E;AAAjE,uGAAA,sBAAsB,OAAkB;AACjD,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";;;AAAA,mDAAoF;AAA3E,uGAAA,sBAAsB,OAAkB;AACjD,iCAA8C;AAArC,6GAAA,oBAAoB,OAAA;AAC7B,iCAAyC;AAAhC,wGAAA,eAAe,OAAA;AACxB,mCAA2C;AAAlC,0GAAA,gBAAgB,OAAA"}
@@ -1,11 +1,9 @@
1
- import { Context, DAL } from "@medusajs/types";
2
- import { DALUtils } from "@medusajs/utils";
1
+ import { DALUtils } from "@medusajs/framework/utils";
3
2
  import { Order } from "../models";
4
3
  declare const OrderRepository_base: new ({ manager }: {
5
4
  manager: any;
6
5
  }) => DALUtils.MikroOrmBaseRepository<Order>;
7
6
  export declare class OrderRepository extends OrderRepository_base {
8
- find(options?: DAL.FindOptions<Order>, context?: Context): Promise<Order[]>;
9
- findAndCount(findOptions?: DAL.FindOptions<Order>, context?: Context): Promise<[Order[], number]>;
10
7
  }
11
8
  export {};
9
+ //# sourceMappingURL=order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/repositories/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;;;;AAG/B,qBAAa,eAAgB,SAAQ,oBAEpC;CAAG"}
@@ -1,94 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderRepository = void 0;
4
- const utils_1 = require("@medusajs/utils");
5
- const core_1 = require("@mikro-orm/core");
4
+ const utils_1 = require("@medusajs/framework/utils");
6
5
  const _models_1 = require("../models");
7
- const transform_order_1 = require("../utils/transform-order");
6
+ const base_repository_find_1 = require("../utils/base-repository-find");
8
7
  class OrderRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.Order) {
9
- async find(options, context) {
10
- var _a, _b, _c, _d;
11
- const manager = this.getActiveManager(context);
12
- const knex = manager.getKnex();
13
- const findOptions_ = { ...options };
14
- findOptions_.options ?? (findOptions_.options = {});
15
- findOptions_.where ?? (findOptions_.where = {});
16
- if (!("strategy" in findOptions_.options)) {
17
- if (findOptions_.options.limit != null || findOptions_.options.offset) {
18
- Object.assign(findOptions_.options, {
19
- strategy: core_1.LoadStrategy.SELECT_IN,
20
- });
21
- }
22
- else {
23
- Object.assign(findOptions_.options, {
24
- strategy: core_1.LoadStrategy.JOINED,
25
- });
26
- }
27
- }
28
- const config = (0, transform_order_1.mapRepositoryToOrderModel)(findOptions_);
29
- let defaultVersion = knex.raw(`"o0"."version"`);
30
- const strategy = config.options.strategy ?? core_1.LoadStrategy.JOINED;
31
- if (strategy === core_1.LoadStrategy.SELECT_IN) {
32
- const sql = manager
33
- .qb(_models_1.Order, "_sub0")
34
- .select("version")
35
- .where({ id: knex.raw(`"o0"."order_id"`) })
36
- .getKnexQuery()
37
- .toString();
38
- defaultVersion = knex.raw(`(${sql})`);
39
- }
40
- const version = config.where.version ?? defaultVersion;
41
- delete config.where?.version;
42
- (_a = config.options).populateWhere ?? (_a.populateWhere = {});
43
- (_b = config.options.populateWhere).items ?? (_b.items = {});
44
- config.options.populateWhere.items.version = version;
45
- (_c = config.options.populateWhere).summary ?? (_c.summary = {});
46
- config.options.populateWhere.summary.version = version;
47
- (_d = config.options.populateWhere).shipping_methods ?? (_d.shipping_methods = {});
48
- config.options.populateWhere.shipping_methods.version = version;
49
- if (!config.options.orderBy) {
50
- config.options.orderBy = { id: "ASC" };
51
- }
52
- return await manager.find(_models_1.Order, config.where, config.options);
53
- }
54
- async findAndCount(findOptions = { where: {} }, context = {}) {
55
- var _a, _b, _c, _d;
56
- const manager = this.getActiveManager(context);
57
- const knex = manager.getKnex();
58
- const findOptions_ = { ...findOptions };
59
- findOptions_.options ?? (findOptions_.options = {});
60
- findOptions_.where ?? (findOptions_.where = {});
61
- if (!("strategy" in findOptions_.options)) {
62
- Object.assign(findOptions_.options, {
63
- strategy: core_1.LoadStrategy.SELECT_IN,
64
- });
65
- }
66
- const config = (0, transform_order_1.mapRepositoryToOrderModel)(findOptions_);
67
- let defaultVersion = knex.raw(`"o0"."version"`);
68
- const strategy = config.options.strategy ?? core_1.LoadStrategy.JOINED;
69
- if (strategy === core_1.LoadStrategy.SELECT_IN) {
70
- const sql = manager
71
- .qb(_models_1.Order, "_sub0")
72
- .select("version")
73
- .where({ id: knex.raw(`"o0"."order_id"`) })
74
- .getKnexQuery()
75
- .toString();
76
- defaultVersion = knex.raw(`(${sql})`);
77
- }
78
- const version = config.where.version ?? defaultVersion;
79
- delete config.where.version;
80
- (_a = config.options).populateWhere ?? (_a.populateWhere = {});
81
- (_b = config.options.populateWhere).items ?? (_b.items = {});
82
- config.options.populateWhere.items.version = version;
83
- (_c = config.options.populateWhere).summary ?? (_c.summary = {});
84
- config.options.populateWhere.summary.version = version;
85
- (_d = config.options.populateWhere).shipping_methods ?? (_d.shipping_methods = {});
86
- config.options.populateWhere.shipping_methods.version = version;
87
- if (!config.options.orderBy) {
88
- config.options.orderBy = { id: "ASC" };
89
- }
90
- return await manager.findAndCount(_models_1.Order, config.where, config.options);
91
- }
92
8
  }
93
9
  exports.OrderRepository = OrderRepository;
10
+ (0, base_repository_find_1.setFindMethods)(OrderRepository, _models_1.Order);
94
11
  //# sourceMappingURL=order.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"order.js","sourceRoot":"","sources":["../../src/repositories/order.ts"],"names":[],"mappings":";;;AACA,2CAA0C;AAC1C,0CAA8C;AAE9C,qCAA+B;AAC/B,8DAAoE;AAEpE,MAAa,eAAgB,SAAQ,gBAAQ,CAAC,6BAA6B,CACzE,eAAK,CACN;IACC,KAAK,CAAC,IAAI,CACR,OAAgC,EAChC,OAAiB;;QAEjB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAgB,OAAO,CAAC,CAAA;QAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAA;QAE9B,MAAM,YAAY,GAAG,EAAE,GAAG,OAAO,EAAS,CAAA;QAC1C,YAAY,CAAC,OAAO,KAApB,YAAY,CAAC,OAAO,GAAK,EAAE,EAAA;QAC3B,YAAY,CAAC,KAAK,KAAlB,YAAY,CAAC,KAAK,GAAK,EAAE,EAAA;QAEzB,IAAI,CAAC,CAAC,UAAU,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE;YACzC,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE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,CAAC,OAAO,EAAE;YAC3B,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,CAAA;SACvC;QAED,OAAO,MAAM,OAAO,CAAC,YAAY,CAAC,eAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IACxE,CAAC;CACF;AAjHD,0CAiHC"}
1
+ {"version":3,"file":"order.js","sourceRoot":"","sources":["../../src/repositories/order.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,qCAA+B;AAC/B,wEAA8D;AAE9D,MAAa,eAAgB,SAAQ,gBAAQ,CAAC,6BAA6B,CACzE,eAAK,CACN;CAAG;AAFJ,0CAEI;AAEJ,IAAA,qCAAc,EAAC,eAAe,EAAE,eAAK,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { DALUtils } from "@medusajs/framework/utils";
2
+ import { Return } from "../models";
3
+ declare const ReturnRepository_base: new ({ manager }: {
4
+ manager: any;
5
+ }) => DALUtils.MikroOrmBaseRepository<Return>;
6
+ export declare class ReturnRepository extends ReturnRepository_base {
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=return.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return.d.ts","sourceRoot":"","sources":["../../src/repositories/return.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;;;;AAGhC,qBAAa,gBAAiB,SAAQ,qBAErC;CAAG"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReturnRepository = void 0;
4
+ const utils_1 = require("@medusajs/framework/utils");
5
+ const _models_1 = require("../models");
6
+ const base_repository_find_1 = require("../utils/base-repository-find");
7
+ class ReturnRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.Return) {
8
+ }
9
+ exports.ReturnRepository = ReturnRepository;
10
+ (0, base_repository_find_1.setFindMethods)(ReturnRepository, _models_1.Return);
11
+ //# sourceMappingURL=return.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return.js","sourceRoot":"","sources":["../../src/repositories/return.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,qCAAgC;AAChC,wEAA8D;AAE9D,MAAa,gBAAiB,SAAQ,gBAAQ,CAAC,6BAA6B,CAC1E,gBAAM,CACP;CAAG;AAFJ,4CAEI;AAEJ,IAAA,qCAAc,EAAC,gBAAgB,EAAE,gBAAM,CAAC,CAAA"}