@lyxa.ai/marketing 1.0.67 → 1.0.68
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/index.d.ts +21 -11810
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts +1233 -10
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js +28 -0
- package/dist/lib/modules/coupon/routers/coupon.router.js.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.d.ts +29 -4
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +19 -3
- package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js +12 -15
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.d.ts +30 -2
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +412 -2
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.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 +1 -0
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/transformers/coupon.transformer.d.ts +50 -0
- package/dist/lib/modules/coupon/transformers/coupon.transformer.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/all-coupons.validation.d.ts +822 -0
- package/dist/lib/modules/coupon/validations/all-coupons.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +580 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js +48 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts +98 -0
- package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js +4 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js.map +1 -1
- package/dist/lib/modules/coupon/validations/referral-reward-coupon.validation.d.ts +374 -0
- package/dist/lib/modules/coupon/validations/referral-reward-coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/referral-reward-coupon.validation.js +2 -0
- package/dist/lib/modules/coupon/validations/referral-reward-coupon.validation.js.map +1 -1
- package/dist/lib/modules/deal-setting/routers/deal-setting.router.d.ts +4 -4
- 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 -1
- 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 +4 -4
- package/dist/lib/modules/featured-setting/routers/featured-setting.router.d.ts.map +1 -1
- package/dist/lib/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
- package/dist/lib/modules/featured-setting/services/featured-setting.service.js +3 -0
- package/dist/lib/modules/featured-setting/services/featured-setting.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +13 -0
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js +9 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +2 -6
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +22 -3
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js +12 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +19 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +10 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +83 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +4 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js +75 -6
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +46 -19
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +241 -10
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +13 -4
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
- package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js +1 -1
- package/dist/lib/modules/limited-time-offer/notification/limited-time-offer-notification.constants.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +30 -3
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +23 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +18 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +103 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +187 -2
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js +34 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js +2 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +515 -116
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +16 -6
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +11 -4
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js +48 -7
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +19 -5
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js +114 -16
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +1 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts +4 -4
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/index.d.ts +1 -0
- package/dist/lib/modules/marketing/services/index.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/index.js +1 -0
- package/dist/lib/modules/marketing/services/index.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +7 -3
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +61 -10
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/new-user-discount-marketing.service.d.ts +11 -0
- package/dist/lib/modules/marketing/services/new-user-discount-marketing.service.d.ts.map +1 -0
- package/dist/lib/modules/marketing/services/new-user-discount-marketing.service.js +116 -0
- package/dist/lib/modules/marketing/services/new-user-discount-marketing.service.js.map +1 -0
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +1 -0
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.js +32 -0
- package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/validations/all-marketings.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/all-marketings.validation.js +3 -0
- package/dist/lib/modules/marketing/validations/all-marketings.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +6 -6
- package/dist/lib/modules/marketing/validations/index.d.ts +1 -0
- package/dist/lib/modules/marketing/validations/index.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/index.js +1 -0
- package/dist/lib/modules/marketing/validations/index.js.map +1 -1
- package/dist/lib/modules/marketing/validations/new-user-discount-marketing.validation.d.ts +677 -0
- package/dist/lib/modules/marketing/validations/new-user-discount-marketing.validation.d.ts.map +1 -0
- package/dist/lib/modules/marketing/validations/new-user-discount-marketing.validation.js +83 -0
- package/dist/lib/modules/marketing/validations/new-user-discount-marketing.validation.js.map +1 -0
- package/dist/lib/modules/marketing/validations/punch-marketing.validation.d.ts +4 -4
- package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js +30 -0
- package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js.map +1 -1
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +4 -4
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/dist/lib/modules/referral-setting/validations/referral-setting.validation.d.ts.map +1 -1
- package/dist/lib/modules/referral-setting/validations/referral-setting.validation.js.map +1 -1
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +3 -2
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -1
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js +11 -3
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js.map +1 -1
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts +20 -4
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -1
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts +2 -2
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -1
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.js.map +1 -1
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +19 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -1
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js.map +1 -1
- package/dist/types/index.d.ts +21 -11810
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +1233 -10
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/coupon.service.d.ts +29 -4
- package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponRepository.d.ts +30 -2
- package/dist/types/modules/coupon/services/patterns/repository/CouponRepository.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/transformers/coupon.transformer.d.ts +50 -0
- package/dist/types/modules/coupon/transformers/coupon.transformer.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/all-coupons.validation.d.ts +822 -0
- package/dist/types/modules/coupon/validations/all-coupons.validation.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts +580 -1
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts +98 -0
- package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/referral-reward-coupon.validation.d.ts +374 -0
- package/dist/types/modules/coupon/validations/referral-reward-coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/deal-setting/routers/deal-setting.router.d.ts +4 -4
- 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 +4 -4
- package/dist/types/modules/featured-setting/routers/featured-setting.router.d.ts.map +1 -1
- package/dist/types/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +10 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +4 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +241 -10
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +30 -3
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +18 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +187 -2
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
- 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 +515 -116
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +11 -4
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +19 -5
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
- package/dist/types/modules/marketing/routers/marketing.router.d.ts +4 -4
- package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/index.d.ts +1 -0
- package/dist/types/modules/marketing/services/index.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts +7 -3
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/new-user-discount-marketing.service.d.ts +20 -0
- package/dist/types/modules/marketing/services/new-user-discount-marketing.service.d.ts.map +1 -0
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts +6 -0
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/all-marketings.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +6 -6
- package/dist/types/modules/marketing/validations/index.d.ts +1 -0
- package/dist/types/modules/marketing/validations/index.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/new-user-discount-marketing.validation.d.ts +686 -0
- package/dist/types/modules/marketing/validations/new-user-discount-marketing.validation.d.ts.map +1 -0
- package/dist/types/modules/marketing/validations/punch-marketing.validation.d.ts +4 -4
- package/dist/types/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +4 -4
- package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/dist/types/modules/referral-setting/validations/referral-setting.validation.d.ts.map +1 -1
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +3 -2
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -1
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts +20 -4
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -1
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts +2 -2
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -1
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +19 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -1
- package/package.json +2 -7
|
@@ -6,6 +6,56 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
6
6
|
user: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
|
|
7
7
|
referralCodeUsedBy: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
|
|
8
8
|
referralCodeUsedOnOrder: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
|
|
9
|
+
referralSettingSnapShot: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
sender: z.ZodObject<{
|
|
11
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
12
|
+
value: z.ZodNumber;
|
|
13
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
value: number;
|
|
16
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
17
|
+
minimumOrderValue: number;
|
|
18
|
+
}, {
|
|
19
|
+
value: number;
|
|
20
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
21
|
+
minimumOrderValue?: number | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
receiver: z.ZodObject<{
|
|
24
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
25
|
+
value: z.ZodNumber;
|
|
26
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
value: number;
|
|
29
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
30
|
+
minimumOrderValue: number;
|
|
31
|
+
}, {
|
|
32
|
+
value: number;
|
|
33
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
34
|
+
minimumOrderValue?: number | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
sender: {
|
|
38
|
+
value: number;
|
|
39
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
40
|
+
minimumOrderValue: number;
|
|
41
|
+
};
|
|
42
|
+
receiver: {
|
|
43
|
+
value: number;
|
|
44
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
45
|
+
minimumOrderValue: number;
|
|
46
|
+
};
|
|
47
|
+
}, {
|
|
48
|
+
sender: {
|
|
49
|
+
value: number;
|
|
50
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
51
|
+
minimumOrderValue?: number | undefined;
|
|
52
|
+
};
|
|
53
|
+
receiver: {
|
|
54
|
+
value: number;
|
|
55
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
56
|
+
minimumOrderValue?: number | undefined;
|
|
57
|
+
};
|
|
58
|
+
}>>;
|
|
9
59
|
valueType: z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>;
|
|
10
60
|
value: z.ZodNumber;
|
|
11
61
|
secondaryCurrencyValue: z.ZodOptional<z.ZodNumber>;
|
|
@@ -83,6 +133,18 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
83
133
|
} | undefined;
|
|
84
134
|
createdBy?: import("mongoose").Types.ObjectId | undefined;
|
|
85
135
|
isExpired?: boolean | undefined;
|
|
136
|
+
referralSettingSnapShot?: {
|
|
137
|
+
sender: {
|
|
138
|
+
value: number;
|
|
139
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
140
|
+
minimumOrderValue: number;
|
|
141
|
+
};
|
|
142
|
+
receiver: {
|
|
143
|
+
value: number;
|
|
144
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
145
|
+
minimumOrderValue: number;
|
|
146
|
+
};
|
|
147
|
+
} | undefined;
|
|
86
148
|
}, {
|
|
87
149
|
code: string;
|
|
88
150
|
value: number;
|
|
@@ -116,11 +178,73 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
116
178
|
isOrderLimitPerUserEnabled?: boolean | undefined;
|
|
117
179
|
createdBy?: string | import("mongoose").Types.ObjectId | undefined;
|
|
118
180
|
isExpired?: boolean | undefined;
|
|
181
|
+
referralSettingSnapShot?: {
|
|
182
|
+
sender: {
|
|
183
|
+
value: number;
|
|
184
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
185
|
+
minimumOrderValue?: number | undefined;
|
|
186
|
+
};
|
|
187
|
+
receiver: {
|
|
188
|
+
value: number;
|
|
189
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
190
|
+
minimumOrderValue?: number | undefined;
|
|
191
|
+
};
|
|
192
|
+
} | undefined;
|
|
119
193
|
}>, ReferralRewardCouponSchema: z.ZodObject<{
|
|
120
194
|
couponType: z.ZodOptional<z.ZodLiteral<CouponType.REFERRAL_REWARD>>;
|
|
121
195
|
user: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
122
196
|
referralCodeUsedBy: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
123
197
|
referralCodeUsedOnOrder: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
198
|
+
referralSettingSnapShot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
199
|
+
sender: z.ZodObject<{
|
|
200
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
201
|
+
value: z.ZodNumber;
|
|
202
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
value: number;
|
|
205
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
206
|
+
minimumOrderValue: number;
|
|
207
|
+
}, {
|
|
208
|
+
value: number;
|
|
209
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
210
|
+
minimumOrderValue?: number | undefined;
|
|
211
|
+
}>;
|
|
212
|
+
receiver: z.ZodObject<{
|
|
213
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
214
|
+
value: z.ZodNumber;
|
|
215
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
value: number;
|
|
218
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
219
|
+
minimumOrderValue: number;
|
|
220
|
+
}, {
|
|
221
|
+
value: number;
|
|
222
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
223
|
+
minimumOrderValue?: number | undefined;
|
|
224
|
+
}>;
|
|
225
|
+
}, "strict", z.ZodTypeAny, {
|
|
226
|
+
sender: {
|
|
227
|
+
value: number;
|
|
228
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
229
|
+
minimumOrderValue: number;
|
|
230
|
+
};
|
|
231
|
+
receiver: {
|
|
232
|
+
value: number;
|
|
233
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
234
|
+
minimumOrderValue: number;
|
|
235
|
+
};
|
|
236
|
+
}, {
|
|
237
|
+
sender: {
|
|
238
|
+
value: number;
|
|
239
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
240
|
+
minimumOrderValue?: number | undefined;
|
|
241
|
+
};
|
|
242
|
+
receiver: {
|
|
243
|
+
value: number;
|
|
244
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
245
|
+
minimumOrderValue?: number | undefined;
|
|
246
|
+
};
|
|
247
|
+
}>>>;
|
|
124
248
|
valueType: z.ZodOptional<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
125
249
|
value: z.ZodOptional<z.ZodNumber>;
|
|
126
250
|
secondaryCurrencyValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -171,6 +295,56 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
171
295
|
user: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
172
296
|
referralCodeUsedBy: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
173
297
|
referralCodeUsedOnOrder: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
298
|
+
referralSettingSnapShot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
299
|
+
sender: z.ZodObject<{
|
|
300
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
301
|
+
value: z.ZodNumber;
|
|
302
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
|
304
|
+
value: number;
|
|
305
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
306
|
+
minimumOrderValue: number;
|
|
307
|
+
}, {
|
|
308
|
+
value: number;
|
|
309
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
310
|
+
minimumOrderValue?: number | undefined;
|
|
311
|
+
}>;
|
|
312
|
+
receiver: z.ZodObject<{
|
|
313
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
314
|
+
value: z.ZodNumber;
|
|
315
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
value: number;
|
|
318
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
319
|
+
minimumOrderValue: number;
|
|
320
|
+
}, {
|
|
321
|
+
value: number;
|
|
322
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
323
|
+
minimumOrderValue?: number | undefined;
|
|
324
|
+
}>;
|
|
325
|
+
}, "strict", z.ZodTypeAny, {
|
|
326
|
+
sender: {
|
|
327
|
+
value: number;
|
|
328
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
329
|
+
minimumOrderValue: number;
|
|
330
|
+
};
|
|
331
|
+
receiver: {
|
|
332
|
+
value: number;
|
|
333
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
334
|
+
minimumOrderValue: number;
|
|
335
|
+
};
|
|
336
|
+
}, {
|
|
337
|
+
sender: {
|
|
338
|
+
value: number;
|
|
339
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
340
|
+
minimumOrderValue?: number | undefined;
|
|
341
|
+
};
|
|
342
|
+
receiver: {
|
|
343
|
+
value: number;
|
|
344
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
345
|
+
minimumOrderValue?: number | undefined;
|
|
346
|
+
};
|
|
347
|
+
}>>>;
|
|
174
348
|
valueType: z.ZodOptional<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
175
349
|
value: z.ZodOptional<z.ZodNumber>;
|
|
176
350
|
secondaryCurrencyValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -221,6 +395,56 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
221
395
|
user: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
222
396
|
referralCodeUsedBy: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
223
397
|
referralCodeUsedOnOrder: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
398
|
+
referralSettingSnapShot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
399
|
+
sender: z.ZodObject<{
|
|
400
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
401
|
+
value: z.ZodNumber;
|
|
402
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
403
|
+
}, "strip", z.ZodTypeAny, {
|
|
404
|
+
value: number;
|
|
405
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
406
|
+
minimumOrderValue: number;
|
|
407
|
+
}, {
|
|
408
|
+
value: number;
|
|
409
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
410
|
+
minimumOrderValue?: number | undefined;
|
|
411
|
+
}>;
|
|
412
|
+
receiver: z.ZodObject<{
|
|
413
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
414
|
+
value: z.ZodNumber;
|
|
415
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
416
|
+
}, "strip", z.ZodTypeAny, {
|
|
417
|
+
value: number;
|
|
418
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
419
|
+
minimumOrderValue: number;
|
|
420
|
+
}, {
|
|
421
|
+
value: number;
|
|
422
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
423
|
+
minimumOrderValue?: number | undefined;
|
|
424
|
+
}>;
|
|
425
|
+
}, "strict", z.ZodTypeAny, {
|
|
426
|
+
sender: {
|
|
427
|
+
value: number;
|
|
428
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
429
|
+
minimumOrderValue: number;
|
|
430
|
+
};
|
|
431
|
+
receiver: {
|
|
432
|
+
value: number;
|
|
433
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
434
|
+
minimumOrderValue: number;
|
|
435
|
+
};
|
|
436
|
+
}, {
|
|
437
|
+
sender: {
|
|
438
|
+
value: number;
|
|
439
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
440
|
+
minimumOrderValue?: number | undefined;
|
|
441
|
+
};
|
|
442
|
+
receiver: {
|
|
443
|
+
value: number;
|
|
444
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
445
|
+
minimumOrderValue?: number | undefined;
|
|
446
|
+
};
|
|
447
|
+
}>>>;
|
|
224
448
|
valueType: z.ZodOptional<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
225
449
|
value: z.ZodOptional<z.ZodNumber>;
|
|
226
450
|
secondaryCurrencyValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -277,6 +501,56 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
277
501
|
user: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
278
502
|
referralCodeUsedBy: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
279
503
|
referralCodeUsedOnOrder: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
504
|
+
referralSettingSnapShot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
505
|
+
sender: z.ZodObject<{
|
|
506
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
507
|
+
value: z.ZodNumber;
|
|
508
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
509
|
+
}, "strip", z.ZodTypeAny, {
|
|
510
|
+
value: number;
|
|
511
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
512
|
+
minimumOrderValue: number;
|
|
513
|
+
}, {
|
|
514
|
+
value: number;
|
|
515
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
516
|
+
minimumOrderValue?: number | undefined;
|
|
517
|
+
}>;
|
|
518
|
+
receiver: z.ZodObject<{
|
|
519
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
520
|
+
value: z.ZodNumber;
|
|
521
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
522
|
+
}, "strip", z.ZodTypeAny, {
|
|
523
|
+
value: number;
|
|
524
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
525
|
+
minimumOrderValue: number;
|
|
526
|
+
}, {
|
|
527
|
+
value: number;
|
|
528
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
529
|
+
minimumOrderValue?: number | undefined;
|
|
530
|
+
}>;
|
|
531
|
+
}, "strict", z.ZodTypeAny, {
|
|
532
|
+
sender: {
|
|
533
|
+
value: number;
|
|
534
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
535
|
+
minimumOrderValue: number;
|
|
536
|
+
};
|
|
537
|
+
receiver: {
|
|
538
|
+
value: number;
|
|
539
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
540
|
+
minimumOrderValue: number;
|
|
541
|
+
};
|
|
542
|
+
}, {
|
|
543
|
+
sender: {
|
|
544
|
+
value: number;
|
|
545
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
546
|
+
minimumOrderValue?: number | undefined;
|
|
547
|
+
};
|
|
548
|
+
receiver: {
|
|
549
|
+
value: number;
|
|
550
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
551
|
+
minimumOrderValue?: number | undefined;
|
|
552
|
+
};
|
|
553
|
+
}>>>;
|
|
280
554
|
valueType: z.ZodOptional<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
281
555
|
value: z.ZodOptional<z.ZodNumber>;
|
|
282
556
|
secondaryCurrencyValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -327,6 +601,56 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
327
601
|
user: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
328
602
|
referralCodeUsedBy: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
329
603
|
referralCodeUsedOnOrder: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
604
|
+
referralSettingSnapShot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
605
|
+
sender: z.ZodObject<{
|
|
606
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
607
|
+
value: z.ZodNumber;
|
|
608
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
609
|
+
}, "strip", z.ZodTypeAny, {
|
|
610
|
+
value: number;
|
|
611
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
612
|
+
minimumOrderValue: number;
|
|
613
|
+
}, {
|
|
614
|
+
value: number;
|
|
615
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
616
|
+
minimumOrderValue?: number | undefined;
|
|
617
|
+
}>;
|
|
618
|
+
receiver: z.ZodObject<{
|
|
619
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
620
|
+
value: z.ZodNumber;
|
|
621
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
622
|
+
}, "strip", z.ZodTypeAny, {
|
|
623
|
+
value: number;
|
|
624
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
625
|
+
minimumOrderValue: number;
|
|
626
|
+
}, {
|
|
627
|
+
value: number;
|
|
628
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
629
|
+
minimumOrderValue?: number | undefined;
|
|
630
|
+
}>;
|
|
631
|
+
}, "strict", z.ZodTypeAny, {
|
|
632
|
+
sender: {
|
|
633
|
+
value: number;
|
|
634
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
635
|
+
minimumOrderValue: number;
|
|
636
|
+
};
|
|
637
|
+
receiver: {
|
|
638
|
+
value: number;
|
|
639
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
640
|
+
minimumOrderValue: number;
|
|
641
|
+
};
|
|
642
|
+
}, {
|
|
643
|
+
sender: {
|
|
644
|
+
value: number;
|
|
645
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
646
|
+
minimumOrderValue?: number | undefined;
|
|
647
|
+
};
|
|
648
|
+
receiver: {
|
|
649
|
+
value: number;
|
|
650
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
651
|
+
minimumOrderValue?: number | undefined;
|
|
652
|
+
};
|
|
653
|
+
}>>>;
|
|
330
654
|
valueType: z.ZodOptional<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
331
655
|
value: z.ZodOptional<z.ZodNumber>;
|
|
332
656
|
secondaryCurrencyValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -377,6 +701,56 @@ declare const ReferralRewardCouponValidationSchema: z.ZodObject<{
|
|
|
377
701
|
user: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
378
702
|
referralCodeUsedBy: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
379
703
|
referralCodeUsedOnOrder: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
704
|
+
referralSettingSnapShot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
705
|
+
sender: z.ZodObject<{
|
|
706
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
707
|
+
value: z.ZodNumber;
|
|
708
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
709
|
+
}, "strip", z.ZodTypeAny, {
|
|
710
|
+
value: number;
|
|
711
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
712
|
+
minimumOrderValue: number;
|
|
713
|
+
}, {
|
|
714
|
+
value: number;
|
|
715
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
716
|
+
minimumOrderValue?: number | undefined;
|
|
717
|
+
}>;
|
|
718
|
+
receiver: z.ZodObject<{
|
|
719
|
+
valueType: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
720
|
+
value: z.ZodNumber;
|
|
721
|
+
minimumOrderValue: z.ZodDefault<z.ZodNumber>;
|
|
722
|
+
}, "strip", z.ZodTypeAny, {
|
|
723
|
+
value: number;
|
|
724
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
725
|
+
minimumOrderValue: number;
|
|
726
|
+
}, {
|
|
727
|
+
value: number;
|
|
728
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
729
|
+
minimumOrderValue?: number | undefined;
|
|
730
|
+
}>;
|
|
731
|
+
}, "strict", z.ZodTypeAny, {
|
|
732
|
+
sender: {
|
|
733
|
+
value: number;
|
|
734
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
735
|
+
minimumOrderValue: number;
|
|
736
|
+
};
|
|
737
|
+
receiver: {
|
|
738
|
+
value: number;
|
|
739
|
+
valueType: import("@lyxa.ai/core/dist/utilities/enum").ValueType;
|
|
740
|
+
minimumOrderValue: number;
|
|
741
|
+
};
|
|
742
|
+
}, {
|
|
743
|
+
sender: {
|
|
744
|
+
value: number;
|
|
745
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
746
|
+
minimumOrderValue?: number | undefined;
|
|
747
|
+
};
|
|
748
|
+
receiver: {
|
|
749
|
+
value: number;
|
|
750
|
+
valueType?: import("@lyxa.ai/core/dist/utilities/enum").ValueType | undefined;
|
|
751
|
+
minimumOrderValue?: number | undefined;
|
|
752
|
+
};
|
|
753
|
+
}>>>;
|
|
380
754
|
valueType: z.ZodOptional<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").ValueType>>;
|
|
381
755
|
value: z.ZodOptional<z.ZodNumber>;
|
|
382
756
|
secondaryCurrencyValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referral-reward-coupon.validation.d.ts","sourceRoot":"/","sources":["modules/coupon/validations/referral-reward-coupon.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"referral-reward-coupon.validation.d.ts","sourceRoot":"/","sources":["modules/coupon/validations/referral-reward-coupon.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAyB/D,QAAA,MACa,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAClC,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAC9B,4BAA4B,mNACxB,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACK,CAAC;AAKrD,OAAO,EACN,oCAAoC,EACpC,0BAA0B,EAC1B,4BAA4B,IAAI,sCAAsC,EACtE,gCAAgC,GAChC,CAAC;AAKF,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAC7F,MAAM,MAAM,uBAAuB,GAAG,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
|
|
@@ -5,12 +5,14 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const global_validation_1 = require("@lyxa.ai/core/dist/utilities/validation/global-validation");
|
|
6
6
|
const coupon_validation_1 = require("./coupon.validation");
|
|
7
7
|
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
8
|
+
const validations_1 = require("../../referral-setting/validations");
|
|
8
9
|
const baseFields = {
|
|
9
10
|
...coupon_validation_1.baseFields,
|
|
10
11
|
couponType: zod_1.z.literal(enum_1.CouponType.REFERRAL_REWARD),
|
|
11
12
|
user: global_validation_1.ZodValidation.objectId('User'),
|
|
12
13
|
referralCodeUsedBy: global_validation_1.ZodValidation.objectId('ReferralCodeUsedBy'),
|
|
13
14
|
referralCodeUsedOnOrder: global_validation_1.ZodValidation.objectId('ReferralCodeUsedOnOrder'),
|
|
15
|
+
referralSettingSnapShot: validations_1.ReferralSettingValidationSchema.optional(),
|
|
14
16
|
};
|
|
15
17
|
const schemaBuilder = (0, global_validation_1.createSchemaBuilder)(baseFields);
|
|
16
18
|
const { BaseSchema: ReferralRewardCouponValidationSchema, EntitySchema: ReferralRewardCouponSchema, IdSchema: ReferralRewardCouponIdSchema, UpdateSchema: UpdateReferralRewardCouponSchema, } = schemaBuilder.getAllSchemas({ createdAt: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referral-reward-coupon.validation.js","sourceRoot":"/","sources":["modules/coupon/validations/referral-reward-coupon.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,2DAAqE;AACrE,4DAA+D;
|
|
1
|
+
{"version":3,"file":"referral-reward-coupon.validation.js","sourceRoot":"/","sources":["modules/coupon/validations/referral-reward-coupon.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,2DAAqE;AACrE,4DAA+D;AAC/D,uEAAwF;AAKxF,MAAM,UAAU,GAAG;IAClB,GAAG,8BAAgB;IACnB,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,iBAAU,CAAC,eAAe,CAAC;IACjD,IAAI,EAAE,iCAAa,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpC,kBAAkB,EAAE,iCAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAChE,uBAAuB,EAAE,iCAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAC1E,uBAAuB,EAAE,6CAA+B,CAAC,QAAQ,EAAE;CACnE,CAAC;AAOF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AAKtD,MAAM,EACL,UAAU,EAAE,oCAAoC,EAChD,YAAY,EAAE,0BAA0B,EACxC,QAAQ,EAAE,4BAA4B,EACtC,YAAY,EAAE,gCAAgC,GAC9C,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAMpD,oFAAoC;AACpC,gEAA0B;AACM,8EAAsC;AACtE,4EAAgC","sourcesContent":["import { z } from 'zod';\nimport {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO,\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { baseFields as baseCouponFields } from './coupon.validation';\nimport { CouponType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { ReferralSettingValidationSchema } from '@modules/referral-setting/validations';\n\n/**\n * Define the base parent schema fields\n */\nconst baseFields = {\n\t...baseCouponFields,\n\tcouponType: z.literal(CouponType.REFERRAL_REWARD),\n\tuser: ZodValidation.objectId('User'),\n\treferralCodeUsedBy: ZodValidation.objectId('ReferralCodeUsedBy'),\n\treferralCodeUsedOnOrder: ZodValidation.objectId('ReferralCodeUsedOnOrder'),\n\treferralSettingSnapShot: ReferralSettingValidationSchema.optional(),\n};\n\n/**\n * Create schema builder for Parent entity\n * - Includes timestamps\n * - Excludes 'createdAt' from update operations\n */\nconst schemaBuilder = createSchemaBuilder(baseFields);\n\n/**\n * Get all schemas for the Parent entity\n */\nconst {\n\tBaseSchema: ReferralRewardCouponValidationSchema,\n\tEntitySchema: ReferralRewardCouponSchema,\n\tIdSchema: ReferralRewardCouponIdSchema,\n\tUpdateSchema: UpdateReferralRewardCouponSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\n/**\n * Export schemas\n */\nexport {\n\tReferralRewardCouponValidationSchema,\n\tReferralRewardCouponSchema,\n\tReferralRewardCouponIdSchema as ReferralRewardCouponIdValidationSchema,\n\tUpdateReferralRewardCouponSchema,\n};\n\n/**\n * Export DTO types\n */\nexport type CreateReferralRewardCouponDTO = DTO<typeof ReferralRewardCouponValidationSchema>;\nexport type ReferralRewardCouponDTO = DTO<typeof ReferralRewardCouponSchema>;\nexport type UpdateReferralRewardCouponDTO = DTO<typeof UpdateReferralRewardCouponSchema>;\n"]}
|
|
@@ -89,16 +89,16 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
89
89
|
}>;
|
|
90
90
|
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
91
91
|
input: {
|
|
92
|
-
|
|
92
|
+
query?: Record<string, any> | undefined;
|
|
93
93
|
search?: {
|
|
94
94
|
searchKey: string;
|
|
95
95
|
searchFields?: string[] | undefined;
|
|
96
96
|
} | undefined;
|
|
97
|
-
|
|
98
|
-
populate?: any;
|
|
97
|
+
sort?: Record<string, 1 | -1> | undefined;
|
|
99
98
|
size?: number | undefined;
|
|
100
99
|
page?: number | undefined;
|
|
101
|
-
|
|
100
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
101
|
+
populate?: any;
|
|
102
102
|
} | undefined;
|
|
103
103
|
output: {
|
|
104
104
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deal-setting.router.d.ts","sourceRoot":"/","sources":["modules/deal-setting/routers/deal-setting.router.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"deal-setting.router.d.ts","sourceRoot":"/","sources":["modules/deal-setting/routers/deal-setting.router.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAsBxB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deal-setting.service.d.ts","sourceRoot":"/","sources":["modules/deal-setting/services/deal-setting.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAoB,WAAW,IAAI,KAAK,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,EACN,oBAAoB,IAAI,SAAS,EACjC,oBAAoB,IAAI,SAAS,EACjC,mBAAmB,IAAI,YAAY,EACnC,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"deal-setting.service.d.ts","sourceRoot":"/","sources":["modules/deal-setting/services/deal-setting.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAoB,WAAW,IAAI,KAAK,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,EACN,oBAAoB,IAAI,SAAS,EACjC,oBAAoB,IAAI,SAAS,EACjC,mBAAmB,IAAI,YAAY,EACnC,MAAM,mCAAmC,CAAC;AAY3C,qBACa,kBAAkB;IAC9B,OAAO,CAAC,KAAK,CAAmD;IAChE,OAAO,CAAC,kBAAkB,CAcxB;;IAUW,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IA4BrE,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAkB5E,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YA2B1F,yBAAyB;IAyB1B,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IA4BjF,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAkB9E,8BAA8B;IAmB/B,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAoCzE;AAED,eAAO,MAAM,kBAAkB,oBAAoC,CAAC"}
|
|
@@ -61,7 +61,10 @@ let DealSettingService = class DealSettingService {
|
|
|
61
61
|
enum_1.ItemType.PET,
|
|
62
62
|
enum_1.ItemType.CLEANING,
|
|
63
63
|
enum_1.ItemType.LAUNDRY,
|
|
64
|
-
enum_1.ItemType.SALOON
|
|
64
|
+
enum_1.ItemType.SALOON,
|
|
65
|
+
enum_1.ItemType.WELLNESS,
|
|
66
|
+
enum_1.ItemType.ELECTRONICS,
|
|
67
|
+
enum_1.ItemType.BEAUTY,
|
|
65
68
|
];
|
|
66
69
|
constructor() {
|
|
67
70
|
this.model = models_1.DealSettingModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deal-setting.service.js","sourceRoot":"/","sources":["modules/deal-setting/services/deal-setting.service.ts"],"names":[],"mappings":";;;;;;;;;;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AAC,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,kBAAkB;aAC3B,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;QACnF,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,yBAAyB;aAClC,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,8BAA8B,CAClC,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAClC,iCAA0B,CAAC,0BAA0B,EACrD,MAAM,EACN,MAAM,CACN,CAAC;QAEF,OAAO,6BAA6B,CAAC;IACtC,CAAC;CACD,CAAA;AA9NY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,gBAAO,GAAE;;GACG,kBAAkB,CA8N9B;AAEY,QAAA,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { DocumentType, mongoose, ReturnModelType } from '@typegoose/typegoose';\nimport { FilterDTO, PaginatedResponse, DeleteDTO } from '@lyxa.ai/core/dist/utilities/validation';\nimport { createRawDocumentPaginatorObject, PaginatorOptions } from '@lyxa.ai/core/dist/utilities/pagination';\nimport { ModelType } from '@typegoose/typegoose/lib/types';\nimport { DealSettingModel, DealSetting as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {\n\tCreateDealSettingDTO as CreateDTO,\n\tUpdateDealSettingDTO as UpdateDTO,\n\tDealSettingArrayDTO as UpdateAllDTO,\n} from '@modules/deal-setting/validations';\nimport { SoftDeleteModel } from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport { publishEvent } from '@lyxa.ai/core/dist/libraries/event';\nimport { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';\nimport { AdminActivityLogsEvent } from '@lyxa.ai/core/dist/libraries/event/events/admin-logs-event';\nimport { AdminLogsUpdatedFieldsType, ItemType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { badRequestError, internalServerError, notFoundError } from '@lyxa.ai/core/dist/utilities/error-common';\n\n@Service()\nexport class DealSettingService {\n\tprivate model: typeof DealSettingModel & SoftDeleteModel<Model>;\n\tprivate ALLOWED_ITEM_TYPES = [\n\t\tItemType.FOOD,\n\t\tItemType.GROCERY,\n\t\t// ItemType.COFFEE, // removed because https://trello.com/c/x19zLU0A/2935-marketing-remove-coffee\n\t\tItemType.FLOWER,\n\t\tItemType.PET,\n\t\t// ItemType.PHARMACY,\n\t\t// ItemType.HEALTHY_CORNER,\n\t\tItemType.CLEANING,\n\t\tItemType.LAUNDRY,\n\t\tItemType.SALOON\n\t];\n\n\tconstructor() {\n\t\tthis.model = DealSettingModel as typeof DealSettingModel & SoftDeleteModel<Model>;\n\t}\n\n\t/**\n\t * Create a new record\n\t * @param data Data for the new record\n\t */\n\tpublic async create(data: CreateDTO, admin?: string): Promise<DocumentType<Model>> {\n\t\tconst exists = await this.model.exists({\n\t\t\titemType: data.itemType,\n\t\t});\n\t\tif (exists) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'CONFLICT',\n\t\t\t\tmessage: `Deal settings for itemType ${data.itemType} already exists. Please update the existing settings.`,\n\t\t\t});\n\t\t}\n\t\tconst result = await this.model.create(data);\n\n\t\tif (admin) {\n\t\t\tthis.logMarketingSettingAdminAction(\n\t\t\t\tnew mongoose.Types.ObjectId(admin),\n\t\t\t\tAdminLogsUpdatedFieldsType.CREATED_MARKETING_SETTINGS,\n\t\t\t\t'',\n\t\t\t\tresult\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Get record by ID\n\t * @param id ID of the record\n\t */\n\tpublic async findById(id: string | mongoose.Types.ObjectId): Promise<DocumentType<Model>> {\n\t\tconst result = await this.model.findOne({\n\t\t\t_id: id,\n\t\t\tdeletedAt: null,\n\t\t});\n\t\tif (!result) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Record not found',\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Get records\n\t * @param query Query to find records\n\t */\n\tpublic async find(data?: Partial<FilterDTO>): Promise<PaginatedResponse<DocumentType<ModelType<Model>>>> {\n\t\ttry {\n\t\t\tconst query = data?.query ?? {}\n\t\t\tquery.itemType = { $in: this.ALLOWED_ITEM_TYPES }\n\n\t\t\tconst paginate = createRawDocumentPaginatorObject(this.model as ReturnModelType<typeof this.model>);\n\t\t\tconst options: PaginatorOptions<typeof Model> = {\n\t\t\t\tpage: data?.page,\n\t\t\t\tsize: data?.size,\n\t\t\t\tsort: data?.sort,\n\t\t\t\tquery,\n\t\t\t\tselect: data?.select,\n\t\t\t\tpopulate: data?.populate,\n\t\t\t};\n\t\t\tlet paginatedResult = await paginate(options);\n\n\t\t\tif (!data?.query && paginatedResult.metadata.totalElements < this.ALLOWED_ITEM_TYPES.length) {\n\t\t\t\tawait this.createDefaultDealSettings(paginatedResult.documents as unknown as DocumentType<Model>[]);\n\t\t\t\tpaginatedResult = await paginate(options);\n\t\t\t}\n\n\t\t\treturn paginatedResult;\n\t\t} catch (err) {\n\t\t\tinternalServerError(`err: ${err}`);\n\t\t}\n\t}\n\n\tprivate async createDefaultDealSettings(documents: DocumentType<Model>[]): Promise<void> {\n\t\tconst existingItemTypes = documents.map(deal => deal.itemType);\n\t\tconst newItemTypes = this.ALLOWED_ITEM_TYPES.filter(item => !existingItemTypes.includes(item));\n\t\tconst defaultSetting = {\n\t\t\tpercentageBundles: [],\n\t\t\tisDiscount: false,\n\t\t\tisBuy1Get1: false,\n\t\t\tisFreeDelivery: false,\n\t\t\tisPunchMarketing: false,\n\t\t};\n\n\t\tfor (const item of newItemTypes) {\n\t\t\tawait this.create({\n\t\t\t\t...defaultSetting,\n\t\t\t\titemType: item as ItemType,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Update record\n\t * @param id ID of the record\n\t * @param data Data to update\n\t * @param admin Admin id\n\t */\n\tpublic async update(id: string, data: UpdateDTO, admin?: string): Promise<DocumentType<Model>> {\n\t\tif (!admin) notFoundError('Admin not found');\n\n\t\tconst record = await this.model.findById(id);\n\t\tif (!record) notFoundError('Record not found');\n\n\t\tconst result = await this.model.findByIdAndUpdate(id, data, {\n\t\t\tnew: true,\n\t\t\trunValidators: true,\n\t\t});\n\n\t\tif (!result) notFoundError('Record not found');\n\n\t\tthis.logMarketingSettingAdminAction(\n\t\t\tnew mongoose.Types.ObjectId(admin),\n\t\t\tAdminLogsUpdatedFieldsType.CHANGE_IN_MARKETING_SETTINGS,\n\t\t\trecord,\n\t\t\tresult\n\t\t);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Update all records\n\t * @param data Data to update\n\t * @param admin Admin id\n\t */\n\tpublic async updateAll(data: UpdateAllDTO[], admin?: string): Promise<DocumentType<Model>[]> {\n\t\t// Check admin existence\n\t\tif (!admin) notFoundError('Admin not found');\n\n\t\tconst results: DocumentType<Model>[] = [];\n\n\t\tfor (const dealSetting of data) {\n\t\t\tconst { _id, ...rest } = dealSetting as UpdateAllDTO & { _id: string | mongoose.Types.ObjectId };\n\n\t\t\tif (!_id) continue;\n\n\t\t\tconst updated = await this.update(String(_id), rest as UpdateAllDTO, admin);\n\t\t\tresults.push(updated);\n\t\t}\n\n\t\treturn results;\n\t}\n\n\tprivate async logMarketingSettingAdminAction(\n\t\tadmin: mongoose.Types.ObjectId,\n\t\tactionType: AdminLogsUpdatedFieldsType,\n\t\toldDocument?: any,\n\t\tnewDocument?: any\n\t) {\n\t\tconst adminActivityLogsEvent: BaseEvent<Record<string, unknown>> = new AdminActivityLogsEvent({\n\t\t\tadmin,\n\t\t\tupdatedField: actionType,\n\t\t\toldDocument: oldDocument ?? '',\n\t\t\tnewDocument: newDocument ?? '',\n\t\t});\n\t\tawait publishEvent(adminActivityLogsEvent);\n\t}\n\n\t/**\n\t * Delete record\n\t * @param data Data for delete\n\t */\n\tpublic async deleteById(data: DeleteDTO, admin?: string): Promise<string> {\n\t\tconst { _id, softDelete } = data;\n\n\t\tif (!admin) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Admin not found',\n\t\t\t});\n\t\t}\n\n\t\tconst record = await this.model.findById(_id);\n\n\t\tif (!record) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Record not found',\n\t\t\t});\n\t\t}\n\n\t\tconst result = await this.model.deleteRecord({ _id, deletedAt: null }, softDelete);\n\t\tif (!result) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'INTERNAL_SERVER_ERROR',\n\t\t\t\tmessage: 'Unable to delete record',\n\t\t\t});\n\t\t}\n\n\t\tthis.logMarketingSettingAdminAction(\n\t\t\tnew mongoose.Types.ObjectId(admin),\n\t\t\tAdminLogsUpdatedFieldsType.DELETED_MARKETING_SETTINGS,\n\t\t\trecord,\n\t\t\tresult\n\t\t);\n\n\t\treturn 'Record deleted successfully';\n\t}\n}\n\nexport const dealSettingService = Container.get(DealSettingService);\n"]}
|
|
1
|
+
{"version":3,"file":"deal-setting.service.js","sourceRoot":"/","sources":["modules/deal-setting/services/deal-setting.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AACzC,oDA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;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,kBAAkB;aAC3B,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;QACnF,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,yBAAyB;aAClC,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,8BAA8B,CAClC,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAClC,iCAA0B,CAAC,0BAA0B,EACrD,MAAM,EACN,MAAM,CACN,CAAC;QAEF,OAAO,6BAA6B,CAAC;IACtC,CAAC;CACD,CAAA;AAjOY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,gBAAO,GAAE;;GACG,kBAAkB,CAiO9B;AAEY,QAAA,kBAAkB,GAAG,gBAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { DocumentType, mongoose, ReturnModelType } from '@typegoose/typegoose';\nimport { FilterDTO, PaginatedResponse, DeleteDTO } from '@lyxa.ai/core/dist/utilities/validation';\nimport { createRawDocumentPaginatorObject, PaginatorOptions } from '@lyxa.ai/core/dist/utilities/pagination';\nimport { ModelType } from '@typegoose/typegoose/lib/types';\nimport { DealSettingModel, DealSetting as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {\n\tCreateDealSettingDTO as CreateDTO,\n\tUpdateDealSettingDTO as UpdateDTO,\n\tDealSettingArrayDTO as UpdateAllDTO,\n} from '@modules/deal-setting/validations';\nimport { SoftDeleteModel } from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport { publishEvent } from '@lyxa.ai/core/dist/libraries/event';\nimport { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';\nimport { AdminActivityLogsEvent } from '@lyxa.ai/core/dist/libraries/event/events/admin-logs-event';\nimport { AdminLogsUpdatedFieldsType, ItemType } from '@lyxa.ai/core/dist/utilities/enum';\nimport {\n\tbadRequestError,\n\tinternalServerError,\n\tnotFoundError,\n} from '@lyxa.ai/core/dist/utilities/error-common';\n\n@Service()\nexport class DealSettingService {\n\tprivate model: typeof DealSettingModel & SoftDeleteModel<Model>;\n\tprivate ALLOWED_ITEM_TYPES = [\n\t\tItemType.FOOD,\n\t\tItemType.GROCERY,\n\t\t// ItemType.COFFEE, // removed because https://trello.com/c/x19zLU0A/2935-marketing-remove-coffee\n\t\tItemType.FLOWER,\n\t\tItemType.PET,\n\t\t// ItemType.PHARMACY,\n\t\t// ItemType.HEALTHY_CORNER,\n\t\tItemType.CLEANING,\n\t\tItemType.LAUNDRY,\n\t\tItemType.SALOON,\n\t\tItemType.WELLNESS,\n\t\tItemType.ELECTRONICS,\n\t\tItemType.BEAUTY,\n\t];\n\n\tconstructor() {\n\t\tthis.model = DealSettingModel as typeof DealSettingModel & SoftDeleteModel<Model>;\n\t}\n\n\t/**\n\t * Create a new record\n\t * @param data Data for the new record\n\t */\n\tpublic async create(data: CreateDTO, admin?: string): Promise<DocumentType<Model>> {\n\t\tconst exists = await this.model.exists({\n\t\t\titemType: data.itemType,\n\t\t});\n\t\tif (exists) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'CONFLICT',\n\t\t\t\tmessage: `Deal settings for itemType ${data.itemType} already exists. Please update the existing settings.`,\n\t\t\t});\n\t\t}\n\t\tconst result = await this.model.create(data);\n\n\t\tif (admin) {\n\t\t\tthis.logMarketingSettingAdminAction(\n\t\t\t\tnew mongoose.Types.ObjectId(admin),\n\t\t\t\tAdminLogsUpdatedFieldsType.CREATED_MARKETING_SETTINGS,\n\t\t\t\t'',\n\t\t\t\tresult\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Get record by ID\n\t * @param id ID of the record\n\t */\n\tpublic async findById(id: string | mongoose.Types.ObjectId): Promise<DocumentType<Model>> {\n\t\tconst result = await this.model.findOne({\n\t\t\t_id: id,\n\t\t\tdeletedAt: null,\n\t\t});\n\t\tif (!result) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Record not found',\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Get records\n\t * @param query Query to find records\n\t */\n\tpublic async find(data?: Partial<FilterDTO>): Promise<PaginatedResponse<DocumentType<ModelType<Model>>>> {\n\t\ttry {\n\t\t\tconst query = data?.query ?? {};\n\t\t\tquery.itemType = { $in: this.ALLOWED_ITEM_TYPES };\n\n\t\t\tconst paginate = createRawDocumentPaginatorObject(this.model as ReturnModelType<typeof this.model>);\n\t\t\tconst options: PaginatorOptions<typeof Model> = {\n\t\t\t\tpage: data?.page,\n\t\t\t\tsize: data?.size,\n\t\t\t\tsort: data?.sort,\n\t\t\t\tquery,\n\t\t\t\tselect: data?.select,\n\t\t\t\tpopulate: data?.populate,\n\t\t\t};\n\t\t\tlet paginatedResult = await paginate(options);\n\n\t\t\tif (!data?.query && paginatedResult.metadata.totalElements < this.ALLOWED_ITEM_TYPES.length) {\n\t\t\t\tawait this.createDefaultDealSettings(paginatedResult.documents as unknown as DocumentType<Model>[]);\n\t\t\t\tpaginatedResult = await paginate(options);\n\t\t\t}\n\n\t\t\treturn paginatedResult;\n\t\t} catch (err) {\n\t\t\tinternalServerError(`err: ${err}`);\n\t\t}\n\t}\n\n\tprivate async createDefaultDealSettings(documents: DocumentType<Model>[]): Promise<void> {\n\t\tconst existingItemTypes = documents.map(deal => deal.itemType);\n\t\tconst newItemTypes = this.ALLOWED_ITEM_TYPES.filter(item => !existingItemTypes.includes(item));\n\t\tconst defaultSetting = {\n\t\t\tpercentageBundles: [],\n\t\t\tisDiscount: false,\n\t\t\tisBuy1Get1: false,\n\t\t\tisFreeDelivery: false,\n\t\t\tisPunchMarketing: false,\n\t\t};\n\n\t\tfor (const item of newItemTypes) {\n\t\t\tawait this.create({\n\t\t\t\t...defaultSetting,\n\t\t\t\titemType: item as ItemType,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Update record\n\t * @param id ID of the record\n\t * @param data Data to update\n\t * @param admin Admin id\n\t */\n\tpublic async update(id: string, data: UpdateDTO, admin?: string): Promise<DocumentType<Model>> {\n\t\tif (!admin) notFoundError('Admin not found');\n\n\t\tconst record = await this.model.findById(id);\n\t\tif (!record) notFoundError('Record not found');\n\n\t\tconst result = await this.model.findByIdAndUpdate(id, data, {\n\t\t\tnew: true,\n\t\t\trunValidators: true,\n\t\t});\n\n\t\tif (!result) notFoundError('Record not found');\n\n\t\tthis.logMarketingSettingAdminAction(\n\t\t\tnew mongoose.Types.ObjectId(admin),\n\t\t\tAdminLogsUpdatedFieldsType.CHANGE_IN_MARKETING_SETTINGS,\n\t\t\trecord,\n\t\t\tresult\n\t\t);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Update all records\n\t * @param data Data to update\n\t * @param admin Admin id\n\t */\n\tpublic async updateAll(data: UpdateAllDTO[], admin?: string): Promise<DocumentType<Model>[]> {\n\t\t// Check admin existence\n\t\tif (!admin) notFoundError('Admin not found');\n\n\t\tconst results: DocumentType<Model>[] = [];\n\n\t\tfor (const dealSetting of data) {\n\t\t\tconst { _id, ...rest } = dealSetting as UpdateAllDTO & { _id: string | mongoose.Types.ObjectId };\n\n\t\t\tif (!_id) continue;\n\n\t\t\tconst updated = await this.update(String(_id), rest as UpdateAllDTO, admin);\n\t\t\tresults.push(updated);\n\t\t}\n\n\t\treturn results;\n\t}\n\n\tprivate async logMarketingSettingAdminAction(\n\t\tadmin: mongoose.Types.ObjectId,\n\t\tactionType: AdminLogsUpdatedFieldsType,\n\t\toldDocument?: any,\n\t\tnewDocument?: any\n\t) {\n\t\tconst adminActivityLogsEvent: BaseEvent<Record<string, unknown>> = new AdminActivityLogsEvent({\n\t\t\tadmin,\n\t\t\tupdatedField: actionType,\n\t\t\toldDocument: oldDocument ?? '',\n\t\t\tnewDocument: newDocument ?? '',\n\t\t});\n\t\tawait publishEvent(adminActivityLogsEvent);\n\t}\n\n\t/**\n\t * Delete record\n\t * @param data Data for delete\n\t */\n\tpublic async deleteById(data: DeleteDTO, admin?: string): Promise<string> {\n\t\tconst { _id, softDelete } = data;\n\n\t\tif (!admin) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Admin not found',\n\t\t\t});\n\t\t}\n\n\t\tconst record = await this.model.findById(_id);\n\n\t\tif (!record) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: 'Record not found',\n\t\t\t});\n\t\t}\n\n\t\tconst result = await this.model.deleteRecord({ _id, deletedAt: null }, softDelete);\n\t\tif (!result) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'INTERNAL_SERVER_ERROR',\n\t\t\t\tmessage: 'Unable to delete record',\n\t\t\t});\n\t\t}\n\n\t\tthis.logMarketingSettingAdminAction(\n\t\t\tnew mongoose.Types.ObjectId(admin),\n\t\t\tAdminLogsUpdatedFieldsType.DELETED_MARKETING_SETTINGS,\n\t\t\trecord,\n\t\t\tresult\n\t\t);\n\n\t\treturn 'Record deleted successfully';\n\t}\n}\n\nexport const dealSettingService = Container.get(DealSettingService);\n"]}
|
|
@@ -121,16 +121,16 @@ export declare const featuredSettingRouter: import("@trpc/server").TRPCBuiltRout
|
|
|
121
121
|
}>;
|
|
122
122
|
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
123
123
|
input: {
|
|
124
|
-
|
|
124
|
+
query?: Record<string, any> | undefined;
|
|
125
125
|
search?: {
|
|
126
126
|
searchKey: string;
|
|
127
127
|
searchFields?: string[] | undefined;
|
|
128
128
|
} | undefined;
|
|
129
|
-
|
|
130
|
-
populate?: any;
|
|
129
|
+
sort?: Record<string, 1 | -1> | undefined;
|
|
131
130
|
size?: number | undefined;
|
|
132
131
|
page?: number | undefined;
|
|
133
|
-
|
|
132
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
133
|
+
populate?: any;
|
|
134
134
|
} | undefined;
|
|
135
135
|
output: {
|
|
136
136
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featured-setting.router.d.ts","sourceRoot":"/","sources":["modules/featured-setting/routers/featured-setting.router.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAmB/B,
|
|
1
|
+
{"version":3,"file":"featured-setting.router.d.ts","sourceRoot":"/","sources":["modules/featured-setting/routers/featured-setting.router.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAmB/B,CAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featured-setting.service.d.ts","sourceRoot":"/","sources":["modules/featured-setting/services/featured-setting.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAwB,eAAe,IAAI,KAAK,EAAE,MAAM,4CAA4C,CAAC;AAC5G,OAAO,EACN,wBAAwB,IAAI,SAAS,EACrC,wBAAwB,IAAI,SAAS,EACrC,MAAM,uCAAuC,CAAC;AAO/C,qBACa,sBAAsB;IAClC,OAAO,CAAC,KAAK,CAAuD;IACpE,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"featured-setting.service.d.ts","sourceRoot":"/","sources":["modules/featured-setting/services/featured-setting.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAwB,eAAe,IAAI,KAAK,EAAE,MAAM,4CAA4C,CAAC;AAC5G,OAAO,EACN,wBAAwB,IAAI,SAAS,EACrC,wBAAwB,IAAI,SAAS,EACrC,MAAM,uCAAuC,CAAC;AAO/C,qBACa,sBAAsB;IAClC,OAAO,CAAC,KAAK,CAAuD;IACpE,OAAO,CAAC,UAAU,CAWhB;;IAUW,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IA4BrE,QAAQ,CAAC,EAAE,EAAE,M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