@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
@@ -1,15 +1,16 @@
1
1
  import { DAL } from "@medusajs/types";
2
2
  import { OrderStatus } from "@medusajs/utils";
3
- import { Collection, OptionalProps } from "@mikro-orm/core";
3
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
4
4
  import Address from "./address";
5
5
  import OrderItem from "./order-item";
6
6
  import OrderShippingMethod from "./order-shipping-method";
7
7
  import OrderSummary from "./order-summary";
8
8
  import Transaction from "./transaction";
9
- type OptionalOrderProps = "shipping_address" | "billing_address" | DAL.EntityDateColumns;
9
+ type OptionalOrderProps = "shipping_address" | "billing_address" | DAL.ModelDateColumns;
10
10
  export default class Order {
11
11
  [OptionalProps]?: OptionalOrderProps;
12
12
  id: string;
13
+ display_id: number;
13
14
  region_id: string | null;
14
15
  customer_id: string | null;
15
16
  version: number;
@@ -19,9 +20,9 @@ export default class Order {
19
20
  email: string | null;
20
21
  currency_code: string;
21
22
  shipping_address_id?: string | null;
22
- shipping_address?: Address | null;
23
+ shipping_address?: Rel<Address> | null;
23
24
  billing_address_id?: string | null;
24
- billing_address?: Address | null;
25
+ billing_address?: Rel<Address> | null;
25
26
  no_notification: boolean | null;
26
27
  summary: Collection<OrderSummary, object>;
27
28
  metadata: Record<string, unknown> | null;
@@ -36,3 +37,4 @@ export default class Order {
36
37
  onInit(): void;
37
38
  }
38
39
  export {};
40
+ //# sourceMappingURL=order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/models/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EACL,WAAW,EAGZ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,UAAU,EAMV,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,mBAAmB,MAAM,yBAAyB,CAAA;AACzD,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAC1C,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,KAAK,kBAAkB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,GAAG,CAAC,gBAAgB,CAAA;AAyDxB,MAAM,CAAC,OAAO,OAAO,KAAK;IACxB,CAAC,aAAa,CAAC,CAAC,EAAE,kBAAkB,CAAA;IAGpC,EAAE,EAAE,MAAM,CAAA;IAIV,UAAU,EAAE,MAAM,CAAA;IAOlB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAO/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAO;IAMjC,OAAO,EAAE,MAAM,CAAI;IAOnB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAO;IAGtC,MAAM,EAAE,WAAW,CAAA;IAMnB,cAAc,EAAE,OAAO,CAAQ;IAG/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAO;IAI3B,aAAa,EAAE,MAAM,CAAA;IAIrB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAQnC,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IAItC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAQlC,eAAe,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IAGrC,eAAe,EAAE,OAAO,GAAG,IAAI,CAAO;IAKtC,OAAO,mCAA0C;IAGjD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAK/C,KAAK,gCAAuC;IAS5C,gBAAgB,0CAAiD;IAKjE,YAAY,kCAAyC;IAOrD,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAO;IAG/B,QAAQ;IAKR,MAAM;CAGP"}
@@ -19,6 +19,11 @@ const order_item_1 = __importDefault(require("./order-item"));
19
19
  const order_shipping_method_1 = __importDefault(require("./order-shipping-method"));
20
20
  const order_summary_1 = __importDefault(require("./order-summary"));
21
21
  const transaction_1 = __importDefault(require("./transaction"));
22
+ const DisplayIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
+ tableName: "order",
24
+ columns: "display_id",
25
+ where: "deleted_at IS NOT NULL",
26
+ });
22
27
  const RegionIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
23
28
  tableName: "order",
24
29
  columns: "region_id",
@@ -87,6 +92,11 @@ __decorate([
87
92
  (0, core_1.PrimaryKey)({ columnType: "text" }),
88
93
  __metadata("design:type", String)
89
94
  ], Order.prototype, "id", void 0);
