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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. package/dist/index.d.ts +6 -8
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +4 -26
  4. package/dist/index.js.map +1 -1
  5. package/dist/migrations/Migration20240219102530.d.ts +1 -0
  6. package/dist/migrations/Migration20240219102530.d.ts.map +1 -0
  7. package/dist/migrations/Migration20240219102530.js +38 -4
  8. package/dist/migrations/Migration20240219102530.js.map +1 -1
  9. package/dist/migrations/Migration20240604100512.d.ts +5 -0
  10. package/dist/migrations/Migration20240604100512.d.ts.map +1 -0
  11. package/dist/migrations/Migration20240604100512.js +364 -0
  12. package/dist/migrations/Migration20240604100512.js.map +1 -0
  13. package/dist/migrations/Migration20240715102100.d.ts +5 -0
  14. package/dist/migrations/Migration20240715102100.d.ts.map +1 -0
  15. package/dist/migrations/Migration20240715102100.js +15 -0
  16. package/dist/migrations/Migration20240715102100.js.map +1 -0
  17. package/dist/migrations/Migration20240715174100.d.ts +5 -0
  18. package/dist/migrations/Migration20240715174100.d.ts.map +1 -0
  19. package/dist/migrations/Migration20240715174100.js +21 -0
  20. package/dist/migrations/Migration20240715174100.js.map +1 -0
  21. package/dist/migrations/Migration20240716081800.d.ts +5 -0
  22. package/dist/migrations/Migration20240716081800.d.ts.map +1 -0
  23. package/dist/migrations/Migration20240716081800.js +67 -0
  24. package/dist/migrations/Migration20240716081800.js.map +1 -0
  25. package/dist/models/address.d.ts +2 -1
  26. package/dist/models/address.d.ts.map +1 -0
  27. package/dist/models/adjustment-line.d.ts +3 -1
  28. package/dist/models/adjustment-line.d.ts.map +1 -0
  29. package/dist/models/adjustment-line.js +5 -0
  30. package/dist/models/adjustment-line.js.map +1 -1
  31. package/dist/models/claim-item-image.d.ts +19 -0
  32. package/dist/models/claim-item-image.d.ts.map +1 -0
  33. package/dist/models/claim-item-image.js +109 -0
  34. package/dist/models/claim-item-image.js.map +1 -0
  35. package/dist/models/claim-item.d.ts +29 -0
  36. package/dist/models/claim-item.d.ts.map +1 -0
  37. package/dist/models/claim-item.js +156 -0
  38. package/dist/models/claim-item.js.map +1 -0
  39. package/dist/models/claim.d.ts +36 -0
  40. package/dist/models/claim.d.ts.map +1 -0
  41. package/dist/models/claim.js +195 -0
  42. package/dist/models/claim.js.map +1 -0
  43. package/dist/models/exchange-item.d.ts +24 -0
  44. package/dist/models/exchange-item.d.ts.map +1 -0
  45. package/dist/models/exchange-item.js +138 -0
  46. package/dist/models/exchange-item.js.map +1 -0
  47. package/dist/models/exchange.d.ts +34 -0
  48. package/dist/models/exchange.d.ts.map +1 -0
  49. package/dist/models/exchange.js +188 -0
  50. package/dist/models/exchange.js.map +1 -0
  51. package/dist/models/index.d.ts +9 -0
  52. package/dist/models/index.d.ts.map +1 -0
  53. package/dist/models/index.js +17 -1
  54. package/dist/models/index.js.map +1 -1
  55. package/dist/models/line-item-adjustment.d.ts +3 -1
  56. package/dist/models/line-item-adjustment.d.ts.map +1 -0
  57. package/dist/models/line-item-adjustment.js +3 -3
  58. package/dist/models/line-item-adjustment.js.map +1 -1
  59. package/dist/models/line-item-tax-line.d.ts +3 -1
  60. package/dist/models/line-item-tax-line.d.ts.map +1 -0
  61. package/dist/models/line-item-tax-line.js +3 -3
  62. package/dist/models/line-item-tax-line.js.map +1 -1
  63. package/dist/models/line-item.d.ts +3 -1
  64. package/dist/models/line-item.d.ts.map +1 -0
  65. package/dist/models/line-item.js +18 -4
  66. package/dist/models/line-item.js.map +1 -1
  67. package/dist/models/order-change-action.d.ts +15 -4
  68. package/dist/models/order-change-action.d.ts.map +1 -0
  69. package/dist/models/order-change-action.js +102 -7
  70. package/dist/models/order-change-action.js.map +1 -1
  71. package/dist/models/order-change.d.ts +17 -5
  72. package/dist/models/order-change.d.ts.map +1 -0
  73. package/dist/models/order-change.js +109 -4
  74. package/dist/models/order-change.js.map +1 -1
  75. package/dist/models/order-item.d.ts +5 -4
  76. package/dist/models/order-item.d.ts.map +1 -0
  77. package/dist/models/order-item.js +13 -13
  78. package/dist/models/order-item.js.map +1 -1
  79. package/dist/models/order-shipping-method.d.ts +14 -4
  80. package/dist/models/order-shipping-method.d.ts.map +1 -0
  81. package/dist/models/order-shipping-method.js +89 -13
  82. package/dist/models/order-shipping-method.js.map +1 -1
  83. package/dist/models/order-summary.d.ts +6 -7
  84. package/dist/models/order-summary.d.ts.map +1 -0
  85. package/dist/models/order-summary.js +9 -6
  86. package/dist/models/order-summary.js.map +1 -1
  87. package/dist/models/order.d.ts +6 -4
  88. package/dist/models/order.d.ts.map +1 -0
  89. package/dist/models/order.js +11 -1
  90. package/dist/models/order.js.map +1 -1
  91. package/dist/models/return-item.d.ts +29 -0
  92. package/dist/models/return-item.d.ts.map +1 -0
  93. package/dist/models/return-item.js +170 -0
  94. package/dist/models/return-item.js.map +1 -0
  95. package/dist/models/return-reason.d.ts +21 -0
  96. package/dist/models/return-reason.d.ts.map +1 -0
  97. package/dist/models/return-reason.js +120 -0
  98. package/dist/models/return-reason.js.map +1 -0
  99. package/dist/models/return.d.ts +39 -0
  100. package/dist/models/return.d.ts.map +1 -0
  101. package/dist/models/return.js +216 -0
  102. package/dist/models/return.js.map +1 -0
  103. package/dist/models/shipping-method-adjustment.d.ts +3 -1
  104. package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
  105. package/dist/models/shipping-method-adjustment.js +3 -3
  106. package/dist/models/shipping-method-adjustment.js.map +1 -1
  107. package/dist/models/shipping-method-tax-line.d.ts +3 -1
  108. package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
  109. package/dist/models/shipping-method-tax-line.js +3 -3
  110. package/dist/models/shipping-method-tax-line.js.map +1 -1
  111. package/dist/models/shipping-method.d.ts +2 -0
  112. package/dist/models/shipping-method.d.ts.map +1 -0
  113. package/dist/models/shipping-method.js +17 -4
  114. package/dist/models/shipping-method.js.map +1 -1
  115. package/dist/models/tax-line.d.ts +2 -0
  116. package/dist/models/tax-line.d.ts.map +1 -0
  117. package/dist/models/tax-line.js +7 -0
  118. package/dist/models/tax-line.js.map +1 -1
  119. package/dist/models/transaction.d.ts +15 -3
  120. package/dist/models/transaction.d.ts.map +1 -0
  121. package/dist/models/transaction.js +109 -4
  122. package/dist/models/transaction.js.map +1 -1
  123. package/dist/repositories/claim.d.ts +9 -0
  124. package/dist/repositories/claim.d.ts.map +1 -0
  125. package/dist/repositories/claim.js +11 -0
  126. package/dist/repositories/claim.js.map +1 -0
  127. package/dist/repositories/exchange.d.ts +9 -0
  128. package/dist/repositories/exchange.d.ts.map +1 -0
  129. package/dist/repositories/exchange.js +11 -0
  130. package/dist/repositories/exchange.js.map +1 -0
  131. package/dist/repositories/index.d.ts +4 -1
  132. package/dist/repositories/index.d.ts.map +1 -0
  133. package/dist/repositories/index.js +7 -16
  134. package/dist/repositories/index.js.map +1 -1
  135. package/dist/repositories/order.d.ts +1 -3
  136. package/dist/repositories/order.d.ts.map +1 -0
  137. package/dist/repositories/order.js +2 -85
  138. package/dist/repositories/order.js.map +1 -1
  139. package/dist/repositories/return.d.ts +9 -0
  140. package/dist/repositories/return.d.ts.map +1 -0
  141. package/dist/repositories/return.js +11 -0
  142. package/dist/repositories/return.js.map +1 -0
  143. package/dist/services/actions/cancel-claim.d.ts +3 -0
  144. package/dist/services/actions/cancel-claim.d.ts.map +1 -0
  145. package/dist/services/actions/cancel-claim.js +107 -0
  146. package/dist/services/actions/cancel-claim.js.map +1 -0
  147. package/dist/services/actions/cancel-exchange.d.ts +3 -0
  148. package/dist/services/actions/cancel-exchange.d.ts.map +1 -0
  149. package/dist/services/actions/cancel-exchange.js +92 -0
  150. package/dist/services/actions/cancel-exchange.js.map +1 -0
  151. package/dist/services/actions/cancel-fulfillment.d.ts +3 -0
  152. package/dist/services/actions/cancel-fulfillment.d.ts.map +1 -0
  153. package/dist/services/actions/cancel-fulfillment.js +32 -0
  154. package/dist/services/actions/cancel-fulfillment.js.map +1 -0
  155. package/dist/services/actions/cancel-return.d.ts +3 -0
  156. package/dist/services/actions/cancel-return.d.ts.map +1 -0
  157. package/dist/services/actions/cancel-return.js +72 -0
  158. package/dist/services/actions/cancel-return.js.map +1 -0
  159. package/dist/services/actions/create-claim.d.ts +3 -0
  160. package/dist/services/actions/create-claim.d.ts.map +1 -0
  161. package/dist/services/actions/create-claim.js +228 -0
  162. package/dist/services/actions/create-claim.js.map +1 -0
  163. package/dist/services/actions/create-exchange.d.ts +3 -0
  164. package/dist/services/actions/create-exchange.d.ts.map +1 -0
  165. package/dist/services/actions/create-exchange.js +193 -0
  166. package/dist/services/actions/create-exchange.js.map +1 -0
  167. package/dist/services/actions/create-return.d.ts +3 -0
  168. package/dist/services/actions/create-return.d.ts.map +1 -0
  169. package/dist/services/actions/create-return.js +102 -0
  170. package/dist/services/actions/create-return.js.map +1 -0
  171. package/dist/services/actions/index.d.ts +11 -0
  172. package/dist/services/actions/index.d.ts.map +1 -0
  173. package/dist/services/actions/index.js +27 -0
  174. package/dist/services/actions/index.js.map +1 -0
  175. package/dist/services/actions/receive-return.d.ts +3 -0
  176. package/dist/services/actions/receive-return.d.ts.map +1 -0
  177. package/dist/services/actions/receive-return.js +72 -0
  178. package/dist/services/actions/receive-return.js.map +1 -0
  179. package/dist/services/actions/register-fulfillment.d.ts +3 -0
  180. package/dist/services/actions/register-fulfillment.d.ts.map +1 -0
  181. package/dist/services/actions/register-fulfillment.js +30 -0
  182. package/dist/services/actions/register-fulfillment.js.map +1 -0
  183. package/dist/services/actions/register-shipment.d.ts +3 -0
  184. package/dist/services/actions/register-shipment.d.ts.map +1 -0
  185. package/dist/services/actions/register-shipment.js +38 -0
  186. package/dist/services/actions/register-shipment.js.map +1 -0
  187. package/dist/services/index.d.ts +1 -1
  188. package/dist/services/index.d.ts.map +1 -0
  189. package/dist/services/index.js +1 -3
  190. package/dist/services/index.js.map +1 -1
  191. package/dist/services/order-module-service.d.ts +138 -67
  192. package/dist/services/order-module-service.d.ts.map +1 -0
  193. package/dist/services/order-module-service.js +993 -241
  194. package/dist/services/order-module-service.js.map +1 -1
  195. package/dist/services/order-service.d.ts +5 -4
  196. package/dist/services/order-service.d.ts.map +1 -0
  197. package/dist/services/order-service.js +1 -1
  198. package/dist/services/order-service.js.map +1 -1
  199. package/dist/types/address.d.ts +1 -0
  200. package/dist/types/address.d.ts.map +1 -0
  201. package/dist/types/index.d.ts +3 -1
  202. package/dist/types/index.d.ts.map +1 -0
  203. package/dist/types/index.js +1 -0
  204. package/dist/types/index.js.map +1 -1
  205. package/dist/types/line-item-adjustment.d.ts +1 -0
  206. package/dist/types/line-item-adjustment.d.ts.map +1 -0
  207. package/dist/types/line-item-tax-line.d.ts +1 -0
  208. package/dist/types/line-item-tax-line.d.ts.map +1 -0
  209. package/dist/types/line-item.d.ts +1 -0
  210. package/dist/types/line-item.d.ts.map +1 -0
  211. package/dist/types/order-change.d.ts +6 -0
  212. package/dist/types/order-change.d.ts.map +1 -0
  213. package/dist/types/order-change.js +3 -0
  214. package/dist/types/order-change.js.map +1 -0
  215. package/dist/types/order-detail.d.ts +2 -1
  216. package/dist/types/order-detail.d.ts.map +1 -0
  217. package/dist/types/order.d.ts +3 -2
  218. package/dist/types/order.d.ts.map +1 -0
  219. package/dist/types/shipping-method-adjustment.d.ts +1 -0
  220. package/dist/types/shipping-method-adjustment.d.ts.map +1 -0
  221. package/dist/types/shipping-method-tax-line.d.ts +1 -0
  222. package/dist/types/shipping-method-tax-line.d.ts.map +1 -0
  223. package/dist/types/shipping-method.d.ts +4 -0
  224. package/dist/types/shipping-method.d.ts.map +1 -0
  225. package/dist/types/tax-line.d.ts +1 -0
  226. package/dist/types/tax-line.d.ts.map +1 -0
  227. package/dist/types/transaction.d.ts +1 -0
  228. package/dist/types/transaction.d.ts.map +1 -0
  229. package/dist/types/utils/index.d.ts +40 -21
  230. package/dist/types/utils/index.d.ts.map +1 -0
  231. package/dist/types/utils/index.js +0 -1
  232. package/dist/types/utils/index.js.map +1 -1
  233. package/dist/utils/actions/cancel-item-fulfillment.d.ts +2 -0
  234. package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +1 -0
  235. package/dist/utils/actions/cancel-item-fulfillment.js +34 -0
  236. package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -0
  237. package/dist/utils/actions/cancel-return.d.ts +1 -0
  238. package/dist/utils/actions/cancel-return.d.ts.map +1 -0
  239. package/dist/utils/actions/cancel-return.js +6 -10
  240. package/dist/utils/actions/cancel-return.js.map +1 -1
  241. package/dist/utils/actions/fulfill-item.d.ts +1 -0
  242. package/dist/utils/actions/fulfill-item.d.ts.map +1 -0
  243. package/dist/utils/actions/fulfill-item.js +6 -10
  244. package/dist/utils/actions/fulfill-item.js.map +1 -1
  245. package/dist/utils/actions/index.d.ts +4 -1
  246. package/dist/utils/actions/index.d.ts.map +1 -0
  247. package/dist/utils/actions/index.js +3 -1
  248. package/dist/utils/actions/index.js.map +1 -1
  249. package/dist/utils/actions/item-add.d.ts +1 -0
  250. package/dist/utils/actions/item-add.d.ts.map +1 -0
  251. package/dist/utils/actions/item-add.js +15 -24
  252. package/dist/utils/actions/item-add.js.map +1 -1
  253. package/dist/utils/actions/item-remove.d.ts +1 -0
  254. package/dist/utils/actions/item-remove.d.ts.map +1 -0
  255. package/dist/utils/actions/item-remove.js +8 -22
  256. package/dist/utils/actions/item-remove.js.map +1 -1
  257. package/dist/utils/actions/receive-damaged-return-item.d.ts +1 -0
  258. package/dist/utils/actions/receive-damaged-return-item.d.ts.map +1 -0
  259. package/dist/utils/actions/receive-damaged-return-item.js +9 -35
  260. package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
  261. package/dist/utils/actions/receive-return-item.d.ts +1 -0
  262. package/dist/utils/actions/receive-return-item.d.ts.map +1 -0
  263. package/dist/utils/actions/receive-return-item.js +7 -36
  264. package/dist/utils/actions/receive-return-item.js.map +1 -1
  265. package/dist/utils/actions/reinstate-item.d.ts +2 -0
  266. package/dist/utils/actions/reinstate-item.d.ts.map +1 -0
  267. package/dist/utils/actions/reinstate-item.js +32 -0
  268. package/dist/utils/actions/reinstate-item.js.map +1 -0
  269. package/dist/utils/actions/return-item.d.ts +1 -0
  270. package/dist/utils/actions/return-item.d.ts.map +1 -0
  271. package/dist/utils/actions/return-item.js +8 -12
  272. package/dist/utils/actions/return-item.js.map +1 -1
  273. package/dist/utils/actions/ship-item.d.ts +1 -0
  274. package/dist/utils/actions/ship-item.d.ts.map +1 -0
  275. package/dist/utils/actions/ship-item.js +6 -10
  276. package/dist/utils/actions/ship-item.js.map +1 -1
  277. package/dist/utils/actions/shipping-add.d.ts +1 -0
  278. package/dist/utils/actions/shipping-add.d.ts.map +1 -0
  279. package/dist/utils/actions/shipping-add.js +16 -16
  280. package/dist/utils/actions/shipping-add.js.map +1 -1
  281. package/dist/utils/actions/shipping-remove.d.ts +2 -0
  282. package/dist/utils/actions/shipping-remove.d.ts.map +1 -0
  283. package/dist/utils/actions/shipping-remove.js +25 -0
  284. package/dist/utils/actions/shipping-remove.js.map +1 -0
  285. package/dist/utils/actions/write-off-item.d.ts +1 -0
  286. package/dist/utils/actions/write-off-item.d.ts.map +1 -0
  287. package/dist/utils/actions/write-off-item.js +6 -10
  288. package/dist/utils/actions/write-off-item.js.map +1 -1
  289. package/dist/utils/apply-order-changes.d.ts +18 -0
  290. package/dist/utils/apply-order-changes.d.ts.map +1 -0
  291. package/dist/utils/apply-order-changes.js +95 -0
  292. package/dist/utils/apply-order-changes.js.map +1 -0
  293. package/dist/utils/base-repository-find.d.ts +3 -0
  294. package/dist/utils/base-repository-find.d.ts.map +1 -0
  295. package/dist/utils/base-repository-find.js +142 -0
  296. package/dist/utils/base-repository-find.js.map +1 -0
  297. package/dist/utils/calculate-order-change.d.ts +11 -5
  298. package/dist/utils/calculate-order-change.d.ts.map +1 -0
  299. package/dist/utils/calculate-order-change.js +58 -183
  300. package/dist/utils/calculate-order-change.js.map +1 -1
  301. package/dist/utils/index.d.ts +4 -1
  302. package/dist/utils/index.d.ts.map +1 -0
  303. package/dist/utils/index.js +3 -1
  304. package/dist/utils/index.js.map +1 -1
  305. package/dist/utils/set-action-reference.d.ts +2 -0
  306. package/dist/utils/set-action-reference.d.ts.map +1 -0
  307. package/dist/utils/set-action-reference.js +11 -0
  308. package/dist/utils/set-action-reference.js.map +1 -0
  309. package/dist/utils/transform-order.d.ts +4 -2
  310. package/dist/utils/transform-order.d.ts.map +1 -0
  311. package/dist/utils/transform-order.js +131 -17
  312. package/dist/utils/transform-order.js.map +1 -1
  313. package/package.json +8 -14
  314. package/dist/joiner-config.d.ts +0 -5
  315. package/dist/joiner-config.js +0 -36
  316. package/dist/joiner-config.js.map +0 -1
  317. package/dist/module-definition.d.ts +0 -2
  318. package/dist/module-definition.js +0 -59
  319. package/dist/module-definition.js.map +0 -1
  320. package/dist/scripts/bin/run-seed.d.ts +0 -3
  321. package/dist/scripts/bin/run-seed.js +0 -49
  322. package/dist/scripts/bin/run-seed.js.map +0 -1
  323. package/dist/services/order-change-service.d.ts +0 -15
  324. package/dist/services/order-change-service.js +0 -96
  325. package/dist/services/order-change-service.js.map +0 -1
  326. package/dist/utils/action-key.d.ts +0 -13
  327. package/dist/utils/action-key.js +0 -18
  328. package/dist/utils/action-key.js.map +0 -1
  329. package/dist/utils/actions/cancel.d.ts +0 -1
  330. package/dist/utils/actions/cancel.js +0 -8
  331. package/dist/utils/actions/cancel.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- import { moduleDefinition } from "./module-definition";
