@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
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const utils_1 = require("@medusajs/utils");
16
+ const core_1 = require("@mikro-orm/core");
17
+ const _models_1 = require(".");
18
+ const claim_1 = __importDefault(require("./claim"));
19
+ const exchange_1 = __importDefault(require("./exchange"));
20
+ const order_1 = __importDefault(require("./order"));
21
+ const order_shipping_method_1 = __importDefault(require("./order-shipping-method"));
22
+ const DisplayIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
+ tableName: "return",
24
+ columns: "display_id",
25
+ where: "deleted_at IS NOT NULL",
26
+ });
27
+ const ReturnDeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
28
+ tableName: "return",
29
+ columns: "deleted_at",
30
+ where: "deleted_at IS NOT NULL",
31
+ });
32
+ const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
33
+ tableName: "return",
34
+ columns: ["order_id"],
35
+ where: "deleted_at IS NOT NULL",
36
+ });
37
+ const ExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
38
+ tableName: "return",
39
+ columns: ["exchange_id"],
40
+ where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
41
+ });
42
+ const ClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
43
+ tableName: "return",
44
+ columns: ["claim_id"],
45
+ where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
46
+ });
47
+ let Return = class Return {
48
+ constructor() {
49
+ this.exchange_id = null;
50
+ this.claim_id = null;
51
+ this.status = utils_1.ReturnStatus.REQUESTED;
52
+ this.location_id = null;
53
+ this.no_notification = null;
54
+ this.items = new core_1.Collection(this);
55
+ this.shipping_methods = new core_1.Collection(this);
56
+ this.transactions = new core_1.Collection(this);
57
+ this.metadata = null;
58
+ this.deleted_at = null;
59
+ this.received_at = null;
60
+ this.canceled_at = null;
61
+ }
62
+ onCreate() {
63
+ this.id = (0, utils_1.generateEntityId)(this.id, "return");
64
+ }
65
+ onInit() {
66
+ this.id = (0, utils_1.generateEntityId)(this.id, "return");
67
+ }
68
+ };
69
+ __decorate([
70
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
71
+ __metadata("design:type", String)
72
+ ], Return.prototype, "id", void 0);
73
+ __decorate([
74
+ (0, core_1.ManyToOne)({
75
+ entity: () => order_1.default,
76
+ mapToPk: true,
77
+ fieldName: "order_id",
78
+ columnType: "text",
79
+ }),
80
+ OrderIdIndex.MikroORMIndex(),
81
+ __metadata("design:type", String)
82
+ ], Return.prototype, "order_id", void 0);
83
+ __decorate([
84
+ (0, core_1.ManyToOne)(() => order_1.default, {
85
+ persist: false,
86
+ }),
87
+ __metadata("design:type", Object)
88
+ ], Return.prototype, "order", void 0);
89
+ __decorate([
90
+ (0, core_1.OneToOne)({
91
+ entity: () => exchange_1.default,
92
+ fieldName: "exchange_id",
93
+ nullable: true,
94
+ }),
95
+ __metadata("design:type", Object)
96
+ ], Return.prototype, "exchange", void 0);
97
+ __decorate([
98
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
99
+ ExchangeIdIndex.MikroORMIndex(),
100
+ __metadata("design:type", Object)
101
+ ], Return.prototype, "exchange_id", void 0);
102
+ __decorate([
103
+ (0, core_1.OneToOne)({
104
+ entity: () => claim_1.default,
105
+ fieldName: "claim_id",
106
+ nullable: true,
107
+ }),
108
+ __metadata("design:type", Object)
109
+ ], Return.prototype, "claim", void 0);
110
+ __decorate([
111
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
112
+ ClaimIdIndex.MikroORMIndex(),
113
+ __metadata("design:type", Object)
114
+ ], Return.prototype, "claim_id", void 0);
115
+ __decorate([
116
+ (0, core_1.Property)({
117
+ columnType: "integer",
118
+ }),
119
+ __metadata("design:type", Number)
120
+ ], Return.prototype, "order_version", void 0);
121
+ __decorate([
122
+ (0, core_1.Property)({ autoincrement: true, primary: false }),
123
+ DisplayIdIndex.MikroORMIndex(),
124
+ __metadata("design:type", Number)
125
+ ], Return.prototype, "display_id", void 0);
126
+ __decorate([
127
+ (0, core_1.Enum)({ items: () => utils_1.ReturnStatus, default: utils_1.ReturnStatus.REQUESTED }),
128
+ __metadata("design:type", String)
129
+ ], Return.prototype, "status", void 0);
130
+ __decorate([
131
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
132
+ __metadata("design:type", Object)
133
+ ], Return.prototype, "location_id", void 0);
134
+ __decorate([
135
+ (0, core_1.Property)({ columnType: "boolean", nullable: true }),
136
+ __metadata("design:type", Object)
137
+ ], Return.prototype, "no_notification", void 0);
138
+ __decorate([
139
+ (0, utils_1.MikroOrmBigNumberProperty)({
140
+ nullable: true,
141
+ }),
142
+ __metadata("design:type", Object)
143
+ ], Return.prototype, "refund_amount", void 0);
144
+ __decorate([
145
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
146
+ __metadata("design:type", Object)
147
+ ], Return.prototype, "raw_refund_amount", void 0);
148
+ __decorate([
149
+ (0, core_1.OneToMany)(() => _models_1.ReturnItem, (itemDetail) => itemDetail.return, {
150
+ cascade: [core_1.Cascade.PERSIST],
151
+ }),
152
+ __metadata("design:type", Object)
153
+ ], Return.prototype, "items", void 0);
154
+ __decorate([
155
+ (0, core_1.OneToMany)(() => order_shipping_method_1.default, (shippingMethod) => shippingMethod.return, {
156
+ cascade: [core_1.Cascade.PERSIST],
157
+ }),
158
+ __metadata("design:type", Object)
159
+ ], Return.prototype, "shipping_methods", void 0);
160
+ __decorate([
161
+ (0, core_1.OneToMany)(() => _models_1.Transaction, (transaction) => transaction.return, {
162
+ cascade: [core_1.Cascade.PERSIST],
163
+ }),
164
+ __metadata("design:type", Object)
165
+ ], Return.prototype, "transactions", void 0);
166
+ __decorate([
167
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
168
+ __metadata("design:type", Object)
169
+ ], Return.prototype, "metadata", void 0);
170
+ __decorate([
171
+ (0, core_1.Property)({
172
+ onCreate: () => new Date(),
173
+ columnType: "timestamptz",
174
+ defaultRaw: "now()",
175
+ }),
176
+ __metadata("design:type", Date)
177
+ ], Return.prototype, "created_at", void 0);
178
+ __decorate([
179
+ (0, core_1.Property)({
180
+ onCreate: () => new Date(),
181
+ onUpdate: () => new Date(),
182
+ columnType: "timestamptz",
183
+ defaultRaw: "now()",
184
+ }),
185
+ __metadata("design:type", Date)
186
+ ], Return.prototype, "updated_at", void 0);
187
+ __decorate([
188
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
189
+ ReturnDeletedAtIndex.MikroORMIndex(),
190
+ __metadata("design:type", Object)
191
+ ], Return.prototype, "deleted_at", void 0);
192
+ __decorate([
193
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
194
+ __metadata("design:type", Object)
195
+ ], Return.prototype, "received_at", void 0);
196
+ __decorate([
197
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
198
+ __metadata("design:type", Object)
199
+ ], Return.prototype, "canceled_at", void 0);
200
+ __decorate([
201
+ (0, core_1.BeforeCreate)(),
202
+ __metadata("design:type", Function),
203
+ __metadata("design:paramtypes", []),
204
+ __metadata("design:returntype", void 0)
205
+ ], Return.prototype, "onCreate", null);
206
+ __decorate([
207
+ (0, core_1.OnInit)(),
208
+ __metadata("design:type", Function),
209
+ __metadata("design:paramtypes", []),
210
+ __metadata("design:returntype", void 0)
211
+ ], Return.prototype, "onInit", null);
212
+ Return = __decorate([
213
+ (0, core_1.Entity)({ tableName: "return" })
214
+ ], Return);
215
+ exports.default = Return;
216
+ //# sourceMappingURL=return.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return.js","sourceRoot":"","sources":["../../src/models/return.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAMwB;AACxB,0CAcwB;AACxB,qCAAiD;AACjD,oDAA2B;AAC3B,0DAAiC;AACjC,oDAA2B;AAC3B,oFAAyD;AAI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CAAC;KAC3B,CAAC;;4CAC8C;AAGhD;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACH;AAO/C;IALC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;0CAAA;AAQhB;IANC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;0CAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,oBAAoB,CAAC,aAAa,EAAE;;0CACP;AAG9B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACzB;AAG/B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACzB;AAG/B;IADC,IAAA,mBAAY,GAAE;;;;sCAGd;AAGD;IADC,IAAA,aAAM,GAAE;;;;oCAGR;AA3HkB,MAAM;IAD1B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;GACX,MAAM,CA4H1B;kBA5HoB,MAAM"}
@@ -1,8 +1,10 @@
1
+ import { Rel } from "@mikro-orm/core";
1
2
  import AdjustmentLine from "./adjustment-line";
