@lyxa.ai/marketing 1.0.46 → 1.0.48
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/event/event-initializations.d.ts.map +1 -1
- package/dist/lib/event/event-initializations.js +2 -0
- package/dist/lib/event/event-initializations.js.map +1 -1
- package/dist/lib/index.d.ts +1414 -13
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts +72 -6
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js +12 -3
- package/dist/lib/modules/coupon/routers/coupon.router.js.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.d.ts +1 -0
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +102 -4
- package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts +2 -0
- package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.js +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/global-coupon.service.d.ts +1 -1
- package/dist/lib/modules/coupon/services/global-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/global-coupon.service.js +16 -10
- package/dist/lib/modules/coupon/services/global-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/helper.service.d.ts +2 -1
- package/dist/lib/modules/coupon/services/helper.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/helper.service.js +7 -1
- package/dist/lib/modules/coupon/services/helper.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts +2 -0
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.js +2 -2
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/individual-user-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/individual-user-coupon.service.js +6 -0
- package/dist/lib/modules/coupon/services/individual-user-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts +10 -4
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js +88 -9
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +20 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js.map +1 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.js +1 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.d.ts +1 -1
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.js +36 -19
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts +2 -0
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.js +2 -2
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +359 -34
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js +16 -3
- package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +6 -6
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +6 -6
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +30 -30
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +8 -2
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.d.ts +2 -0
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js +14 -0
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +24 -24
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +36 -36
- package/dist/lib/modules/marketing/validations/featured-marketing.validation.d.ts +6 -6
- package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.d.ts +4 -4
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +2 -2
- package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts +7 -7
- package/dist/lib/modules/marketing/validations/punch-marketing.validation.d.ts +4 -4
- 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 +5 -0
- package/dist/lib/modules/tournament/config/config.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.builder.js +19 -0
- package/dist/lib/modules/tournament/config/config.builder.js.map +1 -0
- package/dist/lib/modules/tournament/config/config.repository.d.ts +13 -0
- package/dist/lib/modules/tournament/config/config.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.repository.js +77 -0
- package/dist/lib/modules/tournament/config/config.repository.js.map +1 -0
- package/dist/lib/modules/tournament/config/config.router.d.ts +363 -0
- package/dist/lib/modules/tournament/config/config.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.router.js +40 -0
- package/dist/lib/modules/tournament/config/config.router.js.map +1 -0
- package/dist/lib/modules/tournament/config/config.service.d.ts +14 -0
- package/dist/lib/modules/tournament/config/config.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.service.js +101 -0
- package/dist/lib/modules/tournament/config/config.service.js.map +1 -0
- package/dist/lib/modules/tournament/config/config.validation.d.ts +1014 -0
- package/dist/lib/modules/tournament/config/config.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.validation.js +70 -0
- package/dist/lib/modules/tournament/config/config.validation.js.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js +15 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts +14 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.js +12 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.builder.d.ts +38 -0
- package/dist/lib/modules/tournament/match/match.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.builder.js +37 -0
- package/dist/lib/modules/tournament/match/match.builder.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.repository.d.ts +13 -0
- package/dist/lib/modules/tournament/match/match.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.repository.js +84 -0
- package/dist/lib/modules/tournament/match/match.repository.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.router.d.ts +489 -0
- package/dist/lib/modules/tournament/match/match.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.router.js +56 -0
- package/dist/lib/modules/tournament/match/match.router.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.service.d.ts +29 -0
- package/dist/lib/modules/tournament/match/match.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.service.js +193 -0
- package/dist/lib/modules/tournament/match/match.service.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.validation.d.ts +880 -0
- package/dist/lib/modules/tournament/match/match.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.validation.js +74 -0
- package/dist/lib/modules/tournament/match/match.validation.js.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts +13 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js +28 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts +7 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.js +76 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.js.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.js +86 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.js.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.service.d.ts +11 -0
- package/dist/lib/modules/tournament/notification/notification.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.service.js +101 -0
- package/dist/lib/modules/tournament/notification/notification.service.js.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.repository.d.ts +12 -0
- package/dist/lib/modules/tournament/participant/participant.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.repository.js +73 -0
- package/dist/lib/modules/tournament/participant/participant.repository.js.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.router.d.ts +104 -0
- package/dist/lib/modules/tournament/participant/participant.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.router.js +28 -0
- package/dist/lib/modules/tournament/participant/participant.router.js.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.service.d.ts +14 -0
- package/dist/lib/modules/tournament/participant/participant.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.service.js +103 -0
- package/dist/lib/modules/tournament/participant/participant.service.js.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.validation.d.ts +719 -0
- package/dist/lib/modules/tournament/participant/participant.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/participant/participant.validation.js +44 -0
- package/dist/lib/modules/tournament/participant/participant.validation.js.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.builder.d.ts +14 -0
- package/dist/lib/modules/tournament/prediction/prediction.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.builder.js +23 -0
- package/dist/lib/modules/tournament/prediction/prediction.builder.js.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.repository.d.ts +11 -0
- package/dist/lib/modules/tournament/prediction/prediction.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.repository.js +73 -0
- package/dist/lib/modules/tournament/prediction/prediction.repository.js.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.router.d.ts +133 -0
- package/dist/lib/modules/tournament/prediction/prediction.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.router.js +36 -0
- package/dist/lib/modules/tournament/prediction/prediction.router.js.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.service.d.ts +17 -0
- package/dist/lib/modules/tournament/prediction/prediction.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.service.js +125 -0
- package/dist/lib/modules/tournament/prediction/prediction.service.js.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.validation.d.ts +575 -0
- package/dist/lib/modules/tournament/prediction/prediction.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.validation.js +46 -0
- package/dist/lib/modules/tournament/prediction/prediction.validation.js.map +1 -0
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.d.ts +8 -0
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.d.ts.map +1 -0
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.js +65 -0
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.js.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.factory.d.ts +6 -0
- package/dist/lib/modules/tournament/reward/reward.factory.d.ts.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.factory.js +21 -0
- package/dist/lib/modules/tournament/reward/reward.factory.js.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.interface.d.ts +5 -0
- package/dist/lib/modules/tournament/reward/reward.interface.d.ts.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.interface.js +3 -0
- package/dist/lib/modules/tournament/reward/reward.interface.js.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.service.d.ts +6 -0
- package/dist/lib/modules/tournament/reward/reward.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.service.js +56 -0
- package/dist/lib/modules/tournament/reward/reward.service.js.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.types.d.ts +11 -0
- package/dist/lib/modules/tournament/reward/reward.types.d.ts.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.types.js +8 -0
- package/dist/lib/modules/tournament/reward/reward.types.js.map +1 -0
- package/dist/lib/modules/tournament/team/team.builder.d.ts +19 -0
- package/dist/lib/modules/tournament/team/team.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/team/team.builder.js +18 -0
- package/dist/lib/modules/tournament/team/team.builder.js.map +1 -0
- package/dist/lib/modules/tournament/team/team.repository.d.ts +11 -0
- package/dist/lib/modules/tournament/team/team.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/team/team.repository.js +71 -0
- package/dist/lib/modules/tournament/team/team.repository.js.map +1 -0
- package/dist/lib/modules/tournament/team/team.router.d.ts +237 -0
- package/dist/lib/modules/tournament/team/team.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/team/team.router.js +36 -0
- package/dist/lib/modules/tournament/team/team.router.js.map +1 -0
- package/dist/lib/modules/tournament/team/team.service.d.ts +15 -0
- package/dist/lib/modules/tournament/team/team.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/team/team.service.js +137 -0
- package/dist/lib/modules/tournament/team/team.service.js.map +1 -0
- package/dist/lib/modules/tournament/team/team.validation.d.ts +986 -0
- package/dist/lib/modules/tournament/team/team.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/team/team.validation.js +55 -0
- package/dist/lib/modules/tournament/team/team.validation.js.map +1 -0
- package/dist/lib/modules/tournament/tournament.router.d.ts +1336 -0
- package/dist/lib/modules/tournament/tournament.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/tournament.router.js +17 -0
- package/dist/lib/modules/tournament/tournament.router.js.map +1 -0
- package/dist/types/event/event-initializations.d.ts.map +1 -1
- package/dist/types/events/event-initializations.d.ts +2 -0
- package/dist/types/events/event-initializations.d.ts.map +1 -0
- package/dist/types/index.d.ts +1414 -13
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +72 -6
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/coupon.service.d.ts +1 -0
- package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/custom-coupon.service.d.ts +2 -0
- package/dist/types/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/global-coupon.service.d.ts +1 -1
- package/dist/types/modules/coupon/services/global-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/helper.service.d.ts +2 -1
- package/dist/types/modules/coupon/services/helper.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts +2 -0
- package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/individual-user-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts +10 -4
- package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/referral-code-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/referral-reward-coupon.service.d.ts +1 -1
- package/dist/types/modules/coupon/services/referral-reward-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts +2 -0
- package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts +359 -34
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +6 -6
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +6 -6
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +30 -30
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/synchronize-product-marketing.service.d.ts +2 -0
- package/dist/types/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +24 -24
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +36 -36
- package/dist/types/modules/marketing/validations/featured-marketing.validation.d.ts +6 -6
- package/dist/types/modules/marketing/validations/free-delivery-marketing.validation.d.ts +4 -4
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts +2 -2
- package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts +7 -7
- package/dist/types/modules/marketing/validations/punch-marketing.validation.d.ts +4 -4
- 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 +5 -0
- package/dist/types/modules/tournament/config/config.builder.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/config.repository.d.ts +13 -0
- package/dist/types/modules/tournament/config/config.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/config.router.d.ts +363 -0
- package/dist/types/modules/tournament/config/config.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/config.service.d.ts +14 -0
- package/dist/types/modules/tournament/config/config.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/config.validation.d.ts +1014 -0
- package/dist/types/modules/tournament/config/config.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts +201 -0
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts +14 -0
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.builder.d.ts +38 -0
- package/dist/types/modules/tournament/match/match.builder.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.repository.d.ts +13 -0
- package/dist/types/modules/tournament/match/match.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.router.d.ts +489 -0
- package/dist/types/modules/tournament/match/match.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.service.d.ts +29 -0
- package/dist/types/modules/tournament/match/match.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.validation.d.ts +880 -0
- package/dist/types/modules/tournament/match/match.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts +13 -0
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts +7 -0
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/notification.service.d.ts +11 -0
- package/dist/types/modules/tournament/notification/notification.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/participant/participant.repository.d.ts +12 -0
- package/dist/types/modules/tournament/participant/participant.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/participant/participant.router.d.ts +104 -0
- package/dist/types/modules/tournament/participant/participant.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/participant/participant.service.d.ts +14 -0
- package/dist/types/modules/tournament/participant/participant.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/participant/participant.validation.d.ts +719 -0
- package/dist/types/modules/tournament/participant/participant.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/prediction/prediction.builder.d.ts +14 -0
- package/dist/types/modules/tournament/prediction/prediction.builder.d.ts.map +1 -0
- package/dist/types/modules/tournament/prediction/prediction.repository.d.ts +11 -0
- package/dist/types/modules/tournament/prediction/prediction.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/prediction/prediction.router.d.ts +133 -0
- package/dist/types/modules/tournament/prediction/prediction.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/prediction/prediction.service.d.ts +17 -0
- package/dist/types/modules/tournament/prediction/prediction.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/prediction/prediction.validation.d.ts +575 -0
- package/dist/types/modules/tournament/prediction/prediction.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/reward/handlers/coupon-reward.handler.d.ts +8 -0
- package/dist/types/modules/tournament/reward/handlers/coupon-reward.handler.d.ts.map +1 -0
- package/dist/types/modules/tournament/reward/reward.factory.d.ts +6 -0
- package/dist/types/modules/tournament/reward/reward.factory.d.ts.map +1 -0
- package/dist/types/modules/tournament/reward/reward.interface.d.ts +5 -0
- package/dist/types/modules/tournament/reward/reward.interface.d.ts.map +1 -0
- package/dist/types/modules/tournament/reward/reward.service.d.ts +6 -0
- package/dist/types/modules/tournament/reward/reward.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/reward/reward.types.d.ts +11 -0
- package/dist/types/modules/tournament/reward/reward.types.d.ts.map +1 -0
- package/dist/types/modules/tournament/team/team.builder.d.ts +19 -0
- package/dist/types/modules/tournament/team/team.builder.d.ts.map +1 -0
- package/dist/types/modules/tournament/team/team.repository.d.ts +11 -0
- package/dist/types/modules/tournament/team/team.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/team/team.router.d.ts +237 -0
- package/dist/types/modules/tournament/team/team.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/team/team.service.d.ts +15 -0
- package/dist/types/modules/tournament/team/team.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/team/team.validation.d.ts +986 -0
- package/dist/types/modules/tournament/team/team.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/tournament.router.d.ts +1336 -0
- package/dist/types/modules/tournament/tournament.router.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +0 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +0 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js +0 -2
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js.map +0 -1
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
export declare const configRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
2
|
+
ctx: import("@lyxa.ai/core/dist/libraries/trpc/context").LyxaHTTPContext;
|
|
3
|
+
meta: object;
|
|
4
|
+
errorShape: {
|
|
5
|
+
message: string;
|
|
6
|
+
data: {
|
|
7
|
+
stack: undefined;
|
|
8
|
+
path: undefined;
|
|
9
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
10
|
+
httpStatus: number;
|
|
11
|
+
};
|
|
12
|
+
stack: undefined;
|
|
13
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
14
|
+
};
|
|
15
|
+
transformer: false;
|
|
16
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
17
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
18
|
+
input: {
|
|
19
|
+
startDate: string | Date;
|
|
20
|
+
endDate: string | Date;
|
|
21
|
+
tag: string;
|
|
22
|
+
status?: import("@lyxa.ai/core/dist/utilities/enum").Status | undefined;
|
|
23
|
+
};
|
|
24
|
+
output: {
|
|
25
|
+
message: string;
|
|
26
|
+
success: boolean;
|
|
27
|
+
data?: {
|
|
28
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
29
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
30
|
+
tag: string;
|
|
31
|
+
createdAt?: Date | null | undefined;
|
|
32
|
+
startDate?: Date | null | undefined;
|
|
33
|
+
endDate?: Date | null | undefined;
|
|
34
|
+
updatedAt?: Date | null | undefined;
|
|
35
|
+
matches?: {
|
|
36
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
37
|
+
team1: {
|
|
38
|
+
name: string;
|
|
39
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
40
|
+
};
|
|
41
|
+
team2: {
|
|
42
|
+
name: string;
|
|
43
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
44
|
+
};
|
|
45
|
+
score: {
|
|
46
|
+
team1: number | null;
|
|
47
|
+
team2: number | null;
|
|
48
|
+
};
|
|
49
|
+
stage: string;
|
|
50
|
+
endDate?: Date | null | undefined;
|
|
51
|
+
startingDate?: Date | null | undefined;
|
|
52
|
+
additionalTag?: string | undefined;
|
|
53
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
teams?: {
|
|
56
|
+
name: string;
|
|
57
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
58
|
+
picture?: string | null | undefined;
|
|
59
|
+
}[] | undefined;
|
|
60
|
+
} | {
|
|
61
|
+
documents: {
|
|
62
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
63
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
64
|
+
tag: string;
|
|
65
|
+
createdAt?: Date | null | undefined;
|
|
66
|
+
startDate?: Date | null | undefined;
|
|
67
|
+
endDate?: Date | null | undefined;
|
|
68
|
+
updatedAt?: Date | null | undefined;
|
|
69
|
+
matches?: {
|
|
70
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
71
|
+
team1: {
|
|
72
|
+
name: string;
|
|
73
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
74
|
+
};
|
|
75
|
+
team2: {
|
|
76
|
+
name: string;
|
|
77
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
78
|
+
};
|
|
79
|
+
score: {
|
|
80
|
+
team1: number | null;
|
|
81
|
+
team2: number | null;
|
|
82
|
+
};
|
|
83
|
+
stage: string;
|
|
84
|
+
endDate?: Date | null | undefined;
|
|
85
|
+
startingDate?: Date | null | undefined;
|
|
86
|
+
additionalTag?: string | undefined;
|
|
87
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
teams?: {
|
|
90
|
+
name: string;
|
|
91
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
92
|
+
picture?: string | null | undefined;
|
|
93
|
+
}[] | undefined;
|
|
94
|
+
}[];
|
|
95
|
+
metadata?: {
|
|
96
|
+
page: number;
|
|
97
|
+
size: number;
|
|
98
|
+
totalElements: number;
|
|
99
|
+
totalPages: number;
|
|
100
|
+
} | undefined;
|
|
101
|
+
} | undefined;
|
|
102
|
+
};
|
|
103
|
+
meta: object;
|
|
104
|
+
}>;
|
|
105
|
+
getAll: import("@trpc/server").TRPCQueryProcedure<{
|
|
106
|
+
input: void;
|
|
107
|
+
output: {
|
|
108
|
+
message: string;
|
|
109
|
+
success: boolean;
|
|
110
|
+
data?: {
|
|
111
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
112
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
113
|
+
tag: string;
|
|
114
|
+
createdAt?: Date | null | undefined;
|
|
115
|
+
startDate?: Date | null | undefined;
|
|
116
|
+
endDate?: Date | null | undefined;
|
|
117
|
+
updatedAt?: Date | null | undefined;
|
|
118
|
+
matches?: {
|
|
119
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
120
|
+
team1: {
|
|
121
|
+
name: string;
|
|
122
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
123
|
+
};
|
|
124
|
+
team2: {
|
|
125
|
+
name: string;
|
|
126
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
127
|
+
};
|
|
128
|
+
score: {
|
|
129
|
+
team1: number | null;
|
|
130
|
+
team2: number | null;
|
|
131
|
+
};
|
|
132
|
+
stage: string;
|
|
133
|
+
endDate?: Date | null | undefined;
|
|
134
|
+
startingDate?: Date | null | undefined;
|
|
135
|
+
additionalTag?: string | undefined;
|
|
136
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
teams?: {
|
|
139
|
+
name: string;
|
|
140
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
141
|
+
picture?: string | null | undefined;
|
|
142
|
+
}[] | undefined;
|
|
143
|
+
}[] | {
|
|
144
|
+
documents: {
|
|
145
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
146
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
147
|
+
tag: string;
|
|
148
|
+
createdAt?: Date | null | undefined;
|
|
149
|
+
startDate?: Date | null | undefined;
|
|
150
|
+
endDate?: Date | null | undefined;
|
|
151
|
+
updatedAt?: Date | null | undefined;
|
|
152
|
+
matches?: {
|
|
153
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
154
|
+
team1: {
|
|
155
|
+
name: string;
|
|
156
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
157
|
+
};
|
|
158
|
+
team2: {
|
|
159
|
+
name: string;
|
|
160
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
161
|
+
};
|
|
162
|
+
score: {
|
|
163
|
+
team1: number | null;
|
|
164
|
+
team2: number | null;
|
|
165
|
+
};
|
|
166
|
+
stage: string;
|
|
167
|
+
endDate?: Date | null | undefined;
|
|
168
|
+
startingDate?: Date | null | undefined;
|
|
169
|
+
additionalTag?: string | undefined;
|
|
170
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
171
|
+
}[] | undefined;
|
|
172
|
+
teams?: {
|
|
173
|
+
name: string;
|
|
174
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
175
|
+
picture?: string | null | undefined;
|
|
176
|
+
}[] | undefined;
|
|
177
|
+
}[][];
|
|
178
|
+
metadata?: {
|
|
179
|
+
page: number;
|
|
180
|
+
size: number;
|
|
181
|
+
totalElements: number;
|
|
182
|
+
totalPages: number;
|
|
183
|
+
} | undefined;
|
|
184
|
+
} | undefined;
|
|
185
|
+
};
|
|
186
|
+
meta: object;
|
|
187
|
+
}>;
|
|
188
|
+
getById: import("@trpc/server").TRPCQueryProcedure<{
|
|
189
|
+
input: {
|
|
190
|
+
tournamentId: string | import("mongoose").Types.ObjectId;
|
|
191
|
+
};
|
|
192
|
+
output: {
|
|
193
|
+
message: string;
|
|
194
|
+
success: boolean;
|
|
195
|
+
data?: {
|
|
196
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
197
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
198
|
+
tag: string;
|
|
199
|
+
createdAt?: Date | null | undefined;
|
|
200
|
+
startDate?: Date | null | undefined;
|
|
201
|
+
endDate?: Date | null | undefined;
|
|
202
|
+
updatedAt?: Date | null | undefined;
|
|
203
|
+
matches?: {
|
|
204
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
205
|
+
team1: {
|
|
206
|
+
name: string;
|
|
207
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
208
|
+
};
|
|
209
|
+
team2: {
|
|
210
|
+
name: string;
|
|
211
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
212
|
+
};
|
|
213
|
+
score: {
|
|
214
|
+
team1: number | null;
|
|
215
|
+
team2: number | null;
|
|
216
|
+
};
|
|
217
|
+
stage: string;
|
|
218
|
+
endDate?: Date | null | undefined;
|
|
219
|
+
startingDate?: Date | null | undefined;
|
|
220
|
+
additionalTag?: string | undefined;
|
|
221
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
teams?: {
|
|
224
|
+
name: string;
|
|
225
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
226
|
+
picture?: string | null | undefined;
|
|
227
|
+
}[] | undefined;
|
|
228
|
+
} | {
|
|
229
|
+
documents: {
|
|
230
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
231
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
232
|
+
tag: string;
|
|
233
|
+
createdAt?: Date | null | undefined;
|
|
234
|
+
startDate?: Date | null | undefined;
|
|
235
|
+
endDate?: Date | null | undefined;
|
|
236
|
+
updatedAt?: Date | null | undefined;
|
|
237
|
+
matches?: {
|
|
238
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
239
|
+
team1: {
|
|
240
|
+
name: string;
|
|
241
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
242
|
+
};
|
|
243
|
+
team2: {
|
|
244
|
+
name: string;
|
|
245
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
246
|
+
};
|
|
247
|
+
score: {
|
|
248
|
+
team1: number | null;
|
|
249
|
+
team2: number | null;
|
|
250
|
+
};
|
|
251
|
+
stage: string;
|
|
252
|
+
endDate?: Date | null | undefined;
|
|
253
|
+
startingDate?: Date | null | undefined;
|
|
254
|
+
additionalTag?: string | undefined;
|
|
255
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
256
|
+
}[] | undefined;
|
|
257
|
+
teams?: {
|
|
258
|
+
name: string;
|
|
259
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
260
|
+
picture?: string | null | undefined;
|
|
261
|
+
}[] | undefined;
|
|
262
|
+
}[];
|
|
263
|
+
metadata?: {
|
|
264
|
+
page: number;
|
|
265
|
+
size: number;
|
|
266
|
+
totalElements: number;
|
|
267
|
+
totalPages: number;
|
|
268
|
+
} | undefined;
|
|
269
|
+
} | undefined;
|
|
270
|
+
};
|
|
271
|
+
meta: object;
|
|
272
|
+
}>;
|
|
273
|
+
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
274
|
+
input: {
|
|
275
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
276
|
+
status?: import("@lyxa.ai/core/dist/utilities/enum").Status | undefined;
|
|
277
|
+
startDate?: string | Date | undefined;
|
|
278
|
+
endDate?: string | Date | undefined;
|
|
279
|
+
tag?: string | undefined;
|
|
280
|
+
};
|
|
281
|
+
output: {
|
|
282
|
+
message: string;
|
|
283
|
+
success: boolean;
|
|
284
|
+
data?: {
|
|
285
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
286
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
287
|
+
tag: string;
|
|
288
|
+
createdAt?: Date | null | undefined;
|
|
289
|
+
startDate?: Date | null | undefined;
|
|
290
|
+
endDate?: Date | null | undefined;
|
|
291
|
+
updatedAt?: Date | null | undefined;
|
|
292
|
+
matches?: {
|
|
293
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
294
|
+
team1: {
|
|
295
|
+
name: string;
|
|
296
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
297
|
+
};
|
|
298
|
+
team2: {
|
|
299
|
+
name: string;
|
|
300
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
301
|
+
};
|
|
302
|
+
score: {
|
|
303
|
+
team1: number | null;
|
|
304
|
+
team2: number | null;
|
|
305
|
+
};
|
|
306
|
+
stage: string;
|
|
307
|
+
endDate?: Date | null | undefined;
|
|
308
|
+
startingDate?: Date | null | undefined;
|
|
309
|
+
additionalTag?: string | undefined;
|
|
310
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
311
|
+
}[] | undefined;
|
|
312
|
+
teams?: {
|
|
313
|
+
name: string;
|
|
314
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
315
|
+
picture?: string | null | undefined;
|
|
316
|
+
}[] | undefined;
|
|
317
|
+
} | {
|
|
318
|
+
documents: {
|
|
319
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
320
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
321
|
+
tag: string;
|
|
322
|
+
createdAt?: Date | null | undefined;
|
|
323
|
+
startDate?: Date | null | undefined;
|
|
324
|
+
endDate?: Date | null | undefined;
|
|
325
|
+
updatedAt?: Date | null | undefined;
|
|
326
|
+
matches?: {
|
|
327
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
328
|
+
team1: {
|
|
329
|
+
name: string;
|
|
330
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
331
|
+
};
|
|
332
|
+
team2: {
|
|
333
|
+
name: string;
|
|
334
|
+
teamId: string | import("mongoose").Types.ObjectId;
|
|
335
|
+
};
|
|
336
|
+
score: {
|
|
337
|
+
team1: number | null;
|
|
338
|
+
team2: number | null;
|
|
339
|
+
};
|
|
340
|
+
stage: string;
|
|
341
|
+
endDate?: Date | null | undefined;
|
|
342
|
+
startingDate?: Date | null | undefined;
|
|
343
|
+
additionalTag?: string | undefined;
|
|
344
|
+
winnerId?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
345
|
+
}[] | undefined;
|
|
346
|
+
teams?: {
|
|
347
|
+
name: string;
|
|
348
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
349
|
+
picture?: string | null | undefined;
|
|
350
|
+
}[] | undefined;
|
|
351
|
+
}[];
|
|
352
|
+
metadata?: {
|
|
353
|
+
page: number;
|
|
354
|
+
size: number;
|
|
355
|
+
totalElements: number;
|
|
356
|
+
totalPages: number;
|
|
357
|
+
} | undefined;
|
|
358
|
+
} | undefined;
|
|
359
|
+
};
|
|
360
|
+
meta: object;
|
|
361
|
+
}>;
|
|
362
|
+
}>>;
|
|
363
|
+
//# sourceMappingURL=config.router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.router.d.ts","sourceRoot":"/","sources":["modules/tournament/config/config.router.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCvB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configRouter = void 0;
|
|
4
|
+
const trpc_1 = require("@lyxa.ai/core/dist/libraries/trpc");
|
|
5
|
+
const auth_1 = require("@lyxa.ai/core/dist/libraries/auth");
|
|
6
|
+
const auth_2 = require("@lyxa.ai/core/dist/libraries/trpc/middlewares/auth");
|
|
7
|
+
const error_handler_1 = require("@lyxa.ai/core/dist/utilities/error-handler");
|
|
8
|
+
const response_1 = require("@lyxa.ai/core/dist/utilities/response");
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const global_validation_1 = require("@lyxa.ai/core/dist/utilities/validation/global-validation");
|
|
11
|
+
const config_service_1 = require("./config.service");
|
|
12
|
+
const config_validation_1 = require("./config.validation");
|
|
13
|
+
exports.configRouter = (0, trpc_1.createTRPCRouter)({
|
|
14
|
+
create: (0, auth_2.createAuthenticatedProcedure)({ entityTypes: [auth_1.AuthEntityType.CRM] })
|
|
15
|
+
.input(config_validation_1.CreateTournamentConfigSchema)
|
|
16
|
+
.output(config_validation_1.TournamentConfigResponseSchema)
|
|
17
|
+
.mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
18
|
+
const result = await config_service_1.tournamentConfigService.create(input);
|
|
19
|
+
return (0, response_1.response)('Tournament created successfully', result);
|
|
20
|
+
})),
|
|
21
|
+
getAll: trpc_1.publicProcedure.output(config_validation_1.TournamentConfigListResponseSchema).query(async () => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
22
|
+
const result = await config_service_1.tournamentConfigService.getAll();
|
|
23
|
+
return (0, response_1.response)('Tournaments fetched successfully', result);
|
|
24
|
+
})),
|
|
25
|
+
getById: trpc_1.publicProcedure
|
|
26
|
+
.input(zod_1.z.object({ tournamentId: global_validation_1.ZodValidation.objectId() }))
|
|
27
|
+
.output(config_validation_1.TournamentConfigResponseSchema)
|
|
28
|
+
.query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
29
|
+
const result = await config_service_1.tournamentConfigService.getById(input.tournamentId);
|
|
30
|
+
return (0, response_1.response)('Tournament fetched successfully', result);
|
|
31
|
+
})),
|
|
32
|
+
update: (0, auth_2.createAuthenticatedProcedure)({ entityTypes: [auth_1.AuthEntityType.CRM] })
|
|
33
|
+
.input(config_validation_1.UpdateTournamentConfigSchema)
|
|
34
|
+
.output(config_validation_1.TournamentConfigResponseSchema)
|
|
35
|
+
.mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
36
|
+
const result = await config_service_1.tournamentConfigService.update(input);
|
|
37
|
+
return (0, response_1.response)('Tournament updated successfully', result);
|
|
38
|
+
})),
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=config.router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.router.js","sourceRoot":"/","sources":["modules/tournament/config/config.router.ts"],"names":[],"mappings":";;;AAAA,4DAAsF;AACtF,4DAAmE;AACnE,6EAAkG;AAClG,8EAA0E;AAC1E,oEAAiE;AACjE,6BAAwB;AACxB,iGAA0F;AAC1F,qDAAsE;AACtE,2DAK6B;AAEhB,QAAA,YAAY,GAAG,IAAA,uBAAgB,EAAC;IAC5C,MAAM,EAAE,IAAA,mCAA4B,EAAC,EAAE,WAAW,EAAE,CAAC,qBAAc,CAAC,GAAG,CAAC,EAAE,CAAC;SACzE,KAAK,CAAC,gDAA4B,CAAC;SACnC,MAAM,CAAC,kDAA8B,CAAC;SACtC,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,wCAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,IAAA,mBAAQ,EAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC,CAAC,CACF;IAEF,MAAM,EAAE,sBAAe,CAAC,MAAM,CAAC,sDAAkC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CACnF,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,wCAAO,CAAC,MAAM,EAAE,CAAC;QACtC,OAAO,IAAA,mBAAQ,EAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC,CAAC,CACF;IAED,OAAO,EAAE,sBAAe;SACtB,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,iCAAa,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SAC3D,MAAM,CAAC,kDAA8B,CAAC;SACtC,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC1B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,wCAAO,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACzD,OAAO,IAAA,mBAAQ,EAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC,CAAC,CACF;IAEF,MAAM,EAAE,IAAA,mCAA4B,EAAC,EAAE,WAAW,EAAE,CAAC,qBAAc,CAAC,GAAG,CAAC,EAAE,CAAC;SACzE,KAAK,CAAC,gDAA4B,CAAC;SACnC,MAAM,CAAC,kDAA8B,CAAC;SACtC,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,wCAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,IAAA,mBAAQ,EAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC,CAAC,CACF;CACF,CAAC,CAAC","sourcesContent":["import { createTRPCRouter, publicProcedure } 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 { z } from 'zod';\nimport { ZodValidation } from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { tournamentConfigService as service } from './config.service';\nimport {\n\tCreateTournamentConfigSchema,\n\tTournamentConfigListResponseSchema,\n\tTournamentConfigResponseSchema,\n\tUpdateTournamentConfigSchema,\n} from './config.validation';\n\nexport const configRouter = createTRPCRouter({\n\tcreate: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(CreateTournamentConfigSchema)\n\t\t.output(TournamentConfigResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.create(input);\n\t\t\t\treturn response('Tournament created successfully', result);\n\t\t\t})\n\t\t),\n\n\tgetAll: publicProcedure.output(TournamentConfigListResponseSchema).query(async () =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst result = await service.getAll();\n\t\t\treturn response('Tournaments fetched successfully', result);\n\t\t})\n\t),\n\n\tgetById: publicProcedure\n\t\t.input(z.object({ tournamentId: ZodValidation.objectId() }))\n\t\t.output(TournamentConfigResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.getById(input.tournamentId);\n\t\t\t\treturn response('Tournament fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tupdate: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(UpdateTournamentConfigSchema)\n\t\t.output(TournamentConfigResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.update(input);\n\t\t\t\treturn response('Tournament updated successfully', result);\n\t\t\t})\n\t\t),\n});\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { CreateTournamentConfigInputDTO, TournamentConfigOutputDTO, UpdateTournamentConfigInputDTO } from './config.validation';
|
|
3
|
+
export declare class TournamentConfigService {
|
|
4
|
+
private repository;
|
|
5
|
+
constructor();
|
|
6
|
+
private ensureTagUnique;
|
|
7
|
+
private validateDates;
|
|
8
|
+
create(input: CreateTournamentConfigInputDTO): Promise<TournamentConfigOutputDTO>;
|
|
9
|
+
getAll(): Promise<TournamentConfigOutputDTO[]>;
|
|
10
|
+
getById(id: mongoose.Types.ObjectId): Promise<TournamentConfigOutputDTO>;
|
|
11
|
+
update(input: UpdateTournamentConfigInputDTO): Promise<TournamentConfigOutputDTO>;
|
|
12
|
+
}
|
|
13
|
+
export declare const tournamentConfigService: TournamentConfigService;
|
|
14
|
+
//# sourceMappingURL=config.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.service.d.ts","sourceRoot":"/","sources":["modules/tournament/config/config.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACH,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EACjC,MAAM,qBAAqB,CAAC;AAI7B,qBACa,uBAAuB;IAChC,OAAO,CAAC,UAAU,CAA6B;;YAMjC,eAAe;IAO7B,OAAO,CAAC,aAAa;IAIR,MAAM,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAKjF,MAAM,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAI9C,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAMxE,MAAM,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAejG;AAED,eAAO,MAAM,uBAAuB,yBAAyC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
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.tournamentConfigService = exports.TournamentConfigService = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const server_1 = require("@trpc/server");
|
|
48
|
+
const error_common_1 = require("@lyxa.ai/core/dist/utilities/error-common");
|
|
49
|
+
const config_repository_1 = require("./config.repository");
|
|
50
|
+
const config_builder_1 = require("./config.builder");
|
|
51
|
+
let TournamentConfigService = class TournamentConfigService {
|
|
52
|
+
repository;
|
|
53
|
+
constructor() {
|
|
54
|
+
this.repository = typedi_1.default.get(config_repository_1.TournamentConfigRepository);
|
|
55
|
+
}
|
|
56
|
+
async ensureTagUnique(tag, currentTag) {
|
|
57
|
+
if (tag === currentTag)
|
|
58
|
+
return;
|
|
59
|
+
if (await this.repository.existsByTag(tag)) {
|
|
60
|
+
throw (0, error_common_1.conflictError)('Tournament with this tag already exists');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
validateDates(startDate, endDate) {
|
|
64
|
+
if (endDate <= startDate)
|
|
65
|
+
throw (0, error_common_1.badRequestError)('End date must be after start date');
|
|
66
|
+
}
|
|
67
|
+
async create(input) {
|
|
68
|
+
await this.ensureTagUnique(input.tag);
|
|
69
|
+
return this.repository.create(input);
|
|
70
|
+
}
|
|
71
|
+
async getAll() {
|
|
72
|
+
return this.repository.findAll();
|
|
73
|
+
}
|
|
74
|
+
async getById(id) {
|
|
75
|
+
const result = await this.repository.findById(id);
|
|
76
|
+
if (!result)
|
|
77
|
+
throw (0, error_common_1.notFoundError)('Tournament not found');
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
async update(input) {
|
|
81
|
+
const existing = await this.repository.findById(input._id);
|
|
82
|
+
if (!existing)
|
|
83
|
+
throw (0, error_common_1.notFoundError)('Tournament not found');
|
|
84
|
+
if (input.tag)
|
|
85
|
+
await this.ensureTagUnique(input.tag, existing.tag);
|
|
86
|
+
const startDate = input.startDate ?? existing.startDate;
|
|
87
|
+
const endDate = input.endDate ?? existing.endDate;
|
|
88
|
+
this.validateDates(startDate, endDate);
|
|
89
|
+
const result = await this.repository.updateById(input._id, config_builder_1.TournamentConfigBuilder.buildUpdate(input));
|
|
90
|
+
if (!result)
|
|
91
|
+
throw new server_1.TRPCError({ code: 'INTERNAL_SERVER_ERROR', message: 'Failed to update tournament' });
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.TournamentConfigService = TournamentConfigService;
|
|
96
|
+
exports.TournamentConfigService = TournamentConfigService = __decorate([
|
|
97
|
+
(0, typedi_1.Service)(),
|
|
98
|
+
__metadata("design:paramtypes", [])
|
|
99
|
+
], TournamentConfigService);
|
|
100
|
+
exports.tournamentConfigService = typedi_1.default.get(TournamentConfigService);
|
|
101
|
+
//# sourceMappingURL=config.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.service.js","sourceRoot":"/","sources":["modules/tournament/config/config.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AAEzC,4EAA0G;AAM1G,2DAAiE;AACjE,qDAA2D;AAGpD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACxB,UAAU,CAA6B;IAE/C;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,8CAA0B,CAAC,CAAC;IAChE,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,GAAW,EAAE,UAAmB;QAC1D,IAAI,GAAG,KAAK,UAAU;YAAE,OAAO;QAC/B,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,MAAM,IAAA,4BAAa,EAAC,yCAAyC,CAAC,CAAC;QACnE,CAAC;IACL,CAAC;IAEO,aAAa,CAAC,SAAe,EAAE,OAAa;QAChD,IAAI,OAAO,IAAI,SAAS;YAAE,MAAM,IAAA,8BAAe,EAAC,mCAAmC,CAAC,CAAC;IACzF,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,KAAqC;QACrD,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAuC,CAAC;IAC/E,CAAC;IAEM,KAAK,CAAC,MAAM;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAA0C,CAAC;IAC7E,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,EAA2B;QAC5C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAA,4BAAa,EAAC,sBAAsB,CAAC,CAAC;QACzD,OAAO,MAAmC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,KAAqC;QACrD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAA,4BAAa,EAAC,sBAAsB,CAAC,CAAC;QAE3D,IAAI,KAAK,CAAC,GAAG;YAAE,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;QAEnE,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC;QACxD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC;QAClD,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAEvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,wCAAuB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QACvG,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,kBAAS,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC,CAAC;QAE5G,OAAO,MAAmC,CAAC;IAC/C,CAAC;CACJ,CAAA;AAhDY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,gBAAO,GAAE;;GACG,uBAAuB,CAgDnC;AAEY,QAAA,uBAAuB,GAAG,gBAAS,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { mongoose } from '@typegoose/typegoose';\nimport { badRequestError, conflictError, notFoundError } from '@lyxa.ai/core/dist/utilities/error-common';\nimport {\n CreateTournamentConfigInputDTO,\n TournamentConfigOutputDTO,\n UpdateTournamentConfigInputDTO,\n} from './config.validation';\nimport { TournamentConfigRepository } from './config.repository';\nimport { TournamentConfigBuilder } from './config.builder';\n\n@Service()\nexport class TournamentConfigService {\n private repository: TournamentConfigRepository;\n\n constructor() {\n this.repository = Container.get(TournamentConfigRepository);\n }\n\n private async ensureTagUnique(tag: string, currentTag?: string) {\n if (tag === currentTag) return;\n if (await this.repository.existsByTag(tag)) {\n throw conflictError('Tournament with this tag already exists');\n }\n }\n\n private validateDates(startDate: Date, endDate: Date) {\n if (endDate <= startDate) throw badRequestError('End date must be after start date');\n }\n\n public async create(input: CreateTournamentConfigInputDTO): Promise<TournamentConfigOutputDTO> {\n await this.ensureTagUnique(input.tag);\n return this.repository.create(input) as Promise<TournamentConfigOutputDTO>;\n }\n\n public async getAll(): Promise<TournamentConfigOutputDTO[]> {\n return this.repository.findAll() as Promise<TournamentConfigOutputDTO[]>;\n }\n\n public async getById(id: mongoose.Types.ObjectId): Promise<TournamentConfigOutputDTO> {\n const result = await this.repository.findById(id);\n if (!result) throw notFoundError('Tournament not found');\n return result as TournamentConfigOutputDTO;\n }\n\n public async update(input: UpdateTournamentConfigInputDTO): Promise<TournamentConfigOutputDTO> {\n const existing = await this.repository.findById(input._id);\n if (!existing) throw notFoundError('Tournament not found');\n\n if (input.tag) await this.ensureTagUnique(input.tag, existing.tag);\n\n const startDate = input.startDate ?? existing.startDate;\n const endDate = input.endDate ?? existing.endDate;\n this.validateDates(startDate, endDate);\n\n const result = await this.repository.updateById(input._id, TournamentConfigBuilder.buildUpdate(input));\n if (!result) throw new TRPCError({ code: 'INTERNAL_SERVER_ERROR', message: 'Failed to update tournament' });\n\n return result as TournamentConfigOutputDTO;\n }\n}\n\nexport const tournamentConfigService = Container.get(TournamentConfigService);\n"]}
|