@lyxa.ai/marketing 1.0.62 → 1.0.63

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 (276) 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 +533 -18
  16. package/dist/lib/index.d.ts.map +1 -1
  17. package/dist/lib/index.js +5 -1
  18. package/dist/lib/index.js.map +1 -1
  19. package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
  20. package/dist/lib/modules/coupon/validations/create-coupon.validation.js +4 -1
  21. package/dist/lib/modules/coupon/validations/create-coupon.validation.js.map +1 -1
  22. package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
  23. package/dist/lib/modules/deal-setting/services/deal-setting.service.js +4 -1
  24. package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
  25. package/dist/lib/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
  26. package/dist/lib/modules/featured-setting/services/featured-setting.service.js +3 -0
  27. package/dist/lib/modules/featured-setting/services/featured-setting.service.js.map +1 -1
  28. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
  29. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
  30. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +11 -0
  31. package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
  32. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
  33. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js +6 -0
  34. package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js.map +1 -1
  35. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
  36. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
  37. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +2 -6
  38. package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -1
  39. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
  40. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
  41. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +22 -3
  42. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -1
  43. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
  44. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
  45. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js +12 -0
  46. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js.map +1 -1
  47. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
  48. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
  49. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +19 -1
  50. package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -1
  51. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +8 -1
  52. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  53. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +64 -1
  54. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -1
  55. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
  56. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
  57. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js +66 -8
  58. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js.map +1 -1
  59. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
  60. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  61. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +37 -19
  62. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
  63. package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +249 -18
  64. package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
  65. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
  66. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  67. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +15 -3
  68. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js.map +1 -1
  69. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
  70. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js +1 -1
  71. package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js.map +1 -1
  72. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +24 -3
  73. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  74. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +19 -1
  75. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -1
  76. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
  77. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  78. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +43 -0
  79. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -1
  80. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +195 -10
  81. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
  82. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js +29 -0
  83. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -1
  84. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
  85. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
  86. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js +2 -0
  87. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js.map +1 -0
  88. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +427 -32
  89. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  90. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +16 -6
  91. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
  92. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +7 -4
  93. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  94. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js +42 -7
  95. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js.map +1 -1
  96. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +15 -3
  97. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  98. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js +84 -18
  99. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
  100. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
  101. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
  102. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js +75 -0
  103. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js.map +1 -0
  104. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
  105. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
  106. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js +83 -0
  107. package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js.map +1 -0
  108. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
  109. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
  110. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +29 -0
  111. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -1
  112. package/dist/lib/modules/marketing/routers/marketing.router.d.ts +14 -0
  113. package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  114. package/dist/lib/modules/marketing/routers/marketing.router.js +5 -0
  115. package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
  116. package/dist/lib/modules/marketing/services/index.d.ts +3 -0
  117. package/dist/lib/modules/marketing/services/index.d.ts.map +1 -1
  118. package/dist/lib/modules/marketing/services/index.js +3 -0
  119. package/dist/lib/modules/marketing/services/index.js.map +1 -1
  120. package/dist/lib/modules/marketing/services/marketing-conflict.repository.d.ts +9 -0
  121. package/dist/lib/modules/marketing/services/marketing-conflict.repository.d.ts.map +1 -0
  122. package/dist/lib/modules/marketing/services/marketing-conflict.repository.js +63 -0
  123. package/dist/lib/modules/marketing/services/marketing-conflict.repository.js.map +1 -0
  124. package/dist/lib/modules/marketing/services/marketing-conflict.service.d.ts +28 -0
  125. package/dist/lib/modules/marketing/services/marketing-conflict.service.d.ts.map +1 -0
  126. package/dist/lib/modules/marketing/services/marketing-conflict.service.js +139 -0
  127. package/dist/lib/modules/marketing/services/marketing-conflict.service.js.map +1 -0
  128. package/dist/lib/modules/marketing/services/marketing.service.d.ts +7 -2
  129. package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
  130. package/dist/lib/modules/marketing/services/marketing.service.js +100 -51
  131. package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
  132. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +2 -3
  133. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  134. package/dist/lib/modules/marketing/services/product-marketing.service.js +42 -13
  135. package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
  136. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.d.ts +14 -0
  137. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.d.ts.map +1 -0
  138. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.js +82 -0
  139. package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.js.map +1 -0
  140. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.d.ts +11 -0
  141. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.d.ts.map +1 -0
  142. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.js +100 -0
  143. package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.js.map +1 -0
  144. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.d.ts +9 -0
  145. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.d.ts.map +1 -0
  146. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.js +69 -0
  147. package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.js.map +1 -0
  148. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts +31 -0
  149. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts.map +1 -0
  150. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.js +123 -0
  151. package/dist/lib/modules/marketing/services/spend-to-get-progress.service.js.map +1 -0
  152. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
  153. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js +95 -27
  154. package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
  155. package/dist/lib/modules/marketing/validations/all-marketings.validation.d.ts.map +1 -1
  156. package/dist/lib/modules/marketing/validations/all-marketings.validation.js +3 -0
  157. package/dist/lib/modules/marketing/validations/all-marketings.validation.js.map +1 -1
  158. package/dist/lib/modules/marketing/validations/index.d.ts +1 -0
  159. package/dist/lib/modules/marketing/validations/index.d.ts.map +1 -1
  160. package/dist/lib/modules/marketing/validations/index.js +1 -0
  161. package/dist/lib/modules/marketing/validations/index.js.map +1 -1
  162. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +17 -0
  163. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  164. package/dist/lib/modules/marketing/validations/marketing.validation.js +7 -1
  165. package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
  166. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.d.ts +617 -0
  167. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -0
  168. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js +119 -0
  169. package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js.map +1 -0
  170. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +24 -0
  171. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -0
  172. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js +97 -0
  173. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js.map +1 -0
  174. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts +271 -0
  175. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -0
  176. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.js +62 -0
  177. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.js.map +1 -0
  178. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts +24 -0
  179. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -0
  180. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.js +116 -0
  181. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.js.map +1 -0
  182. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +232 -0
  183. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -0
  184. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js +30 -0
  185. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js.map +1 -0
  186. package/dist/types/event/event-initializations.d.ts.map +1 -1
  187. package/dist/types/event/event-listeners/event-listeners.d.ts +2 -0
  188. package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
  189. package/dist/types/event/events/marketing-product-seed.event.d.ts +1 -2
  190. package/dist/types/event/events/marketing-product-seed.event.d.ts.map +1 -1
  191. package/dist/types/event/events/marketing-product-sync.event.d.ts +11 -0
  192. package/dist/types/event/events/marketing-product-sync.event.d.ts.map +1 -0
  193. package/dist/types/index.d.ts +533 -18
  194. package/dist/types/index.d.ts.map +1 -1
  195. package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
  196. package/dist/types/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
  197. package/dist/types/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
  198. package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
  199. package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
  200. package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
  201. package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
  202. package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
  203. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
  204. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
  205. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
  206. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
  207. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
  208. package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
  209. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +8 -1
  210. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  211. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
  212. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
  213. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
  214. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  215. package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +249 -18
  216. package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
  217. package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
  218. package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  219. package/dist/types/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
  220. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +24 -3
  221. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  222. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
  223. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  224. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +195 -10
  225. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
  226. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
  227. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
  228. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +427 -32
  229. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  230. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +7 -4
  231. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  232. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +15 -3
  233. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  234. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
  235. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
  236. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
  237. package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
  238. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
  239. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
  240. package/dist/types/modules/marketing/routers/marketing.router.d.ts +14 -0
  241. package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  242. package/dist/types/modules/marketing/services/index.d.ts +3 -0
  243. package/dist/types/modules/marketing/services/index.d.ts.map +1 -1
  244. package/dist/types/modules/marketing/services/marketing-conflict.repository.d.ts +9 -0
  245. package/dist/types/modules/marketing/services/marketing-conflict.repository.d.ts.map +1 -0
  246. package/dist/types/modules/marketing/services/marketing-conflict.service.d.ts +46 -0
  247. package/dist/types/modules/marketing/services/marketing-conflict.service.d.ts.map +1 -0
  248. package/dist/types/modules/marketing/services/marketing.service.d.ts +7 -2
  249. package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
  250. package/dist/types/modules/marketing/services/product-marketing.service.d.ts +7 -3
  251. package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  252. package/dist/types/modules/marketing/services/spend-to-get-marketing.repository.d.ts +14 -0
  253. package/dist/types/modules/marketing/services/spend-to-get-marketing.repository.d.ts.map +1 -0
  254. package/dist/types/modules/marketing/services/spend-to-get-marketing.service.d.ts +20 -0
  255. package/dist/types/modules/marketing/services/spend-to-get-marketing.service.d.ts.map +1 -0
  256. package/dist/types/modules/marketing/services/spend-to-get-progress.repository.d.ts +9 -0
  257. package/dist/types/modules/marketing/services/spend-to-get-progress.repository.d.ts.map +1 -0
  258. package/dist/types/modules/marketing/services/spend-to-get-progress.service.d.ts +37 -0
  259. package/dist/types/modules/marketing/services/spend-to-get-progress.service.d.ts.map +1 -0
  260. package/dist/types/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
  261. package/dist/types/modules/marketing/validations/all-marketings.validation.d.ts.map +1 -1
  262. package/dist/types/modules/marketing/validations/index.d.ts +1 -0
  263. package/dist/types/modules/marketing/validations/index.d.ts.map +1 -1
  264. package/dist/types/modules/marketing/validations/marketing.validation.d.ts +17 -0
  265. package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  266. package/dist/types/modules/marketing/validations/spend-to-get-marketing.validation.d.ts +630 -0
  267. package/dist/types/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -0
  268. package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +24 -0
  269. package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -0
  270. package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts +271 -0
  271. package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -0
  272. package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts +56 -0
  273. package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -0
  274. package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +241 -0
  275. package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -0
  276. package/package.json +2 -2
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.spendToGetHistoryRouter = void 0;
4
+ const trpc_1 = require("@lyxa.ai/core/dist/libraries/trpc");
5
+ const spend_to_get_history_service_1 = require("./spend-to-get-history.service");
6
+ const spend_to_get_history_validation_1 = require("./spend-to-get-history.validation");
7
+ const validation_1 = require("@lyxa.ai/core/dist/utilities/validation");
8
+ const error_handler_1 = require("@lyxa.ai/core/dist/utilities/error-handler");
9
+ const response_1 = require("@lyxa.ai/core/dist/utilities/response");
10
+ exports.spendToGetHistoryRouter = (0, trpc_1.createTRPCRouter)({
11
+ create: trpc_1.publicProcedure
12
+ .input(spend_to_get_history_validation_1.SpendToGetHistoryValidationSchema)
13
+ .output(spend_to_get_history_validation_1.SpendToGetHistoryResponseSchema)
14
+ .mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
15
+ await spend_to_get_history_service_1.spendToGetHistoryService.create(input);
16
+ return (0, response_1.response)('Spend to get history created successfully');
17
+ })),
18
+ getById: trpc_1.publicProcedure
19
+ .input(validation_1.IdSchema)
20
+ .output(spend_to_get_history_validation_1.SpendToGetHistoryResponseSchema)
21
+ .query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
22
+ const result = await spend_to_get_history_service_1.spendToGetHistoryService.findById(input);
23
+ return (0, response_1.response)('Spend to get history fetched successfully', spend_to_get_history_validation_1.SpendToGetHistorySchema.parse(result));
24
+ })),
25
+ get: trpc_1.publicProcedure
26
+ .input(validation_1.FilterSchema)
27
+ .output(spend_to_get_history_validation_1.SpendToGetHistoryResponseSchema)
28
+ .query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
29
+ const result = await spend_to_get_history_service_1.spendToGetHistoryService.find(input);
30
+ return (0, response_1.response)('Spend to get history fetched successfully', result);
31
+ })),
32
+ update: trpc_1.publicProcedure
33
+ .input(spend_to_get_history_validation_1.UpdateSpendToGetHistorySchema)
34
+ .output(spend_to_get_history_validation_1.SpendToGetHistoryResponseSchema)
35
+ .mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
36
+ const { _id, ...rest } = input;
37
+ await spend_to_get_history_service_1.spendToGetHistoryService.update(String(_id), rest);
38
+ return (0, response_1.response)('Spend to get history updated successfully');
39
+ })),
40
+ deleteById: trpc_1.publicProcedure
41
+ .input(validation_1.DeleteSchema)
42
+ .output(spend_to_get_history_validation_1.SpendToGetHistoryResponseSchema)
43
+ .mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
44
+ await spend_to_get_history_service_1.spendToGetHistoryService.deleteById(input);
45
+ return (0, response_1.response)('Spend to get history deleted successfully');
46
+ })),
47
+ recordRedemption: trpc_1.publicProcedure
48
+ .input(spend_to_get_history_validation_1.RecordSpendToGetRedemptionSchema)
49
+ .output(spend_to_get_history_validation_1.SpendToGetHistoryResponseSchema)
50
+ .mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
51
+ await spend_to_get_history_service_1.spendToGetHistoryService.recordRedemption(input);
52
+ return (0, response_1.response)('Spend to get redemption recorded successfully');
53
+ })),
54
+ returnRedemption: trpc_1.publicProcedure
55
+ .input(spend_to_get_history_validation_1.ReturnSpendToGetRedemptionSchema)
56
+ .output(spend_to_get_history_validation_1.SpendToGetHistoryResponseSchema)
57
+ .mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
58
+ await spend_to_get_history_service_1.spendToGetHistoryService.returnRedemption(input.order);
59
+ return (0, response_1.response)('Spend to get redemption returned successfully');
60
+ })),
61
+ });
62
+ //# sourceMappingURL=spend-to-get-history.router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-to-get-history.router.js","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.router.ts"],"names":[],"mappings":";;;AAAA,4DAAsF;AACtF,iFAAqF;AACrF,uFAO2C;AAC3C,wEAA+F;AAC/F,8EAA0E;AAC1E,oEAAiE;AAEpD,QAAA,uBAAuB,GAAG,IAAA,uBAAgB,EAAC;IACvD,MAAM,EAAE,sBAAe;SACrB,KAAK,CAAC,mEAAY,CAAC;SACnB,MAAM,CAAC,iEAAc,CAAC;SACtB,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,uDAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,OAAO,IAAA,mBAAQ,EAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC,CAAC,CACF;IAEF,OAAO,EAAE,sBAAe;SACtB,KAAK,CAAC,qBAAQ,CAAC;SACf,MAAM,CAAC,iEAAc,CAAC;SACtB,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC1B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,uDAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,IAAA,mBAAQ,EAAC,2CAA2C,EAAE,yDAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC,CACF;IAEF,GAAG,EAAE,sBAAe;SAClB,KAAK,CAAC,yBAAY,CAAC;SACnB,MAAM,CAAC,iEAAc,CAAC;SACtB,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC1B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,uDAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,OAAO,IAAA,mBAAQ,EAAC,2CAA2C,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CACF;IAEF,MAAM,EAAE,sBAAe;SACrB,KAAK,CAAC,+DAAY,CAAC;SACnB,MAAM,CAAC,iEAAc,CAAC;SACtB,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAC/B,MAAM,uDAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;QACxC,OAAO,IAAA,mBAAQ,EAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC,CAAC,CACF;IAEF,UAAU,EAAE,sBAAe;SACzB,KAAK,CAAC,yBAAY,CAAC;SACnB,MAAM,CAAC,iEAAc,CAAC;SACtB,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,uDAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,IAAA,mBAAQ,EAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC,CAAC,CACF;IAEF,gBAAgB,EAAE,sBAAe;SAC/B,KAAK,CAAC,kEAAgC,CAAC;SACvC,MAAM,CAAC,iEAAc,CAAC;SACtB,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,uDAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACtC,OAAO,IAAA,mBAAQ,EAAC,+CAA+C,CAAC,CAAC;IAClE,CAAC,CAAC,CACF;IAEF,gBAAgB,EAAE,sBAAe;SAC/B,KAAK,CAAC,kEAAgC,CAAC;SACvC,MAAM,CAAC,iEAAc,CAAC;SACtB,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,uDAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5C,OAAO,IAAA,mBAAQ,EAAC,+CAA+C,CAAC,CAAC;IAClE,CAAC,CAAC,CACF;CACF,CAAC,CAAC","sourcesContent":["import { createTRPCRouter, publicProcedure } from '@lyxa.ai/core/dist/libraries/trpc';\nimport { spendToGetHistoryService as service } from './spend-to-get-history.service';\nimport {\n\tSpendToGetHistorySchema as Schema,\n\tSpendToGetHistoryValidationSchema as CreateSchema,\n\tUpdateSpendToGetHistorySchema as UpdateSchema,\n\tSpendToGetHistoryResponseSchema as ResponseSchema,\n\tRecordSpendToGetRedemptionSchema,\n\tReturnSpendToGetRedemptionSchema,\n} from './spend-to-get-history.validation';\nimport { FilterSchema, DeleteSchema, IdSchema } from '@lyxa.ai/core/dist/utilities/validation';\nimport { ErrorHandler } from '@lyxa.ai/core/dist/utilities/error-handler';\nimport { response } from '@lyxa.ai/core/dist/utilities/response';\n\nexport const spendToGetHistoryRouter = createTRPCRouter({\n\tcreate: publicProcedure\n\t\t.input(CreateSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.create(input);\n\t\t\t\treturn response('Spend to get history created successfully');\n\t\t\t})\n\t\t),\n\n\tgetById: publicProcedure\n\t\t.input(IdSchema)\n\t\t.output(ResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.findById(input);\n\t\t\t\treturn response('Spend to get history fetched successfully', Schema.parse(result));\n\t\t\t})\n\t\t),\n\n\tget: publicProcedure\n\t\t.input(FilterSchema)\n\t\t.output(ResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.find(input);\n\t\t\t\treturn response('Spend to get history fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tupdate: publicProcedure\n\t\t.input(UpdateSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst { _id, ...rest } = input;\n\t\t\t\tawait service.update(String(_id), rest);\n\t\t\t\treturn response('Spend to get history updated successfully');\n\t\t\t})\n\t\t),\n\n\tdeleteById: publicProcedure\n\t\t.input(DeleteSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.deleteById(input);\n\t\t\t\treturn response('Spend to get history deleted successfully');\n\t\t\t})\n\t\t),\n\n\trecordRedemption: publicProcedure\n\t\t.input(RecordSpendToGetRedemptionSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.recordRedemption(input);\n\t\t\t\treturn response('Spend to get redemption recorded successfully');\n\t\t\t})\n\t\t),\n\n\treturnRedemption: publicProcedure\n\t\t.input(ReturnSpendToGetRedemptionSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.returnRedemption(input.order);\n\t\t\t\treturn response('Spend to get redemption returned successfully');\n\t\t\t})\n\t\t),\n});\n"]}
@@ -0,0 +1,24 @@
1
+ import { DocumentType, mongoose } from '@typegoose/typegoose';
2
+ import { FilterDTO, PaginatedResponse, DeleteDTO } from '@lyxa.ai/core/dist/utilities/validation';
3
+ import { ModelType } from '@typegoose/typegoose/lib/types';
4
+ import { SpendToGetHistory as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';
5
+ import { CreateSpendToGetHistoryDTO as CreateDTO, UpdateSpendToGetHistoryDTO as UpdateDTO } from './spend-to-get-history.validation';
6
+ export declare class SpendToGetHistoryService {
7
+ private repository;
8
+ constructor();
9
+ create(data: CreateDTO): Promise<DocumentType<Model>>;
10
+ findById(id: string | mongoose.Types.ObjectId): Promise<DocumentType<Model>>;
11
+ find(data?: Partial<FilterDTO>): Promise<PaginatedResponse<DocumentType<ModelType<Model>>>>;
12
+ update(id: string, data: UpdateDTO): Promise<DocumentType<Model>>;
13
+ deleteById(data: DeleteDTO): Promise<string>;
14
+ recordRedemption(params: {
15
+ user: mongoose.Types.ObjectId;
16
+ shop: mongoose.Types.ObjectId;
17
+ marketing: mongoose.Types.ObjectId;
18
+ order: mongoose.Types.ObjectId;
19
+ }): Promise<void>;
20
+ returnRedemption(orderId: mongoose.Types.ObjectId): Promise<void>;
21
+ hasUserReachedLimit(userId: mongoose.Types.ObjectId, marketingId: mongoose.Types.ObjectId, perUserLimit: number): Promise<boolean>;
22
+ }
23
+ export declare const spendToGetHistoryService: SpendToGetHistoryService;
24
+ //# sourceMappingURL=spend-to-get-history.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-to-get-history.service.d.ts","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,iBAAiB,IAAI,KAAK,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EACN,0BAA0B,IAAI,SAAS,EACvC,0BAA0B,IAAI,SAAS,EACvC,MAAM,mCAAmC,CAAC;AAG3C,qBACa,wBAAwB;IACpC,OAAO,CAAC,UAAU,CAA8B;;IAUnC,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAQrD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAe5E,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAgB3F,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAiBjE,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAkB5C,gBAAgB,CAAC,MAAM,EAAE;QACrC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC9B,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC9B,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC;IAQJ,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjE,mBAAmB,CAC/B,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACpC,YAAY,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC;CAInB;AAED,eAAO,MAAM,wBAAwB,0BAA0C,CAAC"}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __metadata = (this && this.__metadata) || function (k, v) {
42
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.spendToGetHistoryService = exports.SpendToGetHistoryService = void 0;
46
+ const typedi_1 = __importStar(require("typedi"));
47
+ const server_1 = require("@trpc/server");
48
+ const spend_to_get_history_repository_1 = require("./spend-to-get-history.repository");
49
+ let SpendToGetHistoryService = class SpendToGetHistoryService {
50
+ repository;
51
+ constructor() {
52
+ this.repository = typedi_1.default.get(spend_to_get_history_repository_1.SpendToGetHistoryRepository);
53
+ }
54
+ async create(data) {
55
+ return await this.repository.create(data);
56
+ }
57
+ async findById(id) {
58
+ const result = await this.repository.findById(id);
59
+ if (!result) {
60
+ throw new server_1.TRPCError({
61
+ code: 'NOT_FOUND',
62
+ message: 'Record not found',
63
+ });
64
+ }
65
+ return result;
66
+ }
67
+ async find(data) {
68
+ try {
69
+ return await this.repository.paginate(data);
70
+ }
71
+ catch (err) {
72
+ throw new server_1.TRPCError({
73
+ code: 'INTERNAL_SERVER_ERROR',
74
+ message: `err: ${err}`,
75
+ });
76
+ }
77
+ }
78
+ async update(id, data) {
79
+ const record = await this.repository.updateById(id, data);
80
+ if (!record) {
81
+ throw new server_1.TRPCError({
82
+ code: 'NOT_FOUND',
83
+ message: `Record not found`,
84
+ });
85
+ }
86
+ return record;
87
+ }
88
+ async deleteById(data) {
89
+ const { _id, softDelete } = data;
90
+ const result = await this.repository.deleteById(_id, softDelete);
91
+ if (!result) {
92
+ throw new server_1.TRPCError({
93
+ code: 'NOT_FOUND',
94
+ message: 'Record not found',
95
+ });
96
+ }
97
+ return 'Record deleted successfully';
98
+ }
99
+ async recordRedemption(params) {
100
+ await this.repository.incrementRedemption(params);
101
+ }
102
+ async returnRedemption(orderId) {
103
+ await this.repository.decrementRedemption(orderId);
104
+ }
105
+ async hasUserReachedLimit(userId, marketingId, perUserLimit) {
106
+ const history = await this.repository.findByUserAndMarketing(userId, marketingId);
107
+ return (history?.redemptionCount ?? 0) >= perUserLimit;
108
+ }
109
+ };
110
+ exports.SpendToGetHistoryService = SpendToGetHistoryService;
111
+ exports.SpendToGetHistoryService = SpendToGetHistoryService = __decorate([
112
+ (0, typedi_1.Service)(),
113
+ __metadata("design:paramtypes", [])
114
+ ], SpendToGetHistoryService);
115
+ exports.spendToGetHistoryService = typedi_1.default.get(SpendToGetHistoryService);
116
+ //# sourceMappingURL=spend-to-get-history.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-to-get-history.service.js","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AASzC,uFAAgF;AAGzE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAC5B,UAAU,CAA8B;IAEhD;QACC,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,6DAA2B,CAAC,CAAC;IAC9D,CAAC;IAMM,KAAK,CAAC,MAAM,CAAC,IAAe;QAClC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAMM,KAAK,CAAC,QAAQ,CAAC,EAAoC;QACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,kBAAkB;aAC3B,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAMM,KAAK,CAAC,IAAI,CAAC,IAAyB;QAC1C,IAAI,CAAC;YACJ,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,QAAQ,GAAG,EAAE;aACtB,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAOM,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,IAAe;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAE1D,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,kBAAkB;aAC3B,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAMM,KAAK,CAAC,UAAU,CAAC,IAAe;QACtC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAEjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,kBAAkB;aAC3B,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,6BAA6B,CAAC;IACtC,CAAC;IAMM,KAAK,CAAC,gBAAgB,CAAC,MAK7B;QACA,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAMM,KAAK,CAAC,gBAAgB,CAAC,OAAgC;QAC7D,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAKM,KAAK,CAAC,mBAAmB,CAC/B,MAA+B,EAC/B,WAAoC,EACpC,YAAoB;QAEpB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAClF,OAAO,CAAC,OAAO,EAAE,eAAe,IAAI,CAAC,CAAC,IAAI,YAAY,CAAC;IACxD,CAAC;CACD,CAAA;AAjHY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,gBAAO,GAAE;;GACG,wBAAwB,CAiHpC;AAEY,QAAA,wBAAwB,GAAG,gBAAS,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { DocumentType, mongoose } from '@typegoose/typegoose';\nimport { FilterDTO, PaginatedResponse, DeleteDTO } from '@lyxa.ai/core/dist/utilities/validation';\nimport { ModelType } from '@typegoose/typegoose/lib/types';\nimport { SpendToGetHistory as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {\n\tCreateSpendToGetHistoryDTO as CreateDTO,\n\tUpdateSpendToGetHistoryDTO as UpdateDTO,\n} from './spend-to-get-history.validation';\nimport { SpendToGetHistoryRepository } from './spend-to-get-history.repository';\n\n@Service()\nexport class SpendToGetHistoryService {\n\tprivate repository: SpendToGetHistoryRepository;\n\n\tconstructor() {\n\t\tthis.repository = Container.get(SpendToGetHistoryRepository);\n\t}\n\n\t/**\n\t * Create a new record\n\t * @param data Data for the new record\n\t */\n\tpublic async create(data: CreateDTO): Promise<DocumentType<Model>> {\n\t\treturn await this.repository.create(data);\n\t}\n\n\t/**\n\t * Get record by ID\n\t * @param id ID of the record\n\t */\n\tpublic async findById(id: string | mongoose.Types.ObjectId): Promise<DocumentType<Model>> {\n\t\tconst result = await this.repository.findById(id);\n\t\tif (!result) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Record not found',\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Get records\n\t * @param query Query to find records\n\t */\n\tpublic async find(data?: Partial<FilterDTO>): Promise<PaginatedResponse<DocumentType<ModelType<Model>>>> {\n\t\ttry {\n\t\t\treturn await this.repository.paginate(data);\n\t\t} catch (err) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'INTERNAL_SERVER_ERROR',\n\t\t\t\tmessage: `err: ${err}`,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Update record\n\t * @param id ID of the record\n\t * @param data Data to update\n\t */\n\tpublic async update(id: string, data: UpdateDTO): Promise<DocumentType<Model>> {\n\t\tconst record = await this.repository.updateById(id, data);\n\n\t\tif (!record) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: `Record not found`,\n\t\t\t});\n\t\t}\n\n\t\treturn record;\n\t}\n\n\t/**\n\t * Delete record by ID\n\t * @param data ID + softDelete flag\n\t */\n\tpublic async deleteById(data: DeleteDTO): Promise<string> {\n\t\tconst { _id, softDelete } = data;\n\n\t\tconst result = await this.repository.deleteById(_id, softDelete);\n\t\tif (!result) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Record not found',\n\t\t\t});\n\t\t}\n\n\t\treturn 'Record deleted successfully';\n\t}\n\n\t/**\n\t * Record a redemption for a user against a Spend-to-Get promotion (per-user limit counter).\n\t * Called on order placement; upserts the one history doc per (user, marketing).\n\t */\n\tpublic async recordRedemption(params: {\n\t\tuser: mongoose.Types.ObjectId;\n\t\tshop: mongoose.Types.ObjectId;\n\t\tmarketing: mongoose.Types.ObjectId;\n\t\torder: mongoose.Types.ObjectId;\n\t}): Promise<void> {\n\t\tawait this.repository.incrementRedemption(params);\n\t}\n\n\t/**\n\t * Reverse a redemption when the order that granted it is cancelled, restoring budget for the\n\t * user's per-user limit.\n\t */\n\tpublic async returnRedemption(orderId: mongoose.Types.ObjectId): Promise<void> {\n\t\tawait this.repository.decrementRedemption(orderId);\n\t}\n\n\t/**\n\t * Whether a user has exhausted their per-user redemption limit for a Spend-to-Get promotion.\n\t */\n\tpublic async hasUserReachedLimit(\n\t\tuserId: mongoose.Types.ObjectId,\n\t\tmarketingId: mongoose.Types.ObjectId,\n\t\tperUserLimit: number\n\t): Promise<boolean> {\n\t\tconst history = await this.repository.findByUserAndMarketing(userId, marketingId);\n\t\treturn (history?.redemptionCount ?? 0) >= perUserLimit;\n\t}\n}\n\nexport const spendToGetHistoryService = Container.get(SpendToGetHistoryService);\n"]}
@@ -0,0 +1,232 @@
1
+ import { z } from 'zod';
2
+ import { DTO } from '@lyxa.ai/core/dist/utilities/validation/global-validation';
3
+ declare const SpendToGetHistoryValidationSchema: z.ZodObject<{
4
+ user: 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>]>;
5
+ marketing: 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>]>;
6
+ 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>]>;
7
+ redemptionCount: z.ZodOptional<z.ZodNumber>;
8
+ lastOrder: z.ZodNullable<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>]>>>;
9
+ }, "strict", z.ZodTypeAny, {
10
+ user: import("mongoose").Types.ObjectId;
11
+ shop: import("mongoose").Types.ObjectId;
12
+ marketing: import("mongoose").Types.ObjectId;
13
+ redemptionCount?: number | undefined;
14
+ lastOrder?: import("mongoose").Types.ObjectId | null | undefined;
15
+ }, {
16
+ user: string | import("mongoose").Types.ObjectId;
17
+ shop: string | import("mongoose").Types.ObjectId;
18
+ marketing: string | import("mongoose").Types.ObjectId;
19
+ redemptionCount?: number | undefined;
20
+ lastOrder?: string | import("mongoose").Types.ObjectId | null | undefined;
21
+ }>, SpendToGetHistorySchema: z.ZodObject<{
22
+ user: 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>]>>;
23
+ marketing: 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>]>>;
24
+ shop: 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>]>>;
25
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
26
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
27
+ _id: 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>]>>;
28
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
29
+ user: 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>]>>;
30
+ marketing: 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>]>>;
31
+ shop: 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>]>>;
32
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
33
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
34
+ _id: 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>]>>;
35
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
36
+ user: 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>]>>;
37
+ marketing: 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>]>>;
38
+ shop: 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>]>>;
39
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
40
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
41
+ _id: 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>]>>;
42
+ }, z.ZodTypeAny, "passthrough">>, SpendToGetHistoryIdSchema: 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>]>, UpdateSpendToGetHistorySchema: z.ZodObject<{
43
+ [x: string]: z.ZodOptional<z.ZodTypeAny>;
44
+ }, "strict", z.ZodTypeAny, {
45
+ [x: string]: any;
46
+ }, {
47
+ [x: string]: any;
48
+ }> | z.ZodObject<{
49
+ user: 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>]>>;
50
+ marketing: 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>]>>;
51
+ shop: 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>]>>;
52
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
53
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
54
+ _id: 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>]>>;
55
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
56
+ user: 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>]>>;
57
+ marketing: 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>]>>;
58
+ shop: 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>]>>;
59
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
60
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
61
+ _id: 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>]>>;
62
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
63
+ user: 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>]>>;
64
+ marketing: 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>]>>;
65
+ shop: 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>]>>;
66
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
67
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
68
+ _id: 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>]>>;
69
+ }, z.ZodTypeAny, "passthrough">>;
70
+ export { SpendToGetHistoryValidationSchema, SpendToGetHistorySchema, SpendToGetHistoryIdSchema as SpendToGetHistoryIdValidationSchema, UpdateSpendToGetHistorySchema, };
71
+ export declare const SpendToGetHistoryResponseSchema: z.ZodObject<{
72
+ success: z.ZodBoolean;
73
+ message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
74
+ data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
75
+ metadata: z.ZodOptional<z.ZodObject<{
76
+ page: z.ZodNumber;
77
+ size: z.ZodNumber;
78
+ totalElements: z.ZodNumber;
79
+ totalPages: z.ZodNumber;
80
+ }, "strip", z.ZodTypeAny, {
81
+ page: number;
82
+ size: number;
83
+ totalElements: number;
84
+ totalPages: number;
85
+ }, {
86
+ page: number;
87
+ size: number;
88
+ totalElements: number;
89
+ totalPages: number;
90
+ }>>;
91
+ documents: z.ZodArray<z.ZodType<z.objectInputType<{
92
+ user: 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>]>>;
93
+ marketing: 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>]>>;
94
+ shop: 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>]>>;
95
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
96
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
97
+ _id: 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>]>>;
98
+ }, z.ZodTypeAny, "passthrough">, z.ZodTypeDef, z.objectInputType<{
99
+ user: 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>]>>;
100
+ marketing: 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>]>>;
101
+ shop: 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>]>>;
102
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
103
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
104
+ _id: 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>]>>;
105
+ }, z.ZodTypeAny, "passthrough">>, "many">;
106
+ }, "strip", z.ZodTypeAny, {
107
+ documents: z.objectInputType<{
108
+ user: 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>]>>;
109
+ marketing: 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>]>>;
110
+ shop: 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>]>>;
111
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
112
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
113
+ _id: 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>]>>;
114
+ }, z.ZodTypeAny, "passthrough">[];
115
+ metadata?: {
116
+ page: number;
117
+ size: number;
118
+ totalElements: number;
119
+ totalPages: number;
120
+ } | undefined;
121
+ }, {
122
+ documents: z.objectInputType<{
123
+ user: 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>]>>;
124
+ marketing: 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>]>>;
125
+ shop: 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>]>>;
126
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
127
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
128
+ _id: 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>]>>;
129
+ }, z.ZodTypeAny, "passthrough">[];
130
+ metadata?: {
131
+ page: number;
132
+ size: number;
133
+ totalElements: number;
134
+ totalPages: number;
135
+ } | undefined;
136
+ }>, z.ZodType<z.objectInputType<{
137
+ user: 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>]>>;
138
+ marketing: 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>]>>;
139
+ shop: 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>]>>;
140
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
141
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
142
+ _id: 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>]>>;
143
+ }, z.ZodTypeAny, "passthrough">, z.ZodTypeDef, z.objectInputType<{
144
+ user: 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>]>>;
145
+ marketing: 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>]>>;
146
+ shop: 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>]>>;
147
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
148
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
149
+ _id: 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>]>>;
150
+ }, z.ZodTypeAny, "passthrough">>]>>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ message: string;
153
+ success: boolean;
154
+ data?: z.objectInputType<{
155
+ user: 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>]>>;
156
+ marketing: 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>]>>;
157
+ shop: 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>]>>;
158
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
159
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
160
+ _id: 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>]>>;
161
+ }, z.ZodTypeAny, "passthrough"> | {
162
+ documents: z.objectInputType<{
163
+ user: 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>]>>;
164
+ marketing: 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>]>>;
165
+ shop: 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>]>>;
166
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
167
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
168
+ _id: 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>]>>;
169
+ }, z.ZodTypeAny, "passthrough">[];
170
+ metadata?: {
171
+ page: number;
172
+ size: number;
173
+ totalElements: number;
174
+ totalPages: number;
175
+ } | undefined;
176
+ } | undefined;
177
+ }, {
178
+ message: string;
179
+ success: boolean;
180
+ data?: z.objectInputType<{
181
+ user: 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>]>>;
182
+ marketing: 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>]>>;
183
+ shop: 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>]>>;
184
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
185
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
186
+ _id: 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>]>>;
187
+ }, z.ZodTypeAny, "passthrough"> | {
188
+ documents: z.objectInputType<{
189
+ user: 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>]>>;
190
+ marketing: 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
+ shop: 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>]>>;
192
+ redemptionCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
193
+ lastOrder: z.ZodOptional<z.ZodNullable<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>]>>>>;
194
+ _id: 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>]>>;
195
+ }, z.ZodTypeAny, "passthrough">[];
196
+ metadata?: {
197
+ page: number;
198
+ size: number;
199
+ totalElements: number;
200
+ totalPages: number;
201
+ } | undefined;
202
+ } | undefined;
203
+ }>;
204
+ export declare const RecordSpendToGetRedemptionSchema: z.ZodObject<{
205
+ user: 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>]>;
206
+ 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>]>;
207
+ marketing: 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>]>;
208
+ order: 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>]>;
209
+ }, "strip", z.ZodTypeAny, {
210
+ user: import("mongoose").Types.ObjectId;
211
+ shop: import("mongoose").Types.ObjectId;
212
+ order: import("mongoose").Types.ObjectId;
213
+ marketing: import("mongoose").Types.ObjectId;
214
+ }, {
215
+ user: string | import("mongoose").Types.ObjectId;
216
+ shop: string | import("mongoose").Types.ObjectId;
217
+ order: string | import("mongoose").Types.ObjectId;
218
+ marketing: string | import("mongoose").Types.ObjectId;
219
+ }>;
220
+ export declare const ReturnSpendToGetRedemptionSchema: z.ZodObject<{
221
+ order: 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>]>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ order: import("mongoose").Types.ObjectId;
224
+ }, {
225
+ order: string | import("mongoose").Types.ObjectId;
226
+ }>;
227
+ export type CreateSpendToGetHistoryDTO = DTO<typeof SpendToGetHistoryValidationSchema>;
228
+ export type SpendToGetHistoryDTO = DTO<typeof SpendToGetHistorySchema>;
229
+ export type UpdateSpendToGetHistoryDTO = DTO<typeof UpdateSpendToGetHistorySchema>;
230
+ export type RecordSpendToGetRedemptionDTO = DTO<typeof RecordSpendToGetRedemptionSchema>;
231
+ export type ReturnSpendToGetRedemptionDTO = DTO<typeof ReturnSpendToGetRedemptionSchema>;
232
+ //# sourceMappingURL=spend-to-get-history.validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-to-get-history.validation.d.ts","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AAwBnE,QAAA,MACa,iCAAiC;;;;;;;;;;;;;;;;;;IAC/B,uBAAuB;;;;;;;;;;;;;;;;;;;;;kCAC3B,yBAAyB,mNACrB,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACQ,CAAC;AAKrD,OAAO,EACN,iCAAiC,EACjC,uBAAuB,EACvB,yBAAyB,IAAI,mCAAmC,EAChE,6BAA6B,GAC7B,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgD,CAAC;AAE7F,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;EAK3C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;EAE3C,CAAC;AAKH,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,iCAAiC,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACnF,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC;AACzF,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReturnSpendToGetRedemptionSchema = exports.RecordSpendToGetRedemptionSchema = exports.SpendToGetHistoryResponseSchema = exports.UpdateSpendToGetHistorySchema = exports.SpendToGetHistoryIdValidationSchema = exports.SpendToGetHistorySchema = exports.SpendToGetHistoryValidationSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const global_validation_1 = require("@lyxa.ai/core/dist/utilities/validation/global-validation");
6
+ const validation_1 = require("@lyxa.ai/core/dist/utilities/validation");
7
+ const baseFields = {
8
+ user: global_validation_1.ZodValidation.objectId('User Id'),
9
+ marketing: global_validation_1.ZodValidation.objectId('Marketing Id'),
10
+ shop: global_validation_1.ZodValidation.objectId('Shop Id'),
11
+ redemptionCount: global_validation_1.ZodValidation.number('Redemption Count').optional(),
12
+ lastOrder: global_validation_1.ZodValidation.objectId('Last Order').optional().nullable(),
13
+ };
14
+ const schemaBuilder = (0, global_validation_1.createSchemaBuilder)(baseFields);
15
+ const { BaseSchema: SpendToGetHistoryValidationSchema, EntitySchema: SpendToGetHistorySchema, IdSchema: SpendToGetHistoryIdSchema, UpdateSchema: UpdateSpendToGetHistorySchema, } = schemaBuilder.getAllSchemas({ createdAt: true });
16
+ exports.SpendToGetHistoryValidationSchema = SpendToGetHistoryValidationSchema;
17
+ exports.SpendToGetHistorySchema = SpendToGetHistorySchema;
18
+ exports.SpendToGetHistoryIdValidationSchema = SpendToGetHistoryIdSchema;
19
+ exports.UpdateSpendToGetHistorySchema = UpdateSpendToGetHistorySchema;
20
+ exports.SpendToGetHistoryResponseSchema = (0, validation_1.createResponseSchema)(SpendToGetHistorySchema);
21
+ exports.RecordSpendToGetRedemptionSchema = zod_1.z.object({
22
+ user: global_validation_1.ZodValidation.objectId('User'),
23
+ shop: global_validation_1.ZodValidation.objectId('Shop'),
24
+ marketing: global_validation_1.ZodValidation.objectId('Marketing'),
25
+ order: global_validation_1.ZodValidation.objectId('Order'),
26
+ });
27
+ exports.ReturnSpendToGetRedemptionSchema = zod_1.z.object({
28
+ order: global_validation_1.ZodValidation.objectId('Order'),
29
+ });
30
+ //# sourceMappingURL=spend-to-get-history.validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend-to-get-history.validation.js","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,wEAA+E;AAK/E,MAAM,UAAU,GAAG;IAClB,IAAI,EAAE,iCAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;IACvC,SAAS,EAAE,iCAAa,CAAC,QAAQ,CAAC,cAAc,CAAC;IACjD,IAAI,EAAE,iCAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;IACvC,eAAe,EAAE,iCAAa,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;IACpE,SAAS,EAAE,iCAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACrE,CAAC;AAOF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AAKtD,MAAM,EACL,UAAU,EAAE,iCAAiC,EAC7C,YAAY,EAAE,uBAAuB,EACrC,QAAQ,EAAE,yBAAyB,EACnC,YAAY,EAAE,6BAA6B,GAC3C,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAMpD,8EAAiC;AACjC,0DAAuB;AACM,wEAAmC;AAChE,sEAA6B;AAGjB,QAAA,+BAA+B,GAAG,IAAA,iCAAoB,EAAC,uBAAuB,CAAC,CAAC;AAEhF,QAAA,gCAAgC,GAAG,OAAC,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,iCAAa,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,iCAAa,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpC,SAAS,EAAE,iCAAa,CAAC,QAAQ,CAAC,WAAW,CAAC;IAC9C,KAAK,EAAE,iCAAa,CAAC,QAAQ,CAAC,OAAO,CAAC;CACtC,CAAC,CAAC;AAEU,QAAA,gCAAgC,GAAG,OAAC,CAAC,MAAM,CAAC;IACxD,KAAK,EAAE,iCAAa,CAAC,QAAQ,CAAC,OAAO,CAAC;CACtC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO,\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { createResponseSchema } from '@lyxa.ai/core/dist/utilities/validation';\n\n/**\n * Define the base parent schema fields\n */\nconst baseFields = {\n\tuser: ZodValidation.objectId('User Id'),\n\tmarketing: ZodValidation.objectId('Marketing Id'),\n\tshop: ZodValidation.objectId('Shop Id'),\n\tredemptionCount: ZodValidation.number('Redemption Count').optional(),\n\tlastOrder: ZodValidation.objectId('Last Order').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(baseFields);\n\n/**\n * Get all schemas for the Parent entity\n */\nconst {\n\tBaseSchema: SpendToGetHistoryValidationSchema,\n\tEntitySchema: SpendToGetHistorySchema,\n\tIdSchema: SpendToGetHistoryIdSchema,\n\tUpdateSchema: UpdateSpendToGetHistorySchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\n/**\n * Export schemas\n */\nexport {\n\tSpendToGetHistoryValidationSchema,\n\tSpendToGetHistorySchema,\n\tSpendToGetHistoryIdSchema as SpendToGetHistoryIdValidationSchema,\n\tUpdateSpendToGetHistorySchema,\n};\n\nexport const SpendToGetHistoryResponseSchema = createResponseSchema(SpendToGetHistorySchema);\n\nexport const RecordSpendToGetRedemptionSchema = z.object({\n\tuser: ZodValidation.objectId('User'),\n\tshop: ZodValidation.objectId('Shop'),\n\tmarketing: ZodValidation.objectId('Marketing'),\n\torder: ZodValidation.objectId('Order'),\n});\n\nexport const ReturnSpendToGetRedemptionSchema = z.object({\n\torder: ZodValidation.objectId('Order'),\n});\n\n/**\n * Export DTO types\n */\nexport type CreateSpendToGetHistoryDTO = DTO<typeof SpendToGetHistoryValidationSchema>;\nexport type SpendToGetHistoryDTO = DTO<typeof SpendToGetHistorySchema>;\nexport type UpdateSpendToGetHistoryDTO = DTO<typeof UpdateSpendToGetHistorySchema>;\nexport type RecordSpendToGetRedemptionDTO = DTO<typeof RecordSpendToGetRedemptionSchema>;\nexport type ReturnSpendToGetRedemptionDTO = DTO<typeof ReturnSpendToGetRedemptionSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"event-initializations.d.ts","sourceRoot":"/","sources":["event/event-initializations.ts"],"names":[],"mappings":"AAQA,wBAAsB,kBAAkB,kBAMvC"}
1
+ {"version":3,"file":"event-initializations.d.ts","sourceRoot":"/","sources":["event/event-initializations.ts"],"names":[],"mappings":"AAUA,wBAAsB,kBAAkB,kBAQvC"}
@@ -1,4 +1,6 @@
1
1
  export declare function subscribeToSyncAllProductsProductMarketingInfoProcessEvent(): Promise<void>;
