@lyxa.ai/marketing 1.0.47 → 1.0.49
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 +1102 -28
- 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 +4 -0
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.d.ts +2 -2
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +1 -1
- 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 +18 -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 +9 -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 +8 -0
- package/dist/lib/modules/coupon/services/individual-user-coupon.service.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 +23 -15
- 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 +13 -0
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js +1 -0
- package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +10 -21
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +5 -4
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +154 -0
- 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 +13 -1
- 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 +8 -2
- 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 +11 -2
- 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/limited-time-offer.router.d.ts +16 -27
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- 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 +18 -18
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +30 -30
- 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 +5 -5
- 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 +23 -0
- package/dist/lib/modules/tournament/config/config.builder.js.map +1 -0
- package/dist/lib/modules/tournament/config/config.repository.d.ts +14 -0
- package/dist/lib/modules/tournament/config/config.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.repository.js +83 -0
- package/dist/lib/modules/tournament/config/config.repository.js.map +1 -0
- package/dist/lib/modules/tournament/config/config.router.d.ts +251 -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 +767 -0
- package/dist/lib/modules/tournament/config/config.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/config/config.validation.js +85 -0
- package/dist/lib/modules/tournament/config/config.validation.js.map +1 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.d.ts +2 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js +20 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.consumer.js.map +1 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.d.ts +15 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.js +12 -0
- package/dist/lib/modules/tournament/match/events/evaluate-predictions.event.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 +41 -0
- package/dist/lib/modules/tournament/match/match.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.builder.js +42 -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 +352 -0
- package/dist/lib/modules/tournament/match/match.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.router.js +49 -0
- package/dist/lib/modules/tournament/match/match.router.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.service.d.ts +19 -0
- package/dist/lib/modules/tournament/match/match.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.service.js +149 -0
- package/dist/lib/modules/tournament/match/match.service.js.map +1 -0
- package/dist/lib/modules/tournament/match/match.validation.d.ts +892 -0
- package/dist/lib/modules/tournament/match/match.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/match.validation.js +76 -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 +12 -0
- package/dist/lib/modules/tournament/notification/notification.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.service.js +106 -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 +14 -0
- package/dist/lib/modules/tournament/prediction/prediction.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.repository.js +91 -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 +25 -0
- package/dist/lib/modules/tournament/prediction/prediction.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/prediction/prediction.service.js +142 -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 +11 -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 +81 -0
- package/dist/lib/modules/tournament/reward/handlers/coupon-reward.handler.js.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.builder.d.ts +6 -0
- package/dist/lib/modules/tournament/reward/reward.builder.d.ts.map +1 -0
- package/dist/lib/modules/tournament/reward/reward.builder.js +43 -0
- package/dist/lib/modules/tournament/reward/reward.builder.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/score/score.repository.d.ts +6 -0
- package/dist/lib/modules/tournament/score/score.repository.d.ts.map +1 -0
- package/dist/lib/modules/tournament/score/score.repository.js +60 -0
- package/dist/lib/modules/tournament/score/score.repository.js.map +1 -0
- package/dist/lib/modules/tournament/score/score.service.d.ts +6 -0
- package/dist/lib/modules/tournament/score/score.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/score/score.service.js +60 -0
- package/dist/lib/modules/tournament/score/score.service.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 +205 -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 +1082 -0
- package/dist/lib/modules/tournament/tournament.router.d.ts.map +1 -0
- package/dist/lib/modules/tournament/tournament.router.js +25 -0
- package/dist/lib/modules/tournament/tournament.router.js.map +1 -0
- package/dist/lib/modules/tournament/tournament.service.d.ts +8 -0
- package/dist/lib/modules/tournament/tournament.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/tournament.service.js +63 -0
- package/dist/lib/modules/tournament/tournament.service.js.map +1 -0
- package/dist/lib/modules/tournament/tournament.validation.d.ts +133 -0
- package/dist/lib/modules/tournament/tournament.validation.d.ts.map +1 -0
- package/dist/lib/modules/tournament/tournament.validation.js +14 -0
- package/dist/lib/modules/tournament/tournament.validation.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 +1102 -28
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +4 -0
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/coupon.service.d.ts +2 -2
- 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/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 +13 -0
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +10 -21
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +154 -0
- 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 +8 -2
- 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/limited-time-offer.router.d.ts +16 -27
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- 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 +18 -18
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +30 -30
- 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 +5 -5
- 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 +14 -0
- package/dist/types/modules/tournament/config/config.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/config.router.d.ts +251 -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 +767 -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/evaluate-predictions.consumer.d.ts +2 -0
- package/dist/types/modules/tournament/match/events/evaluate-predictions.consumer.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/events/evaluate-predictions.event.d.ts +15 -0
- package/dist/types/modules/tournament/match/events/evaluate-predictions.event.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 +41 -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 +352 -0
- package/dist/types/modules/tournament/match/match.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.service.d.ts +19 -0
- package/dist/types/modules/tournament/match/match.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/match.validation.d.ts +892 -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 +12 -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 +14 -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 +25 -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 +11 -0
- package/dist/types/modules/tournament/reward/handlers/coupon-reward.handler.d.ts.map +1 -0
- package/dist/types/modules/tournament/reward/reward.builder.d.ts +6 -0
- package/dist/types/modules/tournament/reward/reward.builder.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/score/score.repository.d.ts +6 -0
- package/dist/types/modules/tournament/score/score.repository.d.ts.map +1 -0
- package/dist/types/modules/tournament/score/score.service.d.ts +6 -0
- package/dist/types/modules/tournament/score/score.service.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 +205 -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 +1082 -0
- package/dist/types/modules/tournament/tournament.router.d.ts.map +1 -0
- package/dist/types/modules/tournament/tournament.service.d.ts +8 -0
- package/dist/types/modules/tournament/tournament.service.d.ts.map +1 -0
- package/dist/types/modules/tournament/tournament.validation.d.ts +133 -0
- package/dist/types/modules/tournament/tournament.validation.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
package/dist/lib/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ declare const PunchMarketingHistoryValidationSchema: z.ZodObject<{
|
|
|
19
19
|
}, "strict", z.ZodTypeAny, {
|
|
20
20
|
user: import("mongoose").Types.ObjectId;
|
|
21
21
|
shop: import("mongoose").Types.ObjectId;
|
|
22
|
-
minimumOrderValue: number;
|
|
23
22
|
marketing: import("mongoose").Types.ObjectId;
|
|
23
|
+
minimumOrderValue: number;
|
|
24
24
|
targetOrder: number;
|
|
25
25
|
couponValueType: ValueType;
|
|
26
26
|
couponValue: number;
|
|
@@ -34,8 +34,8 @@ declare const PunchMarketingHistoryValidationSchema: z.ZodObject<{
|
|
|
34
34
|
}, {
|
|
35
35
|
user: string | import("mongoose").Types.ObjectId;
|
|
36
36
|
shop: string | import("mongoose").Types.ObjectId;
|
|
37
|
-
minimumOrderValue: number;
|
|
38
37
|
marketing: string | import("mongoose").Types.ObjectId;
|
|
38
|
+
minimumOrderValue: number;
|
|
39
39
|
targetOrder: number;
|
|
40
40
|
couponValueType: ValueType;
|
|
41
41
|
couponValue: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.builder.d.ts","sourceRoot":"/","sources":["modules/tournament/config/config.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAErE,qBAAa,uBAAuB;IAChC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,8BAA8B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAUrF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TournamentConfigBuilder = void 0;
|
|
4
|
+
class TournamentConfigBuilder {
|
|
5
|
+
static buildUpdate(input) {
|
|
6
|
+
const updates = {};
|
|
7
|
+
if (input.name !== undefined)
|
|
8
|
+
updates.name = input.name;
|
|
9
|
+
if (input.tag !== undefined)
|
|
10
|
+
updates.tag = input.tag;
|
|
11
|
+
if (input.startDate !== undefined)
|
|
12
|
+
updates.startDate = input.startDate;
|
|
13
|
+
if (input.endDate !== undefined)
|
|
14
|
+
updates.endDate = input.endDate;
|
|
15
|
+
if (input.status !== undefined)
|
|
16
|
+
updates.status = input.status;
|
|
17
|
+
if (input.reward !== undefined)
|
|
18
|
+
updates.reward = input.reward;
|
|
19
|
+
return updates;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.TournamentConfigBuilder = TournamentConfigBuilder;
|
|
23
|
+
//# sourceMappingURL=config.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.builder.js","sourceRoot":"/","sources":["modules/tournament/config/config.builder.ts"],"names":[],"mappings":";;;AAEA,MAAa,uBAAuB;IAChC,MAAM,CAAC,WAAW,CAAC,KAAqC;QACpD,MAAM,OAAO,GAA4B,EAAE,CAAC;QAC5C,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACxD,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;YAAE,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;QACrD,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACvE,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QACjE,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC9D,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC9D,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAXD,0DAWC","sourcesContent":["import { UpdateTournamentConfigInputDTO } from './config.validation';\n\nexport class TournamentConfigBuilder {\n static buildUpdate(input: UpdateTournamentConfigInputDTO): Record<string, unknown> {\n const updates: Record<string, unknown> = {};\n if (input.name !== undefined) updates.name = input.name;\n if (input.tag !== undefined) updates.tag = input.tag;\n if (input.startDate !== undefined) updates.startDate = input.startDate;\n if (input.endDate !== undefined) updates.endDate = input.endDate;\n if (input.status !== undefined) updates.status = input.status;\n if (input.reward !== undefined) updates.reward = input.reward;\n return updates;\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { Tournament as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
+
export declare class TournamentConfigRepository {
|
|
4
|
+
private model;
|
|
5
|
+
constructor();
|
|
6
|
+
findActive(): Promise<Pick<Model, 'name' | 'tag' | 'startDate' | 'endDate'> | null>;
|
|
7
|
+
existsByTag(tag: string): Promise<boolean>;
|
|
8
|
+
create(input: object): Promise<Model>;
|
|
9
|
+
findById(id: mongoose.Types.ObjectId): Promise<Model | null>;
|
|
10
|
+
findAll(): Promise<Model[]>;
|
|
11
|
+
updateById(id: mongoose.Types.ObjectId, updates: object): Promise<Model | null>;
|
|
12
|
+
}
|
|
13
|
+
export declare const tournamentConfigRepository: TournamentConfigRepository;
|
|
14
|
+
//# sourceMappingURL=config.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.repository.d.ts","sourceRoot":"/","sources":["modules/tournament/config/config.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,IAAI,KAAK,EAAmB,MAAM,2CAA2C,CAAC;AAGjG,qBACa,0BAA0B;IACtC,OAAO,CAAC,KAAK,CAAyB;;IAMhC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;IAMnF,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAKrC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAI5D,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAI3B,UAAU,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAIrF;AAED,eAAO,MAAM,0BAA0B,4BAA4C,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
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.tournamentConfigRepository = exports.TournamentConfigRepository = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
|
|
48
|
+
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
49
|
+
let TournamentConfigRepository = class TournamentConfigRepository {
|
|
50
|
+
model;
|
|
51
|
+
constructor() {
|
|
52
|
+
this.model = models_1.TournamentModel;
|
|
53
|
+
}
|
|
54
|
+
async findActive() {
|
|
55
|
+
return this.model
|
|
56
|
+
.findOne({ status: enum_1.Status.ACTIVE }, { name: 1, tag: 1, startDate: 1, endDate: 1, _id: 0 })
|
|
57
|
+
.lean();
|
|
58
|
+
}
|
|
59
|
+
async existsByTag(tag) {
|
|
60
|
+
return !!(await this.model.exists({ tag }));
|
|
61
|
+
}
|
|
62
|
+
async create(input) {
|
|
63
|
+
const doc = await this.model.create(input);
|
|
64
|
+
return doc.toObject();
|
|
65
|
+
}
|
|
66
|
+
async findById(id) {
|
|
67
|
+
return this.model.findById(id).lean();
|
|
68
|
+
}
|
|
69
|
+
async findAll() {
|
|
70
|
+
return this.model.find().sort({ createdAt: -1 }).lean();
|
|
71
|
+
}
|
|
72
|
+
async updateById(id, updates) {
|
|
73
|
+
const doc = await this.model.findByIdAndUpdate(id, { $set: updates }, { new: true, strict: false }).lean();
|
|
74
|
+
return doc;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
exports.TournamentConfigRepository = TournamentConfigRepository;
|
|
78
|
+
exports.TournamentConfigRepository = TournamentConfigRepository = __decorate([
|
|
79
|
+
(0, typedi_1.Service)(),
|
|
80
|
+
__metadata("design:paramtypes", [])
|
|
81
|
+
], TournamentConfigRepository);
|
|
82
|
+
exports.tournamentConfigRepository = typedi_1.default.get(TournamentConfigRepository);
|
|
83
|
+
//# sourceMappingURL=config.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.repository.js","sourceRoot":"/","sources":["modules/tournament/config/config.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAE5C,sEAAiG;AACjG,4DAA2D;AAGpD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAC9B,KAAK,CAAyB;IAEtC;QACC,IAAI,CAAC,KAAK,GAAG,wBAAe,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,UAAU;QACf,OAAO,IAAI,CAAC,KAAK;aACf,OAAO,CAAC,EAAE,MAAM,EAAE,aAAM,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;aACzF,IAAI,EAA2E,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,GAAW;QAC5B,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAa;QACzB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAA2B;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,EAA2B,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAsB,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAA2B,EAAE,OAAe;QAC5D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3G,OAAO,GAAmB,CAAC;IAC5B,CAAC;CACD,CAAA;AAlCY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,gBAAO,GAAE;;GACG,0BAA0B,CAkCtC;AAEY,QAAA,0BAA0B,GAAG,gBAAS,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { mongoose } from '@typegoose/typegoose';\nimport { Tournament as Model, TournamentModel } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { Status } from '@lyxa.ai/core/dist/utilities/enum';\n\n@Service()\nexport class TournamentConfigRepository {\n\tprivate model: typeof TournamentModel;\n\n\tconstructor() {\n\t\tthis.model = TournamentModel;\n\t}\n\n\tasync findActive(): Promise<Pick<Model, 'name' | 'tag' | 'startDate' | 'endDate'> | null> {\n\t\treturn this.model\n\t\t\t.findOne({ status: Status.ACTIVE }, { name: 1, tag: 1, startDate: 1, endDate: 1, _id: 0 })\n\t\t\t.lean() as Promise<Pick<Model, 'name' | 'tag' | 'startDate' | 'endDate'> | null>;\n\t}\n\n\tasync existsByTag(tag: string): Promise<boolean> {\n\t\treturn !!(await this.model.exists({ tag }));\n\t}\n\n\tasync create(input: object): Promise<Model> {\n\t\tconst doc = await this.model.create(input);\n\t\treturn doc.toObject();\n\t}\n\n\tasync findById(id: mongoose.Types.ObjectId): Promise<Model | null> {\n\t\treturn this.model.findById(id).lean() as Promise<Model | null>;\n\t}\n\n\tasync findAll(): Promise<Model[]> {\n\t\treturn this.model.find().sort({ createdAt: -1 }).lean() as Promise<Model[]>;\n\t}\n\n\tasync updateById(id: mongoose.Types.ObjectId, updates: object): Promise<Model | null> {\n\t\tconst doc = await this.model.findByIdAndUpdate(id, { $set: updates }, { new: true, strict: false }).lean();\n\t\treturn doc as Model | null;\n\t}\n}\n\nexport const tournamentConfigRepository = Container.get(TournamentConfigRepository);\n"]}
|
|
@@ -0,0 +1,251 @@
|
|
|
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
|
+
name: string;
|
|
20
|
+
startDate: string | Date;
|
|
21
|
+
endDate: string | Date;
|
|
22
|
+
tag: string;
|
|
23
|
+
status?: import("@lyxa.ai/core/dist/utilities/enum").Status | undefined;
|
|
24
|
+
reward?: {
|
|
25
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
26
|
+
} | {
|
|
27
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
28
|
+
couponNamePrefix: string;
|
|
29
|
+
percentage: number;
|
|
30
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
output: {
|
|
34
|
+
message: string;
|
|
35
|
+
success: boolean;
|
|
36
|
+
data?: {
|
|
37
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
38
|
+
name: string;
|
|
39
|
+
tag: string;
|
|
40
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
41
|
+
createdAt?: Date | null | undefined;
|
|
42
|
+
startDate?: Date | null | undefined;
|
|
43
|
+
endDate?: Date | null | undefined;
|
|
44
|
+
updatedAt?: Date | null | undefined;
|
|
45
|
+
reward?: {
|
|
46
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
47
|
+
} | {
|
|
48
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
49
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
50
|
+
couponNamePrefix?: string | undefined;
|
|
51
|
+
percentage?: number | undefined;
|
|
52
|
+
} | undefined;
|
|
53
|
+
} | {
|
|
54
|
+
documents: {
|
|
55
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
56
|
+
name: string;
|
|
57
|
+
tag: string;
|
|
58
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
59
|
+
createdAt?: Date | null | undefined;
|
|
60
|
+
startDate?: Date | null | undefined;
|
|
61
|
+
endDate?: Date | null | undefined;
|
|
62
|
+
updatedAt?: Date | null | undefined;
|
|
63
|
+
reward?: {
|
|
64
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
65
|
+
} | {
|
|
66
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
67
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
68
|
+
couponNamePrefix?: string | undefined;
|
|
69
|
+
percentage?: number | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
}[];
|
|
72
|
+
metadata?: {
|
|
73
|
+
page: number;
|
|
74
|
+
size: number;
|
|
75
|
+
totalElements: number;
|
|
76
|
+
totalPages: number;
|
|
77
|
+
} | undefined;
|
|
78
|
+
} | undefined;
|
|
79
|
+
};
|
|
80
|
+
meta: object;
|
|
81
|
+
}>;
|
|
82
|
+
getAll: import("@trpc/server").TRPCQueryProcedure<{
|
|
83
|
+
input: void;
|
|
84
|
+
output: {
|
|
85
|
+
message: string;
|
|
86
|
+
success: boolean;
|
|
87
|
+
data?: {
|
|
88
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
89
|
+
name: string;
|
|
90
|
+
tag: string;
|
|
91
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
92
|
+
createdAt?: Date | null | undefined;
|
|
93
|
+
startDate?: Date | null | undefined;
|
|
94
|
+
endDate?: Date | null | undefined;
|
|
95
|
+
updatedAt?: Date | null | undefined;
|
|
96
|
+
reward?: {
|
|
97
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
98
|
+
} | {
|
|
99
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
100
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
101
|
+
percentage?: number | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
}[] | {
|
|
104
|
+
documents: {
|
|
105
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
106
|
+
name: string;
|
|
107
|
+
tag: string;
|
|
108
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
109
|
+
createdAt?: Date | null | undefined;
|
|
110
|
+
startDate?: Date | null | undefined;
|
|
111
|
+
endDate?: Date | null | undefined;
|
|
112
|
+
updatedAt?: Date | null | undefined;
|
|
113
|
+
reward?: {
|
|
114
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
115
|
+
} | {
|
|
116
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
117
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
118
|
+
percentage?: number | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
}[][];
|
|
121
|
+
metadata?: {
|
|
122
|
+
page: number;
|
|
123
|
+
size: number;
|
|
124
|
+
totalElements: number;
|
|
125
|
+
totalPages: number;
|
|
126
|
+
} | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
};
|
|
129
|
+
meta: object;
|
|
130
|
+
}>;
|
|
131
|
+
getById: import("@trpc/server").TRPCQueryProcedure<{
|
|
132
|
+
input: {
|
|
133
|
+
tournamentId: string | import("mongoose").Types.ObjectId;
|
|
134
|
+
};
|
|
135
|
+
output: {
|
|
136
|
+
message: string;
|
|
137
|
+
success: boolean;
|
|
138
|
+
data?: {
|
|
139
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
140
|
+
name: string;
|
|
141
|
+
tag: string;
|
|
142
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
143
|
+
createdAt?: Date | null | undefined;
|
|
144
|
+
startDate?: Date | null | undefined;
|
|
145
|
+
endDate?: Date | null | undefined;
|
|
146
|
+
updatedAt?: Date | null | undefined;
|
|
147
|
+
reward?: {
|
|
148
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
149
|
+
} | {
|
|
150
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
151
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
152
|
+
couponNamePrefix?: string | undefined;
|
|
153
|
+
percentage?: number | undefined;
|
|
154
|
+
} | undefined;
|
|
155
|
+
} | {
|
|
156
|
+
documents: {
|
|
157
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
158
|
+
name: string;
|
|
159
|
+
tag: string;
|
|
160
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
161
|
+
createdAt?: Date | null | undefined;
|
|
162
|
+
startDate?: Date | null | undefined;
|
|
163
|
+
endDate?: Date | null | undefined;
|
|
164
|
+
updatedAt?: Date | null | undefined;
|
|
165
|
+
reward?: {
|
|
166
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
167
|
+
} | {
|
|
168
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
169
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
170
|
+
couponNamePrefix?: string | undefined;
|
|
171
|
+
percentage?: number | undefined;
|
|
172
|
+
} | undefined;
|
|
173
|
+
}[];
|
|
174
|
+
metadata?: {
|
|
175
|
+
page: number;
|
|
176
|
+
size: number;
|
|
177
|
+
totalElements: number;
|
|
178
|
+
totalPages: number;
|
|
179
|
+
} | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
};
|
|
182
|
+
meta: object;
|
|
183
|
+
}>;
|
|
184
|
+
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
185
|
+
input: {
|
|
186
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
187
|
+
status?: import("@lyxa.ai/core/dist/utilities/enum").Status | undefined;
|
|
188
|
+
name?: string | undefined;
|
|
189
|
+
startDate?: string | Date | undefined;
|
|
190
|
+
endDate?: string | Date | undefined;
|
|
191
|
+
tag?: string | undefined;
|
|
192
|
+
reward?: {
|
|
193
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
194
|
+
} | {
|
|
195
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
196
|
+
couponNamePrefix: string;
|
|
197
|
+
percentage: number;
|
|
198
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
199
|
+
} | undefined;
|
|
200
|
+
};
|
|
201
|
+
output: {
|
|
202
|
+
message: string;
|
|
203
|
+
success: boolean;
|
|
204
|
+
data?: {
|
|
205
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
206
|
+
name: string;
|
|
207
|
+
tag: string;
|
|
208
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
209
|
+
createdAt?: Date | null | undefined;
|
|
210
|
+
startDate?: Date | null | undefined;
|
|
211
|
+
endDate?: Date | null | undefined;
|
|
212
|
+
updatedAt?: Date | null | undefined;
|
|
213
|
+
reward?: {
|
|
214
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
215
|
+
} | {
|
|
216
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
217
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
218
|
+
couponNamePrefix?: string | undefined;
|
|
219
|
+
percentage?: number | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
} | {
|
|
222
|
+
documents: {
|
|
223
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").Status;
|
|
224
|
+
name: string;
|
|
225
|
+
tag: string;
|
|
226
|
+
_id?: string | import("mongoose").Types.ObjectId | undefined;
|
|
227
|
+
createdAt?: Date | null | undefined;
|
|
228
|
+
startDate?: Date | null | undefined;
|
|
229
|
+
endDate?: Date | null | undefined;
|
|
230
|
+
updatedAt?: Date | null | undefined;
|
|
231
|
+
reward?: {
|
|
232
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.FREE_DELIVERY;
|
|
233
|
+
} | {
|
|
234
|
+
type: import("@lyxa.ai/core/dist/utilities/enum").TournamentRewardType.COUPON;
|
|
235
|
+
maxDiscountPerOrder?: number | null | undefined;
|
|
236
|
+
couponNamePrefix?: string | undefined;
|
|
237
|
+
percentage?: number | undefined;
|
|
238
|
+
} | undefined;
|
|
239
|
+
}[];
|
|
240
|
+
metadata?: {
|
|
241
|
+
page: number;
|
|
242
|
+
size: number;
|
|
243
|
+
totalElements: number;
|
|
244
|
+
totalPages: number;
|
|
245
|
+
} | undefined;
|
|
246
|
+
} | undefined;
|
|
247
|
+
};
|
|
248
|
+
meta: object;
|
|
249
|
+
}>;
|
|
250
|
+
}>>;
|
|
251
|
+
//# 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, TournamentConfigListItemOutputDTO, 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<TournamentConfigListItemOutputDTO[]>;
|
|
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,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EACH,8BAA8B,EAC9B,iCAAiC,EACjC,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,iCAAiC,EAAE,CAAC;IAItD,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,iDAA0C;AAC1C,yCAAuC;AAEvC,4EAAwG;AAOxG,2DAA+D;AAC/D,qDAAyD;AAGlD,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,EAAkD,CAAC;IACrF,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 TournamentConfigListItemOutputDTO,\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<TournamentConfigListItemOutputDTO[]> {\n return this.repository.findAll() as Promise<TournamentConfigListItemOutputDTO[]>;\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"]}
|