95
+ __decorate([
96
+ (0, core_1.Property)({ autoincrement: true, primary: false }),
97
+ DisplayIdIndex.MikroORMIndex(),
98
+ __metadata("design:type", Number)
99
+ ], Order.prototype, "display_id", void 0);
90
100
  __decorate([
91
101
  (0, core_1.Property)({
92
102
  columnType: "text",
@@ -127,7 +137,7 @@ __decorate([
127
137
  columnType: "boolean",
128
138
  }),
129
139
  IsDraftOrderIndex.MikroORMIndex(),
130
- __metadata("design:type", Object)
140
+ __metadata("design:type", Boolean)
131
141
  ], Order.prototype, "is_draft_order", void 0);
132
142
  __decorate([
133
143
  (0, core_1.Property)({ columnType: "text", nullable: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"order.js","sourceRoot":"","sources":["../../src/models/order.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAIwB;AACxB,0CAYwB;AACxB,wDAA+B;AAC/B,8DAAoC;AACpC,oFAAyD;AACzD,oEAA0C;AAC1C,gEAAuC;AAOvC,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC;IACnD,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,IAAA,sCAA8B,EAAC;IACrD,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAAC;IACzD,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAAC;IACzD,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,iBAAiB,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CAAC,OAAO,CAAC;KAC3B,CAAC;;2CACmD;AAOrD;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;yCAAA;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;yCAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,mBAAmB,CAAC,aAAa,EAAE;;yCACN;AAG9B;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACzB;AAG/B;IADC,IAAA,mBAAY,GAAE;;;;qCAGd;AAGD;IADC,IAAA,aAAM,GAAE;;;;mCAGR;AAzIkB,KAAK;IADzB,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;GACV,KAAK,CA0IzB;kBA1IoB,KAAK"}
@@ -0,0 +1,29 @@
1
+ import { BigNumberRawValue, DAL } from "@medusajs/types";
2
+ import { OptionalProps } from "@mikro-orm/core";
3
+ import LineItem from "./line-item";
4
+ import Return from "./return";
5
+ import ReturnReason from "./return-reason";
6
+ type OptionalLineItemProps = DAL.ModelDateColumns;
7
+ export default class ReturnItem {
8
+ [OptionalProps]?: OptionalLineItemProps;
9
+ id: string;
10
+ reason_id: string | null;
11
+ reason: ReturnReason;
12
+ quantity: Number | number;
13
+ raw_quantity: BigNumberRawValue;
14
+ received_quantity: Number | number;
15
+ raw_received_quantity: BigNumberRawValue;
16
+ return_id: string;
17
+ return: Return;
18
+ item_id: string;
19
+ item: LineItem;
20
+ note: string;
21
+ metadata: Record<string, unknown> | null;
22
+ created_at: Date;
23
+ updated_at: Date;
24
+ deleted_at: Date | null;
25
+ onCreate(): void;
26
+ onInit(): void;
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=return-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return-item.d.ts","sourceRoot":"","sources":["../../src/models/return-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAMxD,OAAO,EAKL,aAAa,EAGd,MAAM,iBAAiB,CAAA;AACxB,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C,KAAK,qBAAqB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AA2BjD,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,CAAC,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAA;IAGvC,EAAE,EAAE,MAAM,CAAA;IASV,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAK/B,MAAM,EAAE,YAAY,CAAA;IAGpB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;IAGzB,YAAY,EAAE,iBAAiB,CAAA;IAG/B,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAI;IAGtC,qBAAqB,EAAE,iBAAiB,CAAA;IASxC,SAAS,EAAE,MAAM,CAAA;IAKjB,MAAM,EAAE,MAAM,CAAA;IASd,OAAO,EAAE,MAAM,CAAA;IAKf,IAAI,EAAE,QAAQ,CAAA;IAGd,IAAI,EAAE,MAAM,CAAA;IAGZ,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAO/C,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAMR,MAAM;CAIP"}
@@ -0,0 +1,170 @@
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 line_item_1 = __importDefault(require("./line-item"));
18
+ const return_1 = __importDefault(require("./return"));
19
+ const return_reason_1 = __importDefault(require("./return-reason"));
20
+ const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
21
+ tableName: "return_item",
22
+ columns: "return_id",
23
+ where: "deleted_at IS NOT NULL",
24
+ });
25
+ const ReturnReasonIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
26
+ tableName: "return_item",
27
+ columns: "reason_id",
28
+ where: "deleted_at IS NOT NULL",
29
+ });
30
+ const ItemIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
31
+ tableName: "return_item",
32
+ columns: "item_id",
33
+ where: "deleted_at IS NOT NULL",
34
+ });
35
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
36
+ tableName: "order_claim_item_image",
37
+ columns: "deleted_at",
38
+ where: "deleted_at IS NOT NULL",
39
+ });
40
+ let ReturnItem = class ReturnItem {
41
+ constructor() {
42
+ this.reason_id = null;
43
+ this.received_quantity = 0;
44
+ this.metadata = null;
45
+ this.deleted_at = null;
46
+ }
47
+ onCreate() {
48
+ this.id = (0, utils_1.generateEntityId)(this.id, "retitem");
49
+ this.return_id = this.return?.id;
50
+ }
51
+ onInit() {
52
+ this.id = (0, utils_1.generateEntityId)(this.id, "retitem");
53
+ this.return_id = this.return?.id;
54
+ }
55
+ };
56
+ __decorate([
57
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
58
+ __metadata("design:type", String)
59
+ ], ReturnItem.prototype, "id", void 0);
60
+ __decorate([
61
+ (0, core_1.ManyToOne)(() => return_reason_1.default, {
62
+ columnType: "text",
63
+ fieldName: "reason_id",
64
+ mapToPk: true,
65
+ nullable: true,
66
+ }),
67
+ ReturnReasonIdIndex.MikroORMIndex(),
68
+ __metadata("design:type", Object)
69
+ ], ReturnItem.prototype, "reason_id", void 0);
70
+ __decorate([
71
+ (0, core_1.ManyToOne)(() => return_reason_1.default, {
72
+ persist: false,
73
+ }),
74
+ __metadata("design:type", return_reason_1.default)
75
+ ], ReturnItem.prototype, "reason", void 0);
76
+ __decorate([
77
+ (0, utils_1.MikroOrmBigNumberProperty)(),
78
+ __metadata("design:type", Number)
79
+ ], ReturnItem.prototype, "quantity", void 0);
80
+ __decorate([
81
+ (0, core_1.Property)({ columnType: "jsonb" }),
82
+ __metadata("design:type", Object)
83
+ ], ReturnItem.prototype, "raw_quantity", void 0);
84
+ __decorate([
85
+ (0, utils_1.MikroOrmBigNumberProperty)(),
86
+ __metadata("design:type", Number)
87
+ ], ReturnItem.prototype, "received_quantity", void 0);
88
+ __decorate([
89
+ (0, core_1.Property)({ columnType: "jsonb" }),
90
+ __metadata("design:type", Object)
91
+ ], ReturnItem.prototype, "raw_received_quantity", void 0);
92
+ __decorate([
93
+ (0, core_1.ManyToOne)(() => return_1.default, {
94
+ columnType: "text",
95
+ fieldName: "return_id",
96
+ mapToPk: true,
97
+ onDelete: "cascade",
98
+ }),
99
+ ReturnIdIndex.MikroORMIndex(),
100
+ __metadata("design:type", String)
101
+ ], ReturnItem.prototype, "return_id", void 0);
102
+ __decorate([
103
+ (0, core_1.ManyToOne)(() => return_1.default, {
104
+ persist: false,
105
+ }),
106
+ __metadata("design:type", return_1.default)
107
+ ], ReturnItem.prototype, "return", void 0);
108
+ __decorate([
109
+ (0, core_1.ManyToOne)({
110
+ entity: () => line_item_1.default,
111
+ fieldName: "item_id",
112
+ mapToPk: true,
113
+ columnType: "text",
114
+ }),
115
+ ItemIdIndex.MikroORMIndex(),
116
+ __metadata("design:type", String)
117
+ ], ReturnItem.prototype, "item_id", void 0);
118
+ __decorate([
119
+ (0, core_1.ManyToOne)(() => line_item_1.default, {
120
+ persist: false,
121
+ }),
122
+ __metadata("design:type", line_item_1.default)
123
+ ], ReturnItem.prototype, "item", void 0);
124
+ __decorate([
125
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
126
+ __metadata("design:type", String)
127
+ ], ReturnItem.prototype, "note", void 0);
128
+ __decorate([
129
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
130
+ __metadata("design:type", Object)
131
+ ], ReturnItem.prototype, "metadata", void 0);
132
+ __decorate([
133
+ (0, core_1.Property)({
134
+ onCreate: () => new Date(),
135
+ columnType: "timestamptz",
136
+ defaultRaw: "now()",
137
+ }),
138
+ __metadata("design:type", Date)
139
+ ], ReturnItem.prototype, "created_at", void 0);
140
+ __decorate([
141
+ (0, core_1.Property)({
142
+ onCreate: () => new Date(),
143
+ onUpdate: () => new Date(),
144
+ columnType: "timestamptz",
145
+ defaultRaw: "now()",
146
+ }),
147
+ __metadata("design:type", Date)
148
+ ], ReturnItem.prototype, "updated_at", void 0);
149
+ __decorate([
150
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
151
+ DeletedAtIndex.MikroORMIndex(),
152
+ __metadata("design:type", Object)
153
+ ], ReturnItem.prototype, "deleted_at", void 0);
154
+ __decorate([
155
+ (0, core_1.BeforeCreate)(),
156
+ __metadata("design:type", Function),
157
+ __metadata("design:paramtypes", []),
158
+ __metadata("design:returntype", void 0)
159
+ ], ReturnItem.prototype, "onCreate", null);
160
+ __decorate([
161
+ (0, core_1.OnInit)(),
162
+ __metadata("design:type", Function),
163
+ __metadata("design:paramtypes", []),
164
+ __metadata("design:returntype", void 0)
165
+ ], ReturnItem.prototype, "onInit", null);
166
+ ReturnItem = __decorate([
167
+ (0, core_1.Entity)({ tableName: "return_item" })
168
+ ], ReturnItem);
169
+ exports.default = ReturnItem;
170
+ //# sourceMappingURL=return-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return-item.js","sourceRoot":"","sources":["../../src/models/return-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAIwB;AACxB,0CAQwB;AACxB,4DAAkC;AAClC,sDAA6B;AAC7B,oEAA0C;AAI1C,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC;IACnD,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAAC;IACzD,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,IAAA,sCAA8B,EAAC;IACjD,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,wBAAwB;IACnC,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAGa,IAAM,UAAU,GAAhB,MAAM,UAAU;IAAhB;QAab,cAAS,GAAkB,IAAI,CAAA;QAc/B,sBAAiB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,cAAc,CAAC,aAAa,EAAE;;8CACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;0CAId;AAGD;IADC,IAAA,aAAM,GAAE;;;;wCAIR;AA/FkB,UAAU;IAD9B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;GAChB,UAAU,CAgG9B;kBAhGoB,UAAU"}
@@ -0,0 +1,21 @@
1
+ import { DAL } from "@medusajs/types";
2
+ import { OptionalProps, Rel } from "@mikro-orm/core";
3
+ type OptionalOrderProps = "parent_return_reason" | DAL.ModelDateColumns;
4
+ export default class ReturnReason {
5
+ [OptionalProps]?: OptionalOrderProps;
6
+ id: string;
7
+ value: string;
8
+ label: string;
9
+ description: string | null;
10
+ parent_return_reason_id?: string | null;
11
+ parent_return_reason?: Rel<ReturnReason> | null;
12
+ return_reason_children: Rel<ReturnReason>[];
13
+ metadata: Record<string, unknown> | null;
14
+ created_at: Date;
15
+ updated_at: Date;
16
+ deleted_at: Date | null;
17
+ onCreate(): void;
18
+ onInit(): void;
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=return-reason.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return-reason.d.ts","sourceRoot":"","sources":["../../src/models/return-reason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAMrC,OAAO,EAQL,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AAoBxB,KAAK,kBAAkB,GAAG,sBAAsB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AAIvE,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,CAAC,aAAa,CAAC,CAAC,EAAE,kBAAkB,CAAA;IAGpC,EAAE,EAAE,MAAM,CAAA;IAIV,KAAK,EAAE,MAAM,CAAA;IAGb,KAAK,EAAE,MAAM,CAAA;IAGb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAO;IAIjC,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAQvC,oBAAoB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;IAO/C,sBAAsB,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,CAAA;IAG3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAO/C,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAKR,MAAM;CAGP"}
@@ -0,0 +1,120 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const utils_1 = require("@medusajs/utils");
13
+ const core_1 = require("@mikro-orm/core");
14
+ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
15
+ tableName: "return_reason",
16
+ columns: "deleted_at",
17
+ where: "deleted_at IS NOT NULL",
18
+ });
19
+ const ValueIndex = (0, utils_1.createPsqlIndexStatementHelper)({
20
+ tableName: "return_reason",
21
+ columns: "value",
22
+ where: "deleted_at IS NOT NULL",
23
+ });
24
+ const ParentIndex = (0, utils_1.createPsqlIndexStatementHelper)({
25
+ tableName: "return_reason",
26
+ columns: "parent_return_reason_id",
27
+ where: "deleted_at IS NOT NULL",
28
+ });
29
+ let ReturnReason = class ReturnReason {
30
+ constructor() {
31
+ this.description = null;
32
+ this.metadata = null;
33
+ this.deleted_at = null;
34
+ }
35
+ onCreate() {
36
+ this.id = (0, utils_1.generateEntityId)(this.id, "rr");
37
+ }
38
+ onInit() {
39
+ this.id = (0, utils_1.generateEntityId)(this.id, "rr");
40
+ }
41
+ };
42
+ __decorate([
43
+ (0, core_1.PrimaryKey)({ columnType: "text" }),
44
+ __metadata("design:type", String)
45
+ ], ReturnReason.prototype, "id", void 0);
46
+ __decorate([
47
+ (0, core_1.Property)({ columnType: "text" }),
48
+ ValueIndex.MikroORMIndex(),
49
+ __metadata("design:type", String)
50
+ ], ReturnReason.prototype, "value", void 0);
51
+ __decorate([
52
+ (0, core_1.Property)({ columnType: "text" }),
53
+ __metadata("design:type", String)
54
+ ], ReturnReason.prototype, "label", void 0);
55
+ __decorate([
56
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
57
+ __metadata("design:type", Object)
58
+ ], ReturnReason.prototype, "description", void 0);
59
+ __decorate([
60
+ (0, core_1.Property)({ columnType: "text", nullable: true }),
61
+ ParentIndex.MikroORMIndex(),
62
+ __metadata("design:type", Object)
63
+ ], ReturnReason.prototype, "parent_return_reason_id", void 0);
64
+ __decorate([
65
+ (0, core_1.ManyToOne)({
66
+ entity: () => ReturnReason,
67
+ fieldName: "parent_return_reason_id",
68
+ nullable: true,
69
+ cascade: [core_1.Cascade.PERSIST],
70
+ }),
71
+ __metadata("design:type", Object)
72
+ ], ReturnReason.prototype, "parent_return_reason", void 0);
73
+ __decorate([
74
+ (0, core_1.OneToMany)(() => ReturnReason, (return_reason) => return_reason.parent_return_reason, { cascade: [core_1.Cascade.PERSIST] }),
75
+ __metadata("design:type", Array)
76
+ ], ReturnReason.prototype, "return_reason_children", void 0);
77
+ __decorate([
78
+ (0, core_1.Property)({ columnType: "jsonb", nullable: true }),
79
+ __metadata("design:type", Object)
80
+ ], ReturnReason.prototype, "metadata", void 0);
81
+ __decorate([
82
+ (0, core_1.Property)({
83
+ onCreate: () => new Date(),
84
+ columnType: "timestamptz",
85
+ defaultRaw: "now()",
86
+ }),
87
+ __metadata("design:type", Date)
88
+ ], ReturnReason.prototype, "created_at", void 0);
89
+ __decorate([
90
+ (0, core_1.Property)({
91
+ onCreate: () => new Date(),
92
+ onUpdate: () => new Date(),
93
+ columnType: "timestamptz",
94
+ defaultRaw: "now()",
95
+ }),
96
+ __metadata("design:type", Date)
97
+ ], ReturnReason.prototype, "updated_at", void 0);
98
+ __decorate([
99
+ (0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
100
+ DeletedAtIndex.MikroORMIndex(),
101
+ __metadata("design:type", Object)
102
+ ], ReturnReason.prototype, "deleted_at", void 0);
103
+ __decorate([
104
+ (0, core_1.BeforeCreate)(),
105
+ __metadata("design:type", Function),
106
+ __metadata("design:paramtypes", []),
107
+ __metadata("design:returntype", void 0)
108
+ ], ReturnReason.prototype, "onCreate", null);
109
+ __decorate([
110
+ (0, core_1.OnInit)(),
111
+ __metadata("design:type", Function),
112
+ __metadata("design:paramtypes", []),
113
+ __metadata("design:returntype", void 0)
114
+ ], ReturnReason.prototype, "onInit", null);
115
+ ReturnReason = __decorate([
116
+ (0, core_1.Entity)({ tableName: "return_reason" }),
117
+ (0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
118
+ ], ReturnReason);
119
+ exports.default = ReturnReason;
120
+ //# sourceMappingURL=return-reason.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return-reason.js","sourceRoot":"","sources":["../../src/models/return-reason.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAIwB;AACxB,0CAYwB;AAExB,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,UAAU,GAAG,IAAA,sCAA8B,EAAC;IAChD,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";
3
+ import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
4
+ import { ReturnItem, Transaction } from ".";
5
+ import Claim from "./claim";
6
+ import Exchange from "./exchange";
7
+ import Order from "./order";
8
+ import OrderShippingMethod from "./order-shipping-method";
9
+ type OptionalReturnProps = DAL.ModelDateColumns;
10
+ export default class Return {
11
+ [OptionalProps]?: OptionalReturnProps;
12
+ id: string;
13
+ order_id: string;
14
+ order: Rel<Order>;
15
+ exchange: Rel<Exchange>;
16
+ exchange_id: string | null;
17
+ claim: Rel<Claim>;
18
+ claim_id: string | null;
19
+ order_version: number;
20
+ display_id: number;
21
+ status: ReturnStatus;
22
+ location_id: string | null;
23
+ no_notification: boolean | null;
24
+ refund_amount: BigNumber | number;
25
+ raw_refund_amount: BigNumberRawValue;
26
+ items: Collection<ReturnItem, object>;
27
+ shipping_methods: Collection<OrderShippingMethod, object>;
28
+ transactions: Collection<Transaction, object>;
29
+ metadata: Record<string, unknown> | null;
30
+ created_at: Date;
31
+ updated_at: Date;
32
+ deleted_at: Date | null;
33
+ received_at: Date | null;
34
+ canceled_at: Date | null;
35
+ onCreate(): void;
36
+ onInit(): void;
37
+ }
38
+ export {};
39
+ //# sourceMappingURL=return.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return.d.ts","sourceRoot":"","sources":["../../src/models/return.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EACL,SAAS,EAET,YAAY,EAGb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,UAAU,EAOV,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,mBAA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