@medusajs/medusa 1.2.2-dev.56 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/api/index.d.ts +1 -0
  3. package/dist/api/index.js +1 -0
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/middlewares/error-handler.js +1 -1
  6. package/dist/api/routes/admin/auth/create-session.js +5 -5
  7. package/dist/api/routes/admin/auth/create-session.js.map +1 -1
  8. package/dist/api/routes/admin/customer-groups/list-customer-groups.js +2 -2
  9. package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -1
  10. package/dist/api/routes/admin/discounts/create-discount.d.ts +11 -2
  11. package/dist/api/routes/admin/discounts/create-discount.js +66 -12
  12. package/dist/api/routes/admin/discounts/create-discount.js.map +1 -1
  13. package/dist/api/routes/admin/discounts/create-dynamic-code.d.ts +1 -0
  14. package/dist/api/routes/admin/discounts/create-dynamic-code.js +4 -1
  15. package/dist/api/routes/admin/discounts/create-dynamic-code.js.map +1 -1
  16. package/dist/api/routes/admin/discounts/delete-dynamic-code.js +3 -1
  17. package/dist/api/routes/admin/discounts/delete-dynamic-code.js.map +1 -1
  18. package/dist/api/routes/admin/discounts/get-discount.d.ts +7 -0
  19. package/dist/api/routes/admin/discounts/get-discount.js +43 -9
  20. package/dist/api/routes/admin/discounts/get-discount.js.map +1 -1
  21. package/dist/api/routes/admin/discounts/index.d.ts +1 -3
  22. package/dist/api/routes/admin/discounts/index.js +1 -6
  23. package/dist/api/routes/admin/discounts/index.js.map +1 -1
  24. package/dist/api/routes/admin/discounts/list-discounts.d.ts +2 -6
  25. package/dist/api/routes/admin/discounts/list-discounts.js +15 -28
  26. package/dist/api/routes/admin/discounts/list-discounts.js.map +1 -1
  27. package/dist/api/routes/admin/discounts/update-discount.d.ts +12 -2
  28. package/dist/api/routes/admin/discounts/update-discount.js +70 -15
  29. package/dist/api/routes/admin/discounts/update-discount.js.map +1 -1
  30. package/dist/api/routes/admin/draft-orders/create-draft-order.d.ts +3 -3
  31. package/dist/api/routes/admin/draft-orders/create-draft-order.js.map +1 -1
  32. package/dist/api/routes/admin/draft-orders/create-line-item.d.ts +1 -1
  33. package/dist/api/routes/admin/draft-orders/create-line-item.js.map +1 -1
  34. package/dist/api/routes/admin/draft-orders/index.js +7 -1
  35. package/dist/api/routes/admin/draft-orders/index.js.map +1 -1
  36. package/dist/api/routes/admin/draft-orders/register-payment.js +0 -1
  37. package/dist/api/routes/admin/draft-orders/register-payment.js.map +1 -1
  38. package/dist/api/routes/admin/draft-orders/update-line-item.d.ts +1 -1
  39. package/dist/api/routes/admin/draft-orders/update-line-item.js.map +1 -1
  40. package/dist/api/routes/admin/notifications/index.js.map +1 -1
  41. package/dist/api/routes/admin/notifications/list-notifications.js.map +1 -1
  42. package/dist/api/routes/admin/notifications/resend-notification.js.map +1 -1
  43. package/dist/api/routes/admin/orders/add-shipping-method.d.ts +1 -1
  44. package/dist/api/routes/admin/orders/add-shipping-method.js.map +1 -1
  45. package/dist/api/routes/admin/orders/create-order.js.map +1 -1
  46. package/dist/api/routes/admin/orders/create-swap.js +7 -3
  47. package/dist/api/routes/admin/orders/create-swap.js.map +1 -1
  48. package/dist/api/routes/admin/orders/index.d.ts +1 -1
  49. package/dist/api/routes/admin/orders/index.js +1 -3
  50. package/dist/api/routes/admin/orders/index.js.map +1 -1
  51. package/dist/api/routes/admin/orders/list-orders.js.map +1 -1
  52. package/dist/api/routes/admin/orders/update-order.js.map +1 -1
  53. package/dist/api/routes/admin/price-lists/index.d.ts +7 -0
  54. package/dist/api/routes/admin/price-lists/index.js +3 -0
  55. package/dist/api/routes/admin/price-lists/index.js.map +1 -1
  56. package/dist/api/routes/admin/price-lists/list-price-list-products.d.ts +74 -0
  57. package/dist/api/routes/admin/price-lists/list-price-list-products.js +246 -0
  58. package/dist/api/routes/admin/price-lists/list-price-list-products.js.map +1 -0
  59. package/dist/api/routes/admin/price-lists/update-price-list.d.ts +2 -2
  60. package/dist/api/routes/admin/price-lists/update-price-list.js.map +1 -1
  61. package/dist/api/routes/admin/products/list-products.d.ts +2 -1
  62. package/dist/api/routes/admin/products/list-products.js +31 -65
  63. package/dist/api/routes/admin/products/list-products.js.map +1 -1
  64. package/dist/api/routes/admin/products/update-variant.js +11 -7
  65. package/dist/api/routes/admin/products/update-variant.js.map +1 -1
  66. package/dist/api/routes/admin/regions/index.d.ts +1 -1
  67. package/dist/api/routes/admin/store/get-store.js.map +1 -1
  68. package/dist/api/routes/admin/swaps/index.js +3 -0
  69. package/dist/api/routes/admin/swaps/index.js.map +1 -1
  70. package/dist/api/routes/admin/tax-rates/list-tax-rates.js.map +1 -1
  71. package/dist/api/routes/admin/tax-rates/utils/get-query-config.d.ts +1 -1
  72. package/dist/api/routes/admin/tax-rates/utils/get-query-config.js +4 -2
  73. package/dist/api/routes/admin/tax-rates/utils/get-query-config.js.map +1 -1
  74. package/dist/api/routes/admin/uploads/index.d.ts +1 -1
  75. package/dist/api/routes/store/auth/create-session.js +4 -5
  76. package/dist/api/routes/store/auth/create-session.js.map +1 -1
  77. package/dist/api/routes/store/carts/create-cart.js +8 -5
  78. package/dist/api/routes/store/carts/create-cart.js.map +1 -1
  79. package/dist/api/routes/store/carts/create-line-item.d.ts +1 -1
  80. package/dist/api/routes/store/carts/create-line-item.js +9 -6
  81. package/dist/api/routes/store/carts/create-line-item.js.map +1 -1
  82. package/dist/api/routes/store/carts/index.d.ts +0 -1
  83. package/dist/api/routes/store/carts/index.js +1 -3
  84. package/dist/api/routes/store/carts/index.js.map +1 -1
  85. package/dist/api/routes/store/carts/update-cart.js +7 -7
  86. package/dist/api/routes/store/carts/update-cart.js.map +1 -1
  87. package/dist/api/routes/store/customers/create-customer.js +3 -4
  88. package/dist/api/routes/store/customers/create-customer.js.map +1 -1
  89. package/dist/api/routes/store/orders/index.js +0 -2
  90. package/dist/api/routes/store/orders/index.js.map +1 -1
  91. package/dist/api/routes/store/products/get-product.js +17 -5
  92. package/dist/api/routes/store/products/get-product.js.map +1 -1
  93. package/dist/api/routes/store/products/index.d.ts +2 -2
  94. package/dist/api/routes/store/products/list-products.d.ts +2 -1
  95. package/dist/api/routes/store/products/list-products.js +21 -8
  96. package/dist/api/routes/store/products/list-products.js.map +1 -1
  97. package/dist/api/routes/store/products/search.d.ts +1 -1
  98. package/dist/api/routes/store/products/search.js.map +1 -1
  99. package/dist/api/routes/store/shipping-options/list-options.js.map +1 -1
  100. package/dist/api/routes/store/swaps/create-swap.js +7 -3
  101. package/dist/api/routes/store/swaps/create-swap.js.map +1 -1
  102. package/dist/api/routes/store/variants/get-variant.js +17 -5
  103. package/dist/api/routes/store/variants/get-variant.js.map +1 -1
  104. package/dist/api/routes/store/variants/list-variants.d.ts +2 -1
  105. package/dist/api/routes/store/variants/list-variants.js +38 -9
  106. package/dist/api/routes/store/variants/list-variants.js.map +1 -1
  107. package/dist/commands/develop.js +1 -1
  108. package/dist/commands/develop.js.map +1 -1
  109. package/dist/controllers/customers/index.d.ts +1 -1
  110. package/dist/controllers/customers/list-customers.d.ts +1 -1
  111. package/dist/controllers/customers/list-customers.js +34 -37
  112. package/dist/controllers/customers/list-customers.js.map +1 -1
  113. package/dist/controllers/products/admin-list-products.d.ts +16 -0
  114. package/dist/controllers/products/admin-list-products.js +103 -0
  115. package/dist/controllers/products/admin-list-products.js.map +1 -0
  116. package/dist/helpers/test-request.js +15 -7
  117. package/dist/helpers/test-request.js.map +1 -1
  118. package/dist/index.d.ts +3 -59
  119. package/dist/index.js +3 -62
  120. package/dist/index.js.map +1 -1
  121. package/dist/interfaces/base-service.d.ts +66 -0
  122. package/dist/interfaces/base-service.js +378 -0
  123. package/dist/interfaces/base-service.js.map +1 -0
  124. package/dist/interfaces/index.d.ts +1 -0
  125. package/dist/interfaces/index.js +1 -0
  126. package/dist/interfaces/index.js.map +1 -1
  127. package/dist/interfaces/price-selection-strategy.d.ts +50 -0
  128. package/dist/interfaces/price-selection-strategy.js +34 -0
  129. package/dist/interfaces/price-selection-strategy.js.map +1 -0
  130. package/dist/interfaces/tax-service.d.ts +6 -0
  131. package/dist/interfaces/tax-service.js +31 -0
  132. package/dist/interfaces/tax-service.js.map +1 -1
  133. package/dist/loaders/api.d.ts +9 -5
  134. package/dist/loaders/api.js +2 -6
  135. package/dist/loaders/api.js.map +1 -1
  136. package/dist/loaders/config.d.ts +3 -0
  137. package/dist/loaders/config.js +47 -0
  138. package/dist/loaders/config.js.map +1 -0
  139. package/dist/loaders/database.d.ts +8 -4
  140. package/dist/loaders/database.js.map +1 -1
  141. package/dist/loaders/defaults.d.ts +4 -3
  142. package/dist/loaders/defaults.js +39 -31
  143. package/dist/loaders/defaults.js.map +1 -1
  144. package/dist/loaders/express.d.ts +7 -4
  145. package/dist/loaders/express.js +7 -5
  146. package/dist/loaders/express.js.map +1 -1
  147. package/dist/loaders/index.d.ts +13 -8
  148. package/dist/loaders/index.js +29 -54
  149. package/dist/loaders/index.js.map +1 -1
  150. package/dist/loaders/logger.d.ts +1 -0
  151. package/dist/loaders/logger.js.map +1 -1
  152. package/dist/loaders/models.d.ts +8 -3
  153. package/dist/loaders/models.js +19 -17
  154. package/dist/loaders/models.js.map +1 -1
  155. package/dist/loaders/passport.d.ts +7 -4
  156. package/dist/loaders/passport.js +23 -21
  157. package/dist/loaders/passport.js.map +1 -1
  158. package/dist/loaders/plugins.d.ts +18 -10
  159. package/dist/loaders/plugins.js +27 -24
  160. package/dist/loaders/plugins.js.map +1 -1
  161. package/dist/loaders/redis.d.ts +8 -5
  162. package/dist/loaders/redis.js +3 -3
  163. package/dist/loaders/redis.js.map +1 -1
  164. package/dist/loaders/repositories.d.ts +7 -3
  165. package/dist/loaders/repositories.js +1 -1
  166. package/dist/loaders/repositories.js.map +1 -1
  167. package/dist/loaders/search-index.d.ts +4 -3
  168. package/dist/loaders/search-index.js.map +1 -1
  169. package/dist/loaders/services.d.ts +10 -5
  170. package/dist/loaders/services.js.map +1 -1
  171. package/dist/loaders/strategies.d.ts +1 -1
  172. package/dist/loaders/subscribers.d.ts +7 -3
  173. package/dist/loaders/subscribers.js.map +1 -1
  174. package/dist/migrations/1646324713514-discount_conditions.d.ts +6 -0
  175. package/dist/migrations/1646324713514-discount_conditions.js +335 -0
  176. package/dist/migrations/1646324713514-discount_conditions.js.map +1 -0
  177. package/dist/migrations/1648600574750-add_line_item_adjustments.d.ts +6 -0
  178. package/dist/migrations/1648600574750-add_line_item_adjustments.js +101 -0
  179. package/dist/migrations/1648600574750-add_line_item_adjustments.js.map +1 -0
  180. package/dist/migrations/1648641130007-tax_line_constraints.d.ts +6 -0
  181. package/dist/{api/routes/admin/discounts/remove-valid-product.js → migrations/1648641130007-tax_line_constraints.js} +39 -44
  182. package/dist/migrations/1648641130007-tax_line_constraints.js.map +1 -0
  183. package/dist/migrations/1649775522087-add_batch_job_model.d.ts +6 -0
  184. package/dist/{api/routes/admin/discounts/add-valid-product.js → migrations/1649775522087-add_batch_job_model.js} +39 -44
  185. package/dist/migrations/1649775522087-add_batch_job_model.js.map +1 -0
  186. package/dist/models/batch-job.d.ts +58 -0
  187. package/dist/models/batch-job.js +119 -0
  188. package/dist/models/batch-job.js.map +1 -0
  189. package/dist/models/country.d.ts +1 -1
  190. package/dist/models/country.js +1 -1
  191. package/dist/models/country.js.map +1 -1
  192. package/dist/models/customer-group.js +3 -1
  193. package/dist/models/customer-group.js.map +1 -1
  194. package/dist/models/discount-condition-customer-group.d.ts +39 -0
  195. package/dist/models/discount-condition-customer-group.js +84 -0
  196. package/dist/models/discount-condition-customer-group.js.map +1 -0
  197. package/dist/models/discount-condition-product-collection.d.ts +39 -0
  198. package/dist/models/discount-condition-product-collection.js +84 -0
  199. package/dist/models/discount-condition-product-collection.js.map +1 -0
  200. package/dist/models/discount-condition-product-tag.d.ts +39 -0
  201. package/dist/models/discount-condition-product-tag.js +84 -0
  202. package/dist/models/discount-condition-product-tag.js.map +1 -0
  203. package/dist/models/discount-condition-product-type.d.ts +39 -0
  204. package/dist/models/discount-condition-product-type.js +84 -0
  205. package/dist/models/discount-condition-product-type.js.map +1 -0
  206. package/dist/models/discount-condition-product.d.ts +39 -0
  207. package/dist/models/discount-condition-product.js +84 -0
  208. package/dist/models/discount-condition-product.js.map +1 -0
  209. package/dist/models/discount-condition.d.ts +68 -0
  210. package/dist/models/discount-condition.js +208 -0
  211. package/dist/models/discount-condition.js.map +1 -0
  212. package/dist/models/discount-rule.d.ts +5 -5
  213. package/dist/models/discount-rule.js +6 -17
  214. package/dist/models/discount-rule.js.map +1 -1
  215. package/dist/models/discount.js.map +1 -1
  216. package/dist/models/index.d.ts +66 -0
  217. package/dist/models/index.js +79 -0
  218. package/dist/models/index.js.map +1 -0
  219. package/dist/models/line-item-adjustment.d.ts +13 -0
  220. package/dist/models/line-item-adjustment.js +79 -0
  221. package/dist/models/line-item-adjustment.js.map +1 -0
  222. package/dist/models/line-item-tax-line.js +2 -1
  223. package/dist/models/line-item-tax-line.js.map +1 -1
  224. package/dist/models/line-item.d.ts +2 -0
  225. package/dist/models/line-item.js +5 -0
  226. package/dist/models/line-item.js.map +1 -1
  227. package/dist/models/money-amount.js +4 -1
  228. package/dist/models/money-amount.js.map +1 -1
  229. package/dist/models/price-list.js +6 -2
  230. package/dist/models/price-list.js.map +1 -1
  231. package/dist/models/product-variant.js +9 -3
  232. package/dist/models/product-variant.js.map +1 -1
  233. package/dist/models/shipping-method-tax-line.js +2 -1
  234. package/dist/models/shipping-method-tax-line.js.map +1 -1
  235. package/dist/models/swap.d.ts +4 -4
  236. package/dist/models/swap.js +23 -23
  237. package/dist/models/swap.js.map +1 -1
  238. package/dist/repositories/cart.d.ts +2 -2
  239. package/dist/repositories/cart.js.map +1 -1
  240. package/dist/repositories/customer.d.ts +1 -1
  241. package/dist/repositories/customer.js +7 -9
  242. package/dist/repositories/customer.js.map +1 -1
  243. package/dist/repositories/discount-condition.d.ts +34 -0
  244. package/dist/repositories/discount-condition.js +384 -0
  245. package/dist/repositories/discount-condition.js.map +1 -0
  246. package/dist/repositories/line-item-adjustment.d.ts +4 -0
  247. package/dist/repositories/line-item-adjustment.js +38 -0
  248. package/dist/repositories/line-item-adjustment.js.map +1 -0
  249. package/dist/repositories/line-item-tax-line.d.ts +2 -0
  250. package/dist/repositories/line-item-tax-line.js +80 -0
  251. package/dist/repositories/line-item-tax-line.js.map +1 -1
  252. package/dist/repositories/line-item.js +1 -0
  253. package/dist/repositories/line-item.js.map +1 -1
  254. package/dist/repositories/money-amount.d.ts +1 -0
  255. package/dist/repositories/money-amount.js +49 -2
  256. package/dist/repositories/money-amount.js.map +1 -1
  257. package/dist/repositories/product.d.ts +2 -0
  258. package/dist/repositories/product.js +35 -17
  259. package/dist/repositories/product.js.map +1 -1
  260. package/dist/repositories/shipping-method-tax-line.d.ts +2 -0
  261. package/dist/repositories/shipping-method-tax-line.js +80 -0
  262. package/dist/repositories/shipping-method-tax-line.js.map +1 -1
  263. package/dist/scripts/discount-rule-migration.d.ts +4 -0
  264. package/dist/scripts/discount-rule-migration.js +177 -0
  265. package/dist/scripts/discount-rule-migration.js.map +1 -0
  266. package/dist/scripts/line-item-adjustment-migration.d.ts +4 -0
  267. package/dist/scripts/line-item-adjustment-migration.js +173 -0
  268. package/dist/scripts/line-item-adjustment-migration.js.map +1 -0
  269. package/dist/services/cart.d.ts +58 -47
  270. package/dist/services/cart.js +1306 -1391
  271. package/dist/services/cart.js.map +1 -1
  272. package/dist/services/customer.js +4 -2
  273. package/dist/services/customer.js.map +1 -1
  274. package/dist/services/discount.d.ts +50 -58
  275. package/dist/services/discount.js +363 -152
  276. package/dist/services/discount.js.map +1 -1
  277. package/dist/services/draft-order.js +1 -0
  278. package/dist/services/draft-order.js.map +1 -1
  279. package/dist/services/fulfillment-provider.js +23 -17
  280. package/dist/services/fulfillment-provider.js.map +1 -1
  281. package/dist/services/invite.d.ts +4 -2
  282. package/dist/services/invite.js +11 -9
  283. package/dist/services/invite.js.map +1 -1
  284. package/dist/services/line-item-adjustment.d.ts +87 -0
  285. package/dist/services/line-item-adjustment.js +436 -0
  286. package/dist/services/line-item-adjustment.js.map +1 -0
  287. package/dist/services/line-item.d.ts +48 -40
  288. package/dist/services/line-item.js +226 -193
  289. package/dist/services/line-item.js.map +1 -1
  290. package/dist/services/order.js +4 -4
  291. package/dist/services/order.js.map +1 -1
  292. package/dist/services/payment-provider.js +23 -17
  293. package/dist/services/payment-provider.js.map +1 -1
  294. package/dist/services/product-variant.d.ts +26 -9
  295. package/dist/services/product-variant.js +222 -76
  296. package/dist/services/product-variant.js.map +1 -1
  297. package/dist/services/product.d.ts +22 -4
  298. package/dist/services/product.js +236 -48
  299. package/dist/services/product.js.map +1 -1
  300. package/dist/services/region.js +8 -4
  301. package/dist/services/region.js.map +1 -1
  302. package/dist/services/return.js +0 -1
  303. package/dist/services/return.js.map +1 -1
  304. package/dist/services/shipping-option.d.ts +2 -2
  305. package/dist/services/shipping-option.js +7 -4
  306. package/dist/services/shipping-option.js.map +1 -1
  307. package/dist/services/swap.d.ts +4 -1
  308. package/dist/services/swap.js +29 -16
  309. package/dist/services/swap.js.map +1 -1
  310. package/dist/services/system-tax.d.ts +2 -3
  311. package/dist/services/system-tax.js +2 -2
  312. package/dist/services/system-tax.js.map +1 -1
  313. package/dist/services/tax-provider.d.ts +2 -0
  314. package/dist/services/tax-provider.js +96 -7
  315. package/dist/services/tax-provider.js.map +1 -1
  316. package/dist/services/tax-rate.d.ts +3 -3
  317. package/dist/services/tax-rate.js +1 -1
  318. package/dist/services/tax-rate.js.map +1 -1
  319. package/dist/services/totals.d.ts +9 -8
  320. package/dist/services/totals.js +41 -88
  321. package/dist/services/totals.js.map +1 -1
  322. package/dist/strategies/price-selection.d.ts +13 -0
  323. package/dist/strategies/price-selection.js +185 -0
  324. package/dist/strategies/price-selection.js.map +1 -0
  325. package/dist/subscribers/order.js +1 -7
  326. package/dist/subscribers/order.js.map +1 -1
  327. package/dist/types/batch-job.d.ts +6 -0
  328. package/dist/types/batch-job.js +11 -0
  329. package/dist/types/batch-job.js.map +1 -0
  330. package/dist/types/common.d.ts +1 -3
  331. package/dist/types/discount.d.ts +69 -1
  332. package/dist/types/discount.js +129 -5
  333. package/dist/types/discount.js.map +1 -1
  334. package/dist/types/global.d.ts +34 -0
  335. package/dist/types/global.js +3 -0
  336. package/dist/types/global.js.map +1 -0
  337. package/dist/types/line-item-adjustment.d.ts +9 -0
  338. package/dist/types/line-item-adjustment.js +50 -0
  339. package/dist/types/line-item-adjustment.js.map +1 -0
  340. package/dist/types/price-selection.d.ts +5 -0
  341. package/dist/types/price-selection.js +35 -0
  342. package/dist/types/price-selection.js.map +1 -0
  343. package/dist/types/product-variant.d.ts +6 -0
  344. package/dist/types/product-variant.js.map +1 -1
  345. package/dist/types/product.d.ts +16 -0
  346. package/dist/types/product.js +86 -1
  347. package/dist/types/product.js.map +1 -1
  348. package/dist/types/validators/exactly-one.d.ts +6 -0
  349. package/dist/types/validators/exactly-one.js +37 -0
  350. package/dist/types/validators/exactly-one.js.map +1 -0
  351. package/dist/utils/date-helpers.d.ts +2 -0
  352. package/dist/utils/date-helpers.js +15 -0
  353. package/dist/utils/date-helpers.js.map +1 -0
  354. package/dist/utils/get-query-config.d.ts +11 -0
  355. package/dist/utils/get-query-config.js +88 -0
  356. package/dist/utils/get-query-config.js.map +1 -0
  357. package/package.json +7 -8
  358. package/dist/api/routes/admin/discounts/add-valid-product.d.ts +0 -23
  359. package/dist/api/routes/admin/discounts/add-valid-product.js.map +0 -1
  360. package/dist/api/routes/admin/discounts/remove-valid-product.d.ts +0 -23
  361. package/dist/api/routes/admin/discounts/remove-valid-product.js.map +0 -1
  362. package/dist/api/routes/store/carts/update-payment-method.d.ts +0 -38
  363. package/dist/api/routes/store/carts/update-payment-method.js +0 -122
  364. package/dist/api/routes/store/carts/update-payment-method.js.map +0 -1
  365. package/dist/config/index.d.ts +0 -14
  366. package/dist/config/index.js +0 -40
  367. package/dist/config/index.js.map +0 -1
  368. package/yarn-error.log +0 -6769