2
3
  import ShippingMethod from "./shipping-method";
3
4
  export default class ShippingMethodAdjustment extends AdjustmentLine {
4
- shipping_method: ShippingMethod;
5
+ shipping_method: Rel<ShippingMethod>;
5
6
  shipping_method_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
8
9
  }
10
+ //# sourceMappingURL=shipping-method-adjustment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method-adjustment.d.ts","sourceRoot":"","sources":["../../src/models/shipping-method-adjustment.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAQ9C,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,cAAc;IAIlE,eAAe,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IAUpC,kBAAkB,EAAE,MAAM,CAAA;IAG1B,QAAQ;IAMR,MAAM;CAIP"}
@@ -23,18 +23,18 @@ const ShippingMethodIdIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
23
  let ShippingMethodAdjustment = class ShippingMethodAdjustment extends adjustment_line_1.default {
24
24
  onCreate() {
25
25
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmadj");
26
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
26
+ this.shipping_method_id ??= this.shipping_method?.id;
27
27
  }
28
28
  onInit() {
29
29
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmadj");
30
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
30
+ this.shipping_method_id ??= this.shipping_method?.id;
31
31
  }
32
32
  };
33
33
  __decorate([
34
34
  (0, core_1.ManyToOne)(() => shipping_method_1.default, {
35
35
  persist: false,
36
36
  }),
37
- __metadata("design:type", shipping_method_1.default)
37
+ __metadata("design:type", Object)
38
38
  ], ShippingMethodAdjustment.prototype, "shipping_method", void 0);
