@lyxa.ai/marketing 1.0.49 → 1.0.51

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 (241) hide show
  1. package/dist/lib/index.d.ts +265 -21
  2. package/dist/lib/index.d.ts.map +1 -1
  3. package/dist/lib/modules/tournament/config/config.repository.d.ts +3 -0
  4. package/dist/lib/modules/tournament/config/config.repository.d.ts.map +1 -1
  5. package/dist/lib/modules/tournament/config/config.repository.js +3 -0
  6. package/dist/lib/modules/tournament/config/config.repository.js.map +1 -1
  7. package/dist/lib/modules/tournament/config/config.router.d.ts +10 -10
  8. package/dist/lib/modules/tournament/config/config.validation.d.ts +37 -36
  9. package/dist/lib/modules/tournament/config/config.validation.d.ts.map +1 -1
  10. package/dist/lib/modules/tournament/config/config.validation.js +4 -3
  11. package/dist/lib/modules/tournament/config/config.validation.js.map +1 -1
  12. package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.d.ts.map +1 -1
  13. package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js +9 -1
  14. package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js.map +1 -1
  15. package/dist/lib/modules/tournament/match/match.builder.d.ts.map +1 -1
  16. package/dist/lib/modules/tournament/match/match.builder.js +2 -1
  17. package/dist/lib/modules/tournament/match/match.builder.js.map +1 -1
  18. package/dist/lib/modules/tournament/match/match.repository.d.ts +2 -0
  19. package/dist/lib/modules/tournament/match/match.repository.d.ts.map +1 -1
  20. package/dist/lib/modules/tournament/match/match.repository.js +10 -0
  21. package/dist/lib/modules/tournament/match/match.repository.js.map +1 -1
  22. package/dist/lib/modules/tournament/match/match.router.d.ts +16 -4
  23. package/dist/lib/modules/tournament/match/match.router.d.ts.map +1 -1
  24. package/dist/lib/modules/tournament/match/match.service.d.ts +0 -1
  25. package/dist/lib/modules/tournament/match/match.service.d.ts.map +1 -1
  26. package/dist/lib/modules/tournament/match/match.service.js +3 -9
  27. package/dist/lib/modules/tournament/match/match.service.js.map +1 -1
  28. package/dist/lib/modules/tournament/match/match.validation.d.ts +50 -0
  29. package/dist/lib/modules/tournament/match/match.validation.d.ts.map +1 -1
  30. package/dist/lib/modules/tournament/match/match.validation.js +1 -0
  31. package/dist/lib/modules/tournament/match/match.validation.js.map +1 -1
  32. package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts +2 -5
  33. package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -1
  34. package/dist/lib/modules/tournament/notification/jobs/notification.producer.js +1 -6
  35. package/dist/lib/modules/tournament/notification/jobs/notification.producer.js.map +1 -1
  36. package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts +2 -0
  37. package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -1
  38. package/dist/lib/modules/tournament/notification/jobs/notification.worker.js +15 -9
  39. package/dist/lib/modules/tournament/notification/jobs/notification.worker.js.map +1 -1
  40. package/dist/lib/modules/tournament/notification/notification-template.repository.d.ts +8 -0
  41. package/dist/lib/modules/tournament/notification/notification-template.repository.d.ts.map +1 -0
  42. package/dist/lib/modules/tournament/notification/notification-template.repository.js +60 -0
  43. package/dist/lib/modules/tournament/notification/notification-template.repository.js.map +1 -0
  44. package/dist/lib/modules/tournament/notification/notification.config.d.ts +10 -0
  45. package/dist/lib/modules/tournament/notification/notification.config.d.ts.map +1 -0
  46. package/dist/lib/modules/tournament/notification/notification.config.js +15 -0
  47. package/dist/lib/modules/tournament/notification/notification.config.js.map +1 -0
  48. package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
  49. package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
  50. package/dist/lib/modules/tournament/notification/notification.schedule.config.js +15 -0
  51. package/dist/lib/modules/tournament/notification/notification.schedule.config.js.map +1 -0
  52. package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts +4 -4
  53. package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -1
  54. package/dist/lib/modules/tournament/notification/notification.scheduler.service.js +15 -28
  55. package/dist/lib/modules/tournament/notification/notification.scheduler.service.js.map +1 -1
  56. package/dist/lib/modules/tournament/notification/notification.service.d.ts +5 -4
  57. package/dist/lib/modules/tournament/notification/notification.service.d.ts.map +1 -1
  58. package/dist/lib/modules/tournament/notification/notification.service.js +33 -28
  59. package/dist/lib/modules/tournament/notification/notification.service.js.map +1 -1
  60. package/dist/lib/modules/tournament/participant/participant.repository.d.ts +3 -0
  61. package/dist/lib/modules/tournament/participant/participant.repository.d.ts.map +1 -1
  62. package/dist/lib/modules/tournament/participant/participant.repository.js +14 -0
  63. package/dist/lib/modules/tournament/participant/participant.repository.js.map +1 -1
  64. package/dist/lib/modules/tournament/participant/participant.router.d.ts +27 -4
  65. package/dist/lib/modules/tournament/participant/participant.router.d.ts.map +1 -1
  66. package/dist/lib/modules/tournament/participant/participant.router.js +7 -0
  67. package/dist/lib/modules/tournament/participant/participant.router.js.map +1 -1
  68. package/dist/lib/modules/tournament/participant/participant.service.d.ts +2 -2
  69. package/dist/lib/modules/tournament/participant/participant.service.d.ts.map +1 -1
  70. package/dist/lib/modules/tournament/participant/participant.service.js +20 -6
  71. package/dist/lib/modules/tournament/participant/participant.service.js.map +1 -1
  72. package/dist/lib/modules/tournament/participant/participant.validation.d.ts +144 -36
  73. package/dist/lib/modules/tournament/participant/participant.validation.d.ts.map +1 -1
  74. package/dist/lib/modules/tournament/participant/participant.validation.js +10 -3
  75. package/dist/lib/modules/tournament/participant/participant.validation.js.map +1 -1
  76. package/dist/lib/modules/tournament/prediction/prediction.builder.d.ts.map +1 -1
  77. package/dist/lib/modules/tournament/prediction/prediction.builder.js +3 -2
  78. package/dist/lib/modules/tournament/prediction/prediction.builder.js.map +1 -1
  79. package/dist/lib/modules/tournament/prediction/prediction.service.d.ts +1 -0
  80. package/dist/lib/modules/tournament/prediction/prediction.service.d.ts.map +1 -1
  81. package/dist/lib/modules/tournament/prediction/prediction.service.js +12 -1
  82. package/dist/lib/modules/tournament/prediction/prediction.service.js.map +1 -1
  83. package/dist/lib/modules/tournament/reward/reward.builder.d.ts.map +1 -1
  84. package/dist/lib/modules/tournament/reward/reward.builder.js +2 -1
  85. package/dist/lib/modules/tournament/reward/reward.builder.js.map +1 -1
  86. package/dist/lib/modules/tournament/reward/reward.repository.d.ts +8 -0
  87. package/dist/lib/modules/tournament/reward/reward.repository.d.ts.map +1 -0
  88. package/dist/lib/modules/tournament/reward/reward.repository.js +66 -0
  89. package/dist/lib/modules/tournament/reward/reward.repository.js.map +1 -0
  90. package/dist/lib/modules/tournament/schedule/schedule.router.d.ts +27 -0
  91. package/dist/lib/modules/tournament/schedule/schedule.router.d.ts.map +1 -0
  92. package/dist/lib/modules/tournament/schedule/schedule.router.js +17 -0
  93. package/dist/lib/modules/tournament/schedule/schedule.router.js.map +1 -0
  94. package/dist/lib/modules/tournament/schedule/schedule.service.d.ts +10 -0
  95. package/dist/lib/modules/tournament/schedule/schedule.service.d.ts.map +1 -0
  96. package/dist/lib/modules/tournament/schedule/schedule.service.js +87 -0
  97. package/dist/lib/modules/tournament/schedule/schedule.service.js.map +1 -0
  98. package/dist/lib/modules/tournament/score/score.repository.d.ts +8 -1
  99. package/dist/lib/modules/tournament/score/score.repository.d.ts.map +1 -1
  100. package/dist/lib/modules/tournament/score/score.repository.js +12 -2
  101. package/dist/lib/modules/tournament/score/score.repository.js.map +1 -1
  102. package/dist/lib/modules/tournament/score/score.router.d.ts +98 -0
  103. package/dist/lib/modules/tournament/score/score.router.d.ts.map +1 -0
  104. package/dist/lib/modules/tournament/score/score.router.js +20 -0
  105. package/dist/lib/modules/tournament/score/score.router.js.map +1 -0
  106. package/dist/lib/modules/tournament/score/score.service.d.ts +7 -0
  107. package/dist/lib/modules/tournament/score/score.service.d.ts.map +1 -1
  108. package/dist/lib/modules/tournament/score/score.service.js +49 -0
  109. package/dist/lib/modules/tournament/score/score.service.js.map +1 -1
  110. package/dist/lib/modules/tournament/score/score.validation.d.ts +375 -0
  111. package/dist/lib/modules/tournament/score/score.validation.d.ts.map +1 -0
  112. package/dist/lib/modules/tournament/score/score.validation.js +19 -0
  113. package/dist/lib/modules/tournament/score/score.validation.js.map +1 -0
  114. package/dist/lib/modules/tournament/statistics/statistics.builder.d.ts +10 -0
  115. package/dist/lib/modules/tournament/statistics/statistics.builder.d.ts.map +1 -0
  116. package/dist/lib/modules/tournament/statistics/statistics.builder.js +53 -0
  117. package/dist/lib/modules/tournament/statistics/statistics.builder.js.map +1 -0
  118. package/dist/lib/modules/tournament/statistics/statistics.router.d.ts +80 -0
  119. package/dist/lib/modules/tournament/statistics/statistics.router.d.ts.map +1 -0
  120. package/dist/lib/modules/tournament/statistics/statistics.router.js +21 -0
  121. package/dist/lib/modules/tournament/statistics/statistics.router.js.map +1 -0
  122. package/dist/lib/modules/tournament/statistics/statistics.service.d.ts +11 -0
  123. package/dist/lib/modules/tournament/statistics/statistics.service.d.ts.map +1 -0
  124. package/dist/lib/modules/tournament/statistics/statistics.service.js +80 -0
  125. package/dist/lib/modules/tournament/statistics/statistics.service.js.map +1 -0
  126. package/dist/lib/modules/tournament/statistics/statistics.validation.d.ts +404 -0
  127. package/dist/lib/modules/tournament/statistics/statistics.validation.d.ts.map +1 -0
  128. package/dist/lib/modules/tournament/statistics/statistics.validation.js +36 -0
  129. package/dist/lib/modules/tournament/statistics/statistics.validation.js.map +1 -0
  130. package/dist/lib/modules/tournament/team/team.router.d.ts +9 -3
  131. package/dist/lib/modules/tournament/team/team.router.d.ts.map +1 -1
  132. package/dist/lib/modules/tournament/team/team.service.d.ts +1 -0
  133. package/dist/lib/modules/tournament/team/team.service.d.ts.map +1 -1
  134. package/dist/lib/modules/tournament/team/team.service.js +23 -16
  135. package/dist/lib/modules/tournament/team/team.service.js.map +1 -1
  136. package/dist/lib/modules/tournament/team/team.validation.d.ts +54 -4
  137. package/dist/lib/modules/tournament/team/team.validation.d.ts.map +1 -1
  138. package/dist/lib/modules/tournament/team/team.validation.js +4 -2
  139. package/dist/lib/modules/tournament/team/team.validation.js.map +1 -1
  140. package/dist/lib/modules/tournament/tournament.router.d.ts +370 -125
  141. package/dist/lib/modules/tournament/tournament.router.d.ts.map +1 -1
  142. package/dist/lib/modules/tournament/tournament.router.js +13 -2
  143. package/dist/lib/modules/tournament/tournament.router.js.map +1 -1
  144. package/dist/lib/modules/tournament/tournament.service.d.ts +3 -1
  145. package/dist/lib/modules/tournament/tournament.service.d.ts.map +1 -1
  146. package/dist/lib/modules/tournament/tournament.service.js +17 -2
  147. package/dist/lib/modules/tournament/tournament.service.js.map +1 -1
  148. package/dist/lib/modules/tournament/tournament.types.d.ts +14 -0
  149. package/dist/lib/modules/tournament/tournament.types.d.ts.map +1 -0
  150. package/dist/lib/modules/tournament/tournament.types.js +20 -0
  151. package/dist/lib/modules/tournament/tournament.types.js.map +1 -0
  152. package/dist/lib/modules/tournament/tournament.utils.d.ts +2 -0
  153. package/dist/lib/modules/tournament/tournament.utils.d.ts.map +1 -0
  154. package/dist/lib/modules/tournament/tournament.utils.js +6 -0
  155. package/dist/lib/modules/tournament/tournament.utils.js.map +1 -0
  156. package/dist/lib/modules/tournament/tournament.validation.d.ts +15 -0
  157. package/dist/lib/modules/tournament/tournament.validation.d.ts.map +1 -1
  158. package/dist/lib/modules/tournament/tournament.validation.js +4 -1
  159. package/dist/lib/modules/tournament/tournament.validation.js.map +1 -1
  160. package/dist/types/index.d.ts +265 -21
  161. package/dist/types/index.d.ts.map +1 -1
  162. package/dist/types/modules/tournament/config/config.repository.d.ts +3 -0
  163. package/dist/types/modules/tournament/config/config.repository.d.ts.map +1 -1
  164. package/dist/types/modules/tournament/config/config.router.d.ts +10 -10
  165. package/dist/types/modules/tournament/config/config.validation.d.ts +37 -36
  166. package/dist/types/modules/tournament/config/config.validation.d.ts.map +1 -1
  167. package/dist/types/modules/tournament/match/events/evaluate-predictions.consumer.d.ts.map +1 -1
  168. package/dist/types/modules/tournament/match/match.builder.d.ts.map +1 -1
  169. package/dist/types/modules/tournament/match/match.repository.d.ts +2 -0
  170. package/dist/types/modules/tournament/match/match.repository.d.ts.map +1 -1
  171. package/dist/types/modules/tournament/match/match.router.d.ts +16 -4
  172. package/dist/types/modules/tournament/match/match.router.d.ts.map +1 -1
  173. package/dist/types/modules/tournament/match/match.service.d.ts +0 -1
  174. package/dist/types/modules/tournament/match/match.service.d.ts.map +1 -1
  175. package/dist/types/modules/tournament/match/match.validation.d.ts +50 -0
  176. package/dist/types/modules/tournament/match/match.validation.d.ts.map +1 -1
  177. package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts +2 -5
  178. package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -1
  179. package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts +2 -0
  180. package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -1
  181. package/dist/types/modules/tournament/notification/notification-template.repository.d.ts +8 -0
  182. package/dist/types/modules/tournament/notification/notification-template.repository.d.ts.map +1 -0
  183. package/dist/types/modules/tournament/notification/notification.config.d.ts +10 -0
  184. package/dist/types/modules/tournament/notification/notification.config.d.ts.map +1 -0
  185. package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
  186. package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
  187. package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts +4 -4
  188. package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -1
  189. package/dist/types/modules/tournament/notification/notification.service.d.ts +5 -4
  190. package/dist/types/modules/tournament/notification/notification.service.d.ts.map +1 -1
  191. package/dist/types/modules/tournament/participant/participant.repository.d.ts +3 -0
  192. package/dist/types/modules/tournament/participant/participant.repository.d.ts.map +1 -1
  193. package/dist/types/modules/tournament/participant/participant.router.d.ts +27 -4
  194. package/dist/types/modules/tournament/participant/participant.router.d.ts.map +1 -1
  195. package/dist/types/modules/tournament/participant/participant.service.d.ts +2 -2
  196. package/dist/types/modules/tournament/participant/participant.service.d.ts.map +1 -1
  197. package/dist/types/modules/tournament/participant/participant.validation.d.ts +144 -36
  198. package/dist/types/modules/tournament/participant/participant.validation.d.ts.map +1 -1
  199. package/dist/types/modules/tournament/prediction/prediction.builder.d.ts.map +1 -1
  200. package/dist/types/modules/tournament/prediction/prediction.service.d.ts +1 -0
  201. package/dist/types/modules/tournament/prediction/prediction.service.d.ts.map +1 -1
  202. package/dist/types/modules/tournament/reward/reward.builder.d.ts.map +1 -1
  203. package/dist/types/modules/tournament/reward/reward.repository.d.ts +8 -0
  204. package/dist/types/modules/tournament/reward/reward.repository.d.ts.map +1 -0
  205. package/dist/types/modules/tournament/schedule/schedule.router.d.ts +27 -0
  206. package/dist/types/modules/tournament/schedule/schedule.router.d.ts.map +1 -0
  207. package/dist/types/modules/tournament/schedule/schedule.service.d.ts +10 -0
  208. package/dist/types/modules/tournament/schedule/schedule.service.d.ts.map +1 -0
  209. package/dist/types/modules/tournament/score/score.repository.d.ts +8 -1
  210. package/dist/types/modules/tournament/score/score.repository.d.ts.map +1 -1
  211. package/dist/types/modules/tournament/score/score.router.d.ts +98 -0
  212. package/dist/types/modules/tournament/score/score.router.d.ts.map +1 -0
  213. package/dist/types/modules/tournament/score/score.service.d.ts +7 -0
  214. package/dist/types/modules/tournament/score/score.service.d.ts.map +1 -1
  215. package/dist/types/modules/tournament/score/score.validation.d.ts +375 -0
  216. package/dist/types/modules/tournament/score/score.validation.d.ts.map +1 -0
  217. package/dist/types/modules/tournament/statistics/statistics.builder.d.ts +10 -0
  218. package/dist/types/modules/tournament/statistics/statistics.builder.d.ts.map +1 -0
  219. package/dist/types/modules/tournament/statistics/statistics.router.d.ts +80 -0
  220. package/dist/types/modules/tournament/statistics/statistics.router.d.ts.map +1 -0
  221. package/dist/types/modules/tournament/statistics/statistics.service.d.ts +11 -0
  222. package/dist/types/modules/tournament/statistics/statistics.service.d.ts.map +1 -0
  223. package/dist/types/modules/tournament/statistics/statistics.validation.d.ts +404 -0
  224. package/dist/types/modules/tournament/statistics/statistics.validation.d.ts.map +1 -0
  225. package/dist/types/modules/tournament/team/team.router.d.ts +9 -3
  226. package/dist/types/modules/tournament/team/team.router.d.ts.map +1 -1
  227. package/dist/types/modules/tournament/team/team.service.d.ts +1 -0
  228. package/dist/types/modules/tournament/team/team.service.d.ts.map +1 -1
  229. package/dist/types/modules/tournament/team/team.validation.d.ts +54 -4
  230. package/dist/types/modules/tournament/team/team.validation.d.ts.map +1 -1
  231. package/dist/types/modules/tournament/tournament.router.d.ts +370 -125
  232. package/dist/types/modules/tournament/tournament.router.d.ts.map +1 -1
  233. package/dist/types/modules/tournament/tournament.service.d.ts +3 -1
  234. package/dist/types/modules/tournament/tournament.service.d.ts.map +1 -1
  235. package/dist/types/modules/tournament/tournament.types.d.ts +14 -0
  236. package/dist/types/modules/tournament/tournament.types.d.ts.map +1 -0
  237. package/dist/types/modules/tournament/tournament.utils.d.ts +2 -0
  238. package/dist/types/modules/tournament/tournament.utils.d.ts.map +1 -0
  239. package/dist/types/modules/tournament/tournament.validation.d.ts +15 -0
  240. package/dist/types/modules/tournament/tournament.validation.d.ts.map +1 -1
  241. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.router.d.ts","sourceRoot":"/","sources":["modules/tournament/statistics/statistics.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAShD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAU3B,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.statisticsRouter = void 0;
