@lyxa.ai/marketing 1.0.60 → 1.0.61

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 (378) hide show
  1. package/dist/lib/event/event-initializations.d.ts.map +1 -1
  2. package/dist/lib/event/event-initializations.js +2 -0
  3. package/dist/lib/event/event-initializations.js.map +1 -1
  4. package/dist/lib/event/event-listeners/event-listeners.d.ts +2 -0
  5. package/dist/lib/event/event-listeners/event-listeners.d.ts.map +1 -1
  6. package/dist/lib/event/event-listeners/event-listeners.js +69 -12
  7. package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
  8. package/dist/lib/event/events/marketing-product-seed.event.d.ts +1 -2
  9. package/dist/lib/event/events/marketing-product-seed.event.d.ts.map +1 -1
  10. package/dist/lib/event/events/marketing-product-seed.event.js.map +1 -1
  11. package/dist/lib/event/events/marketing-product-sync.event.d.ts +11 -0
  12. package/dist/lib/event/events/marketing-product-sync.event.d.ts.map +1 -0
  13. package/dist/lib/event/events/marketing-product-sync.event.js +12 -0
  14. package/dist/lib/event/events/marketing-product-sync.event.js.map +1 -0
  15. package/dist/lib/index.d.ts +8175 -33
  16. package/dist/lib/index.d.ts.map +1 -1
  17. package/dist/lib/index.js +4 -0
  18. package/dist/lib/index.js.map +1 -1
  19. package/dist/lib/modules/coupon/routers/coupon.router.d.ts +7630 -2
  20. package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  21. package/dist/lib/modules/coupon/routers/coupon.router.js +0 -7
  22. package/dist/lib/modules/coupon/routers/coupon.router.js.map +1 -1
  23. package/dist/lib/modules/coupon/services/coupon.service.d.ts +0 -1
  24. package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
  25. package/dist/lib/modules/coupon/services/coupon.service.js +3 -4
  26. package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
  27. package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +2 -2
  28. package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js.map +1 -1
  29. package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +6 -6
  30. package/dist/lib/modules/coupon/validations/coupon.validation.js +2 -2
  31. package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
  32. package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
  33. package/dist/lib/modules/coupon/validations/create-coupon.validation.js +4 -1
  34. package/dist/lib/modules/coupon/validations/create-coupon.validation.js.map +1 -1
  35. package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
  36. package/dist/lib/modules/deal-setting/services/deal-setting.service.js +4 -1
  37. package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
  38. package/dist/lib/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
  39. package/dist/lib/modules/featured-setting/services/featured-setting.service.js +3 -0
  40. package/dist/lib/modules/featured-setting/services/featured-setting.service.js.map +1 -1
  41. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
  42. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
  43. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +11 -0
  44. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
  45. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
  46. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js +6 -0
  47. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js.map +1 -1
  48. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
  49. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
  50. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +2 -6
  51. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -1
  52. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
  53. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
  54. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +22 -3
  55. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -1
  56. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
  57. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
  58. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js +12 -0
  59. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js.map +1 -1
  60. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
  61. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
  62. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +19 -1
  63. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -1
  64. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +8 -1
  65. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  66. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +64 -1
  67. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -1
  68. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
  69. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
  70. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js +66 -8
  71. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js.map +1 -1
  72. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
  73. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  74. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +37 -19
  75. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
  76. package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +249 -18
  77. package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
  78. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
  79. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  80. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +15 -3
  81. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js.map +1 -1
  82. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
  83. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js +1 -1
  84. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js.map +1 -1
  85. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +24 -3
  86. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  87. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +19 -1
  88. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -1
  89. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
  90. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  91. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +43 -0
  92. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -1
  93. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +195 -10
  94. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
  95. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js +29 -0
  96. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -1
  97. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +428 -33
  98. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  99. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +16 -6
  100. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
  101. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +7 -4
  102. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  103. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js +42 -7
  104. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js.map +1 -1
  105. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +14 -3
  106. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  107. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js +76 -16
  108. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
  109. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
  110. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
  111. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js +75 -0
  112. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js.map +1 -0
  113. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
  114. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
  115. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js +83 -0
  116. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js.map +1 -0
  117. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
  118. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
  119. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +29 -0
  120. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -1
  121. package/dist/lib/modules/marketing/routers/marketing.router.d.ts +14 -0
  122. package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  123. package/dist/lib/modules/marketing/routers/marketing.router.js +5 -0
  124. package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
  125. package/dist/lib/modules/marketing/services/index.d.ts +3 -0
  126. package/dist/lib/modules/marketing/services/index.d.ts.map +1 -1
  127. package/dist/lib/modules/marketing/services/index.js +3 -0
  128. package/dist/lib/modules/marketing/services/index.js.map +1 -1
  129. package/dist/lib/modules/marketing/services/marketing-conflict.repository.d.ts +9 -0
  130. package/dist/lib/modules/marketing/services/marketing-conflict.repository.d.ts.map +1 -0
  131. package/dist/lib/modules/marketing/services/marketing-conflict.repository.js +63 -0
  132. package/dist/lib/modules/marketing/services/marketing-conflict.repository.js.map +1 -0
  133. package/dist/lib/modules/marketing/services/marketing-conflict.service.d.ts +27 -0
  134. package/dist/lib/modules/marketing/services/marketing-conflict.service.d.ts.map +1 -0
  135. package/dist/lib/modules/marketing/services/marketing-conflict.service.js +135 -0
  136. package/dist/lib/modules/marketing/services/marketing-conflict.service.js.map +1 -0
  137. package/dist/lib/modules/marketing/services/marketing.service.d.ts +7 -2
  138. package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
  139. package/dist/lib/modules/marketing/services/marketing.service.js +97 -51
  140. package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
  141. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +2 -3
  142. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  143. package/dist/lib/modules/marketing/services/product-marketing.service.js +42 -13
  144. package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
  145. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.d.ts +14 -0
  146. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.d.ts.map +1 -0
  147. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.js +82 -0
  148. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.js.map +1 -0
  149. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.d.ts +11 -0
  150. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.d.ts.map +1 -0
  151. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.js +99 -0
  152. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.js.map +1 -0
  153. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.d.ts +9 -0
  154. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.d.ts.map +1 -0
  155. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.js +69 -0
  156. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.js.map +1 -0
  157. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts +31 -0
  158. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts.map +1 -0
  159. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.js +123 -0
  160. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.js.map +1 -0
  161. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
  162. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js +95 -27
  163. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
  164. package/dist/lib/modules/marketing/validations/all-marketings.validation.d.ts.map +1 -1
  165. package/dist/lib/modules/marketing/validations/all-marketings.validation.js +3 -0
  166. package/dist/lib/modules/marketing/validations/all-marketings.validation.js.map +1 -1
  167. package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +3 -3
  168. package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +3 -3
  169. package/dist/lib/modules/marketing/validations/index.d.ts +1 -0
  170. package/dist/lib/modules/marketing/validations/index.d.ts.map +1 -1
  171. package/dist/lib/modules/marketing/validations/index.js +1 -0
  172. package/dist/lib/modules/marketing/validations/index.js.map +1 -1
  173. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +17 -0
  174. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  175. package/dist/lib/modules/marketing/validations/marketing.validation.js +7 -1
  176. package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
  177. package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
  178. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.d.ts +617 -0
  179. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -0
  180. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js +119 -0
  181. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js.map +1 -0
  182. package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
  183. package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts +0 -1
  184. package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
  185. package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js +2 -49
  186. package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js.map +1 -1
  187. package/dist/lib/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
  188. package/dist/lib/modules/spend-to-get-history/routers/index.d.ts +2 -0
  189. package/dist/lib/modules/spend-to-get-history/routers/index.d.ts.map +1 -0
  190. package/dist/lib/modules/spend-to-get-history/routers/index.js +18 -0
  191. package/dist/lib/modules/spend-to-get-history/routers/index.js.map +1 -0
  192. package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js +62 -0
  193. package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js.map +1 -0
  194. package/dist/lib/modules/spend-to-get-history/services/index.d.ts +2 -0
  195. package/dist/lib/modules/spend-to-get-history/services/index.d.ts.map +1 -0
  196. package/dist/lib/modules/spend-to-get-history/services/index.js +18 -0
  197. package/dist/lib/modules/spend-to-get-history/services/index.js.map +1 -0
  198. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +24 -0
  199. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts.map +1 -0
  200. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.js +136 -0
  201. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.js.map +1 -0
  202. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +24 -0
  203. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -0
  204. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js +97 -0
  205. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js.map +1 -0
  206. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts +271 -0
  207. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -0
  208. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.js +62 -0
  209. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.js.map +1 -0
  210. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts +24 -0
  211. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -0
  212. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.js +116 -0
  213. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.js.map +1 -0
  214. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +232 -0
  215. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -0
  216. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js +30 -0
  217. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js.map +1 -0
  218. package/dist/lib/modules/spend-to-get-history/validations/index.d.ts +2 -0
  219. package/dist/lib/modules/spend-to-get-history/validations/index.d.ts.map +1 -0
  220. package/dist/lib/modules/spend-to-get-history/validations/index.js +18 -0
  221. package/dist/lib/modules/spend-to-get-history/validations/index.js.map +1 -0
  222. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +232 -0
  223. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +1 -0
  224. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js +30 -0
  225. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js.map +1 -0
  226. package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
  227. package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
  228. package/dist/lib/modules/tournament/match/events/match-ended.consumer.js +15 -0
  229. package/dist/lib/modules/tournament/match/events/match-ended.consumer.js.map +1 -0
  230. package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts +14 -0
  231. package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
  232. package/dist/lib/modules/tournament/match/events/match-ended.event.js +12 -0
  233. package/dist/lib/modules/tournament/match/events/match-ended.event.js.map +1 -0
  234. package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts +10 -0
  235. package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
  236. package/dist/lib/modules/tournament/notification/jobs/notification.producer.js +23 -0
  237. package/dist/lib/modules/tournament/notification/jobs/notification.producer.js.map +1 -0
  238. package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts +9 -0
  239. package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
  240. package/dist/lib/modules/tournament/notification/jobs/notification.worker.js +82 -0
  241. package/dist/lib/modules/tournament/notification/jobs/notification.worker.js.map +1 -0
  242. package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
  243. package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
  244. package/dist/lib/modules/tournament/notification/notification.schedule.config.js +15 -0
  245. package/dist/lib/modules/tournament/notification/notification.schedule.config.js.map +1 -0
  246. package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
  247. package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
  248. package/dist/lib/modules/tournament/notification/notification.scheduler.service.js +73 -0
  249. package/dist/lib/modules/tournament/notification/notification.scheduler.service.js.map +1 -0
  250. package/dist/types/event/event-initializations.d.ts.map +1 -1
  251. package/dist/types/event/event-listeners/event-listeners.d.ts +2 -0
  252. package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
  253. package/dist/types/event/events/marketing-product-seed.event.d.ts +1 -2
  254. package/dist/types/event/events/marketing-product-seed.event.d.ts.map +1 -1
  255. package/dist/types/event/events/marketing-product-sync.event.d.ts +11 -0
  256. package/dist/types/event/events/marketing-product-sync.event.d.ts.map +1 -0
  257. package/dist/types/events/event-initializations.d.ts +2 -0
  258. package/dist/types/events/event-initializations.d.ts.map +1 -0
  259. package/dist/types/index.d.ts +8175 -33
  260. package/dist/types/index.d.ts.map +1 -1
  261. package/dist/types/modules/coupon/routers/coupon.router.d.ts +7630 -2
  262. package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  263. package/dist/types/modules/coupon/services/coupon.service.d.ts +0 -1
  264. package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
  265. package/dist/types/modules/coupon/validations/coupon.validation.d.ts +6 -6
  266. package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
  267. package/dist/types/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
  268. package/dist/types/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
  269. package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
  270. package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
  271. package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
  272. package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
  273. package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
  274. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
  275. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
  276. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
  277. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
  278. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
  279. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
  280. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +8 -1
  281. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  282. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
  283. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
  284. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
  285. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  286. package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +249 -18
  287. package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
  288. package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
  289. package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  290. package/dist/types/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
  291. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +24 -3
  292. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  293. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
  294. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  295. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +195 -10
  296. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
  297. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
  298. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
  299. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +428 -33
  300. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  301. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +7 -4
  302. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  303. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +14 -3
  304. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  305. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
  306. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
  307. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
  308. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
  309. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
  310. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
  311. package/dist/types/modules/marketing/routers/marketing.router.d.ts +14 -0
  312. package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  313. package/dist/types/modules/marketing/services/index.d.ts +3 -0
  314. package/dist/types/modules/marketing/services/index.d.ts.map +1 -1
  315. package/dist/types/modules/marketing/services/marketing-conflict.repository.d.ts +9 -0
  316. package/dist/types/modules/marketing/services/marketing-conflict.repository.d.ts.map +1 -0
  317. package/dist/types/modules/marketing/services/marketing-conflict.service.d.ts +41 -0
  318. package/dist/types/modules/marketing/services/marketing-conflict.service.d.ts.map +1 -0
  319. package/dist/types/modules/marketing/services/marketing.service.d.ts +7 -2
  320. package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
  321. package/dist/types/modules/marketing/services/product-marketing.service.d.ts +7 -3
  322. package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  323. package/dist/types/modules/marketing/services/spend-to-get-marketing.repository.d.ts +14 -0
  324. package/dist/types/modules/marketing/services/spend-to-get-marketing.repository.d.ts.map +1 -0
  325. package/dist/types/modules/marketing/services/spend-to-get-marketing.service.d.ts +20 -0
  326. package/dist/types/modules/marketing/services/spend-to-get-marketing.service.d.ts.map +1 -0
  327. package/dist/types/modules/marketing/services/spend-to-get-progress.repository.d.ts +9 -0
  328. package/dist/types/modules/marketing/services/spend-to-get-progress.repository.d.ts.map +1 -0
  329. package/dist/types/modules/marketing/services/spend-to-get-progress.service.d.ts +37 -0
  330. package/dist/types/modules/marketing/services/spend-to-get-progress.service.d.ts.map +1 -0
  331. package/dist/types/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
  332. package/dist/types/modules/marketing/validations/all-marketings.validation.d.ts.map +1 -1
  333. package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +3 -3
  334. package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +3 -3
  335. package/dist/types/modules/marketing/validations/index.d.ts +1 -0
  336. package/dist/types/modules/marketing/validations/index.d.ts.map +1 -1
  337. package/dist/types/modules/marketing/validations/marketing.validation.d.ts +17 -0
  338. package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  339. package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
  340. package/dist/types/modules/marketing/validations/spend-to-get-marketing.validation.d.ts +630 -0
  341. package/dist/types/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -0
  342. package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
  343. package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts +0 -5
  344. package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
  345. package/dist/types/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
  346. package/dist/types/modules/spend-to-get-history/routers/index.d.ts +2 -0
  347. package/dist/types/modules/spend-to-get-history/routers/index.d.ts.map +1 -0
  348. package/dist/types/modules/spend-to-get-history/services/index.d.ts +2 -0
  349. package/dist/types/modules/spend-to-get-history/services/index.d.ts.map +1 -0
  350. package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +56 -0
  351. package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts.map +1 -0
  352. package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +24 -0
  353. package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -0
  354. package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts +271 -0
  355. package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -0
  356. package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts +56 -0
  357. package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -0
  358. package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +241 -0
  359. package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -0
  360. package/dist/types/modules/spend-to-get-history/validations/index.d.ts +2 -0
  361. package/dist/types/modules/spend-to-get-history/validations/index.d.ts.map +1 -0
  362. package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +241 -0
  363. package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +1 -0
  364. package/dist/types/modules/tournament/config/tournament-config.validation.d.ts +201 -0
  365. package/dist/types/modules/tournament/config/tournament-config.validation.d.ts.map +1 -0
  366. package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
  367. package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
  368. package/dist/types/modules/tournament/match/events/match-ended.event.d.ts +14 -0
  369. package/dist/types/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
  370. package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts +10 -0
  371. package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
  372. package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts +9 -0
  373. package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
  374. package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
  375. package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
  376. package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
  377. package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
  378. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"synchronize-product-marketing.service.js","sourceRoot":"/","sources":["modules/marketing/services/synchronize-product-marketing.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,wCAA6C;AAG7C,sEAMmD;AACnD,4GAAyG;AACz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CAAC,kCAAkC,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { getLibraries } from '@lyxa.ai/core';\nimport { mongoose } from '@typegoose/typegoose';\nimport { SoftDeleteModel } from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport {\n\tProductModel,\n\tProduct as Model,\n\tSetting,\n\tProductMarketingModel,\n\tProductMarketing,\n} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { addProductMarketingInfo } from '@lyxa.ai/core/dist/utilities/pipelines/product-pipeline-stages';\nimport { publishAllProductsProductMarketingInfoProcessEvent } from '@lyxa.ai/core/dist/utilities/events-common-methods';\nimport { SynchronizeAllProductsProductMarketingInfoDTO } from '@lyxa.ai/core/dist/libraries/event/events/sync-all-products-product-marketing-info-event';\n\nconst TAG = 'marketing.seed.entire-menu';\n\n@Service()\nexport class SynchronizeProductMarketingService {\n\tprivate productModel: typeof ProductModel & SoftDeleteModel<Model>;\n\tprivate productMarketingModel: typeof ProductMarketingModel & SoftDeleteModel<ProductMarketing>;\n\n\tconstructor() {\n\t\tthis.productModel = ProductModel as typeof ProductModel & SoftDeleteModel<Model>;\n\t\tthis.productMarketingModel = ProductMarketingModel as typeof ProductMarketingModel &\n\t\t\tSoftDeleteModel<ProductMarketing>;\n\t}\n\n\tpublic async publishAllProductsProductMarketingInfoProcessEvent() {\n\t\tawait publishAllProductsProductMarketingInfoProcessEvent({});\n\t\treturn 'Processing all products product marketing information! ';\n\t}\n\n\tpublic processAllProductsProductMarketingInfoEvent(\n\t\tpayload: SynchronizeAllProductsProductMarketingInfoDTO\n\t): string {\n\t\tthis.syncAllProductsMarketingInfo();\n\t\treturn 'Processing all products product marketing information! ';\n\t}\n\n\tpublic syncAllProductsMarketingInfo = async (): Promise<any> => {\n\t\tconst logger = getLibraries().getLoggerKit();\n\t\tconst CHUNK_SIZE = 500;\n\n\t\tconst cursor = this.productModel.find().select('_id shop price priceBreakdowns').lean().cursor();\n\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\n\t\tlet batch: any[] = [];\n\t\tlet batchIndex = 0;\n\t\tlet totalProcessed = 0;\n\n\t\tfor await (const product of cursor) {\n\t\t\tbatch.push(product);\n\n\t\t\tif (batch.length === CHUNK_SIZE) {\n\t\t\t\tbatchIndex++;\n\t\t\t\ttotalProcessed += batch.length;\n\t\t\t\tawait this.processProductsBatch(batch, exchangeRate, secondaryCurrencyName, batchIndex);\n\t\t\t\tbatch = [];\n\t\t\t}\n\t\t}\n\n\t\tif (batch.length) {\n\t\t\tbatchIndex++;\n\t\t\ttotalProcessed += batch.length;\n\t\t\tawait this.processProductsBatch(batch, exchangeRate, secondaryCurrencyName, batchIndex);\n\t\t}\n\n\t\tlogger.debug('full product marketing sync complete', {\n\t\t\ttag: TAG,\n\t\t\tdata: { totalProducts: totalProcessed },\n\t\t});\n\n\t\treturn 'Bulk product marketing info sync completed';\n\t};\n\n\tprivate async processProductsBatch(\n\t\tproductsBatch: any[],\n\t\texchangeRate: number,\n\t\tsecondaryCurrencyName: string,\n\t\tbatchIndex: number\n\t): Promise<void> {\n\t\tconst productIds = productsBatch.map(p => p._id);\n\n\t\tconst results = await this.productModel.aggregate([\n\t\t\t{ $match: { _id: { $in: productIds } } },\n\t\t\t...addProductMarketingInfo(exchangeRate, secondaryCurrencyName),\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$_id',\n\t\t\t\t\tproductMarketingInfo: { $push: '$productMarketing' },\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tconst bulkOps = results.map(r => ({\n\t\t\tupdateOne: {\n\t\t\t\tfilter: { _id: r._id },\n\t\t\t\tupdate: {\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tproductMarketingInfo: (r.productMarketingInfo ?? []).filter(Boolean).map((pm: any) => ({\n\t\t\t\t\t\t\tmarketing: pm.marketingInfo,\n\t\t\t\t\t\t\tisBuy1Get1: pm.isBuy1Get1,\n\t\t\t\t\t\t\tvalueType: pm.valueType,\n\t\t\t\t\t\t\tvalue: pm.value,\n\t\t\t\t\t\t\tsecondaryCurrencyValue: pm.secondaryCurrencyValue,\n\t\t\t\t\t\t\tlabel: pm.label,\n\t\t\t\t\t\t\tisAppliedByCompany: pm.isAppliedByCompany ?? false,\n\t\t\t\t\t\t})),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}));\n\n\t\tif (bulkOps.length) {\n\t\t\tawait this.productModel.bulkWrite(bulkOps, { ordered: false });\n\t\t}\n\t}\n\n\tprivate async getProductMarketingInfoByProductId(productId: mongoose.Types.ObjectId): Promise<any[]> {\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\n\t\tconst result = await this.productModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: { _id: productId },\n\t\t\t},\n\t\t\t...addProductMarketingInfo(exchangeRate, secondaryCurrencyName),\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$_id',\n\t\t\t\t\tproductMarketingInfo: {\n\t\t\t\t\t\t$push: '$productMarketing',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tconst productMarketingInfo = result?.[0]?.productMarketing\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tmarketing: result?.[0].productMarketing.marketingInfo,\n\t\t\t\t\t\tisBuy1Get1: result?.[0].productMarketing.isBuy1Get1,\n\t\t\t\t\t\tvalueType: result?.[0].productMarketing.valueType,\n\t\t\t\t\t\tvalue: result?.[0].productMarketing.value,\n\t\t\t\t\t\tsecondaryCurrencyValue: result?.[0].productMarketing.secondaryCurrencyValue,\n\t\t\t\t\t\tlabel: result?.[0].productMarketing.label,\n\t\t\t\t\t\tisAppliedByCompany: result?.[0].productMarketing.isAppliedByCompany ?? false,\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t: [];\n\n\t\treturn productMarketingInfo;\n\t}\n\n\tpublic async syncProductMarketingInfoByProductId(productId: mongoose.Types.ObjectId) {\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\t\tconst result = await this.productModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t_id: productId,\n\t\t\t\t},\n\t\t\t},\n\t\t\t...addProductMarketingInfo(exchangeRate, secondaryCurrencyName),\n\t\t]);\n\n\t\tconst productMarketingInfo = (result || [])\n\t\t\t.filter(item => item?.productMarketing)\n\t\t\t.map(item => ({\n\t\t\t\tmarketing: item.productMarketing.marketingInfo,\n\t\t\t\tisBuy1Get1: item.productMarketing.isBuy1Get1,\n\t\t\t\tvalueType: item.productMarketing.valueType,\n\t\t\t\tvalue: item.productMarketing.value,\n\t\t\t\tsecondaryCurrencyValue: item.productMarketing.secondaryCurrencyValue,\n\t\t\t\tlabel: item.productMarketing.label,\n\t\t\t\tisAppliedByCompany: item.productMarketing.isAppliedByCompany ?? false,\n\t\t\t}));\n\n\t\tawait this.productModel.updateOne(\n\t\t\t{ _id: productId },\n\t\t\t{\n\t\t\t\t$set: {\n\t\t\t\t\tproductMarketingInfo,\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\treturn 'Synchronized product marketing info';\n\t}\n\n\tpublic async syncProductMarketingInfoByProductIds(productIds: mongoose.Types.ObjectId[]) {\n\t\tif (!productIds.length) return 'No products to sync';\n\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\n\t\tconst BATCH_SIZE = 500;\n\t\tconst results: any[] = [];\n\t\tconst totalBatches = Math.ceil(productIds.length / BATCH_SIZE);\n\n\t\tfor (let i = 0; i < productIds.length; i += BATCH_SIZE) {\n\t\t\tconst batchIds = productIds.slice(i, i + BATCH_SIZE);\n\n\t\t\tconst batchResults = await this.productModel.aggregate([\n\t\t\t\t{\n\t\t\t\t\t$match: {\n\t\t\t\t\t\t_id: { $in: batchIds },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...addProductMarketingInfo(exchangeRate, secondaryCurrencyName),\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: '$_id',\n\t\t\t\t\t\tproductMarketingInfo: {\n\t\t\t\t\t\t\t$push: '$productMarketing',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]);\n\n\t\t\tresults.push(...batchResults);\n\t\t}\n\n\t\tif (!results.length) return 'No matching products found';\n\n\t\tconst bulkOps = results.map(product => {\n\t\t\tconst productMarketingInfo = (product.productMarketingInfo || []).map((pm: any) => ({\n\t\t\t\tmarketing: pm.marketingInfo,\n\t\t\t\tisBuy1Get1: pm.isBuy1Get1,\n\t\t\t\tvalueType: pm.valueType,\n\t\t\t\tvalue: pm.value,\n\t\t\t\tsecondaryCurrencyValue: pm.secondaryCurrencyValue,\n\t\t\t\tlabel: pm.label,\n\t\t\t\tisAppliedByCompany: pm.isAppliedByCompany ?? false,\n\t\t\t}));\n\n\t\t\treturn {\n\t\t\t\tupdateOne: {\n\t\t\t\t\tfilter: { _id: product._id },\n\t\t\t\t\tupdate: {\n\t\t\t\t\t\t$set: { productMarketingInfo },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t});\n\n\t\tawait this.productModel.bulkWrite(bulkOps);\n\n\t\treturn `Synchronized product marketing info for ${bulkOps.length} products`;\n\t}\n\n\tpublic async syncProductMarketingInfoByMarketingIds(marketingIds: mongoose.Types.ObjectId[]) {\n\t\tif (!marketingIds.length) return 'No marketings to sync';\n\n\t\tconst productsToUpdate = await this.productMarketingModel\n\t\t\t.find({ marketing: { $in: marketingIds } })\n\t\t\t.select('product')\n\t\t\t.lean();\n\t\tif (!productsToUpdate.length) return 'No matching products found';\n\n\t\tconst productIds = productsToUpdate.map(p => p.product._id);\n\t\treturn await this.syncProductMarketingInfoByProductIds(productIds);\n\t}\n}\n\nexport const synchronizeProductMarketingService = Container.get(SynchronizeProductMarketingService);\n"]}