2
2
  export declare function subscribeToMarketingEntireMenuSeedEvent(): Promise<void>;
3
+ export declare function subscribeToMarketingProductSyncEvent(): Promise<void>;
3
4
  export declare function subscribeToMarketingReturnPunchCouponEvent(): Promise<void>;
5
+ export declare function subscribeToMarketingReturnSpendToGetRedemptionEvent(): Promise<void>;
4
6
  //# sourceMappingURL=event-listeners.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-listeners.d.ts","sourceRoot":"/","sources":["event/event-listeners/event-listeners.ts"],"names":[],"mappings":"AAaA,wBAAsB,0DAA0D,kBAI/E;AAgBD,wBAAsB,uCAAuC,kBA4D5D;AAED,wBAAsB,0CAA0C,kBAI/D"}
1
+ {"version":3,"file":"event-listeners.d.ts","sourceRoot":"/","sources":["event/event-listeners/event-listeners.ts"],"names":[],"mappings":"AAeA,wBAAsB,0DAA0D,kBAI/E;AAgBD,wBAAsB,uCAAuC,kBA+D5D;AAED,wBAAsB,oCAAoC,kBAqDzD;AAED,wBAAsB,0CAA0C,kBAI/D;AAED,wBAAsB,mDAAmD,kBAIxE"}
@@ -6,8 +6,7 @@ export interface MarketingProductSeedPayload {
6
6
  shopId: string;
7
7
  isAppliedByCompany: boolean;
8
8
  isBuy1Get1: boolean;
9
- page: number;
10
- pageSize: number;
9
+ productIds: string[];
11
10
  value?: number;
12
11
  valueType?: ValueType;
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"marketing-product-seed.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-seed.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AAEnF,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,4BAA6B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBAC3E,OAAO,EAAE,2BAA2B;CAGhD"}
1
+ {"version":3,"file":"marketing-product-seed.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-seed.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AAEnF,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,4BAA6B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBAC3E,OAAO,EAAE,2BAA2B;CAGhD"}
@@ -0,0 +1,11 @@
1
+ import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';
2
+ export declare const MARKETING_PRODUCT_SYNC_EVENT = "marketing_product_sync_event";
3
+ export interface MarketingProductSyncPayload {
4
+ marketingId: string;
5
+ shopId: string;
6
+ productIds: string[];
7
+ }
8
+ export declare class MarketingProductSyncEvent extends BaseEvent<MarketingProductSyncPayload> {
9
+ constructor(payload: MarketingProductSyncPayload);
10
+ }
11
+ //# sourceMappingURL=marketing-product-sync.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketing-product-sync.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-sync.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qBAAa,yBAA0B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBACxE,OAAO,EAAE,2BAA2B;CAGhD"}