@lyxa.ai/marketing 1.0.40 → 1.0.42
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/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
- package/dist/lib/index.d.ts +652 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +6 -6
- 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 +1 -0
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +74 -65
- package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts +28 -2
- package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.js +13 -33
- package/dist/lib/modules/coupon/services/custom-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/helper.service.d.ts +30 -2
- package/dist/lib/modules/coupon/services/helper.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/helper.service.js +121 -8
- package/dist/lib/modules/coupon/services/helper.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts +29 -3
- 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 +10 -62
- package/dist/lib/modules/coupon/services/individual-store-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 +117 -155
- 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 +9 -0
- 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 +97 -30
- 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.map +1 -1
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.js +5 -1
- 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 +29 -3
- 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 +10 -63
- 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 +3 -2
- package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
- package/dist/lib/modules/deal-setting/routers/deal-setting.router.d.ts.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js +4 -4
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
- package/dist/lib/modules/featured-setting/routers/featured-setting.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +339 -0
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +77 -0
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts +4 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js +24 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.d.ts +12 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.js +29 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +8 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +79 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +851 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +100 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +11 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +75 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +9 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js +42 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +78 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +308 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts +12 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.js +94 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts +189 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.js +24 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.validation.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer.router.d.ts +122 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer.router.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer.router.js +37 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer.router.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +644 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.js +13 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +170 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js +51 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +603 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +85 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +12 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js +98 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +21 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js +133 -0
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +2 -1
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +23 -15
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts +5 -0
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.js +3 -0
- package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.d.ts +0 -2
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js +18 -39
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/discount-marketing.service.d.ts +0 -3
- package/dist/lib/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/discount-marketing.service.js +26 -52
- package/dist/lib/modules/marketing/services/discount-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +1 -0
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +55 -25
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +9 -2
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.js +132 -7
- package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
- 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 +58 -31
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts +3 -0
- package/dist/lib/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/transformers/discount-marketing.transformer.d.ts +3 -0
- package/dist/lib/modules/marketing/transformers/discount-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/transformers/product-marketing.transformer.d.ts +1 -0
- package/dist/lib/modules/marketing/transformers/product-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +42 -12
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +57 -21
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts +77 -0
- package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/product-marketing.validation.js +20 -1
- package/dist/lib/modules/marketing/validations/product-marketing.validation.js.map +1 -1
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/dist/types/event/event-initializations.d.ts.map +1 -1
- package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/types/index.d.ts +652 -0
- 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 +1 -0
- package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/custom-coupon.service.d.ts +28 -2
- package/dist/types/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/helper.service.d.ts +30 -2
- 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 +29 -3
- package/dist/types/modules/coupon/services/individual-store-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 +57 -0
- 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.map +1 -1
- package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts +29 -3
- 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/deal-setting/routers/deal-setting.router.d.ts.map +1 -1
- package/dist/types/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
- package/dist/types/modules/featured-setting/routers/featured-setting.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +339 -0
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts +4 -0
- package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.d.ts +12 -0
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +8 -0
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +851 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +11 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +9 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +78 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts +12 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts +189 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.validation.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer.router.d.ts +122 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer.router.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +644 -0
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +170 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +603 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +12 -0
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +21 -0
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +2 -1
- package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
- package/dist/types/modules/marketing/routers/marketing.router.d.ts +5 -0
- package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/buy1-get1-marketing.service.d.ts +0 -2
- package/dist/types/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/discount-marketing.service.d.ts +0 -3
- package/dist/types/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts +1 -0
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts +13 -2
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts +3 -0
- package/dist/types/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/discount-marketing.transformer.d.ts +3 -0
- package/dist/types/modules/marketing/transformers/discount-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/product-marketing.transformer.d.ts +1 -0
- package/dist/types/modules/marketing/transformers/product-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +42 -12
- package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +57 -21
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts +77 -0
- package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/lib/events/event-initializations.d.ts +0 -2
- package/dist/lib/events/event-initializations.d.ts.map +0 -1
- package/dist/lib/events/event-initializations.js +0 -5
- package/dist/lib/events/event-initializations.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.router.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/campaign.router.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFzB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.campaignRouter = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const limited_time_offer_campaign_service_1 = require("./services/limited-time-offer-campaign.service");
|
|
6
|
+
const limited_time_offer_campaign_validation_1 = require("./limited-time-offer-campaign.validation");
|
|
7
|
+
const trpc_1 = require("@lyxa.ai/core/dist/libraries/trpc");
|
|
8
|
+
const auth_1 = require("@lyxa.ai/core/dist/libraries/trpc/middlewares/auth");
|
|
9
|
+
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
10
|
+
const error_handler_1 = require("@lyxa.ai/core/dist/utilities/error-handler");
|
|
11
|
+
const response_1 = require("@lyxa.ai/core/dist/utilities/response");
|
|
12
|
+
const validation_1 = require("@lyxa.ai/core/dist/utilities/validation");
|
|
13
|
+
const crmProcedure = (0, auth_1.createAuthenticatedProcedure)({ entityTypes: [enum_1.AuthEntityType.CRM] });
|
|
14
|
+
const sellerProcedure = (0, auth_1.createAuthenticatedProcedure)({ entityTypes: [enum_1.AuthEntityType.SELLER] });
|
|
15
|
+
exports.campaignRouter = (0, trpc_1.createTRPCRouter)({
|
|
16
|
+
create: crmProcedure
|
|
17
|
+
.input(limited_time_offer_campaign_validation_1.CreateLtoCampaignSchema)
|
|
18
|
+
.output(limited_time_offer_campaign_validation_1.LtoCampaignResponseSchema)
|
|
19
|
+
.mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
20
|
+
const result = await limited_time_offer_campaign_service_1.ltoCampaignService.create(input);
|
|
21
|
+
return (0, response_1.response)('Campaign created successfully', result);
|
|
22
|
+
})),
|
|
23
|
+
getCurrent: crmProcedure
|
|
24
|
+
.output(limited_time_offer_campaign_validation_1.LtoCampaignNullableResponseSchema)
|
|
25
|
+
.query(async () => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
26
|
+
const result = await limited_time_offer_campaign_service_1.ltoCampaignService.getCurrent();
|
|
27
|
+
return (0, response_1.response)('Current campaign fetched successfully', result);
|
|
28
|
+
})),
|
|
29
|
+
getActiveForShop: sellerProcedure
|
|
30
|
+
.output(limited_time_offer_campaign_validation_1.LtoCampaignNullableResponseSchema)
|
|
31
|
+
.query(async () => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
32
|
+
const result = await limited_time_offer_campaign_service_1.ltoCampaignService.getActiveCampaign();
|
|
33
|
+
return (0, response_1.response)('Active campaign fetched successfully', result);
|
|
34
|
+
})),
|
|
35
|
+
getActiveForUser: trpc_1.publicProcedure
|
|
36
|
+
.output(limited_time_offer_campaign_validation_1.LtoCampaignNullableResponseSchema)
|
|
37
|
+
.query(async () => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
38
|
+
const campaign = await limited_time_offer_campaign_service_1.ltoCampaignService.getActiveCampaign();
|
|
39
|
+
if (!campaign)
|
|
40
|
+
return (0, response_1.response)('Active campaign fetched successfully', null);
|
|
41
|
+
const { discountOptions: _, maxDiscountCaps: __, ...rest } = campaign;
|
|
42
|
+
return (0, response_1.response)('Active campaign fetched successfully', {
|
|
43
|
+
...rest,
|
|
44
|
+
discountOptions: [],
|
|
45
|
+
maxDiscountCaps: [],
|
|
46
|
+
});
|
|
47
|
+
})),
|
|
48
|
+
getById: crmProcedure
|
|
49
|
+
.input(zod_1.z.object({ campaignId: validation_1.ZodValidation.objectId() }))
|
|
50
|
+
.output(limited_time_offer_campaign_validation_1.LtoCampaignResponseSchema)
|
|
51
|
+
.query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
52
|
+
const result = await limited_time_offer_campaign_service_1.ltoCampaignService.getById(input.campaignId);
|
|
53
|
+
return (0, response_1.response)('Campaign fetched successfully', result);
|
|
54
|
+
})),
|
|
55
|
+
getHistory: crmProcedure
|
|
56
|
+
.input(limited_time_offer_campaign_validation_1.GetLtoCampaignHistorySchema)
|
|
57
|
+
.output(limited_time_offer_campaign_validation_1.LtoCampaignHistoryResponseSchema)
|
|
58
|
+
.query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
59
|
+
const result = await limited_time_offer_campaign_service_1.ltoCampaignService.getHistory(input);
|
|
60
|
+
return (0, response_1.response)('Campaign history fetched successfully', result);
|
|
61
|
+
})),
|
|
62
|
+
update: crmProcedure
|
|
63
|
+
.input(limited_time_offer_campaign_validation_1.UpdateLtoCampaignSchema)
|
|
64
|
+
.output(limited_time_offer_campaign_validation_1.LtoCampaignResponseSchema)
|
|
65
|
+
.mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
66
|
+
const result = await limited_time_offer_campaign_service_1.ltoCampaignService.update(input);
|
|
67
|
+
return (0, response_1.response)('Campaign updated successfully', result);
|
|
68
|
+
})),
|
|
69
|
+
cancel: crmProcedure
|
|
70
|
+
.input(zod_1.z.object({ campaignId: validation_1.ZodValidation.objectId() }))
|
|
71
|
+
.output(limited_time_offer_campaign_validation_1.LtoEmptyResponseSchema)
|
|
72
|
+
.mutation(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
73
|
+
await limited_time_offer_campaign_service_1.ltoCampaignService.cancel(input.campaignId);
|
|
74
|
+
return (0, response_1.response)('Campaign cancelled successfully');
|
|
75
|
+
})),
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=campaign.router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.router.js","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/campaign.router.ts"],"names":[],"mappings":"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","sourcesContent":["import {z} from 'zod';\nimport {ltoCampaignService as service} from './services/limited-time-offer-campaign.service';\nimport {\n CreateLtoCampaignSchema,\n GetLtoCampaignHistorySchema,\n LtoCampaignHistoryResponseSchema,\n LtoCampaignNullableResponseSchema,\n LtoCampaignResponseSchema,\n LtoEmptyResponseSchema,\n UpdateLtoCampaignSchema,\n} from './limited-time-offer-campaign.validation';\nimport {createTRPCRouter, publicProcedure} from '@lyxa.ai/core/dist/libraries/trpc';\nimport {createAuthenticatedProcedure} from '@lyxa.ai/core/dist/libraries/trpc/middlewares/auth';\nimport {AuthEntityType} from '@lyxa.ai/core/dist/utilities/enum';\nimport {ErrorHandler} from '@lyxa.ai/core/dist/utilities/error-handler';\nimport {response} from '@lyxa.ai/core/dist/utilities/response';\nimport {ZodValidation} from '@lyxa.ai/core/dist/utilities/validation';\n\nconst crmProcedure = createAuthenticatedProcedure({entityTypes: [AuthEntityType.CRM]});\nconst sellerProcedure = createAuthenticatedProcedure({entityTypes: [AuthEntityType.SELLER]});\n\nexport const campaignRouter = createTRPCRouter({\n create: crmProcedure\n .input(CreateLtoCampaignSchema)\n .output(LtoCampaignResponseSchema)\n .mutation(async ({input}) =>\n ErrorHandler.wrapAsync(async () => {\n const result = await service.create(input);\n return response('Campaign created successfully', result);\n })\n ),\n\n getCurrent: crmProcedure\n .output(LtoCampaignNullableResponseSchema)\n .query(async () =>\n ErrorHandler.wrapAsync(async () => {\n const result = await service.getCurrent();\n return response('Current campaign fetched successfully', result);\n })\n ),\n\n getActiveForShop: sellerProcedure\n .output(LtoCampaignNullableResponseSchema)\n .query(async () =>\n ErrorHandler.wrapAsync(async () => {\n const result = await service.getActiveCampaign();\n return response('Active campaign fetched successfully', result);\n })\n ),\n\n getActiveForUser: publicProcedure\n .output(LtoCampaignNullableResponseSchema)\n .query(async () =>\n ErrorHandler.wrapAsync(async () => {\n const campaign = await service.getActiveCampaign();\n if (!campaign) return response('Active campaign fetched successfully', null);\n const {discountOptions: _, maxDiscountCaps: __, ...rest} = campaign;\n return response('Active campaign fetched successfully', {\n ...rest,\n discountOptions: [],\n maxDiscountCaps: [],\n });\n })\n ),\n\n getById: crmProcedure\n .input(z.object({campaignId: ZodValidation.objectId()}))\n .output(LtoCampaignResponseSchema)\n .query(async ({input}) =>\n ErrorHandler.wrapAsync(async () => {\n const result = await service.getById(input.campaignId);\n return response('Campaign fetched successfully', result);\n })\n ),\n\n getHistory: crmProcedure\n .input(GetLtoCampaignHistorySchema)\n .output(LtoCampaignHistoryResponseSchema)\n .query(async ({input}) =>\n ErrorHandler.wrapAsync(async () => {\n const result = await service.getHistory(input);\n return response('Campaign history fetched successfully', result);\n })\n ),\n\n update: crmProcedure\n .input(UpdateLtoCampaignSchema)\n .output(LtoCampaignResponseSchema)\n .mutation(async ({input}) =>\n ErrorHandler.wrapAsync(async () => {\n const result = await service.update(input);\n return response('Campaign updated successfully', result);\n })\n ),\n\n cancel: crmProcedure\n .input(z.object({campaignId: ZodValidation.objectId()}))\n .output(LtoEmptyResponseSchema)\n .mutation(async ({input}) =>\n ErrorHandler.wrapAsync(async () => {\n await service.cancel(input.campaignId);\n return response('Campaign cancelled successfully');\n })\n ),\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/jobs/index.ts"],"names":[],"mappings":"AAEA,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAErD,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAExD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.startBullMQWorkers = startBullMQWorkers;
|
|
18
|
+
const limited_time_offer_campaign_worker_1 = require("./limited-time-offer-campaign.worker");
|
|
19
|
+
__exportStar(require("./limited-time-offer-campaign.producer"), exports);
|
|
20
|
+
__exportStar(require("./limited-time-offer-campaign.worker"), exports);
|
|
21
|
+
async function startBullMQWorkers() {
|
|
22
|
+
await limited_time_offer_campaign_worker_1.ltoCampaignQueueWorker.startWorker();
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,gDAEC;AAPD,6FAA8E;AAE9E,yEAAuD;AACvD,uEAAqD;AAE9C,KAAK,UAAU,kBAAkB;IACpC,MAAM,2DAAsB,CAAC,WAAW,EAAE,CAAC;AAC/C,CAAC","sourcesContent":["import { ltoCampaignQueueWorker } from './limited-time-offer-campaign.worker';\n\nexport * from './limited-time-offer-campaign.producer';\nexport * from './limited-time-offer-campaign.worker';\n\nexport async function startBullMQWorkers(): Promise<void> {\n await ltoCampaignQueueWorker.startWorker();\n}\n"]}
|
package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Queue, JobsOptions } from 'bullmq';
|
|
2
|
+
export declare const LTO_CAMPAIGN_TRANSITIONS_QUEUE = "lto-campaign-transitions";
|
|
3
|
+
export declare enum LtoCampaignJobName {
|
|
4
|
+
ACTIVATE = "lto-activate",
|
|
5
|
+
EXPIRE = "lto-expire"
|
|
6
|
+
}
|
|
7
|
+
export declare function getLtoCampaignQueue(): Queue;
|
|
8
|
+
export declare function addLtoCampaignJob(name: LtoCampaignJobName, data: {
|
|
9
|
+
campaignId: string;
|
|
10
|
+
}, options: JobsOptions): Promise<void>;
|
|
11
|
+
export declare function removeLtoCampaignJob(jobId: string): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=limited-time-offer-campaign.producer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limited-time-offer-campaign.producer.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE5C,eAAO,MAAM,8BAA8B,6BAA6B,CAAC;AAEzE,oBAAY,kBAAkB;IAC1B,QAAQ,iBAAiB;IACzB,MAAM,eAAe;CACxB;AAID,wBAAgB,mBAAmB,IAAI,KAAK,CAM3C;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnI;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvE"}
|
package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LtoCampaignJobName = exports.LTO_CAMPAIGN_TRANSITIONS_QUEUE = void 0;
|
|
4
|
+
exports.getLtoCampaignQueue = getLtoCampaignQueue;
|
|
5
|
+
exports.addLtoCampaignJob = addLtoCampaignJob;
|
|
6
|
+
exports.removeLtoCampaignJob = removeLtoCampaignJob;
|
|
7
|
+
const core_1 = require("@lyxa.ai/core");
|
|
8
|
+
exports.LTO_CAMPAIGN_TRANSITIONS_QUEUE = 'lto-campaign-transitions';
|
|
9
|
+
var LtoCampaignJobName;
|
|
10
|
+
(function (LtoCampaignJobName) {
|
|
11
|
+
LtoCampaignJobName["ACTIVATE"] = "lto-activate";
|
|
12
|
+
LtoCampaignJobName["EXPIRE"] = "lto-expire";
|
|
13
|
+
})(LtoCampaignJobName || (exports.LtoCampaignJobName = LtoCampaignJobName = {}));
|
|
14
|
+
let _queue = null;
|
|
15
|
+
function getLtoCampaignQueue() {
|
|
16
|
+
if (!_queue) {
|
|
17
|
+
_queue = (0, core_1.getLibraries)().getBullMQService().createQueue(exports.LTO_CAMPAIGN_TRANSITIONS_QUEUE);
|
|
18
|
+
}
|
|
19
|
+
return _queue;
|
|
20
|
+
}
|
|
21
|
+
async function addLtoCampaignJob(name, data, options) {
|
|
22
|
+
await getLtoCampaignQueue().add(name, data, options);
|
|
23
|
+
}
|
|
24
|
+
async function removeLtoCampaignJob(jobId) {
|
|
25
|
+
const job = await getLtoCampaignQueue().getJob(jobId);
|
|
26
|
+
if (job)
|
|
27
|
+
await job.remove();
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=limited-time-offer-campaign.producer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limited-time-offer-campaign.producer.js","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.producer.ts"],"names":[],"mappings":";;;AAYA,kDAMC;AAED,8CAEC;AAED,oDAGC;AA3BD,wCAA6C;AAGhC,QAAA,8BAA8B,GAAG,0BAA0B,CAAC;AAEzE,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,+CAAyB,CAAA;IACzB,2CAAqB,CAAA;AACzB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAI,MAAM,GAAiB,IAAI,CAAC;AAEhC,SAAgB,mBAAmB;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;QAEV,MAAM,GAAG,IAAA,mBAAY,GAAE,CAAC,gBAAgB,EAAE,CAAC,WAAW,CAAC,sCAA8B,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,MAAO,CAAC;AACnB,CAAC;AAEM,KAAK,UAAU,iBAAiB,CAAC,IAAwB,EAAE,IAA4B,EAAE,OAAoB;IAChH,MAAM,mBAAmB,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAEM,KAAK,UAAU,oBAAoB,CAAC,KAAa;IACpD,MAAM,GAAG,GAAG,MAAM,mBAAmB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,GAAG;QAAE,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import { getLibraries } from '@lyxa.ai/core';\nimport { Queue, JobsOptions } from 'bullmq';\n\nexport const LTO_CAMPAIGN_TRANSITIONS_QUEUE = 'lto-campaign-transitions';\n\nexport enum LtoCampaignJobName {\n ACTIVATE = 'lto-activate',\n EXPIRE = 'lto-expire',\n}\n\nlet _queue: Queue | null = null;\n\nexport function getLtoCampaignQueue(): Queue {\n if (!_queue) {\n // @ts-ignore\n _queue = getLibraries().getBullMQService().createQueue(LTO_CAMPAIGN_TRANSITIONS_QUEUE);\n }\n return _queue!;\n}\n\nexport async function addLtoCampaignJob(name: LtoCampaignJobName, data: { campaignId: string }, options: JobsOptions): Promise<void> {\n await getLtoCampaignQueue().add(name, data, options);\n}\n\nexport async function removeLtoCampaignJob(jobId: string): Promise<void> {\n const job = await getLtoCampaignQueue().getJob(jobId);\n if (job) await job.remove();\n}\n"]}
|
package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class LtoCampaignQueueWorker {
|
|
2
|
+
private lifecycle;
|
|
3
|
+
private participantMarketing;
|
|
4
|
+
constructor();
|
|
5
|
+
startWorker(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare const ltoCampaignQueueWorker: LtoCampaignQueueWorker;
|
|
8
|
+
//# sourceMappingURL=limited-time-offer-campaign.worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limited-time-offer-campaign.worker.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.ts"],"names":[],"mappings":"AAOA,qBACa,sBAAsB;IAC/B,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,oBAAoB,CAAiC;;IAOhD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAY5C;AAED,eAAO,MAAM,sBAAsB,wBAAwC,CAAC"}
|
package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
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.ltoCampaignQueueWorker = exports.LtoCampaignQueueWorker = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
48
|
+
const core_1 = require("@lyxa.ai/core");
|
|
49
|
+
const limited_time_offer_campaign_producer_1 = require("./limited-time-offer-campaign.producer");
|
|
50
|
+
const limited_time_offer_campaign_lifecycle_service_1 = require("../services/limited-time-offer-campaign-lifecycle.service");
|
|
51
|
+
const limited_time_offer_participant_marketing_service_1 = require("../../../limited-time-offer/participant/services/limited-time-offer-participant-marketing.service");
|
|
52
|
+
let LtoCampaignQueueWorker = class LtoCampaignQueueWorker {
|
|
53
|
+
lifecycle;
|
|
54
|
+
participantMarketing;
|
|
55
|
+
constructor() {
|
|
56
|
+
this.lifecycle = typedi_1.default.get(limited_time_offer_campaign_lifecycle_service_1.LtoCampaignLifecycleService);
|
|
57
|
+
this.participantMarketing = typedi_1.default.get(limited_time_offer_participant_marketing_service_1.LtoParticipantMarketingService);
|
|
58
|
+
}
|
|
59
|
+
async startWorker() {
|
|
60
|
+
(0, core_1.getLibraries)().getBullMQService().createWorker(limited_time_offer_campaign_producer_1.LTO_CAMPAIGN_TRANSITIONS_QUEUE, async (job) => {
|
|
61
|
+
const { campaignId: campaignIdStr } = job.data;
|
|
62
|
+
const campaignId = new typegoose_1.mongoose.Types.ObjectId(campaignIdStr);
|
|
63
|
+
if (job.name === limited_time_offer_campaign_producer_1.LtoCampaignJobName.ACTIVATE) {
|
|
64
|
+
await this.lifecycle.activateCampaign(campaignId);
|
|
65
|
+
}
|
|
66
|
+
else if (job.name === limited_time_offer_campaign_producer_1.LtoCampaignJobName.EXPIRE) {
|
|
67
|
+
await this.lifecycle.expireCampaign(campaignId);
|
|
68
|
+
await this.participantMarketing.removeAllCampaignMarketings(campaignId);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.LtoCampaignQueueWorker = LtoCampaignQueueWorker;
|
|
74
|
+
exports.LtoCampaignQueueWorker = LtoCampaignQueueWorker = __decorate([
|
|
75
|
+
(0, typedi_1.Service)(),
|
|
76
|
+
__metadata("design:paramtypes", [])
|
|
77
|
+
], LtoCampaignQueueWorker);
|
|
78
|
+
exports.ltoCampaignQueueWorker = typedi_1.default.get(LtoCampaignQueueWorker);
|
|
79
|
+
//# sourceMappingURL=limited-time-offer-campaign.worker.js.map
|
package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limited-time-offer-campaign.worker.js","sourceRoot":"/","sources":["modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,oDAAgD;AAChD,wCAA6C;AAC7C,iGAA4G;AAC5G,6HAAwG;AACxG,wKAAmJ;AAG5I,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACvB,SAAS,CAA8B;IACvC,oBAAoB,CAAiC;IAE7D;QACI,IAAI,CAAC,SAAS,GAAG,gBAAS,CAAC,GAAG,CAAC,2EAA2B,CAAC,CAAC;QAC5D,IAAI,CAAC,oBAAoB,GAAG,gBAAS,CAAC,GAAG,CAAC,iFAA8B,CAAC,CAAC;IAC9E,CAAC;IAEM,KAAK,CAAC,WAAW;QACpB,IAAA,mBAAY,GAAE,CAAC,gBAAgB,EAAE,CAAC,YAAY,CAAC,qEAA8B,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE;YACvF,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,IAA8B,CAAC;YACzE,MAAM,UAAU,GAAG,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YAC9D,IAAI,GAAG,CAAC,IAAI,KAAK,yDAAkB,CAAC,QAAQ,EAAE,CAAC;gBAC3C,MAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACtD,CAAC;iBAAM,IAAI,GAAG,CAAC,IAAI,KAAK,yDAAkB,CAAC,MAAM,EAAE,CAAC;gBAChD,MAAM,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;gBAChD,MAAM,IAAI,CAAC,oBAAoB,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;YAC5E,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AArBY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,gBAAO,GAAE;;GACG,sBAAsB,CAqBlC;AAEY,QAAA,sBAAsB,GAAG,gBAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { mongoose } from '@typegoose/typegoose';\nimport { getLibraries } from '@lyxa.ai/core';\nimport { LTO_CAMPAIGN_TRANSITIONS_QUEUE, LtoCampaignJobName } from './limited-time-offer-campaign.producer';\nimport { LtoCampaignLifecycleService } from '../services/limited-time-offer-campaign-lifecycle.service';\nimport { LtoParticipantMarketingService } from '@modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service';\n\n@Service()\nexport class LtoCampaignQueueWorker {\n private lifecycle: LtoCampaignLifecycleService;\n private participantMarketing: LtoParticipantMarketingService;\n\n constructor() {\n this.lifecycle = Container.get(LtoCampaignLifecycleService);\n this.participantMarketing = Container.get(LtoParticipantMarketingService);\n }\n\n public async startWorker(): Promise<void> {\n getLibraries().getBullMQService().createWorker(LTO_CAMPAIGN_TRANSITIONS_QUEUE, async job => {\n const { campaignId: campaignIdStr } = job.data as { campaignId: string };\n const campaignId = new mongoose.Types.ObjectId(campaignIdStr);\n if (job.name === LtoCampaignJobName.ACTIVATE) {\n await this.lifecycle.activateCampaign(campaignId);\n } else if (job.name === LtoCampaignJobName.EXPIRE) {\n await this.lifecycle.expireCampaign(campaignId);\n await this.participantMarketing.removeAllCampaignMarketings(campaignId);\n }\n });\n }\n}\n\nexport const ltoCampaignQueueWorker = Container.get(LtoCampaignQueueWorker);\n"]}
|