@@ -36,47 +36,42 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var _1 = require(".");
40
- /**
41
- * @oas [post] /discounts/{id}/products/{product_id}
42
- * operationId: "PostDiscountsDiscountProductsProduct"
43
- * summary: "Adds Product availability"
44
- * description: "Adds a Product to the list of Products that a Discount can be used for."
45
- * x-authenticated: true
46
- * parameters:
47
- * - (path) id=* {string} The id of the Discount.
48
- * - (path) product_id=* {string} The id of the Product.
49
- * tags:
50
- * - Discount
51
- * responses:
52
- * 200:
53
- * description: OK
54
- * content:
55
- * application/json:
56
- * schema:
57
- * properties:
58
- * discount:
59
- * $ref: "#/components/schemas/discount"
60
- */
61
- exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
62
- var _a, discount_id, product_id, discountService, discount;
63
- return __generator(this, function (_b) {
64
- switch (_b.label) {
65
- case 0:
66
- _a = req.params, discount_id = _a.discount_id, product_id = _a.product_id;
67
- discountService = req.scope.resolve("discountService");
68
- return [4 /*yield*/, discountService.addValidProduct(discount_id, product_id)];
69
- case 1:
70
- _b.sent();
71
- return [4 /*yield*/, discountService.retrieve(discount_id, {
72
- select: _1.defaultAdminDiscountsFields,
73
- relations: _1.defaultAdminDiscountsRelations,
74
- })];
75
- case 2:
76
- discount = _b.sent();
77
- res.status(200).json({ discount: discount });
78
- return [2 /*return*/];
79
- }
80
- });
81
- }); });
82
- //# sourceMappingURL=add-valid-product.js.map
39
+ exports.addBatchJobModel1649775522087 = void 0;
40
+ var addBatchJobModel1649775522087 = /** @class */ (function () {
41
+ function addBatchJobModel1649775522087() {
42
+ this.name = "addBatchJobModel1649775522087";
43
+ }
44
+ addBatchJobModel1649775522087.prototype.up = function (queryRunner) {
45
+ return __awaiter(this, void 0, void 0, function () {
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0: return [4 /*yield*/, queryRunner.query("CREATE TYPE \"batch_job_status_enum\" AS ENUM('created', 'processing', 'awaiting_confirmation', 'completed')")];
49
+ case 1:
50
+ _a.sent();
51
+ return [4 /*yield*/, queryRunner.query("CREATE TABLE \"batch_job\" (\"id\" character varying NOT NULL, \"type\" text NOT NULL, \"status\" \"public\".\"batch_job_status_enum\" NOT NULL, \"created_by\" text, \"context\" jsonb, \"result\" jsonb, \"created_at\" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), \"updated_at\" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), \"deleted_at\" TIMESTAMP WITH TIME ZONE, CONSTRAINT \"PK_e57f84d485145d5be96bc6d871e\" PRIMARY KEY (\"id\"))")];
52
+ case 2:
53
+ _a.sent();
54
+ return [2 /*return*/];
55
+ }
56
+ });
57
+ });
58
+ };
59
+ addBatchJobModel1649775522087.prototype.down = function (queryRunner) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ return __generator(this, function (_a) {
62
+ switch (_a.label) {
63
+ case 0: return [4 /*yield*/, queryRunner.query("DROP TABLE \"batch_job\"")];
64
+ case 1:
65
+ _a.sent();
66
+ return [4 /*yield*/, queryRunner.query("DROP TYPE \"batch_job_status_enum\"")];
67
+ case 2:
68
+ _a.sent();
69
+ return [2 /*return*/];
70
+ }
71
+ });
72
+ });
73
+ };
74
+ return addBatchJobModel1649775522087;
75
+ }());
76
+ exports.addBatchJobModel1649775522087 = addBatchJobModel1649775522087;
77
+ //# sourceMappingURL=1649775522087-add_batch_job_model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1649775522087-add_batch_job_model.js","sourceRoot":"","sources":["../../src/migrations/1649775522087-add_batch_job_model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;IAAA;QACE,SAAI,GAAG,+BAA+B,CAAA;IAexC,CAAC;IAbc,0CAAE,GAAf,UAAgB,WAAwB;;;;4BACtC,qBAAM,WAAW,CAAC,KAAK,CACrB,8GAA4G,CAC7G,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,ybAA6Z,CAC9Z,EAAA;;wBAFD,SAEC,CAAA;;;;;KACF;IAEY,4CAAI,GAAjB,UAAkB,WAAwB;;;;4BACxC,qBAAM,WAAW,CAAC,KAAK,CAAC,0BAAwB,CAAC,EAAA;;wBAAjD,SAAiD,CAAA;wBACjD,qBAAM,WAAW,CAAC,KAAK,CAAC,qCAAmC,CAAC,EAAA;;wBAA5D,SAA4D,CAAA;;;;;KAC7D;IACH,oCAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,sEAA6B"}
@@ -0,0 +1,58 @@
1
+ import { BatchJobStatus } from "../types/batch-job";
2
+ export declare class BatchJob {
3
+ id: string;
4
+ type: string;
5
+ status: BatchJobStatus;
6
+ created_by: string | null;
7
+ context: Record<string, unknown>;
8
+ result: Record<string, unknown>;
9
+ created_at: Date;
10
+ updated_at: Date;
11
+ deleted_at: Date | null;
12
+ private beforeInsert;
13
+ }
14
+ /**
15
+ * @schema batch_job
16
+ * title: "Batch Job"
17
+ * description: "A Batch Job."
18
+ * x-resourceId: batch_job
19
+ * properties:
20
+ * id:
21
+ * description: "The unique identifier for the batch job."
22
+ * type: string
23
+ * type:
24
+ * description: "The type of batch job."
25
+ * type: string
26
+ * enum:
27
+ * - product_import
28
+ * - product_export
29
+ * status:
30
+ * description: "The status of the batch job."
31
+ * type: string
32
+ * enum:
33
+ * - created
34
+ * - processing
35
+ * - awaiting_confirmation
36
+ * - completed
37
+ * created_by:
38
+ * description: "The unique identifier of the user that created the batch job."
39
+ * type: string
40
+ * context:
41
+ * description: "The context of the batch job, the type of the batch job determines what the context should contain."
42
+ * type: object
43
+ * result:
44
+ * description: "The result of the batch job."
45
+ * type: object
46
+ * created_at:
47
+ * description: "The date with timezone at which the resource was created."
48
+ * type: string
49
+ * format: date-time
50
+ * updated_at:
51
+ * description: "The date with timezone at which the resource was last updated."
52
+ * type: string
53
+ * format: date-time
54
+ * deleted_at:
55
+ * description: "The date with timezone at which the resource was deleted."
56
+ * type: string
57
+ * format: date-time
58
+ */
@@ -0,0 +1,119 @@
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
+ exports.BatchJob = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var ulid_1 = require("ulid");
15
+ var batch_job_1 = require("../types/batch-job");
16
+ var db_aware_column_1 = require("../utils/db-aware-column");
17
+ var BatchJob = /** @class */ (function () {
18
+ function BatchJob() {
19
+ }
20
+ BatchJob.prototype.beforeInsert = function () {
21
+ if (this.id)
22
+ return;
23
+ var id = (0, ulid_1.ulid)();
24
+ this.id = "batch_".concat(id);
25
+ };
26
+ __decorate([
27
+ (0, typeorm_1.PrimaryColumn)(),
28
+ __metadata("design:type", String)
29
+ ], BatchJob.prototype, "id", void 0);
30
+ __decorate([
31
+ (0, db_aware_column_1.DbAwareColumn)({ type: "text" }),
32
+ __metadata("design:type", String)
33
+ ], BatchJob.prototype, "type", void 0);
34
+ __decorate([
35
+ (0, db_aware_column_1.DbAwareColumn)({ type: "enum", enum: batch_job_1.BatchJobStatus }),
36
+ __metadata("design:type", String)
37
+ ], BatchJob.prototype, "status", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
40
+ __metadata("design:type", Object)
41
+ ], BatchJob.prototype, "created_by", void 0);
42
+ __decorate([
43
+ (0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
44
+ __metadata("design:type", Object)
45
+ ], BatchJob.prototype, "context", void 0);
46
+ __decorate([
47
+ (0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
48
+ __metadata("design:type", Object)
49
+ ], BatchJob.prototype, "result", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
52
+ __metadata("design:type", Date)
53
+ ], BatchJob.prototype, "created_at", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
56
+ __metadata("design:type", Date)
57
+ ], BatchJob.prototype, "updated_at", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.DeleteDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
60
+ __metadata("design:type", Object)
61
+ ], BatchJob.prototype, "deleted_at", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.BeforeInsert)(),
64
+ __metadata("design:type", Function),
65
+ __metadata("design:paramtypes", []),
66
+ __metadata("design:returntype", void 0)
67
+ ], BatchJob.prototype, "beforeInsert", null);
68
+ BatchJob = __decorate([
69
+ (0, typeorm_1.Entity)()
70
+ ], BatchJob);
71
+ return BatchJob;
72
+ }());
73
+ exports.BatchJob = BatchJob;
74
+ /**
75
+ * @schema batch_job
76
+ * title: "Batch Job"
77
+ * description: "A Batch Job."
78
+ * x-resourceId: batch_job
79
+ * properties:
80
+ * id:
81
+ * description: "The unique identifier for the batch job."
82
+ * type: string
83
+ * type:
84
+ * description: "The type of batch job."
85
+ * type: string
86
+ * enum:
87
+ * - product_import
88
+ * - product_export
89
+ * status:
90
+ * description: "The status of the batch job."
91
+ * type: string
92
+ * enum:
93
+ * - created
94
+ * - processing
95
+ * - awaiting_confirmation
96
+ * - completed
97
+ * created_by:
98
+ * description: "The unique identifier of the user that created the batch job."
99
+ * type: string
100
+ * context:
101
+ * description: "The context of the batch job, the type of the batch job determines what the context should contain."
102
+ * type: object
103
+ * result:
104
+ * description: "The result of the batch job."
105
+ * type: object
106
+ * created_at:
107
+ * description: "The date with timezone at which the resource was created."
108
+ * type: string
109
+ * format: date-time
110
+ * updated_at:
111
+ * description: "The date with timezone at which the resource was last updated."
112
+ * type: string
113
+ * format: date-time
114
+ * deleted_at:
115
+ * description: "The date with timezone at which the resource was deleted."
116
+ * type: string
117
+ * format: date-time
118
+ */
119
+ //# sourceMappingURL=batch-job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-job.js","sourceRoot":"","sources":["../../src/models/batch-job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAQgB;AAChB,6BAA2B;AAC3B,gDAAmD;AACnD,4DAAuE;AAGvE;IAAA;IAkCA,CAAC;IALS,+BAAY,GAApB;QACE,IAAI,IAAI,CAAC,EAAE;YAAE,OAAM;QACnB,IAAM,EAAE,GAAG,IAAA,WAAI,GAAE,CAAA;QACjB,IAAI,CAAC,EAAE,GAAG,gBAAS,EAAE,CAAE,CAAA;IACzB,CAAC;IA/BD;QADC,IAAA,uBAAa,GAAE;;wCACN;IAGV;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACpB;IAGZ;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAAc,EAAE,CAAC;;4CAChC;IAGtB;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAChB;IAGzB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACjB;IAGhC;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAClB;IAG/B;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;gDAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;gDAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;;gDAClC;IAGvB;QADC,IAAA,sBAAY,GAAE;;;;gDAKd;IAjCU,QAAQ;QADpB,IAAA,gBAAM,GAAE;OACI,QAAQ,CAkCpB;IAAD,eAAC;CAAA,AAlCD,IAkCC;AAlCY,4BAAQ;AAoCrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG"}
@@ -6,7 +6,7 @@ export declare class Country {
6
6
  num_code: number;
7
7
  name: string;
8
8
  display_name: string;
9
- region_id: string;
9
+ region_id: string | null;
10
10
  region: Region;
11
11
  }
