@lyxa.ai/marketing 1.0.63 → 1.0.64

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 (182) hide show
  1. package/dist/lib/index.d.ts +19 -17
  2. package/dist/lib/index.d.ts.map +1 -1
  3. package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  4. package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts +15 -3
  5. package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
  6. package/dist/lib/modules/coupon/services/helper.service.d.ts +15 -3
  7. package/dist/lib/modules/coupon/services/helper.service.d.ts.map +1 -1
  8. package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts +15 -3
  9. package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
  10. package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts +15 -3
  11. package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
  12. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +2 -0
  13. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  14. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +18 -4
  15. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -1
  16. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  17. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +4 -0
  18. package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
  19. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  20. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +3 -9
  21. package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js.map +1 -1
  22. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +7 -1
  23. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  24. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +5 -1
  25. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -1
  26. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +8 -0
  27. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  28. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +60 -0
  29. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -1
  30. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +217 -213
  31. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  32. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
  33. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +4 -0
  34. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  35. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js +14 -8
  36. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js.map +1 -1
  37. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +10 -9
  38. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  39. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js +64 -49
  40. package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
  41. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
  42. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
  43. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +15 -3
  44. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -1
  45. package/dist/lib/modules/marketing/routers/marketing.router.d.ts +2 -0
  46. package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  47. package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
  48. package/dist/lib/modules/marketing/services/marketing.service.js +13 -3
  49. package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
  50. package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +3 -3
  51. package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +3 -3
  52. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +6 -0
  53. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  54. package/dist/lib/modules/marketing/validations/marketing.validation.js +2 -0
  55. package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
  56. package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
  57. package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
  58. package/dist/lib/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
  59. package/dist/lib/modules/spend-to-get-history/routers/index.d.ts +2 -0
  60. package/dist/lib/modules/spend-to-get-history/routers/index.d.ts.map +1 -0
  61. package/dist/lib/modules/spend-to-get-history/routers/index.js +18 -0
  62. package/dist/lib/modules/spend-to-get-history/routers/index.js.map +1 -0
  63. package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js +62 -0
  64. package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js.map +1 -0
  65. package/dist/lib/modules/spend-to-get-history/services/index.d.ts +2 -0
  66. package/dist/lib/modules/spend-to-get-history/services/index.d.ts.map +1 -0
  67. package/dist/lib/modules/spend-to-get-history/services/index.js +18 -0
  68. package/dist/lib/modules/spend-to-get-history/services/index.js.map +1 -0
  69. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +24 -0
  70. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts.map +1 -0
  71. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.js +136 -0
  72. package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.js.map +1 -0
  73. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -1
  74. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js +13 -2
  75. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js.map +1 -1
  76. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts +16 -16
  77. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +19 -19
  78. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js +1 -1
  79. package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js.map +1 -1
  80. package/dist/lib/modules/spend-to-get-history/validations/index.d.ts +2 -0
  81. package/dist/lib/modules/spend-to-get-history/validations/index.d.ts.map +1 -0
  82. package/dist/lib/modules/spend-to-get-history/validations/index.js +18 -0
  83. package/dist/lib/modules/spend-to-get-history/validations/index.js.map +1 -0
  84. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +232 -0
  85. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +1 -0
  86. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js +30 -0
  87. package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js.map +1 -0
  88. package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
  89. package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
  90. package/dist/lib/modules/tournament/match/events/match-ended.consumer.js +15 -0
  91. package/dist/lib/modules/tournament/match/events/match-ended.consumer.js.map +1 -0
  92. package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts +14 -0
  93. package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
  94. package/dist/lib/modules/tournament/match/events/match-ended.event.js +12 -0
  95. package/dist/lib/modules/tournament/match/events/match-ended.event.js.map +1 -0
  96. package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts +10 -0
  97. package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
  98. package/dist/lib/modules/tournament/notification/jobs/notification.producer.js +23 -0
  99. package/dist/lib/modules/tournament/notification/jobs/notification.producer.js.map +1 -0
  100. package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts +9 -0
  101. package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
  102. package/dist/lib/modules/tournament/notification/jobs/notification.worker.js +82 -0
  103. package/dist/lib/modules/tournament/notification/jobs/notification.worker.js.map +1 -0
  104. package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
  105. package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
  106. package/dist/lib/modules/tournament/notification/notification.schedule.config.js +15 -0
  107. package/dist/lib/modules/tournament/notification/notification.schedule.config.js.map +1 -0
  108. package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
  109. package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
  110. package/dist/lib/modules/tournament/notification/notification.scheduler.service.js +73 -0
  111. package/dist/lib/modules/tournament/notification/notification.scheduler.service.js.map +1 -0
  112. package/dist/types/events/event-initializations.d.ts +2 -0
  113. package/dist/types/events/event-initializations.d.ts.map +1 -0
  114. package/dist/types/index.d.ts +19 -17
  115. package/dist/types/index.d.ts.map +1 -1
  116. package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  117. package/dist/types/modules/coupon/services/custom-coupon.service.d.ts +15 -3
  118. package/dist/types/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
  119. package/dist/types/modules/coupon/services/helper.service.d.ts +15 -3
  120. package/dist/types/modules/coupon/services/helper.service.d.ts.map +1 -1
  121. package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts +15 -3
  122. package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
  123. package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts +15 -3
  124. package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
  125. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +2 -0
  126. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
  127. package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
  128. package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
  129. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +7 -1
  130. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
  131. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +8 -0
  132. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
  133. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +217 -213
  134. package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
  135. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +4 -0
  136. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
  137. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +10 -9
  138. package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
  139. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
  140. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
  141. package/dist/types/modules/marketing/routers/marketing.router.d.ts +2 -0
  142. package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  143. package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
  144. package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +3 -3
  145. package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +3 -3
  146. package/dist/types/modules/marketing/validations/marketing.validation.d.ts +6 -0
  147. package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  148. package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
  149. package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
  150. package/dist/types/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
  151. package/dist/types/modules/spend-to-get-history/routers/index.d.ts +2 -0
  152. package/dist/types/modules/spend-to-get-history/routers/index.d.ts.map +1 -0
  153. package/dist/types/modules/spend-to-get-history/services/index.d.ts +2 -0
  154. package/dist/types/modules/spend-to-get-history/services/index.d.ts.map +1 -0
  155. package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +56 -0
  156. package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts.map +1 -0
  157. package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -1
  158. package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts +16 -16
  159. package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +19 -19
  160. package/dist/types/modules/spend-to-get-history/validations/index.d.ts +2 -0
  161. package/dist/types/modules/spend-to-get-history/validations/index.d.ts.map +1 -0
  162. package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +241 -0
  163. package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +1 -0
  164. package/dist/types/modules/tournament/config/tournament-config.validation.d.ts +201 -0
  165. package/dist/types/modules/tournament/config/tournament-config.validation.d.ts.map +1 -0
  166. package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
  167. package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
  168. package/dist/types/modules/tournament/match/events/match-ended.event.d.ts +14 -0
  169. package/dist/types/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
  170. package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts +10 -0
  171. package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
  172. package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts +9 -0
  173. package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
  174. package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
  175. package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
  176. package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
  177. package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
  178. package/package.json +2 -2
  179. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +0 -1
  180. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +0 -1
  181. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js +0 -2
  182. package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js.map +0 -1