39
39
  __decorate([
40
40
  (0, core_1.ManyToOne)({
@@ -1 +1 @@
1
- {"version":3,"file":"shipping-method-adjustment.js","sourceRoot":"","sources":["../../src/models/shipping-method-ad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EAAE,kCAAkC,EAAE,CAAC;GACrC,wBAAwB,CA2B5C;kBA3BoB,wBAAwB"}
@@ -1,8 +1,10 @@
1
+ import { Rel } from "@mikro-orm/core";
1
2
  import ShippingMethod from "./shipping-method";
2
3
  import TaxLine from "./tax-line";
3
4
  export default class ShippingMethodTaxLine extends TaxLine {
4
- shipping_method: ShippingMethod;
5
+ shipping_method: Rel<ShippingMethod>;
5
6
  shipping_method_id: string;
6
7
  onCreate(): void;
7
8
  onInit(): void;
8
9
  }
10
+ //# sourceMappingURL=shipping-method-tax-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method-tax-line.d.ts","sourceRoot":"","sources":["../../src/models/shipping-method-tax-line.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,OAAO,MAAM,YAAY,CAAA;AAQhC,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;IAIxD,eAAe,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IAUpC,kBAAkB,EAAE,MAAM,CAAA;IAG1B,QAAQ;IAMR,MAAM;CAIP"}
@@ -23,18 +23,18 @@ const ShippingMethodIdIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
23
  let ShippingMethodTaxLine = class ShippingMethodTaxLine extends tax_line_1.default {
24
24
  onCreate() {
25
25
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmtxl");
26
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
26
+ this.shipping_method_id ??= this.shipping_method?.id;
27
27
  }
28
28
  onInit() {
29
29
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsmtxl");
30
- this.shipping_method_id ?? (this.shipping_method_id = this.shipping_method?.id);
30
+ this.shipping_method_id ??= this.shipping_method?.id;
31
31
  }
32
32
  };
33
33
  __decorate([
34
34
  (0, core_1.ManyToOne)(() => shipping_method_1.default, {
35
35
  persist: false,
36
36
  }),
37
- __metadata("design:type", shipping_method_1.default)
37
+ __metadata("design:type", Object)
38
38
  ], ShippingMethodTaxLine.prototype, "shipping_method", void 0);
39
39
  __decorate([
40
40
  (0, core_1.ManyToOne)({
@@ -1 +1 @@
1
- {"version":3,"file":"shipping-method-tax-line.js","sourceRoot":"","sources":["../../src/models/shipping-method-tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,0CAAyE;AACzE,wEAA8C;AAC9C,0DAAgC;AAEhC,MAAM,uBAAuB,GAAG,IAAA,sCAA8B,EAAC;IAC7D,SAAS,EAAE,gCAAgC;IAC3C,OAAO,EAAE,oBAAoB;CAC9B,CAAC,CAAA;AAGa,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,kBAAO;IAiBxD,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,kBAAkB,KAAvB,IAAI,CAAC,kBAAkB,GAAK,IAAI,CAAC,eAAe,EAAE,EAAE,EAAA;IACtD,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;QAC/C,IAAI,CAAC,kBAAkB,KAAvB,IAAI,CAAC,kBAAkB,GAAK,IAAI,CAAC,eAAe,EAAE,EAAE,EAAA;IACtD,CAAC;CACF,CAAA;AAvBC;IAHC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,yBAAc,EAAE;QAC/B,OAAO,EAAE,KAAK;KACf,CAAC;8BACe,yBAAc;8DAAA;AAU/B;IARC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,yBAAc;QAC5B,SAAS,EAAE,oBAAoB;QAC/B,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE,IAAI;QACb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AAM;QAClB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,uBAAuB,CAAC,aAAa,EAAE;;iEACd;AAG1B;IADC,IAAA,mBAAY,GAAE;;;;qDAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;mDAIR;AA1BkB,qBAAqB;IADzC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,gCAAgC,EAAE,CAAC;GACnC,qBAAqB,CA2BzC;kBA3BoB,qBAAqB"}
@@ -17,6 +17,8 @@ export default class ShippingMethod {
17
17
  adjustments: Collection<ShippingMethodAdjustment, object>;
18
18
  created_at: Date;
19
19
  updated_at: Date;
20
+ deleted_at: Date | null;
20
21
  onCreate(): void;
21
22
  onInit(): void;
22
23
  }
24
+ //# sourceMappingURL=shipping-method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipping-method.d.ts","sourceRoot":"","sources":["../../src/models/shipping-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EACL,SAAS,EAKV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,UAAU,EAQX,MAAM,iBAAiB,CAAA;AACxB,OAAO,wBAAwB,MAAM,8BAA8B,CAAA;AACnE,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAgB9D,MAAM,CAAC,OAAO,OAAO,cAAc;IAEjC,EAAE,EAAE,MAAM,CAAA;IAGV,IAAI,EAAE,MAAM,CAAA;IAGZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAO;IAGjC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;IAG1B,UAAU,EAAE,iBAAiB,CAAA;IAG7B,gBAAgB,EAAE,OAAO,CAAQ;IAOjC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAO;IAGxC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAG3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAS/C,SAAS,4CAAmD;IAS5D,WAAW,+CAAsD;IAOjE,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAIR,MAAM;CAGP"}
@@ -16,9 +16,15 @@ const utils_1 = require("@medusajs/utils");
16
16
  const core_1 = require("@mikro-orm/core");
17
17
  const shipping_method_adjustment_1 = __importDefault(require("./shipping-method-adjustment"));
18
18
  const shipping_method_tax_line_1 = __importDefault(require("./shipping-method-tax-line"));
19
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
+ tableName: "order_shipping_method",
21
+ columns: "deleted_at",
22
+ where: "deleted_at IS NOT NULL",
23
+ });
19
24
  const ShippingOptionIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
25
  tableName: "order_shipping_method",
21
26
  columns: "shipping_option_id",
27
+ where: "deleted_at IS NOT NULL",
22
28
  });
23
29
  let ShippingMethod = class ShippingMethod {
24
30
  constructor() {
@@ -29,6 +35,7 @@ let ShippingMethod = class ShippingMethod {
29
35
  this.metadata = null;
30
36
  this.tax_lines = new core_1.Collection(this);
31
37
  this.adjustments = new core_1.Collection(this);
38
+ this.deleted_at = null;
32
39
  }
33
40
  onCreate() {
34
41
  this.id = (0, utils_1.generateEntityId)(this.id, "ordsm");
@@ -59,7 +66,7 @@ __decorate([
59
66
  ], ShippingMethod.prototype, "raw_amount", void 0);
60
67
  __decorate([
61
68
  (0, core_1.Property)({ columnType: "boolean" }),
62
- __metadata("design:type", Object)
69
+ __metadata("design:type", Boolean)
63
70
  ], ShippingMethod.prototype, "is_tax_inclusive", void 0);
64
71
  __decorate([
65
72
  (0, core_1.Property)({
@@ -79,13 +86,13 @@ __decorate([
79
86
  ], ShippingMethod.prototype, "metadata", void 0);
80
87
  __decorate([
81
88
  (0, core_1.OneToMany)(() => shipping_method_tax_line_1.default, (taxLine) => taxLine.shipping_method, {
82
- cascade: [core_1.Cascade.PERSIST],
89
+ cascade: [core_1.Cascade.PERSIST, "soft-remove"],
83
90
  }),
84
91
  __metadata("design:type", Object)
85
92
  ], ShippingMethod.prototype, "tax_lines", void 0);
86
93
  __decorate([
87
94
  (0, core_1.OneToMany)(() => shipping_method_adjustment_1.default, (adjustment) => adjustment.shipping_method, {
88
- cascade: [core_1.Cascade.PERSIST],
95
+ cascade: [core_1.Cascade.PERSIST, "soft-remove"],
89
96
  }),
90
97
  __metadata("design:type", Object)
91
98
  ], ShippingMethod.prototype, "adjustments", void 0);
@@ -106,6 +113,11 @@ __decorate([
106
113
  }),
107
114
  __metadata("design:type", Date)
108
115
  ], ShippingMethod.prototype, "updated_at", void 0);
116
+ __decorate([
117
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
118
+ DeletedAtIndex.MikroORMIndex(),
119
+ __metadata("design:type", Object)
120
+ ], ShippingMethod.prototype, "deleted_at", void 0);
109
121
  __decorate([
110
122
  (0, core_1.BeforeCreate)(),
111
123
  __metadata("design:type", Function),
@@ -119,7 +131,8 @@ __decorate([
119
131
  __metadata("design:returntype", void 0)
120
132
  ], ShippingMethod.prototype, "onInit", null);
121
133
  ShippingMethod = __decorate([
122
- (0, core_1.Entity)({ tableName: "order_shipping_method" })
134
+ (0, core_1.Entity)({ tableName: "order_shipping_method" }),
135
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
123
136
  ], ShippingMethod);
124
137
  exports.default = ShippingMethod;
125
138
  //# sourceMappingURL=shipping-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shipping-method.js","sourceRoot":"","sources":["../../src/models/shipping-method.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CASwB;AACxB,8FAAmE;AACnE,0FAA8D;AAE9D,MAAM,qBAAqB,GAAG,IAAA,sCAA8B,EAAC;IAC3D,SAAS,E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B,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;kDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;kDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;8CAGd;AAED;IADC,IAAA,aAAM,GAAE;;;;4CAGR;AA5EkB,cAAc;IAFlC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IAC9C,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;GAC/B,cAAc,CA6ElC;kBA7EoB,cAAc"}
@@ -14,4 +14,6 @@ export default abstract class TaxLine {
14
14
  provider_id?: string | null;
15
15
  created_at: Date;
16
16
  updated_at: Date;
17
+ deleted_at: Date | null;
17
18
  }
19
+ //# sourceMappingURL=tax-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-line.d.ts","sourceRoot":"","sources":["../../src/models/tax-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,SAAS,EAA6B,MAAM,iBAAiB,CAAA;AAGtE;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,OAAO;IAEnC,EAAE,EAAE,MAAM,CAAA;IAGV,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAM3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAG3B,IAAI,EAAE,MAAM,CAAA;IAGZ,IAAI,EAAE,SAAS,GAAG,MAAM,CAAA;IAGxB,QAAQ,EAAE,iBAAiB,CAAA;IAG3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAO3B,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAGhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;CAC/B"}
@@ -16,6 +16,9 @@ const core_1 = require("@mikro-orm/core");
16
16
  * Source: https://mikro-orm.io/docs/inheritance-mapping
17
17
  */
18
18
  class TaxLine {
19
+ constructor() {
20
+ this.deleted_at = null;
21
+ }
19
22
  }
20
23
  exports.default = TaxLine;
21
24
  __decorate([
@@ -66,4 +69,8 @@ __decorate([
66
69
  }),
67
70
  __metadata("design:type", Date)
68
71
  ], TaxLine.prototype, "updated_at", void 0);
72
+ __decorate([
73
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
74
+ __metadata("design:type", Object)
75
+ ], TaxLine.prototype, "deleted_at", void 0);
69
76
  //# sourceMappingURL=tax-line.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tax-line.js","sourceRoot":"","sources":["../../src/models/tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAAoE;AACpE,0CAAsD;AAEtD;;;GAGG;AACH,MAA8B,OAAO;CAuCpC;AAvCD,0BAuCC;AArCC;IADC,IAAA,iBAAU,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;mCACzB;AAGV;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACtB;AAM3B;IAJC,IAAA,eAAQ,EAAC;QACR,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC;;4CACyB;AAG3B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;qCACrB;AAGZ;IADC,IAAA,iCAAyB,GAAE;;qCACJ;AAGxB;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;yCACP;AAG3B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACtB;AAO3B;IALC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG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;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;2CAAA;AAQhB;IANC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;2CAAA;AAGhB;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC1B"}
@@ -1,13 +1,23 @@
1
1
  import { BigNumberRawValue, DAL } from "@medusajs/types";
2
2
  import { BigNumber } from "@medusajs/utils";
3
- import { OptionalProps } from "@mikro-orm/core";
3
+ import { OptionalProps, Rel } from "@mikro-orm/core";
4
+ import Claim from "./claim";
5
+ import Exchange from "./exchange";
4
6
  import Order from "./order";
5
- type OptionalLineItemProps = DAL.EntityDateColumns;
7
+ import Return from "./return";
8
+ type OptionalLineItemProps = DAL.ModelDateColumns;
6
9
  export default class Transaction {
7
10
  [OptionalProps]?: OptionalLineItemProps;
8
11
  id: string;
9
12
  order_id: string;
10
- order: Order;
13
+ order: Rel<Order>;
14
+ return_id: string | null;
15
+ return: Rel<Return>;
16
+ exchange_id: string | null;
17
+ exchange: Rel<Exchange>;
18
+ claim_id: string | null;
19
+ claim: Rel<Claim>;
20
+ version: number;
11
21
  amount: BigNumber | number;
12
22
  raw_amount: BigNumberRawValue;
13
23
  currency_code: string;
@@ -15,7 +25,9 @@ export default class Transaction {
15
25
  reference_id: string | null;
16
26
  created_at: Date;
17
27
  updated_at: Date;
28
+ deleted_at: Date | null;
18
29
  onCreate(): void;
19
30
  onInit(): void;
20
31
  }
21
32
  export {};
33
+ //# sourceMappingURL=transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/models/transaction.ts"],"names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