@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,371 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20240604100512 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20240604100512 extends migrations_1.Migration {
6
+ async up() {
7
+ const sql = `
8
+ ALTER TABLE "order_change"
9
+ ADD COLUMN if NOT exists "change_type" TEXT NULL;
10
+
11
+ ALTER TABLE "order_change"
12
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
13
+
14
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_change_type" ON "order_change" (
15
+ change_type
16
+ );
17
+
18
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_deleted_at" ON "order_change" (
19
+ deleted_at
20
+ );
21
+
22
+
23
+
24
+
25
+ ALTER TABLE "order_transaction"
26
+ ADD COLUMN if NOT exists "return_id" TEXT NULL;
27
+
28
+ ALTER TABLE "order_transaction"
29
+ ADD COLUMN if NOT exists "claim_id" TEXT NULL;
30
+
31
+ ALTER TABLE "order_transaction"
32
+ ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
33
+
34
+ CREATE INDEX IF NOT EXISTS "IDX_order_transaction_return_id" ON "order_transaction" (
35
+ return_id
36
+ )
37
+ WHERE return_id IS NOT NULL AND deleted_at IS NULL;
38
+
39
+ CREATE INDEX IF NOT EXISTS "IDX_order_transaction_claim_id" ON "order_transaction" (
40
+ claim_id
41
+ )
42
+ WHERE claim_id IS NOT NULL AND deleted_at IS NULL;
43
+
44
+ CREATE INDEX IF NOT EXISTS "IDX_order_transaction_exchange_id" ON "order_transaction" (
45
+ exchange_id
46
+ )
47
+ WHERE exchange_id IS NOT NULL AND deleted_at IS NULL;
48
+
49
+
50
+
51
+ ALTER TABLE "order_shipping"
52
+ ADD COLUMN if NOT exists "return_id" TEXT NULL;
53
+
54
+ ALTER TABLE "order_shipping"
55
+ ADD COLUMN if NOT exists "claim_id" TEXT NULL;
56
+
57
+ ALTER TABLE "order_shipping"
58
+ ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
59
+
60
+ CREATE INDEX IF NOT EXISTS "IDX_order_shipping_return_id" ON "order_shipping" (
61
+ return_id
62
+ )
63
+ WHERE return_id IS NOT NULL AND deleted_at IS NULL;
64
+
65
+ CREATE INDEX IF NOT EXISTS "IDX_order_shipping_claim_id" ON "order_shipping" (
66
+ claim_id
67
+ )
68
+ WHERE claim_id IS NOT NULL AND deleted_at IS NULL;
69
+
70
+ CREATE INDEX IF NOT EXISTS "IDX_order_shipping_exchange_id" ON "order_shipping" (
71
+ exchange_id
72
+ )
73
+ WHERE exchange_id IS NOT NULL AND deleted_at IS NULL;
74
+
75
+
76
+
77
+
78
+ ALTER TABLE "order_change"
79
+ ADD COLUMN if NOT exists "return_id" TEXT NULL;
80
+
81
+ ALTER TABLE "order_change"
82
+ ADD COLUMN if NOT exists "claim_id" TEXT NULL;
83
+
84
+ ALTER TABLE "order_change"
85
+ ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
86
+
87
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_return_id" ON "order_change" (
88
+ return_id
89
+ )
90
+ WHERE return_id IS NOT NULL AND deleted_at IS NULL;
91
+
92
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_claim_id" ON "order_change" (
93
+ claim_id
94
+ )
95
+ WHERE claim_id IS NOT NULL AND deleted_at IS NULL;
96
+
97
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_exchange_id" ON "order_change" (
98
+ exchange_id
99
+ )
100
+ WHERE exchange_id IS NOT NULL AND deleted_at IS NULL;
101
+
102
+
103
+
104
+ ALTER TABLE "order_change_action"
105
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
106
+
107
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_action_deleted_at" ON "order_change_action" (
108
+ deleted_at
109
+ );
110
+
111
+ ALTER TABLE "order_change_action"
112
+ ADD COLUMN if NOT exists "return_id" TEXT NULL;
113
+
114
+ ALTER TABLE "order_change_action"
115
+ ADD COLUMN if NOT exists "claim_id" TEXT NULL;
116
+
117
+ ALTER TABLE "order_change_action"
118
+ ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
119
+
120
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_action_return_id" ON "order_change_action" (
121
+ return_id
122
+ )
123
+ WHERE return_id IS NOT NULL AND deleted_at IS NULL;
124
+
125
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_action_claim_id" ON "order_change_action" (
126
+ claim_id
127
+ )
128
+ WHERE claim_id IS NOT NULL AND deleted_at IS NULL;
129
+
130
+ CREATE INDEX IF NOT EXISTS "IDX_order_change_action_exchange_id" ON "order_change_action" (
131
+ exchange_id
132
+ )
133
+ WHERE exchange_id IS NOT NULL AND deleted_at IS NULL;
134
+
135
+ DO $$
136
+ BEGIN
137
+ IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'return_status_enum') THEN
138
+ CREATE TYPE return_status_enum AS ENUM (
139
+ 'requested',
140
+ 'received',
141
+ 'partially_received',
142
+ 'canceled');
143
+ END IF;
144
+ END$$;
145
+
146
+ CREATE TABLE IF NOT EXISTS "return" (
147
+ "id" TEXT NOT NULL,
148
+ "order_id" TEXT NOT NULL,
149
+ "claim_id" TEXT NULL,
150
+ "exchange_id" TEXT NULL,
151
+ "order_version" INTEGER NOT NULL,
152
+ "display_id" SERIAL,
153
+ "status" return_status_enum NOT NULL DEFAULT 'requested',
154
+ "no_notification" boolean NULL,
155
+ "refund_amount" NUMERIC NULL,
156
+ "raw_refund_amount" JSONB NULL,
157
+ "metadata" jsonb NULL,
158
+ "created_at" timestamptz NOT NULL DEFAULT now(),
159
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
160
+ "deleted_at" timestamptz NULL,
161
+ "received_at" timestamptz NULL,
162
+ "canceled_at" timestamptz NULL,
163
+ CONSTRAINT "return_pkey" PRIMARY KEY ("id")
164
+ );
165
+
166
+ CREATE INDEX IF NOT EXISTS "IDX_return_order_id" ON "return" (
167
+ order_id
168
+ )
169
+ WHERE deleted_at IS NULL;
170
+
171
+ CREATE INDEX IF NOT EXISTS "IDX_return_claim_id" ON "return" (
172
+ claim_id
173
+ )
174
+ WHERE claim_id IS NOT NULL AND deleted_at IS NULL;
175
+
176
+ CREATE INDEX IF NOT EXISTS "IDX_return_exchange_id" ON "return" (
177
+ exchange_id
178
+ )
179
+ WHERE exchange_id IS NOT NULL AND deleted_at IS NULL;
180
+
181
+ CREATE INDEX IF NOT EXISTS "IDX_return_display_id" ON "return" (
182
+ display_id
183
+ )
184
+ WHERE deleted_at IS NULL;
185
+
186
+
187
+ CREATE TABLE IF NOT EXISTS "return_item" (
188
+ "id" TEXT NOT NULL,
189
+ "return_id" TEXT NOT NULL,
190
+ "reason_id" TEXT NULL,
191
+ "item_id" TEXT NOT NULL,
192
+ "quantity" NUMERIC NOT NULL,
193
+ "raw_quantity" JSONB NOT NULL,
194
+ "received_quantity" NUMERIC NOT NULL DEFAULT 0,
195
+ "raw_received_quantity" JSONB NOT NULL,
196
+ "note" TEXT NULL,
197
+ "metadata" JSONB NULL,
198
+ "created_at" timestamptz NOT NULL DEFAULT now(),
199
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
200
+ "deleted_at" timestamptz NULL,
201
+ CONSTRAINT "return_item_pkey" PRIMARY KEY ("id")
202
+ );
203
+
204
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" ("deleted_at")
205
+ WHERE deleted_at IS NULL;
206
+
207
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_return_id" ON "return_item" ("return_id")
208
+ WHERE deleted_at IS NULL;
209
+
210
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_item_id" ON "return_item" ("item_id")
211
+ WHERE deleted_at IS NULL;
212
+
213
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_reason_id" ON "return_item" ("reason_id")
214
+ WHERE deleted_at IS NULL;
215
+
216
+
217
+
218
+ CREATE TABLE IF NOT EXISTS "order_exchange" (
219
+ "id" TEXT NOT NULL,
220
+ "order_id" TEXT NOT NULL,
221
+ "return_id" TEXT NULL,
222
+ "order_version" INTEGER NOT NULL,
223
+ "display_id" SERIAL,
224
+ "no_notification" BOOLEAN NULL,
225
+ "allow_backorder" BOOLEAN NOT NULL DEFAULT FALSE,
226
+ "difference_due" NUMERIC NULL,
227
+ "raw_difference_due" JSONB NULL,
228
+ "metadata" JSONB NULL,
229
+ "created_at" timestamptz NOT NULL DEFAULT now(),
230
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
231
+ "deleted_at" timestamptz NULL,
232
+ "canceled_at" timestamptz NULL,
233
+ CONSTRAINT "order_exchange_pkey" PRIMARY KEY ("id")
234
+ );
235
+
236
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_display_id" ON "order_exchange" ("display_id")
237
+ WHERE deleted_at IS NULL;
238
+
239
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_deleted_at" ON "order_exchange" ("deleted_at")
240
+ WHERE deleted_at IS NULL;
241
+
242
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_order_id" ON "order_exchange" ("order_id")
243
+ WHERE deleted_at IS NULL;
244
+
245
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_return_id" ON "order_exchange" ("return_id")
246
+ WHERE return_id IS NOT NULL AND deleted_at IS NULL;
247
+
248
+
249
+ CREATE TABLE IF NOT EXISTS "order_exchange_item" (
250
+ "id" TEXT NOT NULL,
251
+ "exchange_id" TEXT NOT NULL,
252
+ "item_id" TEXT NOT NULL,
253
+ "quantity" NUMERIC NOT NULL,
254
+ "raw_quantity" JSONB NOT NULL,
255
+ "note" TEXT NULL,
256
+ "metadata" JSONB NULL,
257
+ "created_at" timestamptz NOT NULL DEFAULT now(),
258
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
259
+ "deleted_at" timestamptz NULL,
260
+ CONSTRAINT "order_exchange_item_pkey" PRIMARY KEY ("id")
261
+ );
262
+
263
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_deleted_at" ON "order_exchange_item" ("deleted_at")
264
+ WHERE deleted_at IS NULL;
265
+
266
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_exchange_id" ON "order_exchange_item" ("exchange_id")
267
+ WHERE deleted_at IS NULL;
268
+
269
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_item_id" ON "order_exchange_item" ("item_id")
270
+ WHERE deleted_at IS NULL;
271
+
272
+ DO $$
273
+ BEGIN
274
+ IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'order_claim_type_enum') THEN
275
+ CREATE TYPE order_claim_type_enum AS ENUM (
276
+ 'refund',
277
+ 'replace'
278
+ );
279
+ END IF;
280
+ END$$;
281
+
282
+ CREATE TABLE IF NOT EXISTS "order_claim" (
283
+ "id" TEXT NOT NULL,
284
+ "order_id" TEXT NOT NULL,
285
+ "return_id" TEXT NULL,
286
+ "order_version" INTEGER NOT NULL,
287
+ "display_id" SERIAL,
288
+ "type" order_claim_type_enum NOT NULL,
289
+ "no_notification" BOOLEAN NULL,
290
+ "refund_amount" NUMERIC NULL,
291
+ "raw_refund_amount" JSONB NULL,
292
+ "metadata" JSONB NULL,
293
+ "created_at" timestamptz NOT NULL DEFAULT now(),
294
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
295
+ "deleted_at" timestamptz NULL,
296
+ "canceled_at" timestamptz NULL,
297
+ CONSTRAINT "order_claim_pkey" PRIMARY KEY ("id")
298
+ );
299
+
300
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_display_id" ON "order_claim" ("display_id")
301
+ WHERE deleted_at IS NULL;
302
+
303
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_deleted_at" ON "order_claim" ("deleted_at")
304
+ WHERE deleted_at IS NULL;
305
+
306
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_order_id" ON "order_claim" ("order_id")
307
+ WHERE deleted_at IS NULL;
308
+
309
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_return_id" ON "order_claim" ("return_id")
310
+ WHERE return_id IS NOT NULL AND deleted_at IS NULL;
311
+
312
+ DO $$
313
+ BEGIN
314
+ IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'claim_reason_enum') THEN
315
+ CREATE TYPE claim_reason_enum AS ENUM (
316
+ 'missing_item',
317
+ 'wrong_item',
318
+ 'production_failure',
319
+ 'other'
320
+ );
321
+ END IF;
322
+ END$$;
323
+
324
+ CREATE TABLE IF NOT EXISTS "order_claim_item" (
325
+ "id" TEXT NOT NULL,
326
+ "claim_id" TEXT NOT NULL,
327
+ "item_id" TEXT NOT NULL,
328
+ "is_additional_item" BOOLEAN NOT NULL DEFAULT FALSE,
329
+ "reason" claim_reason_enum NULL,
330
+ "quantity" NUMERIC NOT NULL,
331
+ "raw_quantity" JSONB NOT NULL,
332
+ "note" TEXT NULL,
333
+ "metadata" JSONB NULL,
334
+ "created_at" timestamptz NOT NULL DEFAULT now(),
335
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
336
+ "deleted_at" timestamptz NULL,
337
+ CONSTRAINT "order_claim_item_pkey" PRIMARY KEY ("id")
338
+ );
339
+
340
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" ("deleted_at")
341
+ WHERE deleted_at IS NULL;
342
+
343
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_claim_id" ON "order_claim_item" ("claim_id")
344
+ WHERE deleted_at IS NULL;
345
+
346
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_item_id" ON "order_claim_item" ("item_id")
347
+ WHERE deleted_at IS NULL;
348
+
349
+
350
+ CREATE TABLE IF NOT EXISTS "order_claim_item_image" (
351
+ "id" TEXT NOT NULL,
352
+ "claim_item_id" TEXT NOT NULL,
353
+ "url" TEXT NOT NULL,
354
+ "metadata" JSONB NULL,
355
+ "created_at" timestamptz NOT NULL DEFAULT now(),
356
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
357
+ "deleted_at" timestamptz NULL,
358
+ CONSTRAINT "order_claim_item_image_pkey" PRIMARY KEY ("id")
359
+ );
360
+
361
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_claim_item_id" ON "order_claim_item_image" ("claim_item_id")
362
+ WHERE "deleted_at" IS NOT NULL;
363
+
364
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_deleted_at" ON "order_claim_item_image" ("deleted_at")
365
+ WHERE "deleted_at" IS NOT NULL;
366
+ `;
367
+ this.addSql(sql);
368
+ }
369
+ }
370
+ exports.Migration20240604100512 = Migration20240604100512;
371
+ //# sourceMappingURL=Migration20240604100512.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240604100512.js","sourceRoot":"","sources":["../../src/migrations/Migration20240604100512.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuWX,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AA5WD,0DA4WC"}
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240715102100 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20240715102100.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240715102100.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240715102100.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ1B"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20240715102100 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20240715102100 extends migrations_1.Migration {
6
+ async up() {
7
+ const sql = `
8
+ ALTER TABLE "return"
9
+ ADD COLUMN if NOT exists "location_id" TEXT NULL;
10
+ `;
11
+ this.addSql(sql);
12
+ }
13
+ }
14
+ exports.Migration20240715102100 = Migration20240715102100;
15
+ //# sourceMappingURL=Migration20240715102100.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240715102100.js","sourceRoot":"","sources":["../../src/migrations/Migration20240715102100.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;KAGX,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AATD,0DASC"}
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240715174100 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20240715174100.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240715174100.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240715174100.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAc1B"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20240715174100 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20240715174100 extends migrations_1.Migration {
6
+ async up() {
7
+ const sql = `
8
+ DROP INDEX IF EXISTS "IDX_order_shipping_method_shipping_option_id";
9
+
10
+ ALTER TABLE "order_shipping_method"
11
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
12
+
13
+ CREATE INDEX IF NOT EXISTS "IDX_order_shipping_method_shipping_option_id" ON "order_shipping_method" (
14
+ shipping_option_id
15
+ ) WHERE deleted_at IS NULL;
16
+ `;
17
+ this.addSql(sql);
18
+ }
19
+ }
20
+ exports.Migration20240715174100 = Migration20240715174100;
21
+ //# sourceMappingURL=Migration20240715174100.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240715174100.js","sourceRoot":"","sources":["../../src/migrations/Migration20240715174100.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;KASX,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AAfD,0DAeC"}
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240716081800 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20240716081800.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240716081800.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240716081800.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CA4D1B"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20240716081800 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20240716081800 extends migrations_1.Migration {
6
+ async up() {
7
+ const sql = `
8
+ DROP INDEX IF EXISTS "IDX_order_line_item_variant_id";
9
+ DROP INDEX IF EXISTS "IDX_order_line_item_product_id";
10
+
11
+ ALTER TABLE "order_line_item"
12
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
13
+
14
+ CREATE INDEX IF NOT EXISTS "IDX_order_line_item_variant_id" ON "order_line_item" (
15
+ variant_id
16
+ ) WHERE deleted_at IS NULL;
17
+
18
+ CREATE INDEX IF NOT EXISTS "IDX_order_line_item_product_id" ON "order_line_item" (
19
+ product_id
20
+ ) WHERE deleted_at IS NULL;
21
+
22
+
23
+
24
+ DROP INDEX IF EXISTS "IDX_order_shipping_method_tax_line_shipping_method_id";
25
+
26
+ ALTER TABLE "order_shipping_method_tax_line"
27
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
28
+
29
+ CREATE INDEX IF NOT EXISTS "IDX_order_shipping_method_tax_line_shipping_method_id" ON "order_shipping_method_tax_line" (
30
+ shipping_method_id
31
+ ) WHERE deleted_at IS NULL;
32
+
33
+
34
+ DROP INDEX IF EXISTS "IDX_order_shipping_method_adjustment_shipping_method_id";
35
+
36
+ ALTER TABLE "order_shipping_method_adjustment"
37
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
38
+
39
+ CREATE INDEX IF NOT EXISTS "IDX_order_shipping_method_adjustment_shipping_method_id" ON "order_shipping_method_adjustment" (
40
+ shipping_method_id
41
+ ) WHERE deleted_at IS NULL;
42
+
43
+
44
+
45
+ DROP INDEX IF EXISTS "IDX_order_line_item_tax_line_item_id";
46
+
47
+ ALTER TABLE "order_line_item_tax_line"
48
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
49
+
50
+ CREATE INDEX IF NOT EXISTS "IDX_order_line_item_tax_line_item_id" ON "order_line_item_tax_line" (
51
+ item_id
52
+ ) WHERE deleted_at IS NULL;
53
+
54
+ DROP INDEX IF EXISTS "IDX_order_line_item_adjustment_item_id";
55
+
56
+ ALTER TABLE "order_line_item_adjustment"
57
+ ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
58
+
59
+ CREATE INDEX IF NOT EXISTS "IDX_order_line_item_adjustment_item_id" ON "order_line_item_adjustment" (
60
+ item_id
61
+ ) WHERE deleted_at IS NULL;
62
+ `;
63
+ this.addSql(sql);
64
+ }
65
+ }
66
+ exports.Migration20240716081800 = Migration20240716081800;
67
+ //# sourceMappingURL=Migration20240716081800.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240716081800.js","sourceRoot":"","sources":["../../src/migrations/Migration20240716081800.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuDX,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AA7DD,0DA6DC"}
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240801085921 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20240801085921.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240801085921.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240801085921.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAsB1B"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20240801085921 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20240801085921 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ ALTER TABLE "return"
9
+ ADD COLUMN IF NOT exists "requested_at" timestamptz NULL;
10
+
11
+
12
+ ALTER TABLE "return" ALTER COLUMN "status" DROP DEFAULT;
13
+ ALTER TABLE "return" ALTER COLUMN "status" TYPE text USING "status"::text;
14
+ DROP TYPE return_status_enum;
15
+
16
+ CREATE TYPE return_status_enum AS ENUM (
17
+ 'open',
18
+ 'requested',
19
+ 'received',
20
+ 'partially_received',
21
+ 'canceled'
22
+ );
23
+
24
+ ALTER TABLE "return" ALTER COLUMN "status" TYPE return_status_enum USING "status"::text::return_status_enum;
25
+ ALTER TABLE "return" ALTER COLUMN "status" SET DEFAULT 'open';
26
+ `);
27
+ }
28
+ }
29
+ exports.Migration20240801085921 = Migration20240801085921;
30
+ //# sourceMappingURL=Migration20240801085921.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240801085921.js","sourceRoot":"","sources":["../../src/migrations/Migration20240801085921.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;OAmBT,CAAC,CAAA;IACN,CAAC;CACF;AAvBD,0DAuBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240821164505 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20240821164505.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240821164505.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240821164505.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAS5B"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20240821164505 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20240821164505 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_item_deleted_at" ON "order_item" (deleted_at) WHERE deleted_at IS NOT NULL;');
8
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_summary_deleted_at" ON "order_summary" (deleted_at) WHERE deleted_at IS NOT NULL;');
9
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" (deleted_at) WHERE deleted_at IS NOT NULL;');
10
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" (deleted_at) WHERE deleted_at IS NOT NULL;');
11
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_shipping_deleted_at" ON "order_shipping" (deleted_at) WHERE deleted_at IS NOT NULL;');
12
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_transaction_exchange_id" ON "order_transaction" (exchange_id) WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;');
13
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_transaction_claim_id" ON "order_transaction" (claim_id) WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;');
14
+ }
15
+ async down() {
16
+ this.addSql('drop index if exists "IDX_order_item_deleted_at";');
17
+ this.addSql('drop index if exists "IDX_order_summary_deleted_at";');
18
+ this.addSql('drop index if exists "IDX_order_claim_item_deleted_at";');
19
+ this.addSql('drop index if exists "IDX_return_item_deleted_at";');
20
+ this.addSql('drop index if exists "IDX_order_shipping_deleted_at";');
21
+ this.addSql('drop index if exists "IDX_order_transaction_exchange_id";');
22
+ this.addSql('drop index if exists "IDX_order_transaction_claim_id";');
23
+ }
24
+ }
25
+ exports.Migration20240821164505 = Migration20240821164505;
26
+ //# sourceMappingURL=Migration20240821164505.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240821164505.js","sourceRoot":"","sources":["../../src/migrations/Migration20240821164505.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT,mHAAmH,CACpH,CAAA;QAED,IAAI,CAAC,MAAM,CACT,yHAAyH,CAC1H,CAAA;QAED,IAAI,CAAC,MAAM,CACT,+HAA+H,CAChI,CAAA;QAED,IAAI,CAAC,MAAM,CACT,qHAAqH,CACtH,CAAA;QAED,IAAI,CAAC,MAAM,CACT,2HAA2H,CAC5H,CAAA;QAED,IAAI,CAAC,MAAM,CACT,+JAA+J,CAChK,CAAA;QAED,IAAI,CAAC,MAAM,CACT,sJAAsJ,CACvJ,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC,mDAAmD,CAAC,CAAA;QAChE,IAAI,CAAC,MAAM,CAAC,sDAAsD,CAAC,CAAA;QACnE,IAAI,CAAC,MAAM,CAAC,yDAAyD,CAAC,CAAA;QACtE,IAAI,CAAC,MAAM,CAAC,oDAAoD,CAAC,CAAA;QACjE,IAAI,CAAC,MAAM,CAAC,uDAAuD,CAAC,CAAA;QACpE,IAAI,CAAC,MAAM,CAAC,2DAA2D,CAAC,CAAA;QACxE,IAAI,CAAC,MAAM,CAAC,wDAAwD,CAAC,CAAA;IACvE,CAAC;CACF;AAxCD,0DAwCC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240821170920 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20240821170920.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240821170920.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240821170920.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAcnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAa5B"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20240821170920 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20240821170920 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql('alter table if exists "return" add column if not exists "created_by" text null;');
8
+ this.addSql('alter table if exists "order_exchange" add column if not exists "created_by" text null;');
9
+ this.addSql('alter table if exists "order_claim" add column if not exists "created_by" text null;');
10
+ }
11
+ async down() {
12
+ this.addSql('alter table if exists "return" drop column if exists "created_by";');
13
+ this.addSql('alter table if exists "order_exchange" drop column if exists "created_by";');
14
+ this.addSql('alter table if exists "order_claim" drop column if exists "created_by";');
15
+ }
16
+ }
17
+ exports.Migration20240821170920 = Migration20240821170920;
18
+ //# sourceMappingURL=Migration20240821170920.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240821170920.js","sourceRoot":"","sources":["../../src/migrations/Migration20240821170920.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT,iFAAiF,CAClF,CAAA;QAED,IAAI,CAAC,MAAM,CACT,yFAAyF,CAC1F,CAAA;QAED,IAAI,CAAC,MAAM,CACT,sFAAsF,CACvF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CACT,oEAAoE,CACrE,CAAA;QAED,IAAI,CAAC,MAAM,CACT,4EAA4E,CAC7E,CAAA;QAED,IAAI,CAAC,MAAM,CACT,yEAAyE,CAC1E,CAAA;IACH,CAAC;CACF;AA5BD,0DA4BC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240827133639 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20240827133639.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240827133639.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240827133639.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAcnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B"}