2
- export * from "./models";
3
- export * from "./services";
4
- export * from "./types";
5
- export declare const initialize: (options?: import("@medusajs/modules-sdk").InternalModuleDeclaration | import("@medusajs/modules-sdk").ModuleServiceInitializeOptions | import("@medusajs/modules-sdk").ModuleServiceInitializeCustomDataLayerOptions | import("@medusajs/modules-sdk").ExternalModuleDeclaration | undefined, injectedDependencies?: any) => Promise<unknown>;
6
- export declare const runMigrations: ((options: import("@medusajs/modules-sdk").LoaderOptions<any>, moduleDeclaration?: import("@medusajs/modules-sdk").InternalModuleDeclaration | undefined) => Promise<void>) | undefined;
7
- export declare const revertMigration: ((options: import("@medusajs/modules-sdk").LoaderOptions<any>, moduleDeclaration?: import("@medusajs/modules-sdk").InternalModuleDeclaration | undefined) => Promise<void>) | undefined;
8
- export default moduleDefinition;
1
+ import { OrderModuleService } from "./services";
2
+ declare const _default: import("@medusajs/types").ModuleExports<typeof OrderModuleService> & {
3
+ linkable: Record<string, any>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;;;;AAG9C,wBAEE"}
package/dist/index.js CHANGED
@@ -1,30 +1,8 @@
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.revertMigration = exports.runMigrations = exports.initialize = void 0;
18
- const modules_sdk_1 = require("@medusajs/modules-sdk");
19
- const module_definition_1 = require("./module-definition");
20
- __exportStar(require("./models"), exports);
21
- __exportStar(require("./services"), exports);
22
- __exportStar(require("./types"), exports);
23
- exports.initialize = (0, modules_sdk_1.initializeFactory)({
24
- moduleName: modules_sdk_1.Modules.ORDER,
25
- moduleDefinition: module_definition_1.moduleDefinition,
3
+ const _services_1 = require("./services");
4
+ const utils_1 = require("@medusajs/utils");
5
+ exports.default = (0, utils_1.Module)(utils_1.Modules.ORDER, {
6
+ service: _services_1.OrderModuleService,
26
7
  });
27
- exports.runMigrations = module_definition_1.moduleDefinition.runMigrations;
28
- exports.revertMigration = module_definition_1.moduleDefinition.revertMigration;
29
- exports.default = module_definition_1.moduleDefinition;
30
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uDAAkE;AAClE,2DAAsD;AAEtD,2CAAwB;AACxB,6CAA0B;AAC1B,0CAAuB;AAEV,QAAA,UAAU,GAAG,IAAA,+BAAiB,EAAC;IAC1C,UAAU,EAAE,qBAAO,CAAC,KAAK;IACzB,gBAAgB,EAAhB,oCAAgB;CACjB,CAAC,CAAA;AACW,QAAA,aAAa,GAAG,oCAAgB,CAAC,aAAa,CAAA;AAC9C,QAAA,eAAe,GAAG,oCAAgB,CAAC,eAAe,CAAA;AAC/D,kBAAe,oCAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,yCAA8C;AAC9C,2CAAiD;AAEjD,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,KAAK,EAAE;IACnC,OAAO,EAAE,8BAAkB;CAC5B,CAAC,CAAA"}
@@ -2,3 +2,4 @@ import { Migration } from "@mikro-orm/migrations";
2
2
  export declare class Migration20240219102530 extends Migration {
3
3
  up(): Promise<void>;
4
4
  }
5
+ //# sourceMappingURL=Migration20240219102530.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240219102530.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240219102530.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAijB1B"}
@@ -32,6 +32,7 @@ class Migration20240219102530 extends migrations_1.Migration {
32
32
  CREATE TABLE IF NOT EXISTS "order" (
33
33
  "id" TEXT NOT NULL,
34
34
  "region_id" TEXT NULL,
35
+ "display_id" SERIAL,
35
36
  "customer_id" TEXT NULL,
36
37
  "version" INTEGER NOT NULL DEFAULT 1,
37
38
  "sales_channel_id" TEXT NULL,
@@ -109,6 +110,11 @@ class Migration20240219102530 extends migrations_1.Migration {
109
110
 
110
111
  ${(0, utils_1.generatePostgresAlterColummnIfExistStatement)("order", ["fulfillment_status", "payment_status", "display_id"], "DROP NOT NULL")}
111
112
 
113
+ CREATE INDEX IF NOT EXISTS "IDX_order_display_id" ON "order" (
114
+ display_id
115
+ )
116
+ WHERE deleted_at IS NOT NULL;
117
+
112
118
  CREATE INDEX IF NOT EXISTS "IDX_order_region_id" ON "order" (
113
119
  region_id
114
120
  )
@@ -437,6 +443,7 @@ class Migration20240219102530 extends migrations_1.Migration {
437
443
  CREATE TABLE IF NOT EXISTS "order_transaction" (
438
444
  "id" TEXT NOT NULL,
439
445
  "order_id" TEXT NOT NULL,
446
+ "version" INTEGER NOT NULL DEFAULT 1,
440
447
  "amount" NUMERIC NOT NULL,
441
448
  "raw_amount" JSONB NOT NULL,
442
449
  "currency_code" TEXT NOT NULL,
@@ -444,21 +451,48 @@ class Migration20240219102530 extends migrations_1.Migration {
444
451
  "reference_id" TEXT NULL,
445
452
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT Now(),
446
453
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT Now(),
454
+ "deleted_at" timestamptz NULL,
447
455
  CONSTRAINT "order_transaction_pkey" PRIMARY KEY ("id")
448
456
  );
449
457
 
450
- CREATE INDEX IF NOT EXISTS "IDX_order_transaction_order_id" ON "order_transaction" (
451
- order_id
452
- );
458
+ CREATE INDEX IF NOT EXISTS "IDX_order_transaction_order_id_version" ON "order_transaction" (
459
+ order_id,
460
+ version
461
+ )
462
+ WHERE deleted_at IS NOT NULL;
453
463
 
454
464
  CREATE INDEX IF NOT EXISTS "IDX_order_transaction_currency_code" ON "order_transaction" (
455
465
  currency_code
456
- );
466
+ )
467
+ WHERE deleted_at IS NOT NULL;
457
468
 
458
469
  CREATE INDEX IF NOT EXISTS "IDX_order_transaction_reference_id" ON "order_transaction" (
459
470
  reference_id
471
+ )
472
+ WHERE deleted_at IS NOT NULL;
473
+
474
+ CREATE TABLE IF NOT EXISTS "return_reason"
475
+ (
476
+ id character varying NOT NULL,
477
+ value character varying NOT NULL,
478
+ label character varying NOT NULL,
479
+ description character varying,
480
+ metadata JSONB NULL,
481
+ parent_return_reason_id character varying,
482
+ created_at timestamp with time zone NOT NULL DEFAULT now(),
483
+ updated_at timestamp with time zone NOT NULL DEFAULT now(),
484
+ deleted_at timestamp with time zone,
485
+ CONSTRAINT "return_reason_pkey" PRIMARY KEY (id),
486
+ CONSTRAINT "return_reason_parent_return_reason_id_foreign" FOREIGN KEY (parent_return_reason_id)
487
+ REFERENCES "return_reason" (id) MATCH SIMPLE
488
+ ON UPDATE NO ACTION
489
+ ON DELETE NO ACTION
460
490
  );
461
491
 
492
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_return_reason_value" ON "return_reason" USING btree (value ASC NULLS LAST)
493
+ WHERE deleted_at IS NOT NULL;
494
+
495
+
462
496
  ALTER TABLE if exists "order"
463
497
  ADD CONSTRAINT "order_shipping_address_id_foreign" FOREIGN KEY ("shipping_address_id") REFERENCES "order_address" ("id") ON
464
498
  UPDATE CASCADE ON
@@ -1 +1 @@
1
- {"version":3,"file":"Migration20240219102530.js","sourceRoot":"","sources":["../../src/migrations/Migration20240219102530.ts"],"names":[],"mappings":";;;AAAA,2CAA8E;AAC9E,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsGR,IAAA,oDAA4C,EAC5C,OAAO,EACP,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,CAAC,EACtD,eAAe,CAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgaF,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AAhhBD,0DAghBC"}
1
+ {"version":3,"file":"Migration20240219102530.js","sourceRoot":"","sources":["../../src/migrations/Migration20240219102530.ts"],"names":[],"mappings":";;;AAAA,2CAA8E;AAC9E,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuGR,IAAA,oDAA4C,EAC5C,OAAO,EACP,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,CAAC,EACtD,eAAe,CAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAicF,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AAljBD,0DAkjBC"}
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20240604100512 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20240604100512.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20240604100512.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240604100512.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAoW1B"}
@@ -0,0 +1,364 @@
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 NOT 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 NOT 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 NOT 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 NOT 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 NOT 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 NOT 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 NOT 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 NOT 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 NOT 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 NOT 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 NOT 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 NOT NULL;
134
+
135
+
136
+
137
+ CREATE TYPE return_status_enum AS ENUM (
138
+ 'requested',
139
+ 'received',
140
+ 'partially_received',
141
+ 'canceled'
142
+ );
143
+
144
+ CREATE TABLE IF NOT EXISTS "return" (
145
+ "id" TEXT NOT NULL,
146
+ "order_id" TEXT NOT NULL,
147
+ "claim_id" TEXT NULL,
148
+ "exchange_id" TEXT NULL,
149
+ "order_version" INTEGER NOT NULL,
150
+ "display_id" SERIAL,
151
+ "status" return_status_enum NOT NULL DEFAULT 'requested',
152
+ "no_notification" boolean NULL,
153
+ "refund_amount" NUMERIC NULL,
154
+ "raw_refund_amount" JSONB NULL,
155
+ "metadata" jsonb NULL,
156
+ "created_at" timestamptz NOT NULL DEFAULT now(),
157
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
158
+ "deleted_at" timestamptz NULL,
159
+ "received_at" timestamptz NULL,
160
+ "canceled_at" timestamptz NULL,
161
+ CONSTRAINT "return_pkey" PRIMARY KEY ("id")
162
+ );
163
+
164
+ CREATE INDEX IF NOT EXISTS "IDX_return_order_id" ON "return" (
165
+ order_id
166
+ )
167
+ WHERE deleted_at IS NOT NULL;
168
+
169
+ CREATE INDEX IF NOT EXISTS "IDX_return_claim_id" ON "return" (
170
+ claim_id
171
+ )
172
+ WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
173
+
174
+ CREATE INDEX IF NOT EXISTS "IDX_return_exchange_id" ON "return" (
175
+ exchange_id
176
+ )
177
+ WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
178
+
179
+ CREATE INDEX IF NOT EXISTS "IDX_return_display_id" ON "return" (
180
+ display_id
181
+ )
182
+ WHERE deleted_at IS NOT NULL;
183
+
184
+
185
+ CREATE TABLE IF NOT EXISTS "return_item" (
186
+ "id" TEXT NOT NULL,
187
+ "return_id" TEXT NOT NULL,
188
+ "reason_id" TEXT NULL,
189
+ "item_id" TEXT NOT NULL,
190
+ "quantity" NUMERIC NOT NULL,
191
+ "raw_quantity" JSONB NOT NULL,
192
+ "received_quantity" NUMERIC NOT NULL DEFAULT 0,
193
+ "raw_received_quantity" JSONB NOT NULL,
194
+ "note" TEXT NULL,
195
+ "metadata" JSONB NULL,
196
+ "created_at" timestamptz NOT NULL DEFAULT now(),
197
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
198
+ "deleted_at" timestamptz NULL,
199
+ CONSTRAINT "return_item_pkey" PRIMARY KEY ("id")
200
+ );
201
+
202
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" ("deleted_at")
203
+ WHERE deleted_at IS NOT NULL;
204
+
205
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_return_id" ON "return_item" ("return_id")
206
+ WHERE deleted_at IS NOT NULL;
207
+
208
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_item_id" ON "return_item" ("item_id")
209
+ WHERE deleted_at IS NOT NULL;
210
+
211
+ CREATE INDEX IF NOT EXISTS "IDX_return_item_reason_id" ON "return_item" ("reason_id")
212
+ WHERE deleted_at IS NOT NULL;
213
+
214
+
215
+
216
+ CREATE TABLE IF NOT EXISTS "order_exchange" (
217
+ "id" TEXT NOT NULL,
218
+ "order_id" TEXT NOT NULL,
219
+ "return_id" TEXT NULL,
220
+ "order_version" INTEGER NOT NULL,
221
+ "display_id" SERIAL,
222
+ "no_notification" BOOLEAN NULL,
223
+ "allow_backorder" BOOLEAN NOT NULL DEFAULT FALSE,
224
+ "difference_due" NUMERIC NULL,
225
+ "raw_difference_due" JSONB NULL,
226
+ "metadata" JSONB NULL,
227
+ "created_at" timestamptz NOT NULL DEFAULT now(),
228
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
229
+ "deleted_at" timestamptz NULL,
230
+ "canceled_at" timestamptz NULL,
231
+ CONSTRAINT "order_exchange_pkey" PRIMARY KEY ("id")
232
+ );
233
+
234
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_display_id" ON "order_exchange" ("display_id")
235
+ WHERE deleted_at IS NOT NULL;
236
+
237
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_deleted_at" ON "order_exchange" ("deleted_at")
238
+ WHERE deleted_at IS NOT NULL;
239
+
240
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_order_id" ON "order_exchange" ("order_id")
241
+ WHERE deleted_at IS NOT NULL;
242
+
243
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_return_id" ON "order_exchange" ("return_id")
244
+ WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
245
+
246
+
247
+ CREATE TABLE IF NOT EXISTS "order_exchange_item" (
248
+ "id" TEXT NOT NULL,
249
+ "exchange_id" TEXT NOT NULL,
250
+ "item_id" TEXT NOT NULL,
251
+ "quantity" NUMERIC NOT NULL,
252
+ "raw_quantity" JSONB NOT NULL,
253
+ "note" TEXT NULL,
254
+ "metadata" JSONB NULL,
255
+ "created_at" timestamptz NOT NULL DEFAULT now(),
256
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
257
+ "deleted_at" timestamptz NULL,
258
+ CONSTRAINT "order_exchange_item_pkey" PRIMARY KEY ("id")
259
+ );
260
+
261
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_deleted_at" ON "order_exchange_item" ("deleted_at")
262
+ WHERE deleted_at IS NOT NULL;
263
+
264
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_exchange_id" ON "order_exchange_item" ("exchange_id")
265
+ WHERE deleted_at IS NOT NULL;
266
+
267
+ CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_item_id" ON "order_exchange_item" ("item_id")
268
+ WHERE deleted_at IS NOT NULL;
269
+
270
+
271
+
272
+ CREATE TYPE order_claim_type_enum AS ENUM (
273
+ 'refund',
274
+ 'replace'
275
+ );
276
+
277
+ CREATE TABLE IF NOT EXISTS "order_claim" (
278
+ "id" TEXT NOT NULL,
279
+ "order_id" TEXT NOT NULL,
280
+ "return_id" TEXT NULL,
281
+ "order_version" INTEGER NOT NULL,
282
+ "display_id" SERIAL,
283
+ "type" order_claim_type_enum NOT NULL,
284
+ "no_notification" BOOLEAN NULL,
285
+ "refund_amount" NUMERIC NULL,
286
+ "raw_refund_amount" JSONB NULL,
287
+ "metadata" JSONB NULL,
288
+ "created_at" timestamptz NOT NULL DEFAULT now(),
289
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
290
+ "deleted_at" timestamptz NULL,
291
+ "canceled_at" timestamptz NULL,
292
+ CONSTRAINT "order_claim_pkey" PRIMARY KEY ("id")
293
+ );
294
+
295
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_display_id" ON "order_claim" ("display_id")
296
+ WHERE deleted_at IS NOT NULL;
297
+
298
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_deleted_at" ON "order_claim" ("deleted_at")
299
+ WHERE deleted_at IS NOT NULL;
300
+
301
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_order_id" ON "order_claim" ("order_id")
302
+ WHERE deleted_at IS NOT NULL;
303
+
304
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_return_id" ON "order_claim" ("return_id")
305
+ WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
306
+
307
+
308
+
309
+ CREATE TYPE claim_reason_enum AS ENUM (
310
+ 'missing_item',
311
+ 'wrong_item',
312
+ 'production_failure',
313
+ 'other'
314
+ );
315
+
316
+ CREATE TABLE IF NOT EXISTS "order_claim_item" (
317
+ "id" TEXT NOT NULL,
318
+ "claim_id" TEXT NOT NULL,
319
+ "item_id" TEXT NOT NULL,
320
+ "is_additional_item" BOOLEAN NOT NULL DEFAULT FALSE,
321
+ "reason" claim_reason_enum NULL,
322
+ "quantity" NUMERIC NOT NULL,
323
+ "raw_quantity" JSONB NOT NULL,
324
+ "note" TEXT NULL,
325
+ "metadata" JSONB NULL,
326
+ "created_at" timestamptz NOT NULL DEFAULT now(),
327
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
328
+ "deleted_at" timestamptz NULL,
329
+ CONSTRAINT "order_claim_item_pkey" PRIMARY KEY ("id")
330
+ );
331
+
332
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" ("deleted_at")
333
+ WHERE deleted_at IS NOT NULL;
334
+
335
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_claim_id" ON "order_claim_item" ("claim_id")
336
+ WHERE deleted_at IS NOT NULL;
337
+
338
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_item_id" ON "order_claim_item" ("item_id")
339
+ WHERE deleted_at IS NOT NULL;
340
+
341
+
342
+
343
+ CREATE TABLE IF NOT EXISTS "order_claim_item_image" (
344
+ "id" TEXT NOT NULL,
345
+ "claim_item_id" TEXT NOT NULL,
346
+ "url" TEXT NOT NULL,
347
+ "metadata" JSONB NULL,
348
+ "created_at" timestamptz NOT NULL DEFAULT now(),
349
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
350
+ "deleted_at" timestamptz NULL,
351
+ CONSTRAINT "order_claim_item_image_pkey" PRIMARY KEY ("id")
352
+ );
353
+
354
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_claim_item_id" ON "order_claim_item_image" ("claim_item_id")
355
+ WHERE "deleted_at" IS NOT NULL;
356
+
357
+ CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_deleted_at" ON "order_claim_item_image" ("deleted_at")
358
+ WHERE "deleted_at" IS NOT NULL;
359
+ `;
360
+ this.addSql(sql);
361
+ }
362
+ }
363
+ exports.Migration20240604100512 = Migration20240604100512;
364
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgWX,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AArWD,0DAqWC"}
@@ -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"}