1
+ {"version":3,"file":"synchronize-product-marketing.service.js","sourceRoot":"/","sources":["modules/marketing/services/synchronize-product-marketing.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,wCAA6C;AAG7C,sEAMmD;AACnD,4GAAyG;AACzG,gHAAkH;AAClH,4DAA6E;AAC7E,8FAAwH;AAGxH,MAAM,GAAG,GAAG,4BAA4B,CAAC;AAGlC,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IACtC,YAAY,CAA+C;IAC3D,qBAAqB,CAAmE;IAEhG;QACC,IAAI,CAAC,YAAY,GAAG,qBAA4D,CAAC;QACjF,IAAI,CAAC,qBAAqB,GAAG,8BACK,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,kDAAkD;QAC9D,MAAM,IAAA,0EAAkD,EAAC,EAAE,CAAC,CAAC;QAC7D,OAAO,yDAAyD,CAAC;IAClE,CAAC;IAEM,2CAA2C,CACjD,OAAsD;QAEtD,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,OAAO,yDAAyD,CAAC;IAClE,CAAC;IAEM,4BAA4B,GAAG,KAAK,IAAkB,EAAE;QAC9D,MAAM,MAAM,GAAG,IAAA,mBAAY,GAAE,CAAC,YAAY,EAA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,OAAO,4BAA4B,CAAC;QAElE,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5D,OAAO,MAAM,IAAI,CAAC,oCAAoC,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;CACD,CAAA;AAnUY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,gBAAO,GAAE;;GACG,kCAAkC,CAmU9C;AAEY,QAAA,kCAAkC,GAAG,gBAAS,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { getLibraries } from '@lyxa.ai/core';\nimport { mongoose } from '@typegoose/typegoose';\nimport { SoftDeleteModel } from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport {\n\tProductModel,\n\tProduct as Model,\n\tSetting,\n\tProductMarketingModel,\n\tProductMarketing,\n} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { addProductMarketingInfo } from '@lyxa.ai/core/dist/utilities/pipelines/product-pipeline-stages';\nimport { getRoundSecondaryCurrencyStage } from '@lyxa.ai/core/dist/utilities/pipelines/common-pipeline-functions';\nimport { MarketingType, ValueType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { publishAllProductsProductMarketingInfoProcessEvent } from '@lyxa.ai/core/dist/utilities/events-common-methods';\nimport { SynchronizeAllProductsProductMarketingInfoDTO } from '@lyxa.ai/core/dist/libraries/event/events/sync-all-products-product-marketing-info-event';\n\nconst TAG = 'marketing.seed.entire-menu';\n\n@Service()\nexport class SynchronizeProductMarketingService {\n\tprivate productModel: typeof ProductModel & SoftDeleteModel<Model>;\n\tprivate productMarketingModel: typeof ProductMarketingModel & SoftDeleteModel<ProductMarketing>;\n\n\tconstructor() {\n\t\tthis.productModel = ProductModel as typeof ProductModel & SoftDeleteModel<Model>;\n\t\tthis.productMarketingModel = ProductMarketingModel as typeof ProductMarketingModel &\n\t\t\tSoftDeleteModel<ProductMarketing>;\n\t}\n\n\tpublic async publishAllProductsProductMarketingInfoProcessEvent() {\n\t\tawait publishAllProductsProductMarketingInfoProcessEvent({});\n\t\treturn 'Processing all products product marketing information! ';\n\t}\n\n\tpublic processAllProductsProductMarketingInfoEvent(\n\t\tpayload: SynchronizeAllProductsProductMarketingInfoDTO\n\t): string {\n\t\tthis.syncAllProductsMarketingInfo();\n\t\treturn 'Processing all products product marketing information! ';\n\t}\n\n\tpublic syncAllProductsMarketingInfo = async (): Promise<any> => {\n\t\tconst logger = getLibraries().getLoggerKit();\n\t\tconst CHUNK_SIZE = 500;\n\n\t\tconst cursor = this.productModel.find().select('_id shop price priceBreakdowns').lean().cursor();\n\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\n\t\tlet batch: any[] = [];\n\t\tlet batchIndex = 0;\n\t\tlet totalProcessed = 0;\n\n\t\tfor await (const product of cursor) {\n\t\t\tbatch.push(product);\n\n\t\t\tif (batch.length === CHUNK_SIZE) {\n\t\t\t\tbatchIndex++;\n\t\t\t\ttotalProcessed += batch.length;\n\t\t\t\tawait this.processProductsBatch(batch, exchangeRate, secondaryCurrencyName, batchIndex);\n\t\t\t\tbatch = [];\n\t\t\t}\n\t\t}\n\n\t\tif (batch.length) {\n\t\t\tbatchIndex++;\n\t\t\ttotalProcessed += batch.length;\n\t\t\tawait this.processProductsBatch(batch, exchangeRate, secondaryCurrencyName, batchIndex);\n\t\t}\n\n\t\tlogger.debug('full product marketing sync complete', {\n\t\t\ttag: TAG,\n\t\t\tdata: { totalProducts: totalProcessed },\n\t\t});\n\n\t\treturn 'Bulk product marketing info sync completed';\n\t};\n\n\tprivate async processProductsBatch(\n\t\tproductsBatch: any[],\n\t\texchangeRate: number,\n\t\tsecondaryCurrencyName: string,\n\t\tbatchIndex: number\n\t): Promise<void> {\n\t\tconst productIds = productsBatch.map(p => p._id);\n\n\t\tconst results = await this.productModel.aggregate([\n\t\t\t{ $match: { _id: { $in: productIds } } },\n\t\t\t...addProductMarketingInfo(exchangeRate, secondaryCurrencyName),\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$_id',\n\t\t\t\t\tproductMarketingInfo: { $push: '$productMarketing' },\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tconst bulkOps = results.map(r => ({\n\t\t\tupdateOne: {\n\t\t\t\tfilter: { _id: r._id },\n\t\t\t\tupdate: {\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tproductMarketingInfo: (r.productMarketingInfo ?? []).filter(Boolean).map((pm: any) => ({\n\t\t\t\t\t\t\tmarketing: pm.marketingInfo,\n\t\t\t\t\t\t\tisBuy1Get1: pm.isBuy1Get1,\n\t\t\t\t\t\t\tvalueType: pm.valueType,\n\t\t\t\t\t\t\tvalue: pm.value,\n\t\t\t\t\t\t\tsecondaryCurrencyValue: pm.secondaryCurrencyValue,\n\t\t\t\t\t\t\tlabel: pm.label,\n\t\t\t\t\t\t\tisAppliedByCompany: pm.isAppliedByCompany ?? false,\n\t\t\t\t\t\t})),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}));\n\n\t\tif (bulkOps.length) {\n\t\t\tawait this.productModel.bulkWrite(bulkOps, { ordered: false });\n\t\t}\n\t}\n\n\tprivate async getProductMarketingInfoByProductId(productId: mongoose.Types.ObjectId): Promise<any[]> {\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\n\t\tconst result = await this.productModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: { _id: productId },\n\t\t\t},\n\t\t\t...addProductMarketingInfo(exchangeRate, secondaryCurrencyName),\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$_id',\n\t\t\t\t\tproductMarketingInfo: {\n\t\t\t\t\t\t$push: '$productMarketing',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tconst productMarketingInfo = result?.[0]?.productMarketing\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tmarketing: result?.[0].productMarketing.marketingInfo,\n\t\t\t\t\t\tisBuy1Get1: result?.[0].productMarketing.isBuy1Get1,\n\t\t\t\t\t\tvalueType: result?.[0].productMarketing.valueType,\n\t\t\t\t\t\tvalue: result?.[0].productMarketing.value,\n\t\t\t\t\t\tsecondaryCurrencyValue: result?.[0].productMarketing.secondaryCurrencyValue,\n\t\t\t\t\t\tlabel: result?.[0].productMarketing.label,\n\t\t\t\t\t\tisAppliedByCompany: result?.[0].productMarketing.isAppliedByCompany ?? false,\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t: [];\n\n\t\treturn productMarketingInfo;\n\t}\n\n\tpublic async syncProductMarketingInfoByProductId(productId: mongoose.Types.ObjectId) {\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\t\tconst result = await this.productModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t_id: productId,\n\t\t\t\t},\n\t\t\t},\n\t\t\t...addProductMarketingInfo(exchangeRate, secondaryCurrencyName),\n\t\t]);\n\n\t\tconst productMarketingInfo = (result || [])\n\t\t\t.filter(item => item?.productMarketing)\n\t\t\t.map(item => ({\n\t\t\t\tmarketing: item.productMarketing.marketingInfo,\n\t\t\t\tisBuy1Get1: item.productMarketing.isBuy1Get1,\n\t\t\t\tvalueType: item.productMarketing.valueType,\n\t\t\t\tvalue: item.productMarketing.value,\n\t\t\t\tsecondaryCurrencyValue: item.productMarketing.secondaryCurrencyValue,\n\t\t\t\tlabel: item.productMarketing.label,\n\t\t\t\tisAppliedByCompany: item.productMarketing.isAppliedByCompany ?? false,\n\t\t\t}));\n\n\t\tawait this.productModel.updateOne(\n\t\t\t{ _id: productId },\n\t\t\t{\n\t\t\t\t$set: {\n\t\t\t\t\tproductMarketingInfo,\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\treturn 'Synchronized product marketing info';\n\t}\n\n\tpublic async syncProductMarketingInfoByProductIds(productIds: mongoose.Types.ObjectId[]) {\n\t\tif (!productIds.length) return 'No products to sync';\n\n\t\tconst adminSettings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\t\tconst exchangeRate = adminSettings?.currencySetting?.exchangeRate ?? 0;\n\t\tconst secondaryCurrencyName = adminSettings?.currencySetting?.secondaryCurrency?.name ?? 'LBP';\n\n\t\tconst BATCH_SIZE = 500;\n\t\tconst now = new Date();\n\t\tconst results: any[] = [];\n\n\t\tfor (let i = 0; i < productIds.length; i += BATCH_SIZE) {\n\t\t\tconst batchIds = productIds.slice(i, i + BATCH_SIZE);\n\n\t\t\t// Inverted join: scan productMarketings once per batch (grouped by product) instead of\n\t\t\t// one correlated $lookup per product (the old product-first addProductMarketingInfo path).\n\t\t\tconst batchResults = await this.productMarketingModel.aggregate([\n\t\t\t\t{ $match: { product: { $in: batchIds }, deletedAt: null } },\n\t\t\t\t{\n\t\t\t\t\t$lookup: {\n\t\t\t\t\t\tfrom: 'marketings',\n\t\t\t\t\t\tlet: { mid: '$marketing' },\n\t\t\t\t\t\tpipeline: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match: {\n\t\t\t\t\t\t\t\t\t$expr: { $eq: ['$_id', '$$mid'] }, // joins on indexed _id\n\t\t\t\t\t\t\t\t\tstatus: 'active',\n\t\t\t\t\t\t\t\t\t'duration.start': { $lte: now },\n\t\t\t\t\t\t\t\t\t'duration.end': { $gte: now },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ $project: { marketingType: 1, duration: 1, isAppliedByCompany: 1 } },\n\t\t\t\t\t\t],\n\t\t\t\t\t\tas: 'marketing',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ $unwind: '$marketing' }, // drops productMarketings whose marketing isn't active\n\t\t\t\t{\n\t\t\t\t\t$addFields: {\n\t\t\t\t\t\tsecondaryCurrencyValue: {\n\t\t\t\t\t\t\t$cond: [\n\t\t\t\t\t\t\t\t{ $eq: ['$valueType', 'fixed'] },\n\t\t\t\t\t\t\t\tgetRoundSecondaryCurrencyStage({ $multiply: ['$value', exchangeRate] }),\n\t\t\t\t\t\t\t\t'$$REMOVE',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t$addFields: {\n\t\t\t\t\t\tlabel: {\n\t\t\t\t\t\t\t$switch: {\n\t\t\t\t\t\t\t\tbranches: [\n\t\t\t\t\t\t\t\t\t{ case: { $eq: ['$marketing.marketingType', MarketingType.BUY1GET1] }, then: 'Buy 1 Get 1' },\n\t\t\t\t\t\t\t\t\t{ case: { $eq: ['$marketing.marketingType', MarketingType.PUNCH_MARKETING] }, then: 'Punch' },\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcase: { $eq: ['$marketing.marketingType', MarketingType.DISCOUNT] },\n\t\t\t\t\t\t\t\t\t\tthen: {\n\t\t\t\t\t\t\t\t\t\t\t$switch: {\n\t\t\t\t\t\t\t\t\t\t\t\tbranches: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase: { $eq: ['$valueType', ValueType.FIXED] },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthen: { $concat: [secondaryCurrencyName, ' ', { $toString: '$secondaryCurrencyValue' }] },\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase: { $eq: ['$valueType', ValueType.PERCENTAGE] },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthen: { $concat: [{ $toString: '$value' }, '%'] },\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\tdefault: 'Discount',\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tdefault: '$marketing.marketingType',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: '$product',\n\t\t\t\t\t\tproductMarketingInfo: {\n\t\t\t\t\t\t\t$push: {\n\t\t\t\t\t\t\t\tmarketing: {\n\t\t\t\t\t\t\t\t\t_id: '$marketing._id',\n\t\t\t\t\t\t\t\t\tmarketingType: '$marketing.marketingType',\n\t\t\t\t\t\t\t\t\tduration: '$marketing.duration',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tisBuy1Get1: '$isBuy1Get1',\n\t\t\t\t\t\t\t\tvalueType: '$valueType',\n\t\t\t\t\t\t\t\tvalue: '$value',\n\t\t\t\t\t\t\t\tsecondaryCurrencyValue: '$secondaryCurrencyValue',\n\t\t\t\t\t\t\t\tlabel: '$label',\n\t\t\t\t\t\t\t\tisAppliedByCompany: '$marketing.isAppliedByCompany',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]);\n\n\t\t\tresults.push(...batchResults);\n\t\t}\n\n\t\t// Products with no active marketing left aren't returned by the aggregate above, so reset\n\t\t// them to [] explicitly — keeps the recompute self-healing for the delete/update callers.\n\t\tconst byProduct = new Map<string, any[]>(results.map(r => [r._id.toString(), r.productMarketingInfo ?? []]));\n\n\t\tconst bulkOps = productIds.map(productId => ({\n\t\t\tupdateOne: {\n\t\t\t\tfilter: { _id: productId },\n\t\t\t\tupdate: {\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tproductMarketingInfo: (byProduct.get(productId.toString()) ?? []).map((pm: any) => ({\n\t\t\t\t\t\t\tmarketing: pm.marketing,\n\t\t\t\t\t\t\tisBuy1Get1: pm.isBuy1Get1,\n\t\t\t\t\t\t\tvalueType: pm.valueType,\n\t\t\t\t\t\t\tvalue: pm.value,\n\t\t\t\t\t\t\tsecondaryCurrencyValue: pm.secondaryCurrencyValue,\n\t\t\t\t\t\t\tlabel: pm.label,\n\t\t\t\t\t\t\tisAppliedByCompany: pm.isAppliedByCompany ?? false,\n\t\t\t\t\t\t})),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}));\n\n\t\tawait this.productModel.bulkWrite(bulkOps, { ordered: false });\n\n\t\treturn `Synchronized product marketing info for ${bulkOps.length} products`;\n\t}\n\n\tpublic async syncProductMarketingInfoByMarketingIds(marketingIds: mongoose.Types.ObjectId[]) {\n\t\tif (!marketingIds.length) return 'No marketings to sync';\n\n\t\tconst productsToUpdate = await this.productMarketingModel\n\t\t\t.find({ marketing: { $in: marketingIds } })\n\t\t\t.select('product')\n\t\t\t.lean();\n\t\tif (!productsToUpdate.length) return 'No matching products found';\n\n\t\tconst productIds = productsToUpdate.map(p => p.product._id);\n\t\treturn await this.syncProductMarketingInfoByProductIds(productIds);\n\t}\n}\n\nexport const synchronizeProductMarketingService = Container.get(SynchronizeProductMarketingService);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"all-marketings.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAoBjC,eAAO,MAAM,6BAA6B,EAAE,OAM1C,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,OAMhC,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,OAMtC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4C,CAAC;AAEjF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACvF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"all-marketings.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAuBjC,eAAO,MAAM,6BAA6B,EAAE,OAO1C,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,OAOhC,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,OAOtC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4C,CAAC;AAEjF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACvF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -10,6 +10,7 @@ exports.AllMarketingsValidationSchema = zod_1.z.union([
10
10
  _1.FeaturedMarketingValidationSchema,
11
11
  _1.FreeDeliveryMarketingValidationSchema,
12
12
  _1.PunchMarketingValidationSchema,
13
+ _1.SpendToGetMarketingValidationSchema,
13
14
  ]);
