@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
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAL3B,CAAC;AAuCH,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
7
3
|
const http_1 = require("http");
|
|
8
4
|
const routers_1 = require("./modules/coupon/routers");
|
|
9
5
|
const routers_2 = require("./modules/deal-setting/routers");
|
|
@@ -16,8 +12,8 @@ const marketing_router_1 = require("./modules/marketing/routers/marketing.router
|
|
|
16
12
|
const error_middleware_1 = require("@lyxa.ai/core/dist/utilities/error-middleware");
|
|
17
13
|
const cors_1 = require("@lyxa.ai/core/dist/libraries/trpc/middlewares/cors");
|
|
18
14
|
const routers_5 = require("./modules/punch-marketing-history/routers");
|
|
15
|
+
const limited_time_offer_router_1 = require("./modules/limited-time-offer/limited-time-offer.router");
|
|
19
16
|
const trpc_1 = require("@lyxa.ai/core/dist/libraries/trpc");
|
|
20
|
-
dotenv_1.default.config();
|
|
21
17
|
const marketingMicroServiceRouter = (0, trpc_1.createTRPCRouter)({
|
|
22
18
|
dealSettingRouter: routers_2.dealSettingRouter,
|
|
23
19
|
featuredSettingRouter: routers_4.featuredSettingRouter,
|
|
@@ -25,6 +21,7 @@ const marketingMicroServiceRouter = (0, trpc_1.createTRPCRouter)({
|
|
|
25
21
|
couponRouter: routers_1.couponRouter,
|
|
26
22
|
punchMarketingHistoryRouter: routers_5.punchMarketingHistoryRouter,
|
|
27
23
|
referralSettingRouter: routers_3.referralSettingRouter,
|
|
24
|
+
limitedTimeOfferRouter: limited_time_offer_router_1.limitedTimeOfferRouter,
|
|
28
25
|
});
|
|
29
26
|
const startServer = async () => {
|
|
30
27
|
const environment = (process.env.NODE_ENV || 'DEV');
|
|
@@ -51,7 +48,10 @@ const startServer = async () => {
|
|
|
51
48
|
}
|
|
52
49
|
handler(req, res);
|
|
53
50
|
}).listen(port, () => {
|
|
54
|
-
|
|
51
|
+
const RED = '\x1b[31m';
|
|
52
|
+
const GREEN = '\x1b[32m';
|
|
53
|
+
const RESET = '\x1b[0m';
|
|
54
|
+
console.log(`${GREEN}Server started on port ${RED}${port}${GREEN} with health check endpoint${RESET}`);
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
startServer().catch(err => {
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index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EH,MAAM,IAAA,0CAAkB,GAAE,CAAC;IAE3B,IAAA,mBAAY,EAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,IAAI,GAAG,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YAC3B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;YAC/E,OAAO;QACR,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACpB,MAAM,GAAG,GAAG,UAAU,CAAC;QACvB,MAAM,KAAK,GAAG,UAAU,CAAC;QACzB,MAAM,KAAK,GAAG,SAAS,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,0BAA0B,GAAG,GAAG,IAAI,GAAG,KAAK,8BAA8B,KAAK,EAAE,CAAC,CAAC;IACxG,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAIF,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACzB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC","sourcesContent":["// index entry point for migration tracking\nimport dotenv from 'dotenv';\nimport { createServer } from 'http';\nimport { couponRouter } from '@modules/coupon/routers';\nimport { dealSettingRouter } from '@modules/deal-setting/routers';\nimport { initEventListeners } from './event/event-initializations';\nimport { referralSettingRouter } from '@modules/referral-setting/routers';\nimport { featuredSettingRouter } from '@modules/featured-setting/routers';\nimport { bootstrapCore, EnvironmentConfigurationType } from '@lyxa.ai/core';\nimport { createLyxaContext } from '@lyxa.ai/core/dist/libraries/trpc/context';\nimport { marketingRouter } from '@modules/marketing/routers/marketing.router';\nimport { handleTRPCError } from '@lyxa.ai/core/dist/utilities/error-middleware';\nimport { corsMiddleware } from '@lyxa.ai/core/dist/libraries/trpc/middlewares/cors';\nimport { punchMarketingHistoryRouter } from '@modules/punch-marketing-history/routers';\nimport { limitedTimeOfferRouter } from '@modules/limited-time-offer/limited-time-offer.router';\nimport { createTRPCRouter, createHTTPHandler } from '@lyxa.ai/core/dist/libraries/trpc';\n\n// dotenv.config();\n\nconst marketingMicroServiceRouter = createTRPCRouter({\n\tdealSettingRouter,\n\tfeaturedSettingRouter,\n\tmarketingRouter,\n\tcouponRouter,\n\tpunchMarketingHistoryRouter,\n\treferralSettingRouter,\n\tlimitedTimeOfferRouter,\n});\n\nconst startServer = async () => {\n\tconst environment = (process.env.NODE_ENV || 'DEV') as keyof typeof EnvironmentConfigurationType;\n\tconst tenet = process.env.TENET || 'lb';\n\tconst port = parseInt(process.env.PORT || '3006', 10);\n\n\tawait bootstrapCore({\n\t\tenvironment: EnvironmentConfigurationType[environment] || EnvironmentConfigurationType.DEV,\n\t\tinstanceType: 'marketing',\n\t\ttenet,\n\t\tmongooseDebug: false,\n\t});\n\n\tconst handler = createHTTPHandler({\n\t\trouter: marketingMicroServiceRouter,\n\t\tcreateContext: createLyxaContext,\n\t\tonError: handleTRPCError,\n\t\tmiddleware: corsMiddleware(),\n\t});\n\n\tawait initEventListeners();\n\n\tcreateServer((req, res) => {\n\t\tif (req.url === '/health') {\n\t\t\tres.writeHead(200, { 'Content-Type': 'application/json' });\n\t\t\tres.end(JSON.stringify({ status: 'ok', timestamp: new Date().toISOString() }));\n\t\t\treturn;\n\t\t}\n\n\t\thandler(req, res);\n\t}).listen(port, () => {\n\t\tconst RED = '\\x1b[31m';\n\t\tconst GREEN = '\\x1b[32m';\n\t\tconst RESET = '\\x1b[0m';\n\t\tconsole.log(`${GREEN}Server started on port ${RED}${port}${GREEN} with health check endpoint${RESET}`);\n\t});\n};\n\nexport type MarketingMicroServiceRouter = typeof marketingMicroServiceRouter;\n\nstartServer().catch(err => {\n\tconsole.error('Failed to start server:', err);\n\tprocess.exit(1);\n});\n"]}
|
|
@@ -5223,6 +5223,7 @@ export declare const couponRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
5223
5223
|
shopCut?: number | undefined;
|
|
5224
5224
|
secondaryShopCut?: number | undefined;
|
|
5225
5225
|
} | undefined;
|
|
5226
|
+
couponDetails?: Record<string, unknown> | undefined;
|
|
5226
5227
|
} | {
|
|
5227
5228
|
documents: {
|
|
5228
5229
|
message?: string | undefined;
|
|
@@ -5237,6 +5238,7 @@ export declare const couponRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
5237
5238
|
shopCut?: number | undefined;
|
|
5238
5239
|
secondaryShopCut?: number | undefined;
|
|
5239
5240
|
} | undefined;
|
|
5241
|
+
couponDetails?: Record<string, unknown> | undefined;
|
|
5240
5242
|
}[];
|
|
5241
5243
|
metadata?: {
|
|
5242
5244
|
page: number;
|
|
@@ -5273,6 +5275,7 @@ export declare const couponRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
5273
5275
|
shopCut?: number | undefined;
|
|
5274
5276
|
secondaryShopCut?: number | undefined;
|
|
5275
5277
|
} | undefined;
|
|
5278
|
+
couponDetails?: Record<string, unknown> | undefined;
|
|
5276
5279
|
} | {
|
|
5277
5280
|
documents: {
|
|
5278
5281
|
message?: string | undefined;
|
|
@@ -5287,6 +5290,7 @@ export declare const couponRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
5287
5290
|
shopCut?: number | undefined;
|
|
5288
5291
|
secondaryShopCut?: number | undefined;
|
|
5289
5292
|
} | undefined;
|
|
5293
|
+
couponDetails?: Record<string, unknown> | undefined;
|
|
5290
5294
|
}[];
|
|
5291
5295
|
metadata?: {
|
|
5292
5296
|
page: number;
|
|
@@ -1 +1 @@
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgOwmyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GADpnyB,CAAC"}
|
|
@@ -22,6 +22,7 @@ export declare class CouponService {
|
|
|
22
22
|
findById(id: string | mongoose.Types.ObjectId): Promise<DocumentType<Model>>;
|
|
23
23
|
find(data?: Partial<FilterDTO>): Promise<PaginatedResponse<DocumentType<ModelType<Model>>>>;
|
|
24
24
|
update(id: string, data: AllCouponsValidationDTO): Promise<DocumentType<Model>>;
|
|
25
|
+
private isCouponRunning;
|
|
25
26
|
updateStatus(id: string, status: Status): Promise<DocumentType<Model>>;
|
|
26
27
|
deleteById(data: DeleteDTO): Promise<string>;
|
|
27
28
|
getUserCoupons(user: mongoose.Types.ObjectId | undefined, shop: mongoose.Types.ObjectId | undefined, page?: number, size?: number): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coupon.service.d.ts","sourceRoot":"/","sources":["modules/coupon/services/coupon.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAgC,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAKN,YAAY,EAGZ,MAAM,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"coupon.service.d.ts","sourceRoot":"/","sources":["modules/coupon/services/coupon.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAgC,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAKN,YAAY,EAGZ,MAAM,IAAI,KAAK,EAcf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,mCAAmC,EACnC,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,MAAM,yCAAyC,CAAC;AAM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U,CAAC,GAAG,IAAI,CAAC;IAqBlE,2CAA2C,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAgGvF,0BAA0B,IAAI,OAAO,CAAC,mCAAmC,CAAC;YAUzE,YAAY;IAQb,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,GACpC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;YAkD1B,wBAAwB;IAczB,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;CAsBlG;AAED,eAAO,MAAM,aAAa,eAA+B,CAAC"}
|
|
@@ -262,14 +262,42 @@ let CouponService = class CouponService {
|
|
|
262
262
|
select: data?.select,
|
|
263
263
|
populate: populate,
|
|
264
264
|
};
|
|
265
|
+
if (data?.search?.searchKey) {
|
|
266
|
+
const keyword = data.search.searchKey.trim();
|
|
267
|
+
const defaultFields = ['code', 'user'];
|
|
268
|
+
const fields = data.search.searchFields || defaultFields;
|
|
269
|
+
const orConditions = [];
|
|
270
|
+
if (fields.includes('code')) {
|
|
271
|
+
orConditions.push({ code: { $regex: keyword, $options: 'i' } });
|
|
272
|
+
}
|
|
273
|
+
if (fields.includes('user')) {
|
|
274
|
+
const coreUsers = await this.coreUserModel
|
|
275
|
+
.find({ name: { $regex: keyword, $options: 'i' } })
|
|
276
|
+
.select('_id');
|
|
277
|
+
const coreUserIds = coreUsers.map(u => u._id);
|
|
278
|
+
const users = await this.userModel.find({ coreUser: { $in: coreUserIds } }).select('_id');
|
|
279
|
+
const userIds = users.map(u => u._id);
|
|
280
|
+
if (userIds.length)
|
|
281
|
+
orConditions.push({ users: { $in: userIds } }, { user: { $in: userIds } });
|
|
282
|
+
}
|
|
283
|
+
if (orConditions.length) {
|
|
284
|
+
options.query = { ...options.query, $or: orConditions };
|
|
285
|
+
}
|
|
286
|
+
}
|
|
265
287
|
const paginatedResult = await paginate(options);
|
|
288
|
+
paginatedResult.documents = await Promise.all(paginatedResult.documents.map(async (doc) => {
|
|
289
|
+
const plainDoc = doc.toObject();
|
|
290
|
+
const allIds = [plainDoc._id, ...(plainDoc.previousVersions || []).filter(Boolean)];
|
|
291
|
+
const count = await this.orderModel.countDocuments({
|
|
292
|
+
'adjustedFinance.coupon.coupon': { $in: allIds },
|
|
293
|
+
status: enum_1.RegularOrderStatus.DELIVERED,
|
|
294
|
+
});
|
|
295
|
+
return { ...plainDoc, usedCount: count };
|
|
296
|
+
}));
|
|
266
297
|
return paginatedResult;
|
|
267
298
|
}
|
|
268
299
|
catch (err) {
|
|
269
|
-
|
|
270
|
-
code: 'INTERNAL_SERVER_ERROR',
|
|
271
|
-
message: `err: ${err}`,
|
|
272
|
-
});
|
|
300
|
+
(0, error_common_1.internalServerError)(`err: ${err}`);
|
|
273
301
|
}
|
|
274
302
|
}
|
|
275
303
|
async update(id, data) {
|
|
@@ -288,32 +316,24 @@ let CouponService = class CouponService {
|
|
|
288
316
|
.select(['_id', 'coupons']),
|
|
289
317
|
]);
|
|
290
318
|
if (!oldCoupon) {
|
|
291
|
-
|
|
292
|
-
code: 'NOT_FOUND',
|
|
293
|
-
message: `Coupon not found`,
|
|
294
|
-
});
|
|
319
|
+
(0, error_common_1.notFoundError)('Coupon not found');
|
|
295
320
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
321
|
+
const running = this.isCouponRunning(oldCoupon);
|
|
322
|
+
if (running && data && 'duration' in data && data.duration) {
|
|
323
|
+
data.duration.start = oldCoupon.duration.start;
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
if (data.couponType !== enum_1.CouponType.REFERRAL_CODE && (0, dayjs_1.dayjs)(data?.duration?.start).isBefore((0, dayjs_1.dayjs)())) {
|
|
327
|
+
(0, error_common_1.badRequestError)(`Start date/time cannot be earlier than the current time`);
|
|
328
|
+
}
|
|
303
329
|
}
|
|
304
330
|
if (data.couponType != enum_1.CouponType.REFERRAL_CODE &&
|
|
305
331
|
data?.duration &&
|
|
306
332
|
(0, dayjs_1.dayjs)(data?.duration?.start) > (0, dayjs_1.dayjs)(data?.duration.end)) {
|
|
307
|
-
|
|
308
|
-
code: 'BAD_REQUEST',
|
|
309
|
-
message: `End date/time must be after start date/time`,
|
|
310
|
-
});
|
|
333
|
+
(0, error_common_1.badRequestError)(`End date/time must be after start date/time`);
|
|
311
334
|
}
|
|
312
335
|
if (checkCouponCode) {
|
|
313
|
-
|
|
314
|
-
code: 'CONFLICT',
|
|
315
|
-
message: `Coupon code already exists`,
|
|
316
|
-
});
|
|
336
|
+
(0, error_common_1.conflictError)(`Coupon code already exists`);
|
|
317
337
|
}
|
|
318
338
|
switch (data.couponType) {
|
|
319
339
|
case enum_1.CouponType.GLOBAL: {
|
|
@@ -366,17 +386,11 @@ let CouponService = class CouponService {
|
|
|
366
386
|
break;
|
|
367
387
|
}
|
|
368
388
|
default: {
|
|
369
|
-
|
|
370
|
-
code: 'BAD_REQUEST',
|
|
371
|
-
message: `Invalid coupon type`,
|
|
372
|
-
});
|
|
389
|
+
(0, error_common_1.badRequestError)(`Invalid coupon type`);
|
|
373
390
|
}
|
|
374
391
|
}
|
|
375
392
|
if (!coupon) {
|
|
376
|
-
|
|
377
|
-
code: 'BAD_REQUEST',
|
|
378
|
-
message: `Could create updated coupon`,
|
|
379
|
-
});
|
|
393
|
+
(0, error_common_1.badRequestError)(`Could not create updated coupon`);
|
|
380
394
|
}
|
|
381
395
|
const previousVersions = oldCoupon?.previousVersions || [];
|
|
382
396
|
previousVersions.push(oldCoupon._id);
|
|
@@ -389,10 +403,7 @@ let CouponService = class CouponService {
|
|
|
389
403
|
runValidators: true,
|
|
390
404
|
});
|
|
391
405
|
if (!updatedCoupon) {
|
|
392
|
-
|
|
393
|
-
code: 'INTERNAL_SERVER_ERROR',
|
|
394
|
-
message: `Could not set previous versions of coupon`,
|
|
395
|
-
});
|
|
406
|
+
(0, error_common_1.internalServerError)(`Could not set previous versions of coupon`);
|
|
396
407
|
}
|
|
397
408
|
const updatedOldCoupon = await this.baseCouponModel.findByIdAndUpdate(oldCoupon._id, {
|
|
398
409
|
$set: {
|
|
@@ -405,6 +416,12 @@ let CouponService = class CouponService {
|
|
|
405
416
|
});
|
|
406
417
|
return updatedCoupon;
|
|
407
418
|
}
|
|
419
|
+
isCouponRunning(coupon) {
|
|
420
|
+
const now = new Date();
|
|
421
|
+
const start = new Date(coupon.duration.start);
|
|
422
|
+
const end = new Date(coupon.duration.end);
|
|
423
|
+
return coupon.status === 'active' && coupon.deletedAt === null && now >= start && now <= end;
|
|
424
|
+
}
|
|
408
425
|
async updateStatus(id, status) {
|
|
409
426
|
const coupon = await this.baseCouponModel.findByIdAndUpdate(id, {
|
|
410
427
|
$set: { status },
|
|
@@ -469,21 +486,28 @@ let CouponService = class CouponService {
|
|
|
469
486
|
const user = await this.userModel.findById(data.user);
|
|
470
487
|
if (!user)
|
|
471
488
|
(0, error_common_1.notFoundError)('User not found');
|
|
472
|
-
let coupon = await this.model
|
|
489
|
+
let coupon = await this.model
|
|
490
|
+
.findOne({
|
|
473
491
|
code: data.coupon,
|
|
474
492
|
_id: { $in: user.coupons ?? [] },
|
|
475
493
|
status: { $in: [enum_1.Status.ACTIVE, null] },
|
|
476
|
-
})
|
|
494
|
+
})
|
|
495
|
+
.populate('shops', '_id name');
|
|
477
496
|
if (!coupon) {
|
|
478
|
-
coupon = await this.model
|
|
497
|
+
coupon = await this.model
|
|
498
|
+
.findOne({
|
|
479
499
|
code: data.coupon,
|
|
480
500
|
status: { $in: [enum_1.Status.ACTIVE, null] },
|
|
481
501
|
couponType: { $in: [enum_1.CouponType.REFERRAL_CODE, enum_1.CouponType.CUSTOM_COUPON] },
|
|
482
502
|
updatedVersion: { $exists: false },
|
|
483
|
-
})
|
|
503
|
+
})
|
|
504
|
+
.populate('shops', '_id name');
|
|
484
505
|
if (!coupon) {
|
|
485
506
|
(0, error_common_1.notFoundError)('Coupon not found');
|
|
486
507
|
}
|
|
508
|
+
this.userModel.findByIdAndUpdate(user._id, {
|
|
509
|
+
$addToSet: { coupons: coupon._id },
|
|
510
|
+
});
|
|
487
511
|
}
|
|
488
512
|
if (coupon.couponType == enum_1.CouponType.REFERRAL_CODE) {
|
|
489
513
|
return await _1.referralCodeCouponService.validateCoupon(data, coupon);
|
|
@@ -533,7 +557,7 @@ let CouponService = class CouponService {
|
|
|
533
557
|
const invalidMessages = [
|
|
534
558
|
'This coupon is expired',
|
|
535
559
|
'This coupon is not available yet',
|
|
536
|
-
|
|
560
|
+
`Minimum order amount ${coupon.minOrderValue}$ is not met!`,
|
|
537
561
|
'This coupon is for new users only',
|
|
538
562
|
'You have reached the order limit for this coupon',
|
|
539
563
|
'This coupon is not valid for this scheduled orders',
|
|
@@ -548,7 +572,7 @@ let CouponService = class CouponService {
|
|
|
548
572
|
const orderLimitPerUser = coupon.orderLimitPerUser;
|
|
549
573
|
if (forNewUserOnly) {
|
|
550
574
|
if (isOrderLimitPerUserEnabled && orderLimitPerUser) {
|
|
551
|
-
const orderCount = await helper_service_1.couponHelperService.
|
|
575
|
+
const orderCount = await helper_service_1.couponHelperService.getSameDeviceOrdersWithCoupon(user, coupon);
|
|
552
576
|
return orderLimitPerUser > orderCount;
|
|
553
577
|
}
|
|
554
578
|
return await helper_service_1.couponHelperService.isNewUser(user);
|
|
@@ -976,17 +1000,14 @@ let CouponService = class CouponService {
|
|
|
976
1000
|
couponType: enum_1.CouponType.GLOBAL,
|
|
977
1001
|
forNewUserOnly: true,
|
|
978
1002
|
deletedAt: null,
|
|
979
|
-
$or: [
|
|
980
|
-
{ expirationReason: { $exists: false } },
|
|
981
|
-
{ expirationReason: null },
|
|
982
|
-
],
|
|
1003
|
+
$or: [{ expirationReason: { $exists: false } }, { expirationReason: null }],
|
|
983
1004
|
'duration.end': { $gte: currentDate },
|
|
984
1005
|
updatedVersion: { $exists: false },
|
|
985
1006
|
},
|
|
986
1007
|
},
|
|
987
1008
|
{
|
|
988
1009
|
$addFields: {
|
|
989
|
-
|
|
1010
|
+
secondaryCurrencyValue: {
|
|
990
1011
|
$cond: [
|
|
991
1012
|
{
|
|
992
1013
|
$eq: ['$valueType', enum_1.ValueType.PERCENTAGE],
|
|
@@ -997,10 +1018,7 @@ let CouponService = class CouponService {
|
|
|
997
1018
|
branches: [
|
|
998
1019
|
{
|
|
999
1020
|
case: {
|
|
1000
|
-
$eq: [
|
|
1001
|
-
'$couponType',
|
|
1002
|
-
enum_1.CouponType.REFERRAL_CODE,
|
|
1003
|
-
],
|
|
1021
|
+
$eq: ['$couponType', enum_1.CouponType.REFERRAL_CODE],
|
|
1004
1022
|
},
|
|
1005
1023
|
then: secondaryReferralReceiverValue,
|
|
1006
1024
|
},
|
|
@@ -1012,15 +1030,12 @@ let CouponService = class CouponService {
|
|
|
1012
1030
|
},
|
|
1013
1031
|
],
|
|
1014
1032
|
},
|
|
1015
|
-
|
|
1033
|
+
secondaryCurrencyMaxDiscountLimit: {
|
|
1016
1034
|
$switch: {
|
|
1017
1035
|
branches: [
|
|
1018
1036
|
{
|
|
1019
1037
|
case: {
|
|
1020
|
-
$eq: [
|
|
1021
|
-
'$couponType',
|
|
1022
|
-
enum_1.CouponType.REFERRAL_CODE,
|
|
1023
|
-
],
|
|
1038
|
+
$eq: ['$couponType', enum_1.CouponType.REFERRAL_CODE],
|
|
1024
1039
|
},
|
|
1025
1040
|
then: null,
|
|
1026
1041
|
},
|
|
@@ -1030,15 +1045,12 @@ let CouponService = class CouponService {
|
|
|
1030
1045
|
}),
|
|
1031
1046
|
},
|
|
1032
1047
|
},
|
|
1033
|
-
|
|
1048
|
+
secondaryCurrencyMinOrderValue: {
|
|
1034
1049
|
$switch: {
|
|
1035
1050
|
branches: [
|
|
1036
1051
|
{
|
|
1037
1052
|
case: {
|
|
1038
|
-
$eq: [
|
|
1039
|
-
'$couponType',
|
|
1040
|
-
enum_1.CouponType.REFERRAL_CODE,
|
|
1041
|
-
],
|
|
1053
|
+
$eq: ['$couponType', enum_1.CouponType.REFERRAL_CODE],
|
|
1042
1054
|
},
|
|
1043
1055
|
then: secondaryReferralReceiverMinOrderAmount,
|
|
1044
1056
|
},
|
|
@@ -1048,7 +1060,7 @@ let CouponService = class CouponService {
|
|
|
1048
1060
|
}),
|
|
1049
1061
|
},
|
|
1050
1062
|
},
|
|
1051
|
-
}
|
|
1063
|
+
},
|
|
1052
1064
|
},
|
|
1053
1065
|
{ $limit: 1 },
|
|
1054
1066
|
]);
|
|
@@ -1103,10 +1115,7 @@ let CouponService = class CouponService {
|
|
|
1103
1115
|
}
|
|
1104
1116
|
async updateCouponGiftBoxShown(userId, data) {
|
|
1105
1117
|
const user = await this.userModel.findById(userId);
|
|
1106
|
-
const users = await this.userModel
|
|
1107
|
-
.find({ deviceId: user?.deviceId })
|
|
1108
|
-
.select('_id')
|
|
1109
|
-
.lean();
|
|
1118
|
+
const users = await this.userModel.find({ deviceId: user?.deviceId }).select('_id').lean();
|
|
1110
1119
|
const userIds = users.map(u => u._id);
|
|
1111
1120
|
const result = await this.userModel.updateMany({ _id: { $in: userIds } }, {
|
|
1112
1121
|
$set: {
|