@lyxa.ai/marketing 1.0.51 → 1.0.53
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.
- package/dist/lib/index.d.ts +323 -77
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js +16 -3
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js.map +1 -1
- package/dist/lib/modules/coupon/validations/all-coupons.validation.d.ts +1117 -285
- package/dist/lib/modules/coupon/validations/all-coupons.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/all-coupons.validation.js +16 -2
- package/dist/lib/modules/coupon/validations/all-coupons.validation.js.map +1 -1
- package/dist/lib/modules/coupon/validations/index.d.ts +0 -1
- package/dist/lib/modules/coupon/validations/index.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/index.js +0 -1
- package/dist/lib/modules/coupon/validations/index.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +32 -32
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +9 -9
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +2 -5
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +2 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +19 -6
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +3 -2
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +3 -9
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +4 -7
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.js +15 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +96 -50
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.js +23 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts +18 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +78 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +12 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +68 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +22 -18
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js +2 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +88 -83
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +3 -2
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +10 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js +68 -22
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
- package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
- package/dist/lib/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
- package/dist/lib/modules/tournament/config/config.builder.d.ts.map +1 -1
- package/dist/lib/modules/tournament/config/config.builder.js +4 -0
- package/dist/lib/modules/tournament/config/config.builder.js.map +1 -1
- package/dist/lib/modules/tournament/config/config.repository.d.ts +8 -2
- package/dist/lib/modules/tournament/config/config.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/config/config.repository.js +30 -1
- package/dist/lib/modules/tournament/config/config.repository.js.map +1 -1
- package/dist/lib/modules/tournament/config/config.router.d.ts +102 -12
- package/dist/lib/modules/tournament/config/config.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/config/config.types.d.ts +15 -0
- package/dist/lib/modules/tournament/config/config.types.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.types.js +3 -0
- package/dist/lib/modules/tournament/config/config.types.js.map +1 -0
- package/dist/lib/modules/tournament/config/config.validation.d.ts +431 -52
- package/dist/lib/modules/tournament/config/config.validation.d.ts.map +1 -1
- package/dist/lib/modules/tournament/config/config.validation.js +20 -6
- package/dist/lib/modules/tournament/config/config.validation.js.map +1 -1
- package/dist/lib/modules/tournament/integration/integration.factory.d.ts +4 -0
- package/dist/lib/modules/tournament/integration/integration.factory.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/integration.factory.js +18 -0
- package/dist/lib/modules/tournament/integration/integration.factory.js.map +1 -0
- package/dist/lib/modules/tournament/integration/interfaces/ITournamentService.d.ts +36 -0
- package/dist/lib/modules/tournament/integration/interfaces/ITournamentService.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/interfaces/ITournamentService.js +3 -0
- package/dist/lib/modules/tournament/integration/interfaces/ITournamentService.js.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.provider.d.ts +14 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.provider.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.provider.js +92 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.provider.js.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.types.d.ts +51 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.types.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.types.js +3 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/api-football.types.js.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/index.d.ts +3 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/index.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/index.js +19 -0
- package/dist/lib/modules/tournament/integration/providers/api-football/index.js.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/index.d.ts +3 -0
- package/dist/lib/modules/tournament/integration/providers/index.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/index.js +19 -0
- package/dist/lib/modules/tournament/integration/providers/index.js.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/mock.provider.d.ts +7 -0
- package/dist/lib/modules/tournament/integration/providers/mock.provider.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/providers/mock.provider.js +22 -0
- package/dist/lib/modules/tournament/integration/providers/mock.provider.js.map +1 -0
- package/dist/lib/modules/tournament/integration/tournamentService.d.ts +9 -0
- package/dist/lib/modules/tournament/integration/tournamentService.d.ts.map +1 -0
- package/dist/lib/modules/tournament/integration/tournamentService.js +20 -0
- package/dist/lib/modules/tournament/integration/tournamentService.js.map +1 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.d.ts.map +1 -1
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js +50 -11
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js.map +1 -1
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.d.ts +7 -3
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.d.ts.map +1 -1
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.js +1 -1
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.js.map +1 -1
- package/dist/lib/modules/tournament/match/events/match-evaluation.orchestrator.d.ts +14 -0
- package/dist/lib/modules/tournament/match/events/match-evaluation.orchestrator.d.ts.map +1 -0
- package/dist/lib/modules/tournament/{notification/jobs/notification.worker.js → match/events/match-evaluation.orchestrator.js} +31 -27
- package/dist/lib/modules/tournament/match/events/match-evaluation.orchestrator.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.builder.d.ts +13 -34
- package/dist/lib/modules/tournament/match/match.builder.d.ts.map +1 -1
- package/dist/lib/modules/tournament/match/match.builder.js +31 -10
- package/dist/lib/modules/tournament/match/match.builder.js.map +1 -1
- package/dist/lib/modules/tournament/match/match.repository.d.ts +1 -1
- package/dist/lib/modules/tournament/match/match.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/match/match.repository.js.map +1 -1
- package/dist/lib/modules/tournament/match/match.router.d.ts +40 -4
- package/dist/lib/modules/tournament/match/match.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/match/match.service.d.ts +3 -0
- package/dist/lib/modules/tournament/match/match.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/match/match.service.js +15 -12
- package/dist/lib/modules/tournament/match/match.service.js.map +1 -1
- package/dist/lib/modules/tournament/match/match.types.d.ts +51 -0
- package/dist/lib/modules/tournament/match/match.types.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.types.js +3 -0
- package/dist/lib/modules/tournament/match/match.types.js.map +1 -0
- package/dist/lib/modules/tournament/notification/notification-template.repository.d.ts +2 -1
- package/dist/lib/modules/tournament/notification/notification-template.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/notification/notification-template.repository.js +2 -1
- package/dist/lib/modules/tournament/notification/notification-template.repository.js.map +1 -1
- package/dist/lib/modules/tournament/notification/notification.builder.d.ts +30 -0
- package/dist/lib/modules/tournament/notification/notification.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.builder.js +35 -0
- package/dist/lib/modules/tournament/notification/notification.builder.js.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.config.d.ts +10 -9
- package/dist/lib/modules/tournament/notification/notification.config.d.ts.map +1 -1
- package/dist/lib/modules/tournament/notification/notification.config.js +0 -12
- package/dist/lib/modules/tournament/notification/notification.config.js.map +1 -1
- package/dist/lib/modules/tournament/notification/notification.service.d.ts +5 -3
- package/dist/lib/modules/tournament/notification/notification.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/notification/notification.service.js +23 -15
- package/dist/lib/modules/tournament/notification/notification.service.js.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.builder.d.ts +12 -0
- package/dist/lib/modules/tournament/participant/participant.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.builder.js +17 -0
- package/dist/lib/modules/tournament/participant/participant.builder.js.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.repository.d.ts +8 -7
- package/dist/lib/modules/tournament/participant/participant.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.repository.js +12 -2
- package/dist/lib/modules/tournament/participant/participant.repository.js.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.service.d.ts +1 -0
- package/dist/lib/modules/tournament/participant/participant.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/participant/participant.service.js +15 -17
- package/dist/lib/modules/tournament/participant/participant.service.js.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.builder.d.ts +3 -9
- package/dist/lib/modules/tournament/prediction/prediction.builder.d.ts.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.builder.js.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.repository.d.ts +11 -3
- package/dist/lib/modules/tournament/prediction/prediction.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.repository.js +47 -0
- package/dist/lib/modules/tournament/prediction/prediction.repository.js.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.service.d.ts +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.service.js +16 -26
- package/dist/lib/modules/tournament/prediction/prediction.service.js.map +1 -1
- package/dist/lib/modules/tournament/prediction/prediction.types.d.ts +17 -0
- package/dist/lib/modules/tournament/prediction/prediction.types.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.types.js +3 -0
- package/dist/lib/modules/tournament/prediction/prediction.types.js.map +1 -0
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.d.ts +8 -5
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.d.ts.map +1 -1
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.js +58 -16
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.js.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.builder.d.ts +5 -2
- package/dist/lib/modules/tournament/reward/reward.builder.d.ts.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.builder.js +44 -28
- package/dist/lib/modules/tournament/reward/reward.builder.js.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.factory.d.ts +1 -1
- package/dist/lib/modules/tournament/reward/reward.factory.d.ts.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.factory.js.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.interface.d.ts +2 -2
- package/dist/lib/modules/tournament/reward/reward.interface.d.ts.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.interface.js.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.service.d.ts +1 -1
- package/dist/lib/modules/tournament/reward/reward.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.service.js +1 -1
- package/dist/lib/modules/tournament/reward/reward.service.js.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.types.d.ts +35 -2
- package/dist/lib/modules/tournament/reward/reward.types.d.ts.map +1 -1
- package/dist/lib/modules/tournament/reward/reward.types.js.map +1 -1
- package/dist/lib/modules/tournament/schedule/schedule.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/schedule/schedule.router.js +1 -3
- package/dist/lib/modules/tournament/schedule/schedule.router.js.map +1 -1
- package/dist/lib/modules/tournament/schedule/schedule.service.d.ts +3 -0
- package/dist/lib/modules/tournament/schedule/schedule.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/schedule/schedule.service.js +30 -1
- package/dist/lib/modules/tournament/schedule/schedule.service.js.map +1 -1
- package/dist/lib/modules/tournament/score/score.repository.d.ts +13 -0
- package/dist/lib/modules/tournament/score/score.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/score/score.repository.js +20 -0
- package/dist/lib/modules/tournament/score/score.repository.js.map +1 -1
- package/dist/lib/modules/tournament/score/score.service.d.ts +3 -0
- package/dist/lib/modules/tournament/score/score.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/score/score.service.js +3 -0
- package/dist/lib/modules/tournament/score/score.service.js.map +1 -1
- package/dist/lib/modules/tournament/statistics/statistics.builder.d.ts +5 -0
- package/dist/lib/modules/tournament/statistics/statistics.builder.d.ts.map +1 -1
- package/dist/lib/modules/tournament/statistics/statistics.builder.js +47 -28
- package/dist/lib/modules/tournament/statistics/statistics.builder.js.map +1 -1
- package/dist/lib/modules/tournament/statistics/statistics.router.d.ts +4 -2
- package/dist/lib/modules/tournament/statistics/statistics.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/statistics/statistics.service.js +4 -4
- package/dist/lib/modules/tournament/statistics/statistics.service.js.map +1 -1
- package/dist/lib/modules/tournament/statistics/statistics.validation.d.ts +32 -14
- package/dist/lib/modules/tournament/statistics/statistics.validation.d.ts.map +1 -1
- package/dist/lib/modules/tournament/statistics/statistics.validation.js +2 -1
- package/dist/lib/modules/tournament/statistics/statistics.validation.js.map +1 -1
- package/dist/lib/modules/tournament/sync/sync.repository.d.ts +11 -0
- package/dist/lib/modules/tournament/sync/sync.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/{notification/notification.scheduler.service.js → sync/sync.repository.js} +22 -28
- package/dist/lib/modules/tournament/sync/sync.repository.js.map +1 -0
- package/dist/lib/modules/tournament/sync/sync.router.d.ts +27 -0
- package/dist/lib/modules/tournament/sync/sync.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/sync/sync.router.js +15 -0
- package/dist/lib/modules/tournament/sync/sync.router.js.map +1 -0
- package/dist/lib/modules/tournament/sync/sync.service.d.ts +9 -0
- package/dist/lib/modules/tournament/sync/sync.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/sync/sync.service.js +117 -0
- package/dist/lib/modules/tournament/sync/sync.service.js.map +1 -0
- package/dist/lib/modules/tournament/team/team.builder.d.ts +4 -0
- package/dist/lib/modules/tournament/team/team.builder.d.ts.map +1 -1
- package/dist/lib/modules/tournament/team/team.builder.js +6 -0
- package/dist/lib/modules/tournament/team/team.builder.js.map +1 -1
- package/dist/lib/modules/tournament/team/team.repository.d.ts +3 -0
- package/dist/lib/modules/tournament/team/team.repository.d.ts.map +1 -1
- package/dist/lib/modules/tournament/team/team.repository.js +6 -0
- package/dist/lib/modules/tournament/team/team.repository.js.map +1 -1
- package/dist/lib/modules/tournament/team/team.router.d.ts +24 -6
- package/dist/lib/modules/tournament/team/team.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/team/team.router.js +1 -1
- package/dist/lib/modules/tournament/team/team.router.js.map +1 -1
- package/dist/lib/modules/tournament/team/team.service.d.ts +2 -1
- package/dist/lib/modules/tournament/team/team.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/team/team.service.js +26 -23
- package/dist/lib/modules/tournament/team/team.service.js.map +1 -1
- package/dist/lib/modules/tournament/team/team.validation.d.ts +23 -24
- package/dist/lib/modules/tournament/team/team.validation.d.ts.map +1 -1
- package/dist/lib/modules/tournament/team/team.validation.js +3 -4
- package/dist/lib/modules/tournament/team/team.validation.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.builder.d.ts +11 -0
- package/dist/lib/modules/tournament/tournament.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/tournament.builder.js +34 -0
- package/dist/lib/modules/tournament/tournament.builder.js.map +1 -0
- package/dist/lib/modules/tournament/tournament.router.d.ts +226 -26
- package/dist/lib/modules/tournament/tournament.router.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.router.js +2 -0
- package/dist/lib/modules/tournament/tournament.router.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.service.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.service.js +3 -10
- package/dist/lib/modules/tournament/tournament.service.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.types.d.ts +0 -3
- package/dist/lib/modules/tournament/tournament.types.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.types.js +1 -5
- package/dist/lib/modules/tournament/tournament.types.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.utils.d.ts +4 -0
- package/dist/lib/modules/tournament/tournament.utils.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.utils.js +8 -1
- package/dist/lib/modules/tournament/tournament.utils.js.map +1 -1
- package/dist/lib/modules/tournament/tournament.validation.d.ts +205 -1
- package/dist/lib/modules/tournament/tournament.validation.d.ts.map +1 -1
- package/dist/lib/modules/tournament/tournament.validation.js +23 -2
- package/dist/lib/modules/tournament/tournament.validation.js.map +1 -1
- package/dist/types/index.d.ts +323 -77
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/all-coupons.validation.d.ts +1117 -285
- package/dist/types/modules/coupon/validations/all-coupons.validation.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/index.d.ts +0 -1
- package/dist/types/modules/coupon/validations/index.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +34 -32
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +1 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +19 -6
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +3 -9
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts +1 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +96 -50
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts +23 -0
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +12 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +22 -18
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +88 -83
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +20 -1
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
- package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
- package/dist/types/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
- package/dist/types/modules/tournament/config/config.builder.d.ts.map +1 -1
- package/dist/types/modules/tournament/config/config.repository.d.ts +8 -2
- package/dist/types/modules/tournament/config/config.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/config/config.router.d.ts +102 -12
- package/dist/types/modules/tournament/config/config.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/config/config.types.d.ts +15 -0
- package/dist/types/modules/tournament/config/config.types.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/config.validation.d.ts +431 -52
- package/dist/types/modules/tournament/config/config.validation.d.ts.map +1 -1
- package/dist/types/modules/tournament/integration/integration.factory.d.ts +4 -0
- package/dist/types/modules/tournament/integration/integration.factory.d.ts.map +1 -0
- package/dist/types/modules/tournament/integration/interfaces/ITournamentService.d.ts +36 -0
- package/dist/types/modules/tournament/integration/interfaces/ITournamentService.d.ts.map +1 -0
- package/dist/types/modules/tournament/integration/providers/api-football/api-football.provider.d.ts +14 -0
- package/dist/types/modules/tournament/integration/providers/api-football/api-football.provider.d.ts.map +1 -0
- package/dist/types/modules/tournament/integration/providers/api-football/api-football.types.d.ts +51 -0
- package/dist/types/modules/tournament/integration/providers/api-football/api-football.types.d.ts.map +1 -0
- package/dist/types/modules/tournament/integration/providers/api-football/index.d.ts +3 -0
- package/dist/types/modules/tournament/integration/providers/api-football/index.d.ts.map +1 -0
- package/dist/types/modules/tournament/integration/providers/index.d.ts +3 -0
- package/dist/types/modules/tournament/integration/providers/index.d.ts.map +1 -0
- package/dist/types/modules/tournament/integration/providers/mock.provider.d.ts +7 -0
- package/dist/types/modules/tournament/integration/providers/mock.provider.d.ts.map +1 -0
- package/dist/types/modules/tournament/integration/tournamentService.d.ts +9 -0
- package/dist/types/modules/tournament/integration/tournamentService.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/events/evaluate-predictions.consumer.d.ts.map +1 -1
- package/dist/types/modules/tournament/match/events/evaluate-predictions.event.d.ts +7 -3
- package/dist/types/modules/tournament/match/events/evaluate-predictions.event.d.ts.map +1 -1
- package/dist/types/modules/tournament/match/events/match-evaluation.orchestrator.d.ts +14 -0
- package/dist/types/modules/tournament/match/events/match-evaluation.orchestrator.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.builder.d.ts +13 -34
- package/dist/types/modules/tournament/match/match.builder.d.ts.map +1 -1
- package/dist/types/modules/tournament/match/match.repository.d.ts +1 -1
- package/dist/types/modules/tournament/match/match.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/match/match.router.d.ts +40 -4
- package/dist/types/modules/tournament/match/match.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/match/match.service.d.ts +3 -0
- package/dist/types/modules/tournament/match/match.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/match/match.types.d.ts +51 -0
- package/dist/types/modules/tournament/match/match.types.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/notification-template.repository.d.ts +2 -1
- package/dist/types/modules/tournament/notification/notification-template.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/notification/notification.builder.d.ts +30 -0
- package/dist/types/modules/tournament/notification/notification.builder.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/notification.config.d.ts +10 -9
- package/dist/types/modules/tournament/notification/notification.config.d.ts.map +1 -1
- package/dist/types/modules/tournament/notification/notification.service.d.ts +5 -3
- package/dist/types/modules/tournament/notification/notification.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/participant/participant.builder.d.ts +12 -0
- package/dist/types/modules/tournament/participant/participant.builder.d.ts.map +1 -0
- package/dist/types/modules/tournament/participant/participant.repository.d.ts +8 -7
- package/dist/types/modules/tournament/participant/participant.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/participant/participant.service.d.ts +1 -0
- package/dist/types/modules/tournament/participant/participant.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/prediction/prediction.builder.d.ts +3 -9
- package/dist/types/modules/tournament/prediction/prediction.builder.d.ts.map +1 -1
- package/dist/types/modules/tournament/prediction/prediction.repository.d.ts +11 -3
- package/dist/types/modules/tournament/prediction/prediction.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/prediction/prediction.service.d.ts +1 -1
- package/dist/types/modules/tournament/prediction/prediction.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/prediction/prediction.types.d.ts +17 -0
- package/dist/types/modules/tournament/prediction/prediction.types.d.ts.map +1 -0
- package/dist/types/modules/tournament/reward/handlers/coupon-reward.handler.d.ts +8 -5
- package/dist/types/modules/tournament/reward/handlers/coupon-reward.handler.d.ts.map +1 -1
- package/dist/types/modules/tournament/reward/reward.builder.d.ts +5 -2
- package/dist/types/modules/tournament/reward/reward.builder.d.ts.map +1 -1
- package/dist/types/modules/tournament/reward/reward.factory.d.ts +1 -1
- package/dist/types/modules/tournament/reward/reward.factory.d.ts.map +1 -1
- package/dist/types/modules/tournament/reward/reward.interface.d.ts +2 -2
- package/dist/types/modules/tournament/reward/reward.interface.d.ts.map +1 -1
- package/dist/types/modules/tournament/reward/reward.service.d.ts +1 -1
- package/dist/types/modules/tournament/reward/reward.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/reward/reward.types.d.ts +35 -2
- package/dist/types/modules/tournament/reward/reward.types.d.ts.map +1 -1
- package/dist/types/modules/tournament/schedule/schedule.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/schedule/schedule.service.d.ts +3 -0
- package/dist/types/modules/tournament/schedule/schedule.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/score/score.repository.d.ts +13 -0
- package/dist/types/modules/tournament/score/score.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/score/score.service.d.ts +3 -0
- package/dist/types/modules/tournament/score/score.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/statistics/statistics.builder.d.ts +5 -0
- package/dist/types/modules/tournament/statistics/statistics.builder.d.ts.map +1 -1
- package/dist/types/modules/tournament/statistics/statistics.router.d.ts +4 -2
- package/dist/types/modules/tournament/statistics/statistics.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/statistics/statistics.validation.d.ts +32 -14
- package/dist/types/modules/tournament/statistics/statistics.validation.d.ts.map +1 -1
- package/dist/types/modules/tournament/sync/sync.repository.d.ts +11 -0
- package/dist/types/modules/tournament/sync/sync.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/sync/sync.router.d.ts +27 -0
- package/dist/types/modules/tournament/sync/sync.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/sync/sync.service.d.ts +9 -0
- package/dist/types/modules/tournament/sync/sync.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/team/team.builder.d.ts +4 -0
- package/dist/types/modules/tournament/team/team.builder.d.ts.map +1 -1
- package/dist/types/modules/tournament/team/team.repository.d.ts +3 -0
- package/dist/types/modules/tournament/team/team.repository.d.ts.map +1 -1
- package/dist/types/modules/tournament/team/team.router.d.ts +24 -6
- package/dist/types/modules/tournament/team/team.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/team/team.service.d.ts +2 -1
- package/dist/types/modules/tournament/team/team.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/team/team.validation.d.ts +23 -24
- package/dist/types/modules/tournament/team/team.validation.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.builder.d.ts +11 -0
- package/dist/types/modules/tournament/tournament.builder.d.ts.map +1 -0
- package/dist/types/modules/tournament/tournament.router.d.ts +226 -26
- package/dist/types/modules/tournament/tournament.router.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.service.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.types.d.ts +0 -3
- package/dist/types/modules/tournament/tournament.types.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.utils.d.ts +4 -0
- package/dist/types/modules/tournament/tournament.utils.d.ts.map +1 -1
- package/dist/types/modules/tournament/tournament.validation.d.ts +205 -1
- package/dist/types/modules/tournament/tournament.validation.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts +0 -2
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts.map +0 -1
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js +0 -15
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js.map +0 -1
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts +0 -14
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts.map +0 -1
- package/dist/lib/modules/tournament/match/events/match-ended.event.js +0 -12
- package/dist/lib/modules/tournament/match/events/match-ended.event.js.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts +0 -10
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js +0 -23
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts +0 -9
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.js.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts +0 -10
- package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.schedule.config.js +0 -15
- package/dist/lib/modules/tournament/notification/notification.schedule.config.js.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts +0 -10
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.js.map +0 -1
- package/dist/types/events/event-initializations.d.ts +0 -2
- package/dist/types/events/event-initializations.d.ts.map +0 -1
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts +0 -201
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts.map +0 -1
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts +0 -2
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts.map +0 -1
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts +0 -14
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts +0 -10
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts +0 -9
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts +0 -10
- package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts +0 -10
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.service.js","sourceRoot":"/","sources":["modules/tournament/team/team.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AAEzC,4EAA2F;AAQ3F,uDAA6D;AAC7D,4EAAwE;AACxE,iDAA6C;AAG7C,0DAA2C;AAC3C,0DAAgD;AAGzC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACZ,UAAU,CAA2B;IACrC,kBAAkB,CAAqB;IAE/C;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,0CAAwB,CAAC,CAAC;QAC1D,IAAI,CAAC,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,wCAAkB,CAAC,CAAC;IAChE,CAAC;IAEO,mBAAmB,CAAC,OAAmC,EAAE,MAA+B;QAC5F,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC1B,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,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,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,IAAI,IAAI,EAAE;oBACtE,CAAC,CAAC,IAAI;gBACV,UAAU,EAAE,CAAC,KAAK,CAAC,YAAY,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;gBACrE,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC;aAC/C,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO;YACH,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,OAAO;SACwB,CAAC;IACxC,CAAC;CACJ,CAAA;AAlGY,kCAAW;sBAAX,WAAW;IADvB,IAAA,gBAAO,GAAE;;GACG,WAAW,CAkGvB;AAEY,QAAA,WAAW,GAAG,gBAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { mongoose } from '@typegoose/typegoose';\nimport { badRequestError, notFoundError } from '@lyxa.ai/core/dist/utilities/error-common';\nimport {\n AddTournamentTeamsInputDTO,\n GetTeamMatchesInputDTO,\n TournamentTeamOutputDTO,\n TournamentWithMatchesOutputDTO,\n TournamentWithTeamsOutputDTO,\n} from './team.validation';\nimport { TournamentTeamRepository } from './team.repository';\nimport { ParticipantService } from '../participant/participant.service';\nimport { TeamBuilder } from './team.builder';\nimport { TournamentConfigOutputDTO } from '../config/config.validation';\nimport { TournamentMatchOutputDTO } from '../match/match.validation';\nimport {utcNow} from '../tournament.utils';\nimport {MatchStatus} from '../tournament.types';\n\n@Service()\nexport class TeamService {\n private repository: TournamentTeamRepository;\n private participantService: ParticipantService;\n\n constructor() {\n this.repository = Container.get(TournamentTeamRepository);\n this.participantService = Container.get(ParticipantService);\n }\n\n private filterMatchesByTeam(matches: TournamentMatchOutputDTO[], teamId: mongoose.Types.ObjectId): TournamentMatchOutputDTO[] {\n return matches.filter(match =>\n [match.team1.teamId.toString(), match.team2.teamId.toString()].includes(teamId.toString())\n );\n }\n\n private getMatchStatus(match: TournamentMatchOutputDTO, now: Date): MatchStatus {\n if (match.endDate) return MatchStatus.ENDED;\n if (match.startingDate && match.startingDate <= now) return MatchStatus.STARTED;\n return MatchStatus.UPCOMING;\n }\n\n private applyStatusFilter(matches: TournamentMatchOutputDTO[], now: Date, filter?: MatchStatus): TournamentMatchOutputDTO[] {\n const filtered = filter\n ? matches.filter(match => this.getMatchStatus(match, now) === filter)\n : matches;\n\n return filtered.sort((a, b) => {\n const aTime = a.startingDate ? new Date(a.startingDate).getTime() : 0;\n const bTime = b.startingDate ? new Date(b.startingDate).getTime() : 0;\n return filter === MatchStatus.ENDED ? bTime - aTime : aTime - bTime;\n });\n }\n\n public async add(input: AddTournamentTeamsInputDTO): Promise<TournamentConfigOutputDTO> {\n const tournament = await this.repository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n const result = await this.repository.addTeams(input.tournamentId, TeamBuilder.buildTeams(input.teams));\n if (!result) throw new TRPCError({ code: 'INTERNAL_SERVER_ERROR', message: 'Failed to add teams' });\n\n return result as TournamentConfigOutputDTO;\n }\n\n public async getAll(tournamentId: mongoose.Types.ObjectId): Promise<TournamentWithTeamsOutputDTO> {\n const tournament = await this.repository.findById(tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n return {\n tournamentId,\n tag: tournament.tag,\n startDate: tournament.startDate,\n endDate: tournament.endDate,\n status: tournament.status,\n teams: tournament.teams as TournamentTeamOutputDTO[],\n } as TournamentWithTeamsOutputDTO;\n }\n\n public async getMatches(userId: mongoose.Types.ObjectId, input: GetTeamMatchesInputDTO): Promise<TournamentWithMatchesOutputDTO> {\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n const tournament = await this.repository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n const teamPictureById = new Map(\n (tournament.teams as TournamentTeamOutputDTO[]).map(t => [t._id.toString(), t.picture])\n );\n\n const now = utcNow();\n if (!participant.teamId) throw badRequestError('You have not joined this tournament');\n const teamMatches = this.filterMatchesByTeam(tournament.matches as TournamentMatchOutputDTO[], participant.teamId);\n const filteredMatches = this.applyStatusFilter(teamMatches, now, input.filter);\n\n const predictionsByMatchId = new Map(\n participant.predictions.map(p => [p.matchId.toString(), p])\n );\n\n const matches = filteredMatches.map(match => {\n const prediction = predictionsByMatchId.get(match._id.toString());\n return {\n ...match,\n team1: { ...match.team1, picture: teamPictureById.get(match.team1.teamId.toString()) },\n team2: { ...match.team2, picture: teamPictureById.get(match.team2.teamId.toString()) },\n prediction: prediction\n ? { score: prediction.score, succeeded: prediction.succeeded ?? null }\n : null,\n canPredict: !match.startingDate || now < new Date(match.startingDate),\n matchStatus: this.getMatchStatus(match, now),\n };\n });\n\n return {\n tournamentId: input.tournamentId,\n tag: tournament.tag,\n startDate: tournament.startDate,\n endDate: tournament.endDate,\n status: tournament.status,\n matches,\n } as TournamentWithMatchesOutputDTO;\n }\n}\n\nexport const teamService = Container.get(TeamService);\n"]}
|
|
1
|
+
{"version":3,"file":"team.service.js","sourceRoot":"/","sources":["modules/tournament/team/team.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AAEzC,4EAA2F;AAQ3F,uDAA6D;AAC7D,4EAAwE;AAExE,iDAA6C;AAI7C,0DAA2C;AAC3C,4DAAwE;AAGjE,IAAM,WAAW,GAAjB,MAAM,WAAW;IACZ,UAAU,CAA2B;IACrC,kBAAkB,CAAqB;IAE/C;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,0CAAwB,CAAC,CAAC;QAC1D,IAAI,CAAC,kBAAkB,GAAG,g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B,CAAC;IACxC,CAAC;IAEO,WAAW,CACf,KAA+B,EAC/B,GAAS,EACT,eAAgD,EAChD,oBAAwF;QAExF,MAAM,UAAU,GAAG,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClE,OAAO;YACH,GAAG,KAAK;YACR,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE;YACtF,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE;YACtF,UAAU,EAAE,UAAU;gBAClB,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,IAAI,IAAI,EAAE;gBACtE,CAAC,CAAC,IAAI;YACV,UAAU,EAAE,CAAC,KAAK,CAAC,YAAY,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;YACrE,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC;SAC/C,CAAC;IACN,CAAC;CACJ,CAAA;AAxGY,kCAAW;sBAAX,WAAW;IADvB,IAAA,gBAAO,GAAE;;GACG,WAAW,CAwGvB;AAEY,QAAA,WAAW,GAAG,gBAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { mongoose } from '@typegoose/typegoose';\nimport { badRequestError, notFoundError } from '@lyxa.ai/core/dist/utilities/error-common';\nimport {\n AddTournamentTeamsInputDTO,\n GetTeamMatchesInputDTO,\n TournamentTeamOutputDTO,\n TournamentWithMatchesOutputDTO,\n TournamentWithTeamsOutputDTO,\n} from './team.validation';\nimport { TournamentTeamRepository } from './team.repository';\nimport { ParticipantService } from '../participant/participant.service';\n\nimport { TeamBuilder } from './team.builder';\nimport { TournamentConfigOutputDTO } from '../config/config.validation';\nimport { TournamentMatchOutputDTO } from '../match/match.validation';\nimport { TournamentParticipantOutputDTO } from '../participant/participant.validation';\nimport {utcNow} from '../tournament.utils';\nimport {TournamentMatchStatus} from '@lyxa.ai/core/dist/utilities/enum';\n\n@Service()\nexport class TeamService {\n private repository: TournamentTeamRepository;\n private participantService: ParticipantService;\n\n constructor() {\n this.repository = Container.get(TournamentTeamRepository);\n this.participantService = Container.get(ParticipantService);\n }\n\n private filterMatchesByTeam(matches: TournamentMatchOutputDTO[], teamId: mongoose.Types.ObjectId): TournamentMatchOutputDTO[] {\n return matches.filter(match =>\n [match.team1.teamId.toString(), match.team2.teamId.toString()].includes(teamId.toString())\n );\n }\n\n private getMatchStatus(match: TournamentMatchOutputDTO, now: Date): TournamentMatchStatus {\n if (match.endDate) return TournamentMatchStatus.ENDED;\n if (match.startingDate && match.startingDate <= now) return TournamentMatchStatus.STARTED;\n return TournamentMatchStatus.UPCOMING;\n }\n\n private applyStatusFilter(matches: TournamentMatchOutputDTO[], now: Date, filter?: TournamentMatchStatus): TournamentMatchOutputDTO[] {\n const filtered = filter\n ? matches.filter(match => this.getMatchStatus(match, now) === filter)\n : matches;\n\n return filtered.sort((a, b) => {\n const aTime = a.startingDate ? new Date(a.startingDate).getTime() : 0;\n const bTime = b.startingDate ? new Date(b.startingDate).getTime() : 0;\n return filter === TournamentMatchStatus.ENDED ? bTime - aTime : aTime - bTime;\n });\n }\n\n public async add(input: AddTournamentTeamsInputDTO): Promise<TournamentConfigOutputDTO> {\n const tournament = await this.repository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n\n const result = await this.repository.addTeams(input.tournamentId, TeamBuilder.buildTeams(input.teams));\n if (!result) throw new TRPCError({ code: 'INTERNAL_SERVER_ERROR', message: 'Failed to add teams' });\n\n return result as TournamentConfigOutputDTO;\n }\n\n public async getAll(tournamentId?: mongoose.Types.ObjectId): Promise<TournamentWithTeamsOutputDTO> {\n const tournament = tournamentId\n ? await this.repository.findById(tournamentId)\n : await this.repository.findActive();\n if (!tournament) throw notFoundError('Tournament not found');\n\n return {\n tournamentId: (tournament as unknown as { _id: mongoose.Types.ObjectId })._id,\n tag: tournament.tag,\n startDate: tournament.startDate,\n endDate: tournament.endDate,\n status: tournament.status,\n teams: tournament.teams as TournamentTeamOutputDTO[],\n } as TournamentWithTeamsOutputDTO;\n }\n\n public async getMatches(userId: mongoose.Types.ObjectId, input: GetTeamMatchesInputDTO): Promise<TournamentWithMatchesOutputDTO> {\n const participant = await this.participantService.getByUserAndTournament(userId, input.tournamentId);\n const tournament = await this.repository.findById(input.tournamentId);\n if (!tournament) throw notFoundError('Tournament not found');\n if (!participant.teamId) throw badRequestError('You have not joined this tournament');\n\n const now = utcNow();\n const teamMatches = this.filterMatchesByTeam(tournament.matches as TournamentMatchOutputDTO[], participant.teamId);\n const filteredMatches = this.applyStatusFilter(teamMatches, now, input.filter);\n\n const teamPictureById = TeamBuilder.buildTeamPictureMap(tournament.teams as TournamentTeamOutputDTO[]);\n const predictionsByMatchId = TeamBuilder.buildPredictionMap(participant.predictions);\n\n const matches = filteredMatches.map(match =>\n this.enrichMatch(match, now, teamPictureById, predictionsByMatchId)\n );\n\n return {\n tournamentId: input.tournamentId,\n tag: tournament.tag,\n startDate: tournament.startDate,\n endDate: tournament.endDate,\n status: tournament.status,\n matches,\n } as TournamentWithMatchesOutputDTO;\n }\n\n private enrichMatch(\n match: TournamentMatchOutputDTO,\n now: Date,\n teamPictureById: Map<string, string | undefined>,\n predictionsByMatchId: Map<string, TournamentParticipantOutputDTO['predictions'][number]>\n ) {\n const prediction = predictionsByMatchId.get(match._id.toString());\n return {\n ...match,\n team1: { ...match.team1, picture: teamPictureById.get(match.team1.teamId.toString()) },\n team2: { ...match.team2, picture: teamPictureById.get(match.team2.teamId.toString()) },\n prediction: prediction\n ? { score: prediction.score, succeeded: prediction.succeeded ?? null }\n : null,\n canPredict: !match.startingDate || now < new Date(match.startingDate),\n matchStatus: this.getMatchStatus(match, now),\n };\n }\n}\n\nexport const teamService = Container.get(TeamService);\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { DTO } from '@lyxa.ai/core/dist/utilities/validation/global-validation';
|
|
3
|
-
import { Status } from '@lyxa.ai/core/dist/utilities/enum';
|
|
4
|
-
import { MatchStatus } from '../tournament.types';
|
|
3
|
+
import { Status, TournamentMatchStatus } from '@lyxa.ai/core/dist/utilities/enum';
|
|
5
4
|
export declare const AddTournamentTeamsSchema: z.ZodObject<{
|
|
6
5
|
tournamentId: 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
6
|
teams: z.ZodArray<z.ZodObject<{
|
|
@@ -28,22 +27,22 @@ export declare const AddTournamentTeamsSchema: z.ZodObject<{
|
|
|
28
27
|
}[];
|
|
29
28
|
}>;
|
|
30
29
|
export declare const GetTournamentTeamsSchema: z.ZodObject<{
|
|
31
|
-
tournamentId: 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
|
+
tournamentId: 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
31
|
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
tournamentId
|
|
32
|
+
tournamentId?: import("mongoose").Types.ObjectId | undefined;
|
|
34
33
|
}, {
|
|
35
|
-
tournamentId
|
|
34
|
+
tournamentId?: string | import("mongoose").Types.ObjectId | undefined;
|
|
36
35
|
}>;
|
|
37
|
-
export declare const TeamMatchFilterSchema: z.ZodNativeEnum<typeof
|
|
36
|
+
export declare const TeamMatchFilterSchema: z.ZodNativeEnum<typeof TournamentMatchStatus>;
|
|
38
37
|
export declare const GetTeamMatchesSchema: z.ZodObject<{
|
|
39
38
|
tournamentId: 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>]>;
|
|
40
|
-
filter: z.ZodOptional<z.ZodNativeEnum<typeof
|
|
39
|
+
filter: z.ZodOptional<z.ZodNativeEnum<typeof TournamentMatchStatus>>;
|
|
41
40
|
}, "strip", z.ZodTypeAny, {
|
|
42
41
|
tournamentId: import("mongoose").Types.ObjectId;
|
|
43
|
-
filter?:
|
|
42
|
+
filter?: TournamentMatchStatus | undefined;
|
|
44
43
|
}, {
|
|
45
44
|
tournamentId: string | import("mongoose").Types.ObjectId;
|
|
46
|
-
filter?:
|
|
45
|
+
filter?: TournamentMatchStatus | undefined;
|
|
47
46
|
}>;
|
|
48
47
|
declare const TournamentTeamSchema: z.ZodObject<{
|
|
49
48
|
name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -180,7 +179,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
180
179
|
succeeded: boolean | null;
|
|
181
180
|
}>>;
|
|
182
181
|
canPredict: z.ZodBoolean;
|
|
183
|
-
matchStatus: z.ZodNativeEnum<typeof
|
|
182
|
+
matchStatus: z.ZodNativeEnum<typeof TournamentMatchStatus>;
|
|
184
183
|
}, "strip", z.ZodTypeAny, {
|
|
185
184
|
_id: import("mongoose").Types.ObjectId;
|
|
186
185
|
team1: {
|
|
@@ -198,7 +197,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
198
197
|
team2: number | null;
|
|
199
198
|
};
|
|
200
199
|
stage: string;
|
|
201
|
-
matchStatus:
|
|
200
|
+
matchStatus: TournamentMatchStatus;
|
|
202
201
|
prediction: {
|
|
203
202
|
score: {
|
|
204
203
|
team1: number | null;
|
|
@@ -228,7 +227,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
228
227
|
team2: number | null;
|
|
229
228
|
};
|
|
230
229
|
stage: string;
|
|
231
|
-
matchStatus:
|
|
230
|
+
matchStatus: TournamentMatchStatus;
|
|
232
231
|
prediction: {
|
|
233
232
|
score: {
|
|
234
233
|
team1: number | null;
|
|
@@ -263,7 +262,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
263
262
|
team2: number | null;
|
|
264
263
|
};
|
|
265
264
|
stage: string;
|
|
266
|
-
matchStatus:
|
|
265
|
+
matchStatus: TournamentMatchStatus;
|
|
267
266
|
prediction: {
|
|
268
267
|
score: {
|
|
269
268
|
team1: number | null;
|
|
@@ -300,7 +299,7 @@ export declare const TournamentWithMatchesSchema: z.ZodObject<{
|
|
|
300
299
|
team2: number | null;
|
|
301
300
|
};
|
|
302
301
|
stage: string;
|
|
303
|
-
matchStatus:
|
|
302
|
+
matchStatus: TournamentMatchStatus;
|
|
304
303
|
prediction: {
|
|
305
304
|
score: {
|
|
306
305
|
team1: number | null;
|
|
@@ -634,7 +633,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
634
633
|
team2: number | null;
|
|
635
634
|
};
|
|
636
635
|
stage: string;
|
|
637
|
-
matchStatus:
|
|
636
|
+
matchStatus: TournamentMatchStatus;
|
|
638
637
|
prediction: {
|
|
639
638
|
score: {
|
|
640
639
|
team1: number | null;
|
|
@@ -671,7 +670,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
671
670
|
team2: number | null;
|
|
672
671
|
};
|
|
673
672
|
stage: string;
|
|
674
|
-
matchStatus:
|
|
673
|
+
matchStatus: TournamentMatchStatus;
|
|
675
674
|
prediction: {
|
|
676
675
|
score: {
|
|
677
676
|
team1: number | null;
|
|
@@ -710,7 +709,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
710
709
|
team2: number | null;
|
|
711
710
|
};
|
|
712
711
|
stage: string;
|
|
713
|
-
matchStatus:
|
|
712
|
+
matchStatus: TournamentMatchStatus;
|
|
714
713
|
prediction: {
|
|
715
714
|
score: {
|
|
716
715
|
team1: number | null;
|
|
@@ -755,7 +754,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
755
754
|
team2: number | null;
|
|
756
755
|
};
|
|
757
756
|
stage: string;
|
|
758
|
-
matchStatus:
|
|
757
|
+
matchStatus: TournamentMatchStatus;
|
|
759
758
|
prediction: {
|
|
760
759
|
score: {
|
|
761
760
|
team1: number | null;
|
|
@@ -799,7 +798,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
799
798
|
team2: number | null;
|
|
800
799
|
};
|
|
801
800
|
stage: string;
|
|
802
|
-
matchStatus:
|
|
801
|
+
matchStatus: TournamentMatchStatus;
|
|
803
802
|
prediction: {
|
|
804
803
|
score: {
|
|
805
804
|
team1: number | null;
|
|
@@ -836,7 +835,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
836
835
|
team2: number | null;
|
|
837
836
|
};
|
|
838
837
|
stage: string;
|
|
839
|
-
matchStatus:
|
|
838
|
+
matchStatus: TournamentMatchStatus;
|
|
840
839
|
prediction: {
|
|
841
840
|
score: {
|
|
842
841
|
team1: number | null;
|
|
@@ -877,7 +876,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
877
876
|
team2: number | null;
|
|
878
877
|
};
|
|
879
878
|
stage: string;
|
|
880
|
-
matchStatus:
|
|
879
|
+
matchStatus: TournamentMatchStatus;
|
|
881
880
|
prediction: {
|
|
882
881
|
score: {
|
|
883
882
|
team1: number | null;
|
|
@@ -915,7 +914,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
915
914
|
team2: number | null;
|
|
916
915
|
};
|
|
917
916
|
stage: string;
|
|
918
|
-
matchStatus:
|
|
917
|
+
matchStatus: TournamentMatchStatus;
|
|
919
918
|
prediction: {
|
|
920
919
|
score: {
|
|
921
920
|
team1: number | null;
|
|
@@ -963,7 +962,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
963
962
|
team2: number | null;
|
|
964
963
|
};
|
|
965
964
|
stage: string;
|
|
966
|
-
matchStatus:
|
|
965
|
+
matchStatus: TournamentMatchStatus;
|
|
967
966
|
prediction: {
|
|
968
967
|
score: {
|
|
969
968
|
team1: number | null;
|
|
@@ -1001,7 +1000,7 @@ export declare const TournamentWithMatchesResponseSchema: z.ZodObject<{
|
|
|
1001
1000
|
team2: number | null;
|
|
1002
1001
|
};
|
|
1003
1002
|
stage: string;
|
|
1004
|
-
matchStatus:
|
|
1003
|
+
matchStatus: TournamentMatchStatus;
|
|
1005
1004
|
prediction: {
|
|
1006
1005
|
score: {
|
|
1007
1006
|
team1: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.validation.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAiB,MAAM,2DAA2D,CAAC;AAE/F,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"team.validation.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAiB,MAAM,2DAA2D,CAAC;AAE/F,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoD,CAAC;AAErG,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC9E,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC9E,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACtE,MAAM,MAAM,uBAAuB,GAAG,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,4BAA4B,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,8BAA8B,GAAG,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -6,7 +6,6 @@ const global_validation_1 = require("@lyxa.ai/core/dist/utilities/validation/glo
|
|
|
6
6
|
const validation_1 = require("@lyxa.ai/core/dist/utilities/validation");
|
|
7
7
|
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
8
8
|
const match_validation_1 = require("../match/match.validation");
|
|
9
|
-
const tournament_types_1 = require("../tournament.types");
|
|
10
9
|
const TournamentTeamInputSchema = zod_1.z.object({
|
|
11
10
|
name: global_validation_1.ZodValidation.string('Team name'),
|
|
12
11
|
picture: global_validation_1.ZodValidation.string('Team picture').optional(),
|
|
@@ -16,9 +15,9 @@ exports.AddTournamentTeamsSchema = zod_1.z.object({
|
|
|
16
15
|
teams: zod_1.z.array(TournamentTeamInputSchema).min(1, 'At least one team is required'),
|
|
17
16
|
});
|
|
18
17
|
exports.GetTournamentTeamsSchema = zod_1.z.object({
|
|
19
|
-
tournamentId: global_validation_1.ZodValidation.objectId('Tournament id'),
|
|
18
|
+
tournamentId: global_validation_1.ZodValidation.objectId('Tournament id').optional(),
|
|
20
19
|
});
|
|
21
|
-
exports.TeamMatchFilterSchema = zod_1.z.nativeEnum(
|
|
20
|
+
exports.TeamMatchFilterSchema = zod_1.z.nativeEnum(enum_1.TournamentMatchStatus);
|
|
22
21
|
exports.GetTeamMatchesSchema = zod_1.z.object({
|
|
23
22
|
tournamentId: global_validation_1.ZodValidation.objectId('Tournament id'),
|
|
24
23
|
filter: exports.TeamMatchFilterSchema.optional(),
|
|
@@ -43,7 +42,7 @@ const PredictionSummarySchema = zod_1.z.object({
|
|
|
43
42
|
const TournamentMatchWithPredictionSchema = match_validation_1.TournamentMatchSchema.extend({
|
|
44
43
|
prediction: PredictionSummarySchema,
|
|
45
44
|
canPredict: zod_1.z.boolean(),
|
|
46
|
-
matchStatus: global_validation_1.ZodValidation.enumType(
|
|
45
|
+
matchStatus: global_validation_1.ZodValidation.enumType(enum_1.TournamentMatchStatus, 'Match status'),
|
|
47
46
|
});
|
|
48
47
|
exports.TournamentWithTeamsSchema = TournamentInfoSchema.extend({
|
|
49
48
|
teams: zod_1.z.array(TournamentTeamSchema),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.validation.js","sourceRoot":"/","sources":["modules/tournament/team/team.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAA+F;AAC/F,wEAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"team.validation.js","sourceRoot":"/","sources":["modules/tournament/team/team.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAA+F;AAC/F,wEAA+E;AAC/E,4DAAkF;AAClF,gEAAkE;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{ createResponseSchema } from '@lyxa.ai/core/dist/utilities/validation';\nimport { Status, TournamentMatchStatus } from '@lyxa.ai/core/dist/utilities/enum';\nimport { TournamentMatchSchema } from '../match/match.validation';\n\nconst TournamentTeamInputSchema = z.object({\n\tname: ZodValidation.string('Team name'),\n\tpicture: ZodValidation.string('Team picture').optional(),\n});\n\nexport const AddTournamentTeamsSchema = z.object({\n\ttournamentId: ZodValidation.objectId('Tournament id'),\n\tteams: z.array(TournamentTeamInputSchema).min(1, 'At least one team is required'),\n});\n\nexport const GetTournamentTeamsSchema = z.object({\n\ttournamentId: ZodValidation.objectId('Tournament id').optional(),\n});\n\nexport const TeamMatchFilterSchema = z.nativeEnum(TournamentMatchStatus);\n\nexport const GetTeamMatchesSchema = z.object({\n\ttournamentId: ZodValidation.objectId('Tournament id'),\n\tfilter: TeamMatchFilterSchema.optional(),\n});\n\nconst TournamentTeamSchema = TournamentTeamInputSchema.extend({\n\t_id: ZodValidation.objectId(),\n});\n\nconst TournamentInfoSchema = z.object({\n\ttournamentId: ZodValidation.objectId(),\n\ttag: ZodValidation.string('Tournament tag'),\n\tstartDate: z.date().nullable().optional(),\n\tendDate: z.date().nullable().optional(),\n\tstatus: ZodValidation.enumType(Status, 'Status'),\n});\n\nconst PredictionSummarySchema = z.object({\n\tscore: z.object({\n\t\tteam1: ZodValidation.number('Team 1 score').nullable(),\n\t\tteam2: ZodValidation.number('Team 2 score').nullable(),\n\t}),\n\tsucceeded: z.boolean().nullable(),\n}).nullable();\n\nconst TournamentMatchWithPredictionSchema = TournamentMatchSchema.extend({\n\tprediction: PredictionSummarySchema,\n\tcanPredict: z.boolean(),\n\tmatchStatus: ZodValidation.enumType(TournamentMatchStatus, 'Match status'),\n});\n\nexport const TournamentWithTeamsSchema = TournamentInfoSchema.extend({\n\tteams: z.array(TournamentTeamSchema),\n});\n\nexport const TournamentWithMatchesSchema = TournamentInfoSchema.extend({\n\tmatches: z.array(TournamentMatchWithPredictionSchema),\n});\n\nexport const TournamentTeamListResponseSchema = createResponseSchema(z.array(TournamentTeamSchema));\nexport const TournamentWithTeamsResponseSchema = createResponseSchema(TournamentWithTeamsSchema);\nexport const TournamentWithMatchesResponseSchema = createResponseSchema(TournamentWithMatchesSchema);\n\nexport type AddTournamentTeamsInputDTO = DTO<typeof AddTournamentTeamsSchema>;\nexport type GetTournamentTeamsInputDTO = DTO<typeof GetTournamentTeamsSchema>;\nexport type GetTeamMatchesInputDTO = DTO<typeof GetTeamMatchesSchema>;\nexport type TournamentTeamOutputDTO = DTO<typeof TournamentTeamSchema>;\nexport type TournamentWithTeamsOutputDTO = DTO<typeof TournamentWithTeamsSchema>;\nexport type TournamentWithMatchesOutputDTO = DTO<typeof TournamentWithMatchesSchema>;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActiveTournamentSummary } from './config/config.types';
|
|
2
|
+
import { ActiveTournamentOutputDTO } from './tournament.validation';
|
|
3
|
+
import { TournamentParticipantOutputDTO } from './participant/participant.validation';
|
|
4
|
+
export type ActiveTournamentUserStatus = ActiveTournamentOutputDTO['userStatus'];
|
|
5
|
+
export type SelectedTeamView = ActiveTournamentOutputDTO['selectedTeam'];
|
|
6
|
+
export declare class TournamentActiveViewBuilder {
|
|
7
|
+
static build(tournament: ActiveTournamentSummary, participant: TournamentParticipantOutputDTO | null): ActiveTournamentOutputDTO;
|
|
8
|
+
private static resolveUserStatus;
|
|
9
|
+
private static resolveSelectedTeam;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tournament.builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tournament.builder.d.ts","sourceRoot":"/","sources":["modules/tournament/tournament.builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,8BAA8B,EAAC,MAAM,sCAAsC,CAAC;AAEpF,MAAM,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAAC;AACjF,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,cAAc,CAAC,CAAC;AAEzE,qBAAa,2BAA2B;IACpC,MAAM,CAAC,KAAK,CACR,UAAU,EAAE,uBAAuB,EACnC,WAAW,EAAE,8BAA8B,GAAG,IAAI,GACnD,yBAAyB;IAa5B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAKhC,OAAO,CAAC,MAAM,CAAC,mBAAmB;CAYrC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TournamentActiveViewBuilder = void 0;
|
|
4
|
+
const tournament_types_1 = require("./tournament.types");
|
|
5
|
+
class TournamentActiveViewBuilder {
|
|
6
|
+
static build(tournament, participant) {
|
|
7
|
+
return {
|
|
8
|
+
_id: tournament._id,
|
|
9
|
+
name: tournament.name,
|
|
10
|
+
tag: tournament.tag,
|
|
11
|
+
startDate: tournament.startDate ?? null,
|
|
12
|
+
endDate: tournament.endDate ?? null,
|
|
13
|
+
userStatus: TournamentActiveViewBuilder.resolveUserStatus(participant),
|
|
14
|
+
selectedTeam: TournamentActiveViewBuilder.resolveSelectedTeam(tournament, participant),
|
|
15
|
+
reward: tournament.reward,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
static resolveUserStatus(participant) {
|
|
19
|
+
if (!participant)
|
|
20
|
+
return tournament_types_1.TournamentParticipantStatus.NOT_SEEN;
|
|
21
|
+
return (participant.status ?? tournament_types_1.TournamentParticipantStatus.JOINED);
|
|
22
|
+
}
|
|
23
|
+
static resolveSelectedTeam(tournament, participant) {
|
|
24
|
+
const teamId = participant?.teamId;
|
|
25
|
+
if (!teamId)
|
|
26
|
+
return null;
|
|
27
|
+
const team = tournament.teams.find(t => t._id.toString() === teamId.toString());
|
|
28
|
+
if (!team)
|
|
29
|
+
return null;
|
|
30
|
+
return { _id: team._id, name: team.name, picture: team.picture };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.TournamentActiveViewBuilder = TournamentActiveViewBuilder;
|
|
34
|
+
//# sourceMappingURL=tournament.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tournament.builder.js","sourceRoot":"/","sources":["modules/tournament/tournament.builder.ts"],"names":[],"mappings":";;;AAGA,yDAA+D;AAM/D,MAAa,2BAA2B;IACpC,MAAM,CAAC,KAAK,CACR,UAAmC,EACnC,WAAkD;QAElD,OAAO;YACH,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,SAAS,EAAE,UAAU,CAAC,SAAS,IAAI,IAAI;YACvC,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,IAAI;YACnC,UAAU,EAAE,2BAA2B,CAAC,iBAAiB,CAAC,WAAW,CAAC;YACtE,YAAY,EAAE,2BAA2B,CAAC,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC;YACtF,MAAM,EAAE,UAAU,CAAC,MAA6C;SACnE,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,iBAAiB,CAAC,WAAkD;QAC/E,IAAI,CAAC,WAAW;YAAE,OAAO,8CAA2B,CAAC,QAAsC,CAAC;QAC5F,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,8CAA2B,CAAC,MAAM,CAA+B,CAAC;IACpG,CAAC;IAEO,MAAM,CAAC,mBAAmB,CAC9B,UAAmC,EACnC,WAAkD;QAElD,MAAM,MAAM,GAAG,WAAW,EAAE,MAA6C,CAAC;QAC1E,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAEzB,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAEvB,OAAO,EAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC;IACnE,CAAC;CACJ;AAlCD,kEAkCC","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {ActiveTournamentSummary} from './config/config.types';\nimport {ActiveTournamentOutputDTO} from './tournament.validation';\nimport {TournamentParticipantStatus} from './tournament.types';\nimport {TournamentParticipantOutputDTO} from './participant/participant.validation';\n\nexport type ActiveTournamentUserStatus = ActiveTournamentOutputDTO['userStatus'];\nexport type SelectedTeamView = ActiveTournamentOutputDTO['selectedTeam'];\n\nexport class TournamentActiveViewBuilder {\n static build(\n tournament: ActiveTournamentSummary,\n participant: TournamentParticipantOutputDTO | null\n ): ActiveTournamentOutputDTO {\n return {\n _id: tournament._id,\n name: tournament.name,\n tag: tournament.tag,\n startDate: tournament.startDate ?? null,\n endDate: tournament.endDate ?? null,\n userStatus: TournamentActiveViewBuilder.resolveUserStatus(participant),\n selectedTeam: TournamentActiveViewBuilder.resolveSelectedTeam(tournament, participant),\n reward: tournament.reward as ActiveTournamentOutputDTO['reward'],\n };\n }\n\n private static resolveUserStatus(participant: TournamentParticipantOutputDTO | null): ActiveTournamentUserStatus {\n if (!participant) return TournamentParticipantStatus.NOT_SEEN as ActiveTournamentUserStatus;\n return (participant.status ?? TournamentParticipantStatus.JOINED) as ActiveTournamentUserStatus;\n }\n\n private static resolveSelectedTeam(\n tournament: ActiveTournamentSummary,\n participant: TournamentParticipantOutputDTO | null\n ): SelectedTeamView {\n const teamId = participant?.teamId as mongoose.Types.ObjectId | undefined;\n if (!teamId) return null;\n\n const team = tournament.teams.find(t => t._id.toString() === teamId.toString());\n if (!team) return null;\n\n return {_id: team._id, name: team.name, picture: team.picture};\n }\n}\n"]}
|