14
15
  exports.AllMarketingsSchema = zod_1.z.union([
15
16
  _1.DiscountMarketingSchema,
@@ -17,6 +18,7 @@ exports.AllMarketingsSchema = zod_1.z.union([
17
18
  _1.PunchMarketingSchema,
18
19
  _1.FeaturedMarketingSchema,
19
20
  _1.FreeDeliveryMarketingSchema,
21
+ _1.SpendToGetMarketingSchema,
20
22
  ]);
21
23
  exports.AllMarketingsUpdateSchema = zod_1.z.union([
22
24
  _1.UpdateDiscountMarketingSchema,
@@ -24,6 +26,7 @@ exports.AllMarketingsUpdateSchema = zod_1.z.union([
24
26
  _1.UpdatePunchMarketingSchema,
25
27
  _1.UpdateFeaturedMarketingSchema,
26
28
  _1.UpdateFreeDeliveryMarketingSchema,
29
+ _1.UpdateSpendToGetMarketingSchema,
27
30
  ]);
28
31
  exports.MarketingResponseSchema = (0, validation_1.createResponseSchema)(exports.AllMarketingsSchema);
29
32
  //# sourceMappingURL=all-marketings.validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-marketings.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAiC;AACjC,wBAgBW;AACX,wEAA+E;AAElE,QAAA,6BAA6B,GAAY,OAAC,CAAC,KAAK,CAAC;IAC7D,oCAAiC;IACjC,oCAAiC;IACjC,oCAAiC;IACjC,wCAAqC;IACrC,iCAA8B;CAC9B,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAY,OAAC,CAAC,KAAK,CAAC;IACnD,0BAAuB;IACvB,0BAAuB;IACvB,uBAAoB;IACpB,0BAAuB;IACvB,8BAA2B;CAC3B,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAY,OAAC,CAAC,KAAK,CAAC;IACzD,gCAA6B;IAC7B,gCAA6B;IAC7B,6BAA0B;IAC1B,gCAA6B;IAC7B,oCAAiC;CACjC,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,IAAA,iCAAoB,EAAC,2BAAmB,CAAC,CAAC","sourcesContent":["import { z, ZodType } from 'zod';\nimport {\n\tBuy1Get1MarketingSchema,\n\tBuy1Get1MarketingValidationSchema,\n\tDiscountMarketingSchema,\n\tDiscountMarketingValidationSchema,\n\tFeaturedMarketingSchema,\n\tFeaturedMarketingValidationSchema,\n\tFreeDeliveryMarketingSchema,\n\tFreeDeliveryMarketingValidationSchema,\n\tPunchMarketingSchema,\n\tPunchMarketingValidationSchema,\n\tUpdateBuy1Get1MarketingSchema,\n\tUpdateDiscountMarketingSchema,\n\tUpdateFeaturedMarketingSchema,\n\tUpdateFreeDeliveryMarketingSchema,\n\tUpdatePunchMarketingSchema,\n} from '.';\nimport { createResponseSchema } from '@lyxa.ai/core/dist/utilities/validation';\n\nexport const AllMarketingsValidationSchema: ZodType = z.union([\n\tBuy1Get1MarketingValidationSchema,\n\tDiscountMarketingValidationSchema,\n\tFeaturedMarketingValidationSchema,\n\tFreeDeliveryMarketingValidationSchema,\n\tPunchMarketingValidationSchema,\n]);\n\nexport const AllMarketingsSchema: ZodType = z.union([\n\tDiscountMarketingSchema,\n\tBuy1Get1MarketingSchema,\n\tPunchMarketingSchema,\n\tFeaturedMarketingSchema,\n\tFreeDeliveryMarketingSchema,\n]);\n\nexport const AllMarketingsUpdateSchema: ZodType = z.union([\n\tUpdateDiscountMarketingSchema,\n\tUpdateBuy1Get1MarketingSchema,\n\tUpdatePunchMarketingSchema,\n\tUpdateFeaturedMarketingSchema,\n\tUpdateFreeDeliveryMarketingSchema,\n]);\n\nexport const MarketingResponseSchema = createResponseSchema(AllMarketingsSchema);\n\nexport type AllMarketingsValidationDTO = z.infer<typeof AllMarketingsValidationSchema>;\nexport type AllMarketingsDTO = z.infer<typeof AllMarketingsSchema>;\n"]}
1
+ {"version":3,"file":"all-marketings.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAiC;AACjC,wBAmBW;AACX,wEAA+E;AAElE,QAAA,6BAA6B,GAAY,OAAC,CAAC,KAAK,CAAC;IAC7D,oCAAiC;IACjC,oCAAiC;IACjC,oCAAiC;IACjC,wCAAqC;IACrC,iCAA8B;IAC9B,sCAAmC;CACnC,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAY,OAAC,CAAC,KAAK,CAAC;IACnD,0BAAuB;IACvB,0BAAuB;IACvB,uBAAoB;IACpB,0BAAuB;IACvB,8BAA2B;IAC3B,4BAAyB;CACzB,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAY,OAAC,CAAC,KAAK,CAAC;IACzD,gCAA6B;IAC7B,gCAA6B;IAC7B,6BAA0B;IAC1B,gCAA6B;IAC7B,oCAAiC;IACjC,kCAA+B;CAC/B,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,IAAA,iCAAoB,EAAC,2BAAmB,CAAC,CAAC","sourcesContent":["import { z, ZodType } from 'zod';\nimport {\n\tBuy1Get1MarketingSchema,\n\tBuy1Get1MarketingValidationSchema,\n\tDiscountMarketingSchema,\n\tDiscountMarketingValidationSchema,\n\tFeaturedMarketingSchema,\n\tFeaturedMarketingValidationSchema,\n\tFreeDeliveryMarketingSchema,\n\tFreeDeliveryMarketingValidationSchema,\n\tPunchMarketingSchema,\n\tPunchMarketingValidationSchema,\n\tSpendToGetMarketingSchema,\n\tSpendToGetMarketingValidationSchema,\n\tUpdateBuy1Get1MarketingSchema,\n\tUpdateDiscountMarketingSchema,\n\tUpdateFeaturedMarketingSchema,\n\tUpdateFreeDeliveryMarketingSchema,\n\tUpdatePunchMarketingSchema,\n\tUpdateSpendToGetMarketingSchema,\n} from '.';\nimport { createResponseSchema } from '@lyxa.ai/core/dist/utilities/validation';\n\nexport const AllMarketingsValidationSchema: ZodType = z.union([\n\tBuy1Get1MarketingValidationSchema,\n\tDiscountMarketingValidationSchema,\n\tFeaturedMarketingValidationSchema,\n\tFreeDeliveryMarketingValidationSchema,\n\tPunchMarketingValidationSchema,\n\tSpendToGetMarketingValidationSchema,\n]);\n\nexport const AllMarketingsSchema: ZodType = z.union([\n\tDiscountMarketingSchema,\n\tBuy1Get1MarketingSchema,\n\tPunchMarketingSchema,\n\tFeaturedMarketingSchema,\n\tFreeDeliveryMarketingSchema,\n\tSpendToGetMarketingSchema,\n]);\n\nexport const AllMarketingsUpdateSchema: ZodType = z.union([\n\tUpdateDiscountMarketingSchema,\n\tUpdateBuy1Get1MarketingSchema,\n\tUpdatePunchMarketingSchema,\n\tUpdateFeaturedMarketingSchema,\n\tUpdateFreeDeliveryMarketingSchema,\n\tUpdateSpendToGetMarketingSchema,\n]);\n\nexport const MarketingResponseSchema = createResponseSchema(AllMarketingsSchema);\n\nexport type AllMarketingsValidationDTO = z.infer<typeof AllMarketingsValidationSchema>;\nexport type AllMarketingsDTO = z.infer<typeof AllMarketingsSchema>;\n"]}
@@ -59,6 +59,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
59
59
  isAppliedByCompany: boolean;
60
60
  isEntireMenu: boolean;
61
61
  pausedAt: Date | null;
62
+ marketingType: MarketingType.BUY1GET1;
62
63
  products: {
63
64
  product: import("mongoose").Types.ObjectId;
64
65
  value?: number | undefined;
@@ -67,7 +68,6 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
67
68
  marketing?: import("mongoose").Types.ObjectId | undefined;
68
69
  isBuy1Get1?: boolean | undefined;
69
70
  }[];
70
- marketingType: MarketingType.BUY1GET1;
71
71
  excludeProducts: import("mongoose").Types.ObjectId[];
72
72
  isOnlyForSubscriber: boolean;
73
73
  admin?: import("mongoose").Types.ObjectId | null | undefined;
@@ -437,6 +437,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
437
437
  isAppliedByCompany: boolean;
438
438
  isEntireMenu: boolean;
439
439
  pausedAt: Date | null;
440
+ marketingType: MarketingType.BUY1GET1;
440
441
  products: {
441
442
  product: import("mongoose").Types.ObjectId;
442
443
  value?: number | undefined;
@@ -445,7 +446,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
445
446
  marketing?: import("mongoose").Types.ObjectId | undefined;
446
447
  isBuy1Get1?: boolean | undefined;
447
448
  }[];
448
- marketingType: MarketingType.BUY1GET1;
449
449
  excludeProducts: import("mongoose").Types.ObjectId[];
450
450
  isOnlyForSubscriber: boolean;
451
451
  admin?: import("mongoose").Types.ObjectId | null | undefined;
@@ -487,6 +487,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
487
487
  isAppliedByCompany: boolean;
488
488
  isEntireMenu: boolean;
489
489
  pausedAt: Date | null;
490
+ marketingType: MarketingType.BUY1GET1;
490
491
  products: {
491
492
  product: import("mongoose").Types.ObjectId;
492
493
  value?: number | undefined;
@@ -495,7 +496,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
495
496
  marketing?: import("mongoose").Types.ObjectId | undefined;
496
497
  isBuy1Get1?: boolean | undefined;
497
498
  }[];
498
- marketingType: MarketingType.BUY1GET1;
499
499
  excludeProducts: import("mongoose").Types.ObjectId[];
500
500
  isOnlyForSubscriber: boolean;
501
501
  admin?: import("mongoose").Types.ObjectId | null | undefined;
@@ -67,6 +67,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
67
67
  isMaxDiscountPerOrderEnabled: boolean;
68
68
  maxDiscountPerOrder: number;
69
69
  pausedAt: Date | null;
70
+ marketingType: MarketingType.DISCOUNT;
70
71
  products: {
71
72
  product: import("mongoose").Types.ObjectId;
72
73
  value?: number | undefined;
@@ -75,7 +76,6 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
75
76
  marketing?: import("mongoose").Types.ObjectId | undefined;
76
77
  isBuy1Get1?: boolean | undefined;
77
78
  }[];
78
- marketingType: MarketingType.DISCOUNT;
79
79
  excludeProducts: import("mongoose").Types.ObjectId[];
80
80
  isOnlyForSubscriber: boolean;
81
81
  value?: number | undefined;
@@ -337,6 +337,7 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
337
337
  isMaxDiscountPerOrderEnabled: boolean;
338
338
  maxDiscountPerOrder: number;
339
339
  pausedAt: Date | null;
340
+ marketingType: MarketingType.DISCOUNT;
340
341
  products: {
341
342
  product: import("mongoose").Types.ObjectId;
342
343
  value?: number | undefined;
@@ -345,7 +346,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
345
346
  marketing?: import("mongoose").Types.ObjectId | undefined;
346
347
  isBuy1Get1?: boolean | undefined;
347
348
  }[];
348
- marketingType: MarketingType.DISCOUNT;
349
349
  excludeProducts: import("mongoose").Types.ObjectId[];
350
350
  isOnlyForSubscriber: boolean;
351
351
  value?: number | undefined;
@@ -399,6 +399,7 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
399
399
  isMaxDiscountPerOrderEnabled: boolean;
400
400
  maxDiscountPerOrder: number;
401
401
  pausedAt: Date | null;
402
+ marketingType: MarketingType.DISCOUNT;
402
403
  products: {
403
404
  product: import("mongoose").Types.ObjectId;
404
405
  value?: number | undefined;
@@ -407,7 +408,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
407
408
  marketing?: import("mongoose").Types.ObjectId | undefined;
408
409
  isBuy1Get1?: boolean | undefined;
409
410
  }[];
410
- marketingType: MarketingType.DISCOUNT;
411
411
  excludeProducts: import("mongoose").Types.ObjectId[];
412
412
  isOnlyForSubscriber: boolean;
413
413
  value?: number | undefined;
@@ -3,6 +3,7 @@ export * from './discount-marketing.validation';
3
3
  export * from './featured-marketing.validation';
4
4
  export * from './free-delivery-marketing.validation';
5
5
  export * from './punch-marketing.validation';
6
+ export * from './spend-to-get-marketing.validation';
6
7
  export * from './product-marketing.validation';
7
8
  export * from './marketing.validation';
8
9
  export * from './all-marketings.validation';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -19,6 +19,7 @@ __exportStar(require("./discount-marketing.validation"), exports);
19
19
  __exportStar(require("./featured-marketing.validation"), exports);
20
20
  __exportStar(require("./free-delivery-marketing.validation"), exports);
21
21
  __exportStar(require("./punch-marketing.validation"), exports);
22
+ __exportStar(require("./spend-to-get-marketing.validation"), exports);
22
23
  __exportStar(require("./product-marketing.validation"), exports);
23
24
  __exportStar(require("./marketing.validation"), exports);
24
25
  __exportStar(require("./all-marketings.validation"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,kEAAgD;AAChD,kEAAgD;AAChD,uEAAqD;AACrD,+DAA6C;AAC7C,iEAA+C;AAC/C,yDAAuC;AACvC,8DAA4C","sourcesContent":["export * from './buy1-get1-marketing.validation';\nexport * from './discount-marketing.validation';\nexport * from './featured-marketing.validation';\nexport * from './free-delivery-marketing.validation';\nexport * from './punch-marketing.validation';\nexport * from './product-marketing.validation';\nexport * from './marketing.validation';\nexport * from './all-marketings.validation';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,kEAAgD;AAChD,kEAAgD;AAChD,uEAAqD;AACrD,+DAA6C;AAC7C,sEAAoD;AACpD,iEAA+C;AAC/C,yDAAuC;AACvC,8DAA4C","sourcesContent":["export * from './buy1-get1-marketing.validation';\nexport * from './discount-marketing.validation';\nexport * from './featured-marketing.validation';\nexport * from './free-delivery-marketing.validation';\nexport * from './punch-marketing.validation';\nexport * from './spend-to-get-marketing.validation';\nexport * from './product-marketing.validation';\nexport * from './marketing.validation';\nexport * from './all-marketings.validation';\n"]}
@@ -184,6 +184,19 @@ export declare const ProductEntireMenuMarketingHandlerSchema: z.ZodObject<{
184
184
  shop: string | import("mongoose").Types.ObjectId;
185
185
  product: string | import("mongoose").Types.ObjectId;
186
186
  }>;
187
+ export declare const SpendToGetProgressInputSchema: z.ZodObject<{
188
+ shop: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
189
+ basketTotal: z.ZodNumber;
190
+ userId: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ shop: import("mongoose").Types.ObjectId;
193
+ basketTotal: number;
194
+ userId?: import("mongoose").Types.ObjectId | undefined;
195
+ }, {
196
+ shop: string | import("mongoose").Types.ObjectId;
197
+ basketTotal: number;
198
+ userId?: string | import("mongoose").Types.ObjectId | undefined;
199
+ }>;
187
200
  export declare const MarketingSpendLimitsEvaluationSchema: z.ZodObject<{
188
201
  marketings: z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">;
189
202
  }, "strip", z.ZodTypeAny, {
@@ -230,6 +243,7 @@ export declare const MarketingMetricsSchema: z.ZodObject<{
230
243
  count?: number | undefined;
231
244
  percentageIncrease?: number | undefined;
232
245
  }>>;
246
+ totalRedemptions: z.ZodOptional<z.ZodNumber>;
233
247
  }, "strip", z.ZodTypeAny, {
234
248
  numberOfItems?: number | undefined;
235
249
  orderIncreaseWithDiscount?: {
@@ -240,6 +254,7 @@ export declare const MarketingMetricsSchema: z.ZodObject<{
240
254
  count: number;
241
255
  percentageIncrease: number;
242
256
  } | undefined;
257
+ totalRedemptions?: number | undefined;
243
258
  }, {
244
259
  numberOfItems?: number | undefined;
245
260
  orderIncreaseWithDiscount?: {
@@ -250,6 +265,7 @@ export declare const MarketingMetricsSchema: z.ZodObject<{
250
265
  count?: number | undefined;
251
266
  percentageIncrease?: number | undefined;
252
267
  } | undefined;
268
+ totalRedemptions?: number | undefined;
253
269
  }>;
254
270
  export declare const MarketingGraphInputSchema: z.ZodObject<{
255
271
  marketingId: z.ZodType<string | import("mongoose").Types.ObjectId, z.ZodTypeDef, string | import("mongoose").Types.ObjectId>;
@@ -301,6 +317,7 @@ export type CreateMarketingDTO = DTO<typeof MarketingValidationSchema>;
301
317
  export type MarketingDTO = DTO<typeof MarketingSchema>;
302
318
  export type UpdateMarketingDTO = DTO<typeof UpdateMarketingSchema>;
303
319
  export type ProductEntireMenuMarketingHandlerDTO = DTO<typeof ProductEntireMenuMarketingHandlerSchema>;
320
+ export type SpendToGetProgressInputDTO = DTO<typeof SpendToGetProgressInputSchema>;
304
321
  export type IncreaseDuringDiscountDTO = DTO<typeof IncreaseDuringDiscountSchema>;
305
322
  export type MarketingMetricsDTO = DTO<typeof MarketingMetricsSchema>;
306
323
  export type MarketingGraphInputDTO = DTO<typeof MarketingGraphInputSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":"AAAA,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,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACnE,MAAM,MAAM,oCAAoC,GAAG,GAAG,CAAC,OAAO,uCAAuC,CAAC,CAAC;AACvG,MAAM,MAAM,yBAAyB,GAAG,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC;AACzF,MAAM,MAAM,gCAAgC,GAAG,GAAG,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAC/F,MAAM,MAAM,kCAAkC,GAAG,GAAG,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
1
+ {"version":3,"file":"marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAO9F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAQ/B,CAAC;AAYF,QAAA,MACa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACvB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCACnB,iBAAiB,mNACb,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACgB,CAAC;AAKrD,OAAO,EACN,yBAAyB,EACzB,eAAe,EACf,iBAAiB,IAAI,2BAA2B,EAChD,qBAAqB,GACrB,CAAC;AAEF,eAAO,MAAM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/F,MAAM,MAAM,kCAAkC,GAAG,GAAG,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MarketingAmountSpentGraphOutputSchema = exports.MarketingCustomersGraphOutputSchema = exports.MarketingOrdersGraphOutputSchema = exports.MarketingGraphInputSchema = exports.MarketingMetricsSchema = exports.IncreaseDuringDiscountSchema = exports.SyncProductMarketingForMultipleProductsSchema = exports.MarketingSpendLimitsEvaluationSchema = exports.ProductEntireMenuMarketingHandlerSchema = exports.UpdateMarketingSchema = exports.MarketingIdValidationSchema = exports.MarketingSchema = exports.MarketingValidationSchema = exports.baseMarketingFields = void 0;
3
+ exports.MarketingAmountSpentGraphOutputSchema = exports.MarketingCustomersGraphOutputSchema = exports.MarketingOrdersGraphOutputSchema = exports.MarketingGraphInputSchema = exports.MarketingMetricsSchema = exports.IncreaseDuringDiscountSchema = exports.SyncProductMarketingForMultipleProductsSchema = exports.MarketingSpendLimitsEvaluationSchema = exports.SpendToGetProgressInputSchema = exports.ProductEntireMenuMarketingHandlerSchema = exports.UpdateMarketingSchema = exports.MarketingIdValidationSchema = exports.MarketingSchema = exports.MarketingValidationSchema = exports.baseMarketingFields = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const global_validation_1 = require("@lyxa.ai/core/dist/utilities/validation/global-validation");
6
6
  const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
@@ -25,6 +25,11 @@ exports.ProductEntireMenuMarketingHandlerSchema = zod_1.z.object({
25
25
  product: global_validation_1.ZodValidation.objectId('Product'),
26
26
  shop: global_validation_1.ZodValidation.objectId('Shop'),
27
27
  });
28
+ exports.SpendToGetProgressInputSchema = zod_1.z.object({
29
+ shop: global_validation_1.ZodValidation.objectId('Shop'),
30
+ basketTotal: global_validation_1.ZodValidation.number('Basket total', { isNonnegative: true }),
31
+ userId: global_validation_1.ZodValidation.objectId('User').optional(),
32
+ });
28
33
  exports.MarketingSpendLimitsEvaluationSchema = zod_1.z.object({
29
34
  marketings: global_validation_1.ZodValidation.array(global_validation_1.ZodValidation.objectId('marketing'), 'marketings'),
30
35
  });
@@ -41,6 +46,7 @@ exports.MarketingMetricsSchema = zod_1.z.object({
41
46
  numberOfItems: global_validation_1.ZodValidation.number('Number of items in the marketing').optional(),
42
47
  orderIncreaseWithDiscount: exports.IncreaseDuringDiscountSchema.optional(),
43
48
  customerIncreaseWithDiscount: exports.IncreaseDuringDiscountSchema.optional(),
49
+ totalRedemptions: global_validation_1.ZodValidation.number('Total redemptions').optional(),
44
50
  });
45
51
  exports.MarketingGraphInputSchema = zod_1.z.object({
46
52
  marketingId: global_validation_1.ZodValidation.objectIdOrStringSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,4DAA8F;AAC9F,iGAA2F;AAC3F,8DAA2D;AAK9C,QAAA,mBAAmB,GAAG;IAClC,IAAI,EAAE,iCAAa,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpC,aAAa,EAAE,iCAAa,CAAC,QAAQ,CAAC,oBAAa,EAAE,gBAAgB,CAAC;IACtE,kBAAkB,EAAE,iCAAa,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC/D,QAAQ,EAAE,kCAAc;IACxB,MAAM,EAAE,iCAAa,CAAC,QAAQ,CAAC,sBAAe,EAAE,kBAAkB,CAAC,CAAC,OAAO,CAAC,sBAAe,CAAC,MAAM,CAAC;IACnG,QAAQ,EAAE,iCAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC7E,KAAK,EAAE,iCAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC5D,CAAC;AAOF,MA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K,CAC3D,OAAC,CAAC,MAAM,CAAC;IACR,IAAI,EAAE,iCAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,iCAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CACjD,CAAC,CACF,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO,\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { GraphType, MarketingStatus, MarketingType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { DurationSchema } from '@lyxa.ai/core/dist/utilities/validation/common-validation';\nimport { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\n\n/**\n * Define the base parent schema fields\n */\nexport const baseMarketingFields = {\n\tshop: ZodValidation.objectId('Shop'),\n\tmarketingType: ZodValidation.enumType(MarketingType, 'Marketing type'),\n\tisAppliedByCompany: ZodValidation.boolean('isAppliedByCompany'),\n\tduration: DurationSchema,\n\tstatus: ZodValidation.enumType(MarketingStatus, 'Marketing status').default(MarketingStatus.ACTIVE),\n\tpausedAt: ZodValidation.date('Paused at').optional().nullable().default(null),\n\tadmin: ZodValidation.objectId('Admin').optional().nullable(),\n};\n\n/**\n * Create schema builder for Parent entity\n * - Includes timestamps\n * - Excludes 'createdAt' from update operations\n */\nconst schemaBuilder = createSchemaBuilder(baseMarketingFields);\n\n/**\n * Get all schemas for the Parent entity\n */\nconst {\n\tBaseSchema: MarketingValidationSchema,\n\tEntitySchema: MarketingSchema,\n\tIdSchema: MarketingIdSchema,\n\tUpdateSchema: UpdateMarketingSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\n/**\n * Export schemas\n */\nexport {\n\tMarketingValidationSchema,\n\tMarketingSchema,\n\tMarketingIdSchema as MarketingIdValidationSchema,\n\tUpdateMarketingSchema,\n};\n\nexport const ProductEntireMenuMarketingHandlerSchema = z.object({\n\tproduct: ZodValidation.objectId('Product'),\n\tshop: ZodValidation.objectId('Shop'),\n});\n\nexport const MarketingSpendLimitsEvaluationSchema = z.object({\n\tmarketings: ZodValidation.array(ZodValidation.objectId('marketing'), 'marketings'),\n});\n\nexport const SyncProductMarketingForMultipleProductsSchema = z.object({\n\tproductIds: ZodValidation.array(ZodValidation.objectId('product id'), 'product ids'),\n});\n\nexport const IncreaseDuringDiscountSchema = z.object({\n\tcount: ZodValidation.number('Count of orders or customers during discount').optional().default(0),\n\tpercentageIncrease: ZodValidation.number('Percentage increase compared to previous duration')\n\t\t.optional()\n\t\t.default(0),\n});\n\nexport const MarketingMetricsSchema = z.object({\n\tnumberOfItems: ZodValidation.number('Number of items in the marketing').optional(),\n\torderIncreaseWithDiscount: IncreaseDuringDiscountSchema.optional(),\n\tcustomerIncreaseWithDiscount: IncreaseDuringDiscountSchema.optional(),\n});\n\nexport const MarketingGraphInputSchema = z.object({\n\tmarketingId: ZodValidation.objectIdOrStringSchema,\n\tstartDate: ZodValidation.date('Start Date').transform(val => dayjs(val).startOf('day').toDate()),\n\tendDate: ZodValidation.date('End Date').transform(val => dayjs(val).endOf('day').toDate()),\n\ttype: ZodValidation.enumType(GraphType, 'Type').default(GraphType.DAILY),\n});\n\nexport const MarketingOrdersGraphOutputSchema = z.array(\n\tz.object({\n\t\tdate: ZodValidation.string('Date'),\n\t\torders: ZodValidation.number('Orders').default(0),\n\t})\n);\n\nexport const MarketingCustomersGraphOutputSchema = z.array(\n\tz.object({\n\t\tdate: ZodValidation.string('Date'),\n\t\tcustomers: ZodValidation.number('Customers').default(0),\n\t})\n);\n\nexport const MarketingAmountSpentGraphOutputSchema = z.array(\n\tz.object({\n\t\tdate: ZodValidation.string('Date'),\n\t\tamount: ZodValidation.number('Amount').default(0),\n\t})\n);\n\n/**\n * Export DTO types\n */\nexport type CreateMarketingDTO = DTO<typeof MarketingValidationSchema>;\nexport type MarketingDTO = DTO<typeof MarketingSchema>;\nexport type UpdateMarketingDTO = DTO<typeof UpdateMarketingSchema>;\nexport type ProductEntireMenuMarketingHandlerDTO = DTO<typeof ProductEntireMenuMarketingHandlerSchema>;\nexport type IncreaseDuringDiscountDTO = DTO<typeof IncreaseDuringDiscountSchema>;\nexport type MarketingMetricsDTO = DTO<typeof MarketingMetricsSchema>;\nexport type MarketingGraphInputDTO = DTO<typeof MarketingGraphInputSchema>;\nexport type MarketingOrdersGraphOutputDTO = DTO<typeof MarketingOrdersGraphOutputSchema>;\nexport type MarketingCustomersGraphOutputDTO = DTO<typeof MarketingCustomersGraphOutputSchema>;\nexport type MarketingAmountSpentGraphOutputDTO = DTO<typeof MarketingAmountSpentGraphOutputSchema>;"]}
1
+ {"version":3,"file":"marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,4DAA8F;AAC9F,iGAA2F;AAC3F,8DAA2D;AAK9C,QAAA,mBAAmB,GAAG;IAClC,IAAI,EAAE,iCAAa,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpC,aAAa,EAAE,iCAAa,CAAC,QAAQ,CAAC,oBAAa,EAAE,gBAAgB,CAAC;IACtE,kBAAkB,EAAE,iCAAa,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC/D,QAAQ,EAAE,kCAAc;IACxB,MAAM,EAAE,iCAAa,CAAC,QAAQ,CAAC,sBAAe,EAAE,kBAAkB,CAAC,CAAC,OAAO,CAAC,sBAAe,CAAC,MAAM,CAAC;IACnG,QAAQ,EAAE,iCAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC7E,KAAK,EAAE,iCAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC5D,CAAC;AAOF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,2BAAmB,CAAC,CAAC;AAK/D,MAAM,EACL,UAAU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AC,CACF,CAAC;AAEW,QAAA,mCAAmC,GAAG,OAAC,CAAC,KAAK,CACzD,OAAC,CAAC,MAAM,CAAC;IACR,IAAI,EAAE,iCAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,SAAS,EAAE,iCAAa,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CACvD,CAAC,CACF,CAAC;AAEW,QAAA,qCAAqC,GAAG,OAAC,CAAC,KAAK,CAC3D,OAAC,CAAC,MAAM,CAAC;IACR,IAAI,EAAE,iCAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,iCAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CACjD,CAAC,CACF,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO,\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { GraphType, MarketingStatus, MarketingType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { DurationSchema } from '@lyxa.ai/core/dist/utilities/validation/common-validation';\nimport { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\n\n/**\n * Define the base parent schema fields\n */\nexport const baseMarketingFields = {\n\tshop: ZodValidation.objectId('Shop'),\n\tmarketingType: ZodValidation.enumType(MarketingType, 'Marketing type'),\n\tisAppliedByCompany: ZodValidation.boolean('isAppliedByCompany'),\n\tduration: DurationSchema,\n\tstatus: ZodValidation.enumType(MarketingStatus, 'Marketing status').default(MarketingStatus.ACTIVE),\n\tpausedAt: ZodValidation.date('Paused at').optional().nullable().default(null),\n\tadmin: ZodValidation.objectId('Admin').optional().nullable(),\n};\n\n/**\n * Create schema builder for Parent entity\n * - Includes timestamps\n * - Excludes 'createdAt' from update operations\n */\nconst schemaBuilder = createSchemaBuilder(baseMarketingFields);\n\n/**\n * Get all schemas for the Parent entity\n */\nconst {\n\tBaseSchema: MarketingValidationSchema,\n\tEntitySchema: MarketingSchema,\n\tIdSchema: MarketingIdSchema,\n\tUpdateSchema: UpdateMarketingSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\n/**\n * Export schemas\n */\nexport {\n\tMarketingValidationSchema,\n\tMarketingSchema,\n\tMarketingIdSchema as MarketingIdValidationSchema,\n\tUpdateMarketingSchema,\n};\n\nexport const ProductEntireMenuMarketingHandlerSchema = z.object({\n\tproduct: ZodValidation.objectId('Product'),\n\tshop: ZodValidation.objectId('Shop'),\n});\n\nexport const SpendToGetProgressInputSchema = z.object({\n\tshop: ZodValidation.objectId('Shop'),\n\tbasketTotal: ZodValidation.number('Basket total', { isNonnegative: true }),\n\tuserId: ZodValidation.objectId('User').optional(),\n});\n\nexport const MarketingSpendLimitsEvaluationSchema = z.object({\n\tmarketings: ZodValidation.array(ZodValidation.objectId('marketing'), 'marketings'),\n});\n\nexport const SyncProductMarketingForMultipleProductsSchema = z.object({\n\tproductIds: ZodValidation.array(ZodValidation.objectId('product id'), 'product ids'),\n});\n\nexport const IncreaseDuringDiscountSchema = z.object({\n\tcount: ZodValidation.number('Count of orders or customers during discount').optional().default(0),\n\tpercentageIncrease: ZodValidation.number('Percentage increase compared to previous duration')\n\t\t.optional()\n\t\t.default(0),\n});\n\nexport const MarketingMetricsSchema = z.object({\n\tnumberOfItems: ZodValidation.number('Number of items in the marketing').optional(),\n\torderIncreaseWithDiscount: IncreaseDuringDiscountSchema.optional(),\n\tcustomerIncreaseWithDiscount: IncreaseDuringDiscountSchema.optional(),\n\ttotalRedemptions: ZodValidation.number('Total redemptions').optional(),\n});\n\nexport const MarketingGraphInputSchema = z.object({\n\tmarketingId: ZodValidation.objectIdOrStringSchema,\n\tstartDate: ZodValidation.date('Start Date').transform(val => dayjs(val).startOf('day').toDate()),\n\tendDate: ZodValidation.date('End Date').transform(val => dayjs(val).endOf('day').toDate()),\n\ttype: ZodValidation.enumType(GraphType, 'Type').default(GraphType.DAILY),\n});\n\nexport const MarketingOrdersGraphOutputSchema = z.array(\n\tz.object({\n\t\tdate: ZodValidation.string('Date'),\n\t\torders: ZodValidation.number('Orders').default(0),\n\t})\n);\n\nexport const MarketingCustomersGraphOutputSchema = z.array(\n\tz.object({\n\t\tdate: ZodValidation.string('Date'),\n\t\tcustomers: ZodValidation.number('Customers').default(0),\n\t})\n);\n\nexport const MarketingAmountSpentGraphOutputSchema = z.array(\n\tz.object({\n\t\tdate: ZodValidation.string('Date'),\n\t\tamount: ZodValidation.number('Amount').default(0),\n\t})\n);\n\n/**\n * Export DTO types\n */\nexport type CreateMarketingDTO = DTO<typeof MarketingValidationSchema>;\nexport type MarketingDTO = DTO<typeof MarketingSchema>;\nexport type UpdateMarketingDTO = DTO<typeof UpdateMarketingSchema>;\nexport type ProductEntireMenuMarketingHandlerDTO = DTO<typeof ProductEntireMenuMarketingHandlerSchema>;\nexport type SpendToGetProgressInputDTO = DTO<typeof SpendToGetProgressInputSchema>;\nexport type IncreaseDuringDiscountDTO = DTO<typeof IncreaseDuringDiscountSchema>;\nexport type MarketingMetricsDTO = DTO<typeof MarketingMetricsSchema>;\nexport type MarketingGraphInputDTO = DTO<typeof MarketingGraphInputSchema>;\nexport type MarketingOrdersGraphOutputDTO = DTO<typeof MarketingOrdersGraphOutputSchema>;\nexport type MarketingCustomersGraphOutputDTO = DTO<typeof MarketingCustomersGraphOutputSchema>;\nexport type MarketingAmountSpentGraphOutputDTO = DTO<typeof MarketingAmountSpentGraphOutputSchema>;"]}
@@ -187,13 +187,13 @@ export declare const BatchCreateProductMarketingsInputSchema: z.ZodObject<{
187
187
  shop: import("mongoose").Types.ObjectId;
188
188
  categories: import("mongoose").Types.ObjectId[];
189
189
  isEntireMenu: boolean;
190
+ isBuy1Get1: boolean;
190
191
  products: {
191
192
  product: import("mongoose").Types.ObjectId;
192
193
  value?: number | undefined;
193
194
  valueType?: ValueType | null | undefined;
194
195
  }[];
195
196
  marketingId: import("mongoose").Types.ObjectId;
196
- isBuy1Get1: boolean;
197
197
  value?: number | undefined;
198
198
  valueType?: ValueType | undefined;
199
199
  isAppliedByCompany?: boolean | undefined;
@@ -202,8 +202,8 @@ export declare const BatchCreateProductMarketingsInputSchema: z.ZodObject<{
202
202
  }, {
203
203
  shop: string | import("mongoose").Types.ObjectId;
204
204
  isEntireMenu: boolean;
205
- marketingId: string | import("mongoose").Types.ObjectId;
206
205
  isBuy1Get1: boolean;
206
+ marketingId: string | import("mongoose").Types.ObjectId;
207
207
  value?: number | undefined;
208
208
  valueType?: ValueType | undefined;
209
209
  categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;