@@ -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/validations/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/validations/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"]}
@@ -0,0 +1,2 @@
1
+ export declare function startTournamentEventConsumer(): Promise<void>;
2
+ //# sourceMappingURL=match-ended.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-ended.consumer.d.ts","sourceRoot":"/","sources":["modules/tournament/match/events/match-ended.consumer.ts"],"names":[],"mappings":"AAKA,wBAAsB,4BAA4B,kBAMjD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startTournamentEventConsumer = startTournamentEventConsumer;
4
+ const typegoose_1 = require("@typegoose/typegoose");
5
+ const match_ended_event_1 = require("./match-ended.event");
6
+ const match_service_1 = require("../match.service");
7
+ const event_1 = require("@lyxa.ai/core/dist/libraries/event");
8
+ async function startTournamentEventConsumer() {
9
+ await (0, event_1.subscribeToEvent)(match_ended_event_1.TOURNAMENT_MATCH_ENDED_EVENT, async (payload) => {
10
+ const tournamentId = new typegoose_1.mongoose.Types.ObjectId(payload.tournamentId);
11
+ const matchId = new typegoose_1.mongoose.Types.ObjectId(payload.matchId);
12
+ await match_service_1.matchService.handleMatchEnded(tournamentId, matchId, payload.finalScore);
13
+ });
14
+ }
15
+ //# sourceMappingURL=match-ended.consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-ended.consumer.js","sourceRoot":"/","sources":["modules/tournament/match/events/match-ended.consumer.ts"],"names":[],"mappings":";;AAKA,oEAMC;AAXD,oDAA8C;AAC9C,2DAAoF;AACpF,oDAA8C;AAC9C,8DAAoE;AAE7D,KAAK,UAAU,4BAA4B;IAC9C,MAAM,IAAA,wBAAgB,EAAC,gDAA4B,EAAE,KAAK,EAAE,OAA0B,EAAE,EAAE;QACtF,MAAM,YAAY,GAAG,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACvE,MAAM,OAAO,GAAG,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,4BAAY,CAAC,gBAAgB,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {MatchEndedPayload, TOURNAMENT_MATCH_ENDED_EVENT} from './match-ended.event';\nimport {matchService} from '../match.service';\nimport {subscribeToEvent} from '@lyxa.ai/core/dist/libraries/event';\n\nexport async function startTournamentEventConsumer() {\n await subscribeToEvent(TOURNAMENT_MATCH_ENDED_EVENT, async (payload: MatchEndedPayload) => {\n const tournamentId = new mongoose.Types.ObjectId(payload.tournamentId);\n const matchId = new mongoose.Types.ObjectId(payload.matchId);\n await matchService.handleMatchEnded(tournamentId, matchId, payload.finalScore);\n });\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';
2
+ export declare const TOURNAMENT_MATCH_ENDED_EVENT = "tournament_match_ended_event";
3
+ export interface MatchEndedPayload {
4
+ tournamentId: string;
5
+ matchId: string;
6
+ finalScore: {
7
+ team1: number;
8
+ team2: number;
9
+ };
10
+ }
11
+ export declare class MatchEndedEvent extends BaseEvent<MatchEndedPayload> {
12
+ constructor(payload: MatchEndedPayload);
13
+ }
14
+ //# sourceMappingURL=match-ended.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-ended.event.d.ts","sourceRoot":"/","sources":["modules/tournament/match/events/match-ended.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD;AAED,qBAAa,eAAgB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;gBACjD,OAAO,EAAE,iBAAiB;CAGzC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MatchEndedEvent = exports.TOURNAMENT_MATCH_ENDED_EVENT = void 0;
4
+ const BaseEvent_1 = require("@lyxa.ai/core/dist/libraries/event/BaseEvent");
5
+ exports.TOURNAMENT_MATCH_ENDED_EVENT = 'tournament_match_ended_event';
6
+ class MatchEndedEvent extends BaseEvent_1.BaseEvent {
7
+ constructor(payload) {
8
+ super(exports.TOURNAMENT_MATCH_ENDED_EVENT, payload);
9
+ }
10
+ }
11
+ exports.MatchEndedEvent = MatchEndedEvent;
12
+ //# sourceMappingURL=match-ended.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-ended.event.js","sourceRoot":"/","sources":["modules/tournament/match/events/match-ended.event.ts"],"names":[],"mappings":";;;AAAA,4EAAyE;AAE5D,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAQ3E,MAAa,eAAgB,SAAQ,qBAA4B;IAC7D,YAAY,OAA0B;QAClC,KAAK,CAAC,oCAA4B,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACJ;AAJD,0CAIC","sourcesContent":["import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';\n\nexport const TOURNAMENT_MATCH_ENDED_EVENT = 'tournament_match_ended_event';\n\nexport interface MatchEndedPayload {\n tournamentId: string;\n matchId: string;\n finalScore: { team1: number; team2: number };\n}\n\nexport class MatchEndedEvent extends BaseEvent<MatchEndedPayload> {\n constructor(payload: MatchEndedPayload) {\n super(TOURNAMENT_MATCH_ENDED_EVENT, payload);\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { JobsOptions } from 'bullmq';
2
+ export declare const TOURNAMENT_NOTIFICATION_QUEUE = "tournament-match-notifications";
3
+ export interface TournamentNotificationJobData {
4
+ tournamentId: string;
5
+ matchId: string;
6
+ target: string;
7
+ }
8
+ export declare function addNotificationJob(name: string, data: TournamentNotificationJobData, options: JobsOptions): Promise<void>;
9
+ export declare function removeNotificationJob(jobId: string): Promise<void>;
10
+ //# sourceMappingURL=notification.producer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.producer.d.ts","sourceRoot":"/","sources":["modules/tournament/notification/jobs/notification.producer.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE5C,eAAO,MAAM,6BAA6B,mCAAmC,CAAC;AAE9E,MAAM,WAAW,6BAA6B;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB;AAYD,wBAAsB,kBAAkB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,6BAA6B,EACnC,OAAO,EAAE,WAAW,GACrB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxE"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOURNAMENT_NOTIFICATION_QUEUE = void 0;
4
+ exports.addNotificationJob = addNotificationJob;
5
+ exports.removeNotificationJob = removeNotificationJob;
6
+ const core_1 = require("@lyxa.ai/core");
7
+ exports.TOURNAMENT_NOTIFICATION_QUEUE = 'tournament-match-notifications';
8
+ let _queue = null;
9
+ function getQueue() {
10
+ if (!_queue) {
11
+ _queue = (0, core_1.getLibraries)().getBullMQService().createQueue(exports.TOURNAMENT_NOTIFICATION_QUEUE);
12
+ }
13
+ return _queue;
14
+ }
15
+ async function addNotificationJob(name, data, options) {
16
+ await getQueue().add(name, data, options);
17
+ }
18
+ async function removeNotificationJob(jobId) {
19
+ const job = await getQueue().getJob(jobId);
20
+ if (job)
21
+ await job.remove();
22
+ }
23
+ //# sourceMappingURL=notification.producer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.producer.js","sourceRoot":"/","sources":["modules/tournament/notification/jobs/notification.producer.ts"],"names":[],"mappings":";;;AAqBA,gDAMC;AAED,sDAGC;AAhCD,wCAA6C;AAGhC,QAAA,6BAA6B,GAAG,gCAAgC,CAAC;AAQ9E,IAAI,MAAM,GAAiB,IAAI,CAAC;AAEhC,SAAS,QAAQ;IACb,IAAI,CAAC,MAAM,EAAE,CAAC;QAEV,MAAM,GAAG,IAAA,mBAAY,GAAE,CAAC,gBAAgB,EAAE,CAAC,WAAW,CAAC,qCAA6B,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,MAAO,CAAC;AACnB,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACpC,IAAY,EACZ,IAAmC,EACnC,OAAoB;IAEpB,MAAM,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAEM,KAAK,UAAU,qBAAqB,CAAC,KAAa;IACrD,MAAM,GAAG,GAAG,MAAM,QAAQ,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,GAAG;QAAE,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import { getLibraries } from '@lyxa.ai/core';\nimport { Queue, JobsOptions } from 'bullmq';\n\nexport const TOURNAMENT_NOTIFICATION_QUEUE = 'tournament-match-notifications';\n\nexport interface TournamentNotificationJobData {\n tournamentId: string;\n matchId: string;\n target: string;\n}\n\nlet _queue: Queue | null = null;\n\nfunction getQueue(): Queue {\n if (!_queue) {\n // @ts-ignore\n _queue = getLibraries().getBullMQService().createQueue(TOURNAMENT_NOTIFICATION_QUEUE);\n }\n return _queue!;\n}\n\nexport async function addNotificationJob(\n name: string,\n data: TournamentNotificationJobData,\n options: JobsOptions\n): Promise<void> {\n await getQueue().add(name, data, options);\n}\n\nexport async function removeNotificationJob(jobId: string): Promise<void> {\n const job = await getQueue().getJob(jobId);\n if (job) await job.remove();\n}\n"]}
@@ -0,0 +1,9 @@
1
+ export declare class TournamentNotificationWorker {
2
+ private notificationService;
3
+ private templateRepository;
4
+ private matchRepository;
5
+ constructor();
6
+ startWorker(): void;
7
+ }
8
+ export declare const tournamentNotificationWorker: TournamentNotificationWorker;
9
+ //# sourceMappingURL=notification.worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.worker.d.ts","sourceRoot":"/","sources":["modules/tournament/notification/jobs/notification.worker.ts"],"names":[],"mappings":"AAQA,qBACa,4BAA4B;IACrC,OAAO,CAAC,mBAAmB,CAAgC;IAC3D,OAAO,CAAC,kBAAkB,CAAiC;IAC3D,OAAO,CAAC,eAAe,CAA4B;;IAQ5C,WAAW,IAAI,IAAI;CAe7B;AAED,eAAO,MAAM,4BAA4B,8BAA8C,CAAC"}
@@ -0,0 +1,82 @@
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.tournamentNotificationWorker = exports.TournamentNotificationWorker = void 0;
46
+ const typedi_1 = __importStar(require("typedi"));
47
+ const typegoose_1 = require("@typegoose/typegoose");
48
+ const core_1 = require("@lyxa.ai/core");
49
+ const notification_producer_1 = require("./notification.producer");
50
+ const notification_service_1 = require("../notification.service");
51
+ const notification_template_repository_1 = require("../notification-template.repository");
52
+ const match_repository_1 = require("../../match/match.repository");
53
+ let TournamentNotificationWorker = class TournamentNotificationWorker {
54
+ notificationService;
55
+ templateRepository;
56
+ matchRepository;
57
+ constructor() {
58
+ this.notificationService = typedi_1.default.get(notification_service_1.TournamentNotificationService);
59
+ this.templateRepository = typedi_1.default.get(notification_template_repository_1.NotificationTemplateRepository);
60
+ this.matchRepository = typedi_1.default.get(match_repository_1.TournamentMatchRepository);
61
+ }
62
+ startWorker() {
63
+ (0, core_1.getLibraries)().getBullMQService().createWorker(notification_producer_1.TOURNAMENT_NOTIFICATION_QUEUE, async (job) => {
64
+ const { tournamentId, matchId, target } = job.data;
65
+ const tournamentObjId = new typegoose_1.mongoose.Types.ObjectId(tournamentId);
66
+ const matchObjId = new typegoose_1.mongoose.Types.ObjectId(matchId);
67
+ const alreadySent = await this.matchRepository.getNotificationFlag(tournamentObjId, matchObjId, job.name);
68
+ if (alreadySent)
69
+ return;
70
+ const templates = await this.templateRepository.findTemplates(tournamentObjId);
71
+ await this.notificationService.dispatchScheduledJob(job.name, target, templates, tournamentObjId, matchObjId);
72
+ await this.matchRepository.setNotificationFlag(tournamentObjId, matchObjId, job.name);
73
+ });
74
+ }
75
+ };
76
+ exports.TournamentNotificationWorker = TournamentNotificationWorker;
77
+ exports.TournamentNotificationWorker = TournamentNotificationWorker = __decorate([
78
+ (0, typedi_1.Service)(),
79
+ __metadata("design:paramtypes", [])
80
+ ], TournamentNotificationWorker);
81
+ exports.tournamentNotificationWorker = typedi_1.default.get(TournamentNotificationWorker);
82
+ //# sourceMappingURL=notification.worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.worker.js","sourceRoot":"/","sources":["modules/tournament/notification/jobs/notification.worker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,oDAA8C;AAC9C,wCAA2C;AAC3C,mEAAqG;AACrG,kEAAsE;AACtE,0FAAmF;AACnF,mEAAuE;AAGhE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAC7B,mBAAmB,CAAgC;IACnD,kBAAkB,CAAiC;IACnD,eAAe,CAA4B;IAEnD;QACI,IAAI,CAAC,mBAAmB,GAAG,gBAAS,CAAC,GAAG,CAAC,oDAA6B,CAAC,CAAC;QACxE,IAAI,CAAC,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,iEAA8B,CAAC,CAAC;QACxE,IAAI,CAAC,eAAe,GAAG,gBAAS,CAAC,GAAG,CAAC,4CAAyB,CAAC,CAAC;IACpE,CAAC;IAEM,WAAW;QACd,IAAA,mBAAY,GAAE,CAAC,gBAAgB,EAAE,CAAC,YAAY,CAAC,qDAA6B,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE;YACtF,MAAM,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAC,GAAG,GAAG,CAAC,IAAqC,CAAC;YAClF,MAAM,eAAe,GAAG,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAClE,MAAM,UAAU,GAAG,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAExD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1G,IAAI,WAAW;gBAAE,OAAO;YAExB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;YAC/E,MAAM,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;YAE9G,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1F,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA1BY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,gBAAO,GAAE;;GACG,4BAA4B,CA0BxC;AAEY,QAAA,4BAA4B,GAAG,gBAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {mongoose} from '@typegoose/typegoose';\nimport {getLibraries} from '@lyxa.ai/core';\nimport {TOURNAMENT_NOTIFICATION_QUEUE, TournamentNotificationJobData} from './notification.producer';\nimport {TournamentNotificationService} from '../notification.service';\nimport {NotificationTemplateRepository} from '../notification-template.repository';\nimport {TournamentMatchRepository} from '../../match/match.repository';\n\n@Service()\nexport class TournamentNotificationWorker {\n private notificationService: TournamentNotificationService;\n private templateRepository: NotificationTemplateRepository;\n private matchRepository: TournamentMatchRepository;\n\n constructor() {\n this.notificationService = Container.get(TournamentNotificationService);\n this.templateRepository = Container.get(NotificationTemplateRepository);\n this.matchRepository = Container.get(TournamentMatchRepository);\n }\n\n public startWorker(): void {\n getLibraries().getBullMQService().createWorker(TOURNAMENT_NOTIFICATION_QUEUE, async job => {\n const {tournamentId, matchId, target} = job.data as TournamentNotificationJobData;\n const tournamentObjId = new mongoose.Types.ObjectId(tournamentId);\n const matchObjId = new mongoose.Types.ObjectId(matchId);\n\n const alreadySent = await this.matchRepository.getNotificationFlag(tournamentObjId, matchObjId, job.name);\n if (alreadySent) return;\n\n const templates = await this.templateRepository.findTemplates(tournamentObjId);\n await this.notificationService.dispatchScheduledJob(job.name, target, templates, tournamentObjId, matchObjId);\n\n await this.matchRepository.setNotificationFlag(tournamentObjId, matchObjId, job.name);\n });\n }\n}\n\nexport const tournamentNotificationWorker = Container.get(TournamentNotificationWorker);\n"]}
@@ -0,0 +1,10 @@
1
+ export declare enum NotificationTag {
2
+ TOURNAMENT_ACTIVATION = "tournament-activation",
3
+ MATCH_RESULT_WINNER = "match-result-winner",
4
+ MATCH_RESULT_LOSER = "match-result-loser"
5
+ }
6
+ export declare enum ScheduledTarget {
7
+ GLOBAL = "global",
8
+ UNPREDICTED_PARTICIPANTS = "unpredicted-participants"
9
+ }
10
+ //# sourceMappingURL=notification.schedule.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.schedule.config.d.ts","sourceRoot":"/","sources":["modules/tournament/notification/notification.schedule.config.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACvB,qBAAqB,0BAA0B;IAC/C,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;CAC5C;AAED,oBAAY,eAAe;IACvB,MAAM,WAAW;IACjB,wBAAwB,6BAA6B;CACxD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduledTarget = exports.NotificationTag = void 0;
4
+ var NotificationTag;
5
+ (function (NotificationTag) {
6
+ NotificationTag["TOURNAMENT_ACTIVATION"] = "tournament-activation";
7
+ NotificationTag["MATCH_RESULT_WINNER"] = "match-result-winner";
8
+ NotificationTag["MATCH_RESULT_LOSER"] = "match-result-loser";
9
+ })(NotificationTag || (exports.NotificationTag = NotificationTag = {}));
10
+ var ScheduledTarget;
11
+ (function (ScheduledTarget) {
12
+ ScheduledTarget["GLOBAL"] = "global";
13
+ ScheduledTarget["UNPREDICTED_PARTICIPANTS"] = "unpredicted-participants";
14
+ })(ScheduledTarget || (exports.ScheduledTarget = ScheduledTarget = {}));
15
+ //# sourceMappingURL=notification.schedule.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.schedule.config.js","sourceRoot":"/","sources":["modules/tournament/notification/notification.schedule.config.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,kEAA+C,CAAA;IAC/C,8DAA2C,CAAA;IAC3C,4DAAyC,CAAA;AAC7C,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAED,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,wEAAqD,CAAA;AACzD,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["export enum NotificationTag {\n TOURNAMENT_ACTIVATION = 'tournament-activation',\n MATCH_RESULT_WINNER = 'match-result-winner',\n MATCH_RESULT_LOSER = 'match-result-loser',\n}\n\nexport enum ScheduledTarget {\n GLOBAL = 'global',\n UNPREDICTED_PARTICIPANTS = 'unpredicted-participants',\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { mongoose } from '@typegoose/typegoose';
2
+ import { ScheduledNotificationConfig } from '@lyxa.ai/core/dist/libraries/mongo/models';
3
+ export declare class NotificationSchedulerService {
4
+ private jobId;
5
+ private buildJobData;
6
+ scheduleForMatch(matchId: mongoose.Types.ObjectId, tournamentId: mongoose.Types.ObjectId, startingDate: Date, scheduledNotifications: ScheduledNotificationConfig[]): Promise<void>;
7
+ cancelForMatch(matchId: mongoose.Types.ObjectId, scheduledNotifications: ScheduledNotificationConfig[]): Promise<void>;
8
+ }
9
+ export declare const notificationSchedulerService: NotificationSchedulerService;
10
+ //# sourceMappingURL=notification.scheduler.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.scheduler.service.d.ts","sourceRoot":"/","sources":["modules/tournament/notification/notification.scheduler.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAGxF,qBACa,4BAA4B;IACrC,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,YAAY;IAIP,gBAAgB,CACzB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAChC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACrC,YAAY,EAAE,IAAI,EAClB,sBAAsB,EAAE,2BAA2B,EAAE,GACtD,OAAO,CAAC,IAAI,CAAC;IAcH,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtI;AAED,eAAO,MAAM,4BAA4B,8BAA8C,CAAC"}