12
12
  /**
@@ -43,7 +43,7 @@ var Country = /** @class */ (function () {
43
43
  __decorate([
44
44
  (0, typeorm_1.Index)(),
45
45
  (0, typeorm_1.Column)({ nullable: true }),
46
- __metadata("design:type", String)
46
+ __metadata("design:type", Object)
47
47
  ], Country.prototype, "region_id", void 0);
48
48
  __decorate([
49
49
  (0, typeorm_1.ManyToOne)(function () { return region_1.Region; }, function (r) { return r.countries; }),
@@ -1 +1 @@
1
- {"version":3,"file":"country.js","sourceRoot":"","sources":["../../src/models/country.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAOgB;AAEhB,mCAAiC;AAGjC;IAAA;IA8BA,CAAC;IA5BC;QADC,IAAA,gCAAsB,GAAE;;uCACf;IAIV;QAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACvB,IAAA,gBAAM,GAAE;;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CAAC,CAAC,SAAS,EAAX,CAAW,CAAC;QAC3C,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;kCAC1B,eAAM;2CAAA;IA1BH,OAAO;QADnB,IAAA,gBAAM,GAAE;OACI,OAAO,CA2BnB;IAAD,cAAC;CAAA,AA3BD,IA2BC;AA3BY,0BAAO;AA6BpB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG"}
@@ -41,7 +41,9 @@ var CustomerGroup = /** @class */ (function () {
41
41
  __metadata("design:type", Array)
42
42
  ], CustomerGroup.prototype, "customers", void 0);
43
43
  __decorate([
44
- (0, typeorm_1.ManyToMany)(function () { return price_list_1.PriceList; }, function (priceList) { return priceList.customer_groups; }, { onDelete: "CASCADE" }),
44
+ (0, typeorm_1.ManyToMany)(function () { return price_list_1.PriceList; }, function (priceList) { return priceList.customer_groups; }, {
45
+ onDelete: "CASCADE",
46
+ }),
45
47
  __metadata("design:type", Array)
46
48
  ], CustomerGroup.prototype, "price_lists", void 0);
47
49
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"customer-group.js","sourceRoot":"","sources":["../../src/models/customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAUgB;AAChB,6BAA2B;AAC3B,4DAAuE;AACvE,uCAAqC;AACrC,2CAAwC;AAGxC;IAAA;IA4CA,CAAC;IAPS,oCAAY,GAApB;QACE,IAAI,IAAI,CAAC,EAAE,EAAE;YACX,OAAM;SACP;QACD,IAAM,EAAE,GAAG,IAAA,WAAI,GAAE,CAAA;QACjB,IAAI,CAAC,EAAE,GAAG,eAAQ,EAAE,CAAE,CAAA;IACxB,CAAC;IAzCD;QADC,IAAA,uBAAa,GAAE;;6CACN;IAIV;QAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;QACpD,IAAA,gBAAM,GAAE;;+CACG;IASZ;QAPC,IAAA,oBAAU,EACT,cAAM,OAAA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condition";
3
+ export declare class DiscountConditionCustomerGroup {
4
+ customer_group_id: string;
5
+ condition_id: string;
6
+ customer_group?: CustomerGroup;
7
+ discount_condition?: DiscountCondition;
8
+ created_at: Date;
9
+ updated_at: Date;
10
+ metadata: any;
11
+ }
12
+ /**
13
+ * @schema discount_condition_customer_group
14
+ * title: "Product Tag Discount Condition"
15
+ * description: "Associates a discount condition with a customer group"
16
+ * x-resourceId: discount_condition_customer_group
17
+ * properties:
18
+ * customer_group_id:
19
+ * description: "The id of the Product Tag"
20
+ * type: string
21
+ * condition_id:
22
+ * description: "The id of the Discount Condition"
23
+ * type: string
24
+ * created_at:
25
+ * description: "The date with timezone at which the resource was created."
26
+ * type: string
27
+ * format: date-time
28
+ * updated_at:
29
+ * description: "The date with timezone at which the resource was last updated."
30
+ * type: string
31
+ * format: date-time
32
+ * deleted_at:
33
+ * description: "The date with timezone at which the resource was deleted."
34
+ * type: string
35
+ * format: date-time
36
+ * metadata:
37
+ * description: "An optional key-value map with additional information."
38
+ * type: object
39
+ */
@@ -0,0 +1,84 @@
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
+ exports.DiscountConditionCustomerGroup = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var db_aware_column_1 = require("../utils/db-aware-column");
15
+ var customer_group_1 = require("./customer-group");
16
+ var discount_condition_1 = require("./discount-condition");
17
+ var DiscountConditionCustomerGroup = /** @class */ (function () {
18
+ function DiscountConditionCustomerGroup() {
19
+ }
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryColumn)(),
22
+ __metadata("design:type", String)
23
+ ], DiscountConditionCustomerGroup.prototype, "customer_group_id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.PrimaryColumn)(),
26
+ __metadata("design:type", String)
27
+ ], DiscountConditionCustomerGroup.prototype, "condition_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.ManyToOne)(function () { return customer_group_1.CustomerGroup; }, { onDelete: "CASCADE" }),
30
+ (0, typeorm_1.JoinColumn)({ name: "customer_group_id" }),
31
+ __metadata("design:type", customer_group_1.CustomerGroup)
32
+ ], DiscountConditionCustomerGroup.prototype, "customer_group", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.ManyToOne)(function () { return discount_condition_1.DiscountCondition; }, { onDelete: "CASCADE" }),
35
+ (0, typeorm_1.JoinColumn)({ name: "condition_id" }),
36
+ __metadata("design:type", discount_condition_1.DiscountCondition)
37
+ ], DiscountConditionCustomerGroup.prototype, "discount_condition", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
40
+ __metadata("design:type", Date)
41
+ ], DiscountConditionCustomerGroup.prototype, "created_at", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
44
+ __metadata("design:type", Date)
45
+ ], DiscountConditionCustomerGroup.prototype, "updated_at", void 0);
46
+ __decorate([
47
+ (0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
48
+ __metadata("design:type", Object)
49
+ ], DiscountConditionCustomerGroup.prototype, "metadata", void 0);
50
+ DiscountConditionCustomerGroup = __decorate([
51
+ (0, typeorm_1.Entity)()
52
+ ], DiscountConditionCustomerGroup);
53
+ return DiscountConditionCustomerGroup;
54
+ }());
55
+ exports.DiscountConditionCustomerGroup = DiscountConditionCustomerGroup;
56
+ /**
57
+ * @schema discount_condition_customer_group
58
+ * title: "Product Tag Discount Condition"
59
+ * description: "Associates a discount condition with a customer group"
60
+ * x-resourceId: discount_condition_customer_group
61
+ * properties:
62
+ * customer_group_id:
63
+ * description: "The id of the Product Tag"
64
+ * type: string
65
+ * condition_id:
66
+ * description: "The id of the Discount Condition"
67
+ * type: string
68
+ * created_at:
69
+ * description: "The date with timezone at which the resource was created."
70
+ * type: string
71
+ * format: date-time
72
+ * updated_at:
73
+ * description: "The date with timezone at which the resource was last updated."
74
+ * type: string
75
+ * format: date-time
76
+ * deleted_at:
77
+ * description: "The date with timezone at which the resource was deleted."
78
+ * type: string
79
+ * format: date-time
80
+ * metadata:
81
+ * description: "An optional key-value map with additional information."
82
+ * type: object
83
+ */
84
+ //# sourceMappingURL=discount-condition-customer-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discount-condition-customer-group.js","sourceRoot":"","sources":["../../src/models/discount-condition-customer-group.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAOgB;AAChB,4DAAuE;AACvE,mDAAgD;AAChD,2DAAwD;AAGxD;IAAA;IAuBA,CAAC;IArBC;QADC,IAAA,uBAAa,GAAE;;6EACS;IAGzB;QADC,IAAA,uBAAa,GAAE;;wEACI;IAIpB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,8BAAa,EAAb,CAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QACvD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;kCACzB,8BAAa;0EAAA;IAI9B;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;kCAChB,sCAAiB;8EAAA;IAGtC;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;sEAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;sEAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oEACpC;IAtBF,8BAA8B;QAD1C,IAAA,gBAAM,GAAE;OACI,8BAA8B,CAuB1C;IAAD,qCAAC;CAAA,AAvBD,IAuBC;AAvBY,wEAA8B;AAyB3C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
@@ -0,0 +1,39 @@
1
+ import { DiscountCondition } from "./discount-condition";
2
+ import { ProductCollection } from "./product-collection";
3
+ export declare class DiscountConditionProductCollection {
4
+ product_collection_id: string;
5
+ condition_id: string;
6
+ product_collection?: ProductCollection;
7
+ discount_condition?: DiscountCondition;
8
+ created_at: Date;
9
+ updated_at: Date;
10
+ metadata: any;
11
+ }
12
+ /**
13
+ * @schema discount_condition_product_collection
14
+ * title: "Product Collection Discount Condition"
15
+ * description: "Associates a discount condition with a product collection"
16
+ * x-resourceId: discount_condition_product_collection
17
+ * properties:
18
+ * product_collection_id:
19
+ * description: "The id of the Product Collection"
20
+ * type: string
21
+ * condition_id:
22
+ * description: "The id of the Discount Condition"
23
+ * type: string
24
+ * created_at:
25
+ * description: "The date with timezone at which the resource was created."
26
+ * type: string
27
+ * format: date-time
28
+ * updated_at:
29
+ * description: "The date with timezone at which the resource was last updated."
30
+ * type: string
31
+ * format: date-time
32
+ * deleted_at:
33
+ * description: "The date with timezone at which the resource was deleted."
34
+ * type: string
35
+ * format: date-time
36
+ * metadata:
37
+ * description: "An optional key-value map with additional information."
38
+ * type: object
39
+ */
@@ -0,0 +1,84 @@
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
+ exports.DiscountConditionProductCollection = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var db_aware_column_1 = require("../utils/db-aware-column");
15
+ var discount_condition_1 = require("./discount-condition");
16
+ var product_collection_1 = require("./product-collection");
17
+ var DiscountConditionProductCollection = /** @class */ (function () {
18
+ function DiscountConditionProductCollection() {
19
+ }
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryColumn)(),
22
+ __metadata("design:type", String)
23
+ ], DiscountConditionProductCollection.prototype, "product_collection_id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.PrimaryColumn)(),
26
+ __metadata("design:type", String)
27
+ ], DiscountConditionProductCollection.prototype, "condition_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.ManyToOne)(function () { return product_collection_1.ProductCollection; }, { onDelete: "CASCADE" }),
30
+ (0, typeorm_1.JoinColumn)({ name: "product_collection_id" }),
31
+ __metadata("design:type", product_collection_1.ProductCollection)
32
+ ], DiscountConditionProductCollection.prototype, "product_collection", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.ManyToOne)(function () { return discount_condition_1.DiscountCondition; }, { onDelete: "CASCADE" }),
35
+ (0, typeorm_1.JoinColumn)({ name: "condition_id" }),
36
+ __metadata("design:type", discount_condition_1.DiscountCondition)
37
+ ], DiscountConditionProductCollection.prototype, "discount_condition", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
40
+ __metadata("design:type", Date)
41
+ ], DiscountConditionProductCollection.prototype, "created_at", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
44
+ __metadata("design:type", Date)
45
+ ], DiscountConditionProductCollection.prototype, "updated_at", void 0);
46
+ __decorate([
47
+ (0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
48
+ __metadata("design:type", Object)
49
+ ], DiscountConditionProductCollection.prototype, "metadata", void 0);
50
+ DiscountConditionProductCollection = __decorate([
51
+ (0, typeorm_1.Entity)()
52
+ ], DiscountConditionProductCollection);
53
+ return DiscountConditionProductCollection;
54
+ }());
55
+ exports.DiscountConditionProductCollection = DiscountConditionProductCollection;
56
+ /**
57
+ * @schema discount_condition_product_collection
58
+ * title: "Product Collection Discount Condition"
59
+ * description: "Associates a discount condition with a product collection"
60
+ * x-resourceId: discount_condition_product_collection
61
+ * properties:
62
+ * product_collection_id:
63
+ * description: "The id of the Product Collection"
64
+ * type: string
65
+ * condition_id:
66
+ * description: "The id of the Discount Condition"
67
+ * type: string
68
+ * created_at:
69
+ * description: "The date with timezone at which the resource was created."
70
+ * type: string
71
+ * format: date-time
72
+ * updated_at:
73
+ * description: "The date with timezone at which the resource was last updated."
74
+ * type: string
75
+ * format: date-time
76
+ * deleted_at:
77
+ * description: "The date with timezone at which the resource was deleted."
78
+ * type: string
79
+ * format: date-time
80
+ * metadata:
81
+ * description: "An optional key-value map with additional information."
82
+ * type: object
83
+ */
84
+ //# sourceMappingURL=discount-condition-product-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discount-condition-product-collection.js","sourceRoot":"","sources":["../../src/models/discount-condition-product-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAOgB;AAChB,4DAAuE;AACvE,2DAAwD;AACxD,2DAAwD;AAGxD;IAAA;IAuBA,CAAC;IArBC;QADC,IAAA,uBAAa,GAAE;;qFACa;IAG7B;QADC,IAAA,uBAAa,GAAE;;4EACI;IAIpB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;kCACzB,sCAAiB;kFAAA;IAItC;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;kCAChB,sCAAiB;kFAAA;IAGtC;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;0EAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;0EAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wEACpC;IAtBF,kCAAkC;QAD9C,IAAA,gBAAM,GAAE;OACI,kCAAkC,CAuB9C;IAAD,yCAAC;CAAA,AAvBD,IAuBC;AAvBY,gFAAkC;AAyB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
@@ -0,0 +1,39 @@
1
+ import { DiscountCondition } from "./discount-condition";
2
+ import { ProductTag } from "./product-tag";
3
+ export declare class DiscountConditionProductTag {
4
+ product_tag_id: string;
5
+ condition_id: string;
6
+ product_tag?: ProductTag;
7
+ discount_condition?: DiscountCondition;
8
+ created_at: Date;
9
+ updated_at: Date;
10
+ metadata: any;
11
+ }
12
+ /**
13
+ * @schema discount_condition_product_tag
14
+ * title: "Product Tag Discount Condition"
15
+ * description: "Associates a discount condition with a product tag"
16
+ * x-resourceId: discount_condition_product_tag
17
+ * properties:
18
+ * product_tag_id:
19
+ * description: "The id of the Product Tag"
20
+ * type: string
21
+ * condition_id:
22
+ * description: "The id of the Discount Condition"
23
+ * type: string
24
+ * created_at:
25
+ * description: "The date with timezone at which the resource was created."
26
+ * type: string
27
+ * format: date-time
28
+ * updated_at:
29
+ * description: "The date with timezone at which the resource was last updated."
30
+ * type: string
31
+ * format: date-time
32
+ * deleted_at:
33
+ * description: "The date with timezone at which the resource was deleted."
34
+ * type: string
35
+ * format: date-time
36
+ * metadata:
37
+ * description: "An optional key-value map with additional information."
38
+ * type: object
39
+ */