@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
|
@@ -0,0 +1,81 @@
|
|
|
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.CouponRewardHandler = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
|
|
48
|
+
const individual_user_coupon_service_1 = require("../../../coupon/services/individual-user-coupon.service");
|
|
49
|
+
const coupon_service_1 = require("../../../coupon/services/coupon.service");
|
|
50
|
+
const FWC_CODE_PREFIX = 'FWC';
|
|
51
|
+
let CouponRewardHandler = class CouponRewardHandler {
|
|
52
|
+
individualUserCouponService;
|
|
53
|
+
couponService;
|
|
54
|
+
baseCouponModel;
|
|
55
|
+
constructor() {
|
|
56
|
+
this.individualUserCouponService = typedi_1.default.get(individual_user_coupon_service_1.IndividualUserCouponService);
|
|
57
|
+
this.couponService = typedi_1.default.get(coupon_service_1.CouponService);
|
|
58
|
+
this.baseCouponModel = models_1.BaseCouponModel;
|
|
59
|
+
}
|
|
60
|
+
async nextFwcCode() {
|
|
61
|
+
const count = await this.baseCouponModel.countDocuments({ code: new RegExp(`^${FWC_CODE_PREFIX}`) });
|
|
62
|
+
return `${FWC_CODE_PREFIX}${String(count + 1).padStart(2, '0')}`;
|
|
63
|
+
}
|
|
64
|
+
async grant(context) {
|
|
65
|
+
for (const userId of context.userIds) {
|
|
66
|
+
const code = await this.nextFwcCode();
|
|
67
|
+
const coupon = await this.individualUserCouponService.create({
|
|
68
|
+
...context.payload,
|
|
69
|
+
code,
|
|
70
|
+
users: [userId],
|
|
71
|
+
});
|
|
72
|
+
await this.couponService.assignCouponToMultipleUser({ _id: userId }, coupon._id);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.CouponRewardHandler = CouponRewardHandler;
|
|
77
|
+
exports.CouponRewardHandler = CouponRewardHandler = __decorate([
|
|
78
|
+
(0, typedi_1.Service)(),
|
|
79
|
+
__metadata("design:paramtypes", [])
|
|
80
|
+
], CouponRewardHandler);
|
|
81
|
+
//# sourceMappingURL=coupon-reward.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon-reward.handler.js","sourceRoot":"/","sources":["modules/tournament/reward/handlers/coupon-reward.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,sEAAsF;AAItF,4GAAoG;AACpG,4EAAsE;AAEtE,MAAM,eAAe,GAAG,KAAK,CAAC;AAGvB,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACpB,2BAA2B,CAA8B;IACzD,aAAa,CAAgB;IAC7B,eAAe,CAAuD;IAE9E;QACI,IAAI,CAAC,2BAA2B,GAAG,gBAAS,CAAC,GAAG,CAAC,4DAA2B,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,GAAG,gBAAS,CAAC,GAAG,CAAC,8BAAa,CAAC,CAAC;QAClD,IAAI,CAAC,eAAe,GAAG,wBAAuE,CAAC;IACnG,CAAC;IAEO,KAAK,CAAC,WAAW;QACrB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAC,IAAI,EAAE,IAAI,MAAM,CAAC,IAAI,eAAe,EAAE,CAAC,EAAC,CAAC,CAAC;QACnG,OAAO,GAAG,eAAe,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAsB;QAC9B,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC;gBACzD,GAAG,OAAO,CAAC,OAAO;gBAClB,IAAI;gBACJ,KAAK,EAAE,CAAC,MAAM,CAAC;aACX,CAAC,CAAC;YAEV,MAAM,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAC/C,EAAC,GAAG,EAAE,MAAM,EAAC,EACb,MAAM,CAAC,GAAG,CACb,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAA;AA/BY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,gBAAO,GAAE;;GACG,mBAAmB,CA+B/B","sourcesContent":["import Container, {Service} from 'typedi';\nimport {mongoose} from '@typegoose/typegoose';\nimport {BaseCoupon, BaseCouponModel} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {SoftDeleteModel} from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport {IRewardHandler} from '../reward.interface';\nimport {RewardContext} from '../reward.types';\nimport {IndividualUserCouponService} from '@modules/coupon/services/individual-user-coupon.service';\nimport {CouponService} from '@modules/coupon/services/coupon.service';\n\nconst FWC_CODE_PREFIX = 'FWC';\n\n@Service()\nexport class CouponRewardHandler implements IRewardHandler {\n private individualUserCouponService: IndividualUserCouponService;\n private couponService: CouponService;\n private baseCouponModel: typeof BaseCouponModel & SoftDeleteModel<BaseCoupon>;\n\n constructor() {\n this.individualUserCouponService = Container.get(IndividualUserCouponService);\n this.couponService = Container.get(CouponService);\n this.baseCouponModel = BaseCouponModel as typeof BaseCouponModel & SoftDeleteModel<BaseCoupon>;\n }\n\n private async nextFwcCode(): Promise<string> {\n const count = await this.baseCouponModel.countDocuments({code: new RegExp(`^${FWC_CODE_PREFIX}`)});\n return `${FWC_CODE_PREFIX}${String(count + 1).padStart(2, '0')}`;\n }\n\n async grant(context: RewardContext): Promise<void> {\n for (const userId of context.userIds) {\n const code = await this.nextFwcCode();\n const coupon = await this.individualUserCouponService.create({\n ...context.payload,\n code,\n users: [userId],\n } as any);\n\n await this.couponService.assignCouponToMultipleUser(\n {_id: userId},\n coupon._id\n );\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { RewardContext } from './reward.types';
|
|
3
|
+
export declare class RewardBuilder {
|
|
4
|
+
static buildCouponRewardContext(matchId: mongoose.Types.ObjectId, tournamentId: mongoose.Types.ObjectId, winnerIds: mongoose.Types.ObjectId[]): RewardContext;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=reward.builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.builder.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAO7C,qBAAa,aAAa;IACtB,MAAM,CAAC,wBAAwB,CAC3B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAChC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACrC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,GACrC,aAAa;CAiCnB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RewardBuilder = void 0;
|
|
4
|
+
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
5
|
+
const FWC_DISCOUNT_PERCENTAGE = 10;
|
|
6
|
+
const FWC_MAX_DISCOUNT_AMOUNT = 5;
|
|
7
|
+
const FWC_MIN_ORDER_VALUE = 5;
|
|
8
|
+
class RewardBuilder {
|
|
9
|
+
static buildCouponRewardContext(matchId, tournamentId, winnerIds) {
|
|
10
|
+
const now = new Date();
|
|
11
|
+
const expiresAt = new Date(now);
|
|
12
|
+
expiresAt.setMonth(expiresAt.getMonth() + 1);
|
|
13
|
+
return {
|
|
14
|
+
userIds: winnerIds,
|
|
15
|
+
tournamentId,
|
|
16
|
+
matchId,
|
|
17
|
+
payload: {
|
|
18
|
+
couponType: enum_1.CouponType.INDIVIDUAL_USER,
|
|
19
|
+
valueType: enum_1.ValueType.PERCENTAGE,
|
|
20
|
+
value: FWC_DISCOUNT_PERCENTAGE,
|
|
21
|
+
maxDiscountLimit: FWC_MAX_DISCOUNT_AMOUNT,
|
|
22
|
+
duration: { start: now, end: expiresAt },
|
|
23
|
+
isSpendLimitEnabled: false,
|
|
24
|
+
spendLimit: null,
|
|
25
|
+
isOrderLimitPerUserEnabled: true,
|
|
26
|
+
orderLimitPerUser: 1,
|
|
27
|
+
isMinOrderValueEnabled: true,
|
|
28
|
+
minOrderValue: FWC_MIN_ORDER_VALUE,
|
|
29
|
+
itemTypes: [
|
|
30
|
+
enum_1.ItemType.FOOD,
|
|
31
|
+
enum_1.ItemType.GROCERY,
|
|
32
|
+
enum_1.ItemType.PHARMACY,
|
|
33
|
+
enum_1.ItemType.COFFEE,
|
|
34
|
+
enum_1.ItemType.FLOWER,
|
|
35
|
+
enum_1.ItemType.PET,
|
|
36
|
+
enum_1.ItemType.HEALTHY_CORNER,
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.RewardBuilder = RewardBuilder;
|
|
43
|
+
//# sourceMappingURL=reward.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.builder.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.builder.ts"],"names":[],"mappings":";;;AACA,4DAAkF;AAIlF,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,MAAa,aAAa;IACtB,MAAM,CAAC,wBAAwB,CAC3B,OAAgC,EAChC,YAAqC,EACrC,SAAoC;QAEpC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;QAE7C,OAAO;YACH,OAAO,EAAE,SAAS;YAClB,YAAY;YACZ,OAAO;YACP,OAAO,EAAE;gBACL,UAAU,EAAE,iBAAU,CAAC,eAAe;gBACtC,SAAS,EAAE,gBAAS,CAAC,UAAU;gBAC/B,KAAK,EAAE,uBAAuB;gBAC9B,gBAAgB,EAAE,uBAAuB;gBACzC,QAAQ,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC;gBACtC,mBAAmB,EAAE,KAAK;gBAC1B,UAAU,EAAE,IAAI;gBAChB,0BAA0B,EAAE,IAAI;gBAChC,iBAAiB,EAAE,CAAC;gBACpB,sBAAsB,EAAE,IAAI;gBAC5B,aAAa,EAAE,mBAAmB;gBAClC,SAAS,EAAE;oBACP,eAAQ,CAAC,IAAI;oBACb,eAAQ,CAAC,OAAO;oBAChB,eAAQ,CAAC,QAAQ;oBACjB,eAAQ,CAAC,MAAM;oBACf,eAAQ,CAAC,MAAM;oBACf,eAAQ,CAAC,GAAG;oBACZ,eAAQ,CAAC,cAAc;iBAC1B;aACJ;SACJ,CAAC;IACN,CAAC;CACJ;AAtCD,sCAsCC","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {CouponType, ItemType, ValueType} from '@lyxa.ai/core/dist/utilities/enum';\nimport {RewardContext} from './reward.types';\n\n// TODO: make these admin-configurable via tournament reward settings\nconst FWC_DISCOUNT_PERCENTAGE = 10;\nconst FWC_MAX_DISCOUNT_AMOUNT = 5;\nconst FWC_MIN_ORDER_VALUE = 5;\n\nexport class RewardBuilder {\n static buildCouponRewardContext(\n matchId: mongoose.Types.ObjectId,\n tournamentId: mongoose.Types.ObjectId,\n winnerIds: mongoose.Types.ObjectId[]\n ): RewardContext {\n const now = new Date();\n const expiresAt = new Date(now);\n expiresAt.setMonth(expiresAt.getMonth() + 1);\n\n return {\n userIds: winnerIds,\n tournamentId,\n matchId,\n payload: {\n couponType: CouponType.INDIVIDUAL_USER,\n valueType: ValueType.PERCENTAGE,\n value: FWC_DISCOUNT_PERCENTAGE,\n maxDiscountLimit: FWC_MAX_DISCOUNT_AMOUNT,\n duration: {start: now, end: expiresAt},\n isSpendLimitEnabled: false,\n spendLimit: null,\n isOrderLimitPerUserEnabled: true,\n orderLimitPerUser: 1,\n isMinOrderValueEnabled: true,\n minOrderValue: FWC_MIN_ORDER_VALUE,\n itemTypes: [\n ItemType.FOOD,\n ItemType.GROCERY,\n ItemType.PHARMACY,\n ItemType.COFFEE,\n ItemType.FLOWER,\n ItemType.PET,\n ItemType.HEALTHY_CORNER,\n ],\n },\n };\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.factory.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,qBAAa,aAAa;IACtB,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc;CAQtD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RewardFactory = void 0;
|
|
7
|
+
const typedi_1 = __importDefault(require("typedi"));
|
|
8
|
+
const reward_types_1 = require("./reward.types");
|
|
9
|
+
const coupon_reward_handler_1 = require("./handlers/coupon-reward.handler");
|
|
10
|
+
class RewardFactory {
|
|
11
|
+
static getHandler(type) {
|
|
12
|
+
switch (type) {
|
|
13
|
+
case reward_types_1.RewardType.COUPON:
|
|
14
|
+
return typedi_1.default.get(coupon_reward_handler_1.CouponRewardHandler);
|
|
15
|
+
default:
|
|
16
|
+
throw new Error(`No handler registered for reward type: ${type}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.RewardFactory = RewardFactory;
|
|
21
|
+
//# sourceMappingURL=reward.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.factory.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.factory.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA+B;AAC/B,iDAA4C;AAE5C,4EAAuE;AAEvE,MAAa,aAAa;IACtB,MAAM,CAAC,UAAU,CAAC,IAAgB;QAC9B,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,yBAAU,CAAC,MAAM;gBAClB,OAAO,gBAAS,CAAC,GAAG,CAAC,2CAAmB,CAAC,CAAC;YAC9C;gBACI,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,EAAE,CAAC,CAAC;QAC1E,CAAC;IACL,CAAC;CACJ;AATD,sCASC","sourcesContent":["import Container from 'typedi';\nimport { RewardType } from './reward.types';\nimport { IRewardHandler } from './reward.interface';\nimport { CouponRewardHandler } from './handlers/coupon-reward.handler';\n\nexport class RewardFactory {\n static getHandler(type: RewardType): IRewardHandler {\n switch (type) {\n case RewardType.COUPON:\n return Container.get(CouponRewardHandler);\n default:\n throw new Error(`No handler registered for reward type: ${type}`);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.interface.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.interface.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {RewardContext} from './reward.types';\n\nexport interface IRewardHandler {\n grant(context: RewardContext): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.service.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAGzD,qBACa,aAAa;IAChB,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAIvE;AAED,eAAO,MAAM,aAAa,eAA+B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.rewardService = exports.RewardService = void 0;
|
|
43
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
44
|
+
const reward_factory_1 = require("./reward.factory");
|
|
45
|
+
let RewardService = class RewardService {
|
|
46
|
+
async grant(type, context) {
|
|
47
|
+
const handler = reward_factory_1.RewardFactory.getHandler(type);
|
|
48
|
+
await handler.grant(context);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.RewardService = RewardService;
|
|
52
|
+
exports.RewardService = RewardService = __decorate([
|
|
53
|
+
(0, typedi_1.Service)()
|
|
54
|
+
], RewardService);
|
|
55
|
+
exports.rewardService = typedi_1.default.get(RewardService);
|
|
56
|
+
//# sourceMappingURL=reward.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.service.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,qDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACtB,KAAK,CAAC,KAAK,CAAC,IAAgB,EAAE,OAAsB;QAChD,MAAM,OAAO,GAAG,8BAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;CACJ,CAAA;AALY,sCAAa;wBAAb,aAAa;IADzB,IAAA,gBAAO,GAAE;GACG,aAAa,CAKzB;AAEY,QAAA,aAAa,GAAG,gBAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {RewardContext, RewardType} from './reward.types';\nimport {RewardFactory} from './reward.factory';\n\n@Service()\nexport class RewardService {\n async grant(type: RewardType, context: RewardContext): Promise<void> {\n const handler = RewardFactory.getHandler(type);\n await handler.grant(context);\n }\n}\n\nexport const rewardService = Container.get(RewardService);\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
+
export declare enum RewardType {
|
|
3
|
+
COUPON = "coupon"
|
|
4
|
+
}
|
|
5
|
+
export interface RewardContext {
|
|
6
|
+
userIds: mongoose.Types.ObjectId[];
|
|
7
|
+
tournamentId: mongoose.Types.ObjectId;
|
|
8
|
+
matchId: mongoose.Types.ObjectId;
|
|
9
|
+
payload: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=reward.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.types.d.ts","sourceRoot":"/","sources":["modules/tournament/reward/reward.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE9C,oBAAY,UAAU;IAClB,MAAM,WAAW;CACpB;AAED,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACnC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IACtC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RewardType = void 0;
|
|
4
|
+
var RewardType;
|
|
5
|
+
(function (RewardType) {
|
|
6
|
+
RewardType["COUPON"] = "coupon";
|
|
7
|
+
})(RewardType || (exports.RewardType = RewardType = {}));
|
|
8
|
+
//# sourceMappingURL=reward.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.types.js","sourceRoot":"/","sources":["modules/tournament/reward/reward.types.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAEX;AAFD,WAAY,UAAU;IAClB,+BAAiB,CAAA;AACrB,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\n\nexport enum RewardType {\n COUPON = 'coupon',\n}\n\nexport interface RewardContext {\n userIds: mongoose.Types.ObjectId[];\n tournamentId: mongoose.Types.ObjectId;\n matchId: mongoose.Types.ObjectId;\n payload: Record<string, unknown>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.repository.d.ts","sourceRoot":"/","sources":["modules/tournament/score/score.repository.ts"],"names":[],"mappings":"AAGA,qBACa,eAAe;IACxB,OAAO,CAAC,gBAAgB,CAAoC;;CAK/D;AAED,eAAO,MAAM,eAAe,iBAAiC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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.scoreRepository = exports.ScoreRepository = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
|
|
48
|
+
let ScoreRepository = class ScoreRepository {
|
|
49
|
+
participantModel;
|
|
50
|
+
constructor() {
|
|
51
|
+
this.participantModel = models_1.TournamentParticipantModel;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.ScoreRepository = ScoreRepository;
|
|
55
|
+
exports.ScoreRepository = ScoreRepository = __decorate([
|
|
56
|
+
(0, typedi_1.Service)(),
|
|
57
|
+
__metadata("design:paramtypes", [])
|
|
58
|
+
], ScoreRepository);
|
|
59
|
+
exports.scoreRepository = typedi_1.default.get(ScoreRepository);
|
|
60
|
+
//# sourceMappingURL=score.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.repository.js","sourceRoot":"/","sources":["modules/tournament/score/score.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,sEAAqF;AAG9E,IAAM,eAAe,GAArB,MAAM,eAAe;IAChB,gBAAgB,CAAoC;IAE5D;QACI,IAAI,CAAC,gBAAgB,GAAG,mCAA0B,CAAC;IACvD,CAAC;CACJ,CAAA;AANY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,gBAAO,GAAE;;GACG,eAAe,CAM3B;AAEY,QAAA,eAAe,GAAG,gBAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {TournamentParticipantModel} from '@lyxa.ai/core/dist/libraries/mongo/models';\n\n@Service()\nexport class ScoreRepository {\n private participantModel: typeof TournamentParticipantModel;\n\n constructor() {\n this.participantModel = TournamentParticipantModel;\n }\n}\n\nexport const scoreRepository = Container.get(ScoreRepository);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.service.d.ts","sourceRoot":"/","sources":["modules/tournament/score/score.service.ts"],"names":[],"mappings":"AAGA,qBACa,YAAY;IACrB,OAAO,CAAC,UAAU,CAAkB;;CAKvC;AAED,eAAO,MAAM,YAAY,cAA8B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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.scoreService = exports.ScoreService = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const score_repository_1 = require("./score.repository");
|
|
48
|
+
let ScoreService = class ScoreService {
|
|
49
|
+
repository;
|
|
50
|
+
constructor() {
|
|
51
|
+
this.repository = typedi_1.default.get(score_repository_1.ScoreRepository);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.ScoreService = ScoreService;
|
|
55
|
+
exports.ScoreService = ScoreService = __decorate([
|
|
56
|
+
(0, typedi_1.Service)(),
|
|
57
|
+
__metadata("design:paramtypes", [])
|
|
58
|
+
], ScoreService);
|
|
59
|
+
exports.scoreService = typedi_1.default.get(ScoreService);
|
|
60
|
+
//# sourceMappingURL=score.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.service.js","sourceRoot":"/","sources":["modules/tournament/score/score.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,yDAAmD;AAG5C,IAAM,YAAY,GAAlB,MAAM,YAAY;IACb,UAAU,CAAkB;IAEpC;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,kCAAe,CAAC,CAAC;IACrD,CAAC;CACJ,CAAA;AANY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,gBAAO,GAAE;;GACG,YAAY,CAMxB;AAEY,QAAA,YAAY,GAAG,gBAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {ScoreRepository} from './score.repository';\n\n@Service()\nexport class ScoreService {\n private repository: ScoreRepository;\n\n constructor() {\n this.repository = Container.get(ScoreRepository);\n }\n}\n\nexport const scoreService = Container.get(ScoreService);\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
+
interface TeamInput {
|
|
3
|
+
name: string;
|
|
4
|
+
picture?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class TeamBuilder {
|
|
7
|
+
static buildTeam(input: TeamInput): {
|
|
8
|
+
_id: mongoose.Types.ObjectId;
|
|
9
|
+
name: string;
|
|
10
|
+
picture: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
static buildTeams(inputs: TeamInput[]): {
|
|
13
|
+
_id: mongoose.Types.ObjectId;
|
|
14
|
+
name: string;
|
|
15
|
+
picture: string | undefined;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=team.builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.builder.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,WAAW;IACpB,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS;;;;;IAQjC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE;;;;;CAGxC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamBuilder = void 0;
|
|
4
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
5
|
+
class TeamBuilder {
|
|
6
|
+
static buildTeam(input) {
|
|
7
|
+
return {
|
|
8
|
+
_id: new typegoose_1.mongoose.Types.ObjectId(),
|
|
9
|
+
name: input.name,
|
|
10
|
+
picture: input.picture,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
static buildTeams(inputs) {
|
|
14
|
+
return inputs.map(TeamBuilder.buildTeam);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.TeamBuilder = TeamBuilder;
|
|
18
|
+
//# sourceMappingURL=team.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.builder.js","sourceRoot":"/","sources":["modules/tournament/team/team.builder.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAOhD,MAAa,WAAW;IACpB,MAAM,CAAC,SAAS,CAAC,KAAgB;QAC7B,OAAO;YACH,GAAG,EAAE,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE;YAClC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;SACzB,CAAC;IACN,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAAmB;QACjC,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACJ;AAZD,kCAYC","sourcesContent":["import { mongoose } from '@typegoose/typegoose';\n\ninterface TeamInput {\n name: string;\n picture?: string;\n}\n\nexport class TeamBuilder {\n static buildTeam(input: TeamInput) {\n return {\n _id: new mongoose.Types.ObjectId(),\n name: input.name,\n picture: input.picture,\n };\n }\n\n static buildTeams(inputs: TeamInput[]) {\n return inputs.map(TeamBuilder.buildTeam);\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { Tournament as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
+
export declare class TournamentTeamRepository {
|
|
4
|
+
private model;
|
|
5
|
+
constructor();
|
|
6
|
+
findById(id: mongoose.Types.ObjectId): Promise<Model | null>;
|
|
7
|
+
findByTeamId(teamId: mongoose.Types.ObjectId): Promise<Model | null>;
|
|
8
|
+
addTeams(id: mongoose.Types.ObjectId, teams: object[]): Promise<Model | null>;
|
|
9
|
+
}
|
|
10
|
+
export declare const tournamentTeamRepository: TournamentTeamRepository;
|
|
11
|
+
//# sourceMappingURL=team.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.repository.d.ts","sourceRoot":"/","sources":["modules/tournament/team/team.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,IAAI,KAAK,EAAmB,MAAM,2CAA2C,CAAC;AAEjG,qBACa,wBAAwB;IACpC,OAAO,CAAC,KAAK,CAAyB;;IAMhC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAI5D,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAIpE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAKnF;AAED,eAAO,MAAM,wBAAwB,0BAA0C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.tournamentTeamRepository = exports.TournamentTeamRepository = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
|
|
48
|
+
let TournamentTeamRepository = class TournamentTeamRepository {
|
|
49
|
+
model;
|
|
50
|
+
constructor() {
|
|
51
|
+
this.model = models_1.TournamentModel;
|
|
52
|
+
}
|
|
53
|
+
async findById(id) {
|
|
54
|
+
return this.model.findById(id).lean();
|
|
55
|
+
}
|
|
56
|
+
async findByTeamId(teamId) {
|
|
57
|
+
return this.model.findOne({ 'teams._id': teamId }).lean();
|
|
58
|
+
}
|
|
59
|
+
async addTeams(id, teams) {
|
|
60
|
+
return this.model
|
|
61
|
+
.findByIdAndUpdate(id, { $push: { teams: { $each: teams } } }, { new: true })
|
|
62
|
+
.lean();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
exports.TournamentTeamRepository = TournamentTeamRepository;
|
|
66
|
+
exports.TournamentTeamRepository = TournamentTeamRepository = __decorate([
|
|
67
|
+
(0, typedi_1.Service)(),
|
|
68
|
+
__metadata("design:paramtypes", [])
|
|
69
|
+
], TournamentTeamRepository);
|
|
70
|
+
exports.tournamentTeamRepository = typedi_1.default.get(TournamentTeamRepository);
|
|
71
|
+
//# sourceMappingURL=team.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.repository.js","sourceRoot":"/","sources":["modules/tournament/team/team.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAE5C,sEAAiG;AAG1F,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAC5B,KAAK,CAAyB;IAEtC;QACC,IAAI,CAAC,KAAK,GAAG,wBAAe,CAAC;IAC9B,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,YAAY,CAAC,MAA+B;QACjD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAA2B,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAA2B,EAAE,KAAe;QAC1D,OAAO,IAAI,CAAC,KAAK;aACf,iBAAiB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;aAC5E,IAAI,EAA2B,CAAC;IACnC,CAAC;CACD,CAAA;AApBY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,gBAAO,GAAE;;GACG,wBAAwB,CAoBpC;AAEY,QAAA,wBAAwB,GAAG,gBAAS,CAAC,GAAG,CAAC,wBAAwB,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';\n\n@Service()\nexport class TournamentTeamRepository {\n\tprivate model: typeof TournamentModel;\n\n\tconstructor() {\n\t\tthis.model = TournamentModel;\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 findByTeamId(teamId: mongoose.Types.ObjectId): Promise<Model | null> {\n\t\treturn this.model.findOne({ 'teams._id': teamId }).lean() as Promise<Model | null>;\n\t}\n\n\tasync addTeams(id: mongoose.Types.ObjectId, teams: object[]): Promise<Model | null> {\n\t\treturn this.model\n\t\t\t.findByIdAndUpdate(id, { $push: { teams: { $each: teams } } }, { new: true })\n\t\t\t.lean() as Promise<Model | null>;\n\t}\n}\n\nexport const tournamentTeamRepository = Container.get(TournamentTeamRepository);\n"]}
|