4
+ const typegoose_1 = require("@typegoose/typegoose");
5
+ const trpc_1 = require("@lyxa.ai/core/dist/libraries/trpc");
6
+ const auth_1 = require("@lyxa.ai/core/dist/libraries/auth");
7
+ const auth_2 = require("@lyxa.ai/core/dist/libraries/trpc/middlewares/auth");
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
+ const statistics_service_1 = require("./statistics.service");
11
+ const statistics_validation_1 = require("./statistics.validation");
12
+ exports.statisticsRouter = (0, trpc_1.createTRPCRouter)({
13
+ getActiveByUser: (0, auth_2.createAuthenticatedProcedure)({ entityTypes: [auth_1.AuthEntityType.CRM] })
14
+ .input(statistics_validation_1.GetUserTournamentStatsSchema)
15
+ .output(statistics_validation_1.UserTournamentStatsResponseSchema)
16
+ .query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
17
+ const result = await statistics_service_1.statisticsService.getActiveByUser(new typegoose_1.mongoose.Types.ObjectId(input.userId));
18
+ return (0, response_1.response)('User tournament stats fetched successfully', result);
19
+ })),
20
+ });
21
+ //# sourceMappingURL=statistics.router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.router.js","sourceRoot":"/","sources":["modules/tournament/statistics/statistics.router.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAChD,4DAAqE;AACrE,4DAAmE;AACnE,6EAAkG;AAClG,8EAA0E;AAC1E,oEAAiE;AACjE,6DAAoE;AACpE,mEAA0G;AAE7F,QAAA,gBAAgB,GAAG,IAAA,uBAAgB,EAAC;IAChD,eAAe,EAAE,IAAA,mCAA4B,EAAC,EAAE,WAAW,EAAE,CAAC,qBAAc,CAAC,GAAG,CAAC,EAAE,CAAC;SAClF,KAAK,CAAC,oDAA4B,CAAC;SACnC,MAAM,CAAC,yDAAiC,CAAC;SACzC,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC1B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,sCAAO,CAAC,eAAe,CAAC,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACxF,OAAO,IAAA,mBAAQ,EAAC,4CAA4C,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CACF;CACF,CAAC,CAAC","sourcesContent":["import { mongoose } from '@typegoose/typegoose';\nimport { createTRPCRouter } from '@lyxa.ai/core/dist/libraries/trpc';\nimport { AuthEntityType } from '@lyxa.ai/core/dist/libraries/auth';\nimport { createAuthenticatedProcedure } from '@lyxa.ai/core/dist/libraries/trpc/middlewares/auth';\nimport { ErrorHandler } from '@lyxa.ai/core/dist/utilities/error-handler';\nimport { response } from '@lyxa.ai/core/dist/utilities/response';\nimport { statisticsService as service } from './statistics.service';\nimport { GetUserTournamentStatsSchema, UserTournamentStatsResponseSchema } from './statistics.validation';\n\nexport const statisticsRouter = createTRPCRouter({\n\tgetActiveByUser: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(GetUserTournamentStatsSchema)\n\t\t.output(UserTournamentStatsResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.getActiveByUser(new mongoose.Types.ObjectId(input.userId));\n\t\t\t\treturn response('User tournament stats fetched successfully', result);\n\t\t\t})\n\t\t),\n});\n"]}
@@ -0,0 +1,11 @@
1
+ import { mongoose } from '@typegoose/typegoose';
2
+ import { UserTournamentStatsOutputDTO } from './statistics.validation';
3
+ export declare class StatisticsService {
4
+ private participantRepository;
5
+ private configRepository;
6
+ private rewardRepository;
7
+ constructor();
8
+ getActiveByUser(userId: mongoose.Types.ObjectId): Promise<UserTournamentStatsOutputDTO | null>;
9
+ }
10
+ export declare const statisticsService: StatisticsService;
11
+ //# sourceMappingURL=statistics.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.service.d.ts","sourceRoot":"/","sources":["modules/tournament/statistics/statistics.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKhD,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,qBACa,iBAAiB;IAC1B,OAAO,CAAC,qBAAqB,CAAkC;IAC/D,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,gBAAgB,CAAmB;;IAQ9B,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC;CAkB9G;AAED,eAAO,MAAM,iBAAiB,mBAAmC,CAAC"}
@@ -0,0 +1,80 @@
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.statisticsService = exports.StatisticsService = void 0;
46
+ const typedi_1 = __importStar(require("typedi"));
47
+ const participant_repository_1 = require("../participant/participant.repository");
48
+ const config_repository_1 = require("../config/config.repository");
49
+ const reward_repository_1 = require("../reward/reward.repository");
50
+ const statistics_builder_1 = require("./statistics.builder");
51
+ let StatisticsService = class StatisticsService {
52
+ participantRepository;
53
+ configRepository;
54
+ rewardRepository;
55
+ constructor() {
56
+ this.participantRepository = typedi_1.default.get(participant_repository_1.TournamentParticipantRepository);
57
+ this.configRepository = typedi_1.default.get(config_repository_1.TournamentConfigRepository);
58
+ this.rewardRepository = typedi_1.default.get(reward_repository_1.RewardRepository);
59
+ }
60
+ async getActiveByUser(userId) {
61
+ const tournament = await this.configRepository.findActiveFull();
62
+ if (!tournament)
63
+ return null;
64
+ const participant = await this.participantRepository.findByUserAndTournament(userId, tournament._id);
65
+ if (!participant)
66
+ return null;
67
+ const couponIds = participant.predictions
68
+ .filter(p => p.coupon)
69
+ .map(p => p.coupon);
70
+ const couponCodeMap = await this.rewardRepository.findCouponCodesByIds(couponIds);
71
+ return statistics_builder_1.StatisticsBuilder.buildUserTournamentStats(participant, tournament, couponCodeMap);
72
+ }
73
+ };
74
+ exports.StatisticsService = StatisticsService;
75
+ exports.StatisticsService = StatisticsService = __decorate([
76
+ (0, typedi_1.Service)(),
77
+ __metadata("design:paramtypes", [])
78
+ ], StatisticsService);
79
+ exports.statisticsService = typedi_1.default.get(StatisticsService);
80
+ //# sourceMappingURL=statistics.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.service.js","sourceRoot":"/","sources":["modules/tournament/statistics/statistics.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAE5C,kFAAwF;AACxF,mEAAyE;AACzE,mEAA+D;AAC/D,6DAAyD;AAIlD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAClB,qBAAqB,CAAkC;IACvD,gBAAgB,CAA6B;IAC7C,gBAAgB,CAAmB;IAE3C;QACI,IAAI,CAAC,qBAAqB,GAAG,gBAAS,CAAC,GAAG,CAAC,wDAA+B,CAAC,CAAC;QAC5E,IAAI,CAAC,gBAAgB,GAAG,gBAAS,CAAC,GAAG,CAAC,8CAA0B,CAAC,CAAC;QAClE,IAAI,CAAC,gBAAgB,GAAG,gBAAS,CAAC,GAAG,CAAC,oCAAgB,CAAC,CAAC;IAC5D,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAA+B;QACxD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;QAChE,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,uBAAuB,CACxE,MAAM,EACN,UAAU,CAAC,GAAG,CACjB,CAAC;QACF,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAE9B,MAAM,SAAS,GAAG,WAAW,CAAC,WAAW;aACpC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;aACrB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAiC,CAAC,CAAC;QAEnD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAElF,OAAO,sCAAiB,CAAC,wBAAwB,CAAC,WAAkB,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IACrG,CAAC;CACJ,CAAA;AA7BY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,gBAAO,GAAE;;GACG,iBAAiB,CA6B7B;AAEY,QAAA,iBAAiB,GAAG,gBAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { mongoose } from '@typegoose/typegoose';\nimport { TournamentParticipantRepository } from '../participant/participant.repository';\nimport { TournamentConfigRepository } from '../config/config.repository';\nimport { RewardRepository } from '../reward/reward.repository';\nimport { StatisticsBuilder } from './statistics.builder';\nimport { UserTournamentStatsOutputDTO } from './statistics.validation';\n\n@Service()\nexport class StatisticsService {\n private participantRepository: TournamentParticipantRepository;\n private configRepository: TournamentConfigRepository;\n private rewardRepository: RewardRepository;\n\n constructor() {\n this.participantRepository = Container.get(TournamentParticipantRepository);\n this.configRepository = Container.get(TournamentConfigRepository);\n this.rewardRepository = Container.get(RewardRepository);\n }\n\n public async getActiveByUser(userId: mongoose.Types.ObjectId): Promise<UserTournamentStatsOutputDTO | null> {\n const tournament = await this.configRepository.findActiveFull();\n if (!tournament) return null;\n\n const participant = await this.participantRepository.findByUserAndTournament(\n userId,\n tournament._id\n );\n if (!participant) return null;\n\n const couponIds = participant.predictions\n .filter(p => p.coupon)\n .map(p => p.coupon as mongoose.Types.ObjectId);\n\n const couponCodeMap = await this.rewardRepository.findCouponCodesByIds(couponIds);\n\n return StatisticsBuilder.buildUserTournamentStats(participant as any, tournament, couponCodeMap);\n }\n}\n\nexport const statisticsService = Container.get(StatisticsService);\n"]}
@@ -0,0 +1,404 @@
1
+ import { z } from 'zod';
2
+ import { DTO } from '@lyxa.ai/core/dist/utilities/validation/global-validation';
3
+ export declare const GetUserTournamentStatsSchema: z.ZodObject<{
4
+ userId: 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
+ }, "strip", z.ZodTypeAny, {
6
+ userId: import("mongoose").Types.ObjectId;
7
+ }, {
8
+ userId: string | import("mongoose").Types.ObjectId;
9
+ }>;
10
+ export declare const UserTournamentMatchViewSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ teams: z.ZodString;
13
+ date: z.ZodNullable<z.ZodString>;
14
+ prediction: z.ZodNullable<z.ZodString>;
15
+ realScore: z.ZodNullable<z.ZodString>;
16
+ result: z.ZodNullable<z.ZodEnum<["won", "lost", "pending"]>>;
17
+ coupon: z.ZodNullable<z.ZodString>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ date: string | null;
20
+ coupon: string | null;
21
+ id: string;
22
+ result: "won" | "lost" | "pending" | null;
23
+ teams: string;
24
+ prediction: string | null;
25
+ realScore: string | null;
26
+ }, {
27
+ date: string | null;
28
+ coupon: string | null;
29
+ id: string;
30
+ result: "won" | "lost" | "pending" | null;
31
+ teams: string;
32
+ prediction: string | null;
33
+ realScore: string | null;
34
+ }>;
35
+ export declare const UserTournamentStatsSchema: z.ZodNullable<z.ZodObject<{
36
+ name: z.ZodString;
37
+ joinedAt: z.ZodNullable<z.ZodDate>;
38
+ selectedTeam: z.ZodObject<{
39
+ name: z.ZodString;
40
+ flag: z.ZodNullable<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ name: string;
43
+ flag: string | null;
44
+ }, {
45
+ name: string;
46
+ flag: string | null;
47
+ }>;
48
+ stats: z.ZodObject<{
49
+ predictionsMade: z.ZodNumber;
50
+ correctPredictions: z.ZodNumber;
51
+ couponsWon: z.ZodNumber;
52
+ }, "strip", z.ZodTypeAny, {
53
+ predictionsMade: number;
54
+ correctPredictions: number;
55
+ couponsWon: number;
56
+ }, {
57
+ predictionsMade: number;
58
+ correctPredictions: number;
59
+ couponsWon: number;
60
+ }>;
61
+ matches: z.ZodArray<z.ZodObject<{
62
+ id: z.ZodString;
63
+ teams: z.ZodString;
64
+ date: z.ZodNullable<z.ZodString>;
65
+ prediction: z.ZodNullable<z.ZodString>;
66
+ realScore: z.ZodNullable<z.ZodString>;
67
+ result: z.ZodNullable<z.ZodEnum<["won", "lost", "pending"]>>;
68
+ coupon: z.ZodNullable<z.ZodString>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ date: string | null;
71
+ coupon: string | null;
72
+ id: string;
73
+ result: "won" | "lost" | "pending" | null;
74
+ teams: string;
75
+ prediction: string | null;
76
+ realScore: string | null;
77
+ }, {
78
+ date: string | null;
79
+ coupon: string | null;
80
+ id: string;
81
+ result: "won" | "lost" | "pending" | null;
82
+ teams: string;
83
+ prediction: string | null;
84
+ realScore: string | null;
85
+ }>, "many">;
86
+ }, "strip", z.ZodTypeAny, {
87
+ name: string;
88
+ joinedAt: Date | null;
89
+ stats: {
90
+ predictionsMade: number;
91
+ correctPredictions: number;
92
+ couponsWon: number;
93
+ };
94
+ matches: {
95
+ date: string | null;
96
+ coupon: string | null;
97
+ id: string;
98
+ result: "won" | "lost" | "pending" | null;
99
+ teams: string;
100
+ prediction: string | null;
101
+ realScore: string | null;
102
+ }[];
103
+ selectedTeam: {
104
+ name: string;
105
+ flag: string | null;
106
+ };
107
+ }, {
108
+ name: string;
109
+ joinedAt: Date | null;
110
+ stats: {
111
+ predictionsMade: number;
112
+ correctPredictions: number;
113
+ couponsWon: number;
114
+ };
115
+ matches: {
116
+ date: string | null;
117
+ coupon: string | null;
118
+ id: string;
119
+ result: "won" | "lost" | "pending" | null;
120
+ teams: string;
121
+ prediction: string | null;
122
+ realScore: string | null;
123
+ }[];
124
+ selectedTeam: {
125
+ name: string;
126
+ flag: string | null;
127
+ };
128
+ }>>;
129
+ export declare const UserTournamentStatsResponseSchema: z.ZodObject<{
130
+ success: z.ZodBoolean;
131
+ message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
132
+ data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
133
+ metadata: z.ZodOptional<z.ZodObject<{
134
+ page: z.ZodNumber;
135
+ size: z.ZodNumber;
136
+ totalElements: z.ZodNumber;
137
+ totalPages: z.ZodNumber;
138
+ }, "strip", z.ZodTypeAny, {
139
+ page: number;
140
+ size: number;
141
+ totalElements: number;
142
+ totalPages: number;
143
+ }, {
144
+ page: number;
145
+ size: number;
146
+ totalElements: number;
147
+ totalPages: number;
148
+ }>>;
149
+ documents: z.ZodArray<z.ZodType<{
150
+ name: string;
151
+ joinedAt: Date | null;
152
+ stats: {
153
+ predictionsMade: number;
154
+ correctPredictions: number;
155
+ couponsWon: number;
156
+ };
157
+ matches: {
158
+ date: string | null;
159
+ coupon: string | null;
160
+ id: string;
161
+ result: "won" | "lost" | "pending" | null;
162
+ teams: string;
163
+ prediction: string | null;
164
+ realScore: string | null;
165
+ }[];
166
+ selectedTeam: {
167
+ name: string;
168
+ flag: string | null;
169
+ };
170
+ } | null, z.ZodTypeDef, {
171
+ name: string;
172
+ joinedAt: Date | null;
173
+ stats: {
174
+ predictionsMade: number;
175
+ correctPredictions: number;
176
+ couponsWon: number;
177
+ };
178
+ matches: {
179
+ date: string | null;
180
+ coupon: string | null;
181
+ id: string;
182
+ result: "won" | "lost" | "pending" | null;
183
+ teams: string;
184
+ prediction: string | null;
185
+ realScore: string | null;
186
+ }[];
187
+ selectedTeam: {
188
+ name: string;
189
+ flag: string | null;
190
+ };
191
+ } | null>, "many">;
192
+ }, "strip", z.ZodTypeAny, {
193
+ documents: ({
194
+ name: string;
195
+ joinedAt: Date | null;
196
+ stats: {
197
+ predictionsMade: number;
198
+ correctPredictions: number;
199
+ couponsWon: number;
200
+ };
201
+ matches: {
202
+ date: string | null;
203
+ coupon: string | null;
204
+ id: string;
205
+ result: "won" | "lost" | "pending" | null;
206
+ teams: string;
207
+ prediction: string | null;
208
+ realScore: string | null;
209
+ }[];
210
+ selectedTeam: {
211
+ name: string;
212
+ flag: string | null;
213
+ };
214
+ } | null)[];
215
+ metadata?: {
216
+ page: number;
217
+ size: number;
218
+ totalElements: number;
219
+ totalPages: number;
220
+ } | undefined;
221
+ }, {
222
+ documents: ({
223
+ name: string;
224
+ joinedAt: Date | null;
225
+ stats: {
226
+ predictionsMade: number;
227
+ correctPredictions: number;
228
+ couponsWon: number;
229
+ };
230
+ matches: {
231
+ date: string | null;
232
+ coupon: string | null;
233
+ id: string;
234
+ result: "won" | "lost" | "pending" | null;
235
+ teams: string;
236
+ prediction: string | null;
237
+ realScore: string | null;
238
+ }[];
239
+ selectedTeam: {
240
+ name: string;
241
+ flag: string | null;
242
+ };
243
+ } | null)[];
244
+ metadata?: {
245
+ page: number;
246
+ size: number;
247
+ totalElements: number;
248
+ totalPages: number;
249
+ } | undefined;
250
+ }>, z.ZodType<{
251
+ name: string;
252
+ joinedAt: Date | null;
253
+ stats: {
254
+ predictionsMade: number;
255
+ correctPredictions: number;
256
+ couponsWon: number;
257
+ };
258
+ matches: {
259
+ date: string | null;
260
+ coupon: string | null;
261
+ id: string;
262
+ result: "won" | "lost" | "pending" | null;
263
+ teams: string;
264
+ prediction: string | null;
265
+ realScore: string | null;
266
+ }[];
267
+ selectedTeam: {
268
+ name: string;
269
+ flag: string | null;
270
+ };
271
+ } | null, z.ZodTypeDef, {
272
+ name: string;
273
+ joinedAt: Date | null;
274
+ stats: {
275
+ predictionsMade: number;
276
+ correctPredictions: number;
277
+ couponsWon: number;
278
+ };
279
+ matches: {
280
+ date: string | null;
281
+ coupon: string | null;
282
+ id: string;
283
+ result: "won" | "lost" | "pending" | null;
284
+ teams: string;
285
+ prediction: string | null;
286
+ realScore: string | null;
287
+ }[];
288
+ selectedTeam: {
289
+ name: string;
290
+ flag: string | null;
291
+ };
292
+ } | null>]>>;
293
+ }, "strip", z.ZodTypeAny, {
294
+ message: string;
295
+ success: boolean;
296
+ data?: {
297
+ name: string;
298
+ joinedAt: Date | null;
299
+ stats: {
300
+ predictionsMade: number;
301
+ correctPredictions: number;
302
+ couponsWon: number;
303
+ };
304
+ matches: {
305
+ date: string | null;
306
+ coupon: string | null;
307
+ id: string;
308
+ result: "won" | "lost" | "pending" | null;
309
+ teams: string;
310
+ prediction: string | null;
311
+ realScore: string | null;
312
+ }[];
313
+ selectedTeam: {
314
+ name: string;
315
+ flag: string | null;
316
+ };
317
+ } | {
318
+ documents: ({
319
+ name: string;
320
+ joinedAt: Date | null;
321
+ stats: {
322
+ predictionsMade: number;
323
+ correctPredictions: number;
324
+ couponsWon: number;
325
+ };
326
+ matches: {
327
+ date: string | null;
328
+ coupon: string | null;
329
+ id: string;
330
+ result: "won" | "lost" | "pending" | null;
331
+ teams: string;
332
+ prediction: string | null;
333
+ realScore: string | null;
334
+ }[];
335
+ selectedTeam: {
336
+ name: string;
337
+ flag: string | null;
338
+ };
339
+ } | null)[];
340
+ metadata?: {
341
+ page: number;
342
+ size: number;
343
+ totalElements: number;
344
+ totalPages: number;
345
+ } | undefined;
346
+ } | null | undefined;
347
+ }, {
348
+ message: string;
349
+ success: boolean;
350
+ data?: {
351
+ name: string;
352
+ joinedAt: Date | null;
353
+ stats: {
354
+ predictionsMade: number;
355
+ correctPredictions: number;
356
+ couponsWon: number;
357
+ };
358
+ matches: {
359
+ date: string | null;
360
+ coupon: string | null;
361
+ id: string;
362
+ result: "won" | "lost" | "pending" | null;
363
+ teams: string;
364
+ prediction: string | null;
365
+ realScore: string | null;
366
+ }[];
367
+ selectedTeam: {
368
+ name: string;
369
+ flag: string | null;
370
+ };
371
+ } | {
372
+ documents: ({
373
+ name: string;
374
+ joinedAt: Date | null;
375
+ stats: {
376
+ predictionsMade: number;
377
+ correctPredictions: number;
378
+ couponsWon: number;
379
+ };
380
+ matches: {
381
+ date: string | null;
382
+ coupon: string | null;
383
+ id: string;
384
+ result: "won" | "lost" | "pending" | null;
385
+ teams: string;
386
+ prediction: string | null;
387
+ realScore: string | null;
388
+ }[];
389
+ selectedTeam: {
390
+ name: string;
391
+ flag: string | null;
392
+ };
393
+ } | null)[];
394
+ metadata?: {
395
+ page: number;
396
+ size: number;
397
+ totalElements: number;
398
+ totalPages: number;
399
+ } | undefined;
400
+ } | null | undefined;
401
+ }>;
402
+ export type GetUserTournamentStatsInputDTO = DTO<typeof GetUserTournamentStatsSchema>;
403
+ export type UserTournamentStatsOutputDTO = DTO<typeof UserTournamentStatsSchema>;
404
+ //# sourceMappingURL=statistics.validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.validation.d.ts","sourceRoot":"/","sources":["modules/tournament/statistics/statistics.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAiB,MAAM,2DAA2D,CAAC;AAG/F,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;EAQxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAe1B,CAAC;AAEb,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkD,CAAC;AAEjG,MAAM,MAAM,8BAA8B,GAAG,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACtF,MAAM,MAAM,4BAA4B,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserTournamentStatsResponseSchema = exports.UserTournamentStatsSchema = exports.UserTournamentMatchViewSchema = exports.GetUserTournamentStatsSchema = 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
+ exports.GetUserTournamentStatsSchema = zod_1.z.object({
8
+ userId: global_validation_1.ZodValidation.objectId('User id'),
9
+ });
10
+ exports.UserTournamentMatchViewSchema = zod_1.z.object({
11
+ id: zod_1.z.string(),
12
+ teams: zod_1.z.string(),
13
+ date: zod_1.z.string().nullable(),
14
+ prediction: zod_1.z.string().nullable(),
15
+ realScore: zod_1.z.string().nullable(),
16
+ result: zod_1.z.enum(['won', 'lost', 'pending']).nullable(),
17
+ coupon: zod_1.z.string().nullable(),
18
+ });
19
+ exports.UserTournamentStatsSchema = zod_1.z
20
+ .object({
21
+ name: zod_1.z.string(),
22
+ joinedAt: zod_1.z.date().nullable(),
23
+ selectedTeam: zod_1.z.object({
24
+ name: zod_1.z.string(),
25
+ flag: zod_1.z.string().nullable(),
26
+ }),
27
+ stats: zod_1.z.object({
28
+ predictionsMade: zod_1.z.number(),
29
+ correctPredictions: zod_1.z.number(),
30
+ couponsWon: zod_1.z.number(),
31
+ }),
32
+ matches: zod_1.z.array(exports.UserTournamentMatchViewSchema),
33
+ })
34
+ .nullable();
35
+ exports.UserTournamentStatsResponseSchema = (0, validation_1.createResponseSchema)(exports.UserTournamentStatsSchema);
36
+ //# sourceMappingURL=statistics.validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.validation.js","sourceRoot":"/","sources":["modules/tournament/statistics/statistics.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAA+F;AAC/F,wEAA+E;AAElE,QAAA,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,MAAM,EAAE,iCAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;CACzC,CAAC,CAAC;AAEU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,OAAC;KACxC,MAAM,CAAC;IACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,OAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC7B,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC3B,CAAC;IACF,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACf,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE;QAC3B,kBAAkB,EAAE,OAAC,CAAC,MAAM,EAAE;QAC9B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;KACtB,CAAC;IACF,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,qCAA6B,CAAC;CAC/C,CAAC;KACD,QAAQ,EAAE,CAAC;AAEA,QAAA,iCAAiC,GAAG,IAAA,iCAAoB,EAAC,iCAAyB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { DTO, ZodValidation } from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { createResponseSchema } from '@lyxa.ai/core/dist/utilities/validation';\n\nexport const GetUserTournamentStatsSchema = z.object({\n\tuserId: ZodValidation.objectId('User id'),\n});\n\nexport const UserTournamentMatchViewSchema = z.object({\n\tid: z.string(),\n\tteams: z.string(),\n\tdate: z.string().nullable(),\n\tprediction: z.string().nullable(),\n\trealScore: z.string().nullable(),\n\tresult: z.enum(['won', 'lost', 'pending']).nullable(),\n\tcoupon: z.string().nullable(),\n});\n\nexport const UserTournamentStatsSchema = z\n\t.object({\n\t\tname: z.string(),\n\t\tjoinedAt: z.date().nullable(),\n\t\tselectedTeam: z.object({\n\t\t\tname: z.string(),\n\t\t\tflag: z.string().nullable(),\n\t\t}),\n\t\tstats: z.object({\n\t\t\tpredictionsMade: z.number(),\n\t\t\tcorrectPredictions: z.number(),\n\t\t\tcouponsWon: z.number(),\n\t\t}),\n\t\tmatches: z.array(UserTournamentMatchViewSchema),\n\t})\n\t.nullable();\n\nexport const UserTournamentStatsResponseSchema = createResponseSchema(UserTournamentStatsSchema);\n\nexport type GetUserTournamentStatsInputDTO = DTO<typeof GetUserTournamentStatsSchema>;\nexport type UserTournamentStatsOutputDTO = DTO<typeof UserTournamentStatsSchema>;\n"]}
@@ -29,12 +29,12 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
29
29
  data?: {
30
30
  status: import("@lyxa.ai/core/dist/utilities/enum").Status;
31
31
  name: string;
32
- tag: string;
33
32
  _id?: string | mongoose.Types.ObjectId | undefined;
34
33
  createdAt?: Date | null | undefined;
35
34
  startDate?: Date | null | undefined;
36
35
  endDate?: Date | null | undefined;
37
36
  updatedAt?: Date | null | undefined;
37
+ tag?: import("../tournament.types").TournamentTag | undefined;
38
38
  reward?: {
39
39
  type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
40
40
  } | {
@@ -47,12 +47,12 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
47
47
  documents: {
48
48
  status: import("@lyxa.ai/core/dist/utilities/enum").Status;
49
49
  name: string;
50
- tag: string;
51
50
  _id?: string | mongoose.Types.ObjectId | undefined;
52
51
  createdAt?: Date | null | undefined;
53
52
  startDate?: Date | null | undefined;
54
53
  endDate?: Date | null | undefined;
55
54
  updatedAt?: Date | null | undefined;
55
+ tag?: import("../tournament.types").TournamentTag | undefined;
56
56
  reward?: {
57
57
  type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
58
58
  } | {
@@ -115,8 +115,8 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
115
115
  }>;
116
116
  getMatches: import("@trpc/server").TRPCQueryProcedure<{
117
117
  input: {
118
- filter: "completed" | "upcoming";
119
118
  tournamentId: string | mongoose.Types.ObjectId;
119
+ filter?: import("../tournament.types").MatchStatus | undefined;
120
120
  };
121
121
  output: {
122
122
  message: string;
@@ -130,16 +130,19 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
130
130
  team1: {
131
131
  name: string;
132
132
  teamId: string | mongoose.Types.ObjectId;
133
+ picture?: string | undefined;
133
134
  };
134
135
  team2: {
135
136
  name: string;
136
137
  teamId: string | mongoose.Types.ObjectId;
138
+ picture?: string | undefined;
137
139
  };
138
140
  score: {
139
141
  team1: number | null;
140
142
  team2: number | null;
141
143
  };
142
144
  stage: string;
145
+ matchStatus: import("../tournament.types").MatchStatus;
143
146
  prediction: {
144
147
  score: {
145
148
  team1: number | null;
@@ -165,16 +168,19 @@ export declare const teamRouter: import("@trpc/server").TRPCBuiltRouter<{
165
168
  team1: {
166
169
  name: string;
167
170
  teamId: string | mongoose.Types.ObjectId;
171
+ picture?: string | undefined;
168
172
  };
169
173
  team2: {
170
174
  name: string;
171
175
  teamId: string | mongoose.Types.ObjectId;
176
+ picture?: string | undefined;
172
177
  };
173
178
  score: {
174
179
  team1: number | null;
175
180
  team2: number | null;
176
181
  };
177
182
  stage: string;
183
+ matchStatus: import("../tournament.types").MatchStatus;
178
184
  prediction: {
179
185
  score: {
180
186
  team1: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"team.router.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAgBhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BrB,CAAC"}
1
+ {"version":3,"file":"team.router.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAgBhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BrB,CAAC"}