@lyxa.ai/marketing 1.0.64 → 1.0.67
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 +0 -1
- package/dist/lib/event/event-initializations.js.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.d.ts +0 -1
- package/dist/lib/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.js +12 -62
- package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
- package/dist/lib/event/events/marketing-product-seed.event.d.ts +2 -1
- package/dist/lib/event/events/marketing-product-seed.event.d.ts.map +1 -1
- package/dist/lib/event/events/marketing-product-seed.event.js.map +1 -1
- package/dist/lib/index.d.ts +127 -347
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +0 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts +27 -27
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.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 +18 -3
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js.map +1 -1
- package/dist/lib/modules/coupon/validations/all-coupons.validation.d.ts +6 -6
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +30 -30
- package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js +1 -4
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js.map +1 -1
- package/dist/lib/modules/deal-setting/routers/deal-setting.router.d.ts +9 -9
- 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 +1 -4
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
- package/dist/lib/modules/deal-setting/validations/deal-setting.validation.d.ts +6 -6
- package/dist/lib/modules/featured-setting/routers/featured-setting.router.d.ts +8 -8
- 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 +0 -3
- package/dist/lib/modules/featured-setting/services/featured-setting.service.js.map +1 -1
- package/dist/lib/modules/featured-setting/validations/featured-setting.validation.d.ts +6 -6
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +14 -60
- 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 +0 -11
- 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 +0 -6
- 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 +1 -0
- 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 +6 -2
- 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 +3 -16
- 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 +3 -22
- 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 +0 -2
- 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 +0 -12
- 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 +64 -271
- 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 +1 -19
- 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 +1 -10
- 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 +1 -78
- 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 +0 -3
- 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 +8 -66
- 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 +19 -41
- 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/config/limited-time-offer-config.validation.d.ts +6 -6
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer.router.d.ts +3 -3
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +22 -253
- 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 +0 -2
- 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 +4 -10
- 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 +3 -30
- 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 +1 -23
- 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 +0 -18
- 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 +0 -103
- 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 +4 -189
- 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 +0 -29
- 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.validation.d.ts +127 -526
- 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 +6 -16
- 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 +4 -11
- 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 +7 -48
- 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 +5 -18
- 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 +17 -98
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts +14 -3
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.js +4 -0
- package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +2 -7
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +49 -85
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +3 -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 +13 -42
- package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts +13 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/spend-to-get-progress.service.js +24 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.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 +27 -95
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/validations/all-marketings.validation.d.ts +4 -4
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +3 -3
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +3 -3
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +8 -0
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.js +4 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +12 -12
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/dist/lib/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +8 -8
- package/dist/lib/modules/referral-setting/routers/referral-setting.router.d.ts +4 -4
- package/dist/lib/modules/referral-setting/validations/referral-setting.validation.d.ts +6 -6
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts +10 -10
- 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.validation.d.ts +6 -6
- package/dist/lib/modules/tournament/config/config.router.d.ts +4 -4
- package/dist/lib/modules/tournament/config/config.validation.d.ts +12 -12
- package/dist/lib/modules/tournament/match/match.router.d.ts +5 -5
- package/dist/lib/modules/tournament/match/match.validation.d.ts +12 -12
- package/dist/lib/modules/tournament/participant/participant.router.d.ts +3 -3
- package/dist/lib/modules/tournament/participant/participant.validation.d.ts +24 -24
- package/dist/lib/modules/tournament/prediction/prediction.router.d.ts +3 -3
- package/dist/lib/modules/tournament/prediction/prediction.validation.d.ts +18 -18
- package/dist/lib/modules/tournament/score/score.router.d.ts +1 -1
- package/dist/lib/modules/tournament/score/score.validation.d.ts +6 -6
- package/dist/lib/modules/tournament/statistics/statistics.router.d.ts +1 -1
- package/dist/lib/modules/tournament/statistics/statistics.validation.d.ts +6 -6
- package/dist/lib/modules/tournament/team/team.router.d.ts +3 -3
- package/dist/lib/modules/tournament/team/team.validation.d.ts +18 -18
- package/dist/lib/modules/tournament/tournament.router.d.ts +21 -21
- package/dist/lib/modules/tournament/tournament.validation.d.ts +6 -6
- package/dist/lib/utility/feature-flags.d.ts +3 -0
- package/dist/lib/utility/feature-flags.d.ts.map +1 -0
- package/dist/lib/utility/feature-flags.js +16 -0
- package/dist/lib/utility/feature-flags.js.map +1 -0
- package/dist/types/event/event-initializations.d.ts.map +1 -1
- package/dist/types/event/event-listeners/event-listeners.d.ts +0 -1
- package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/types/event/events/marketing-product-seed.event.d.ts +2 -1
- package/dist/types/event/events/marketing-product-seed.event.d.ts.map +1 -1
- package/dist/types/index.d.ts +127 -347
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +27 -27
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/all-coupons.validation.d.ts +6 -6
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts +30 -30
- package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/deal-setting/routers/deal-setting.router.d.ts +9 -9
- 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/deal-setting/validations/deal-setting.validation.d.ts +6 -6
- package/dist/types/modules/featured-setting/routers/featured-setting.router.d.ts +8 -8
- 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/featured-setting/validations/featured-setting.validation.d.ts +6 -6
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +14 -60
- 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 +1 -0
- 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 +3 -16
- 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 +0 -2
- 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 +64 -271
- 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 +1 -10
- 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 +0 -3
- 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/config/limited-time-offer-config.validation.d.ts +6 -6
- package/dist/types/modules/limited-time-offer/config/limited-time-offer.router.d.ts +3 -3
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +22 -253
- 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 +0 -2
- 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 +3 -30
- 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 +0 -18
- 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 +4 -189
- 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.validation.d.ts +127 -526
- 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 +4 -11
- 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 +5 -18
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/routers/marketing.router.d.ts +14 -3
- package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts +2 -7
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts +3 -7
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/spend-to-get-progress.service.d.ts +18 -0
- package/dist/types/modules/marketing/services/spend-to-get-progress.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/validations/all-marketings.validation.d.ts +4 -4
- package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +3 -3
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +3 -3
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts +8 -0
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
- package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +12 -12
- package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/dist/types/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +8 -8
- package/dist/types/modules/referral-setting/routers/referral-setting.router.d.ts +4 -4
- package/dist/types/modules/referral-setting/validations/referral-setting.validation.d.ts +6 -6
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts +10 -10
- 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.validation.d.ts +6 -6
- package/dist/types/modules/tournament/config/config.router.d.ts +4 -4
- package/dist/types/modules/tournament/config/config.validation.d.ts +12 -12
- package/dist/types/modules/tournament/match/match.router.d.ts +5 -5
- package/dist/types/modules/tournament/match/match.validation.d.ts +12 -12
- package/dist/types/modules/tournament/participant/participant.router.d.ts +3 -3
- package/dist/types/modules/tournament/participant/participant.validation.d.ts +24 -24
- package/dist/types/modules/tournament/prediction/prediction.router.d.ts +3 -3
- package/dist/types/modules/tournament/prediction/prediction.validation.d.ts +18 -18
- package/dist/types/modules/tournament/score/score.router.d.ts +1 -1
- package/dist/types/modules/tournament/score/score.validation.d.ts +6 -6
- package/dist/types/modules/tournament/statistics/statistics.router.d.ts +1 -1
- package/dist/types/modules/tournament/statistics/statistics.validation.d.ts +6 -6
- package/dist/types/modules/tournament/team/team.router.d.ts +3 -3
- package/dist/types/modules/tournament/team/team.validation.d.ts +18 -18
- package/dist/types/modules/tournament/tournament.router.d.ts +21 -21
- package/dist/types/modules/tournament/tournament.validation.d.ts +6 -6
- package/dist/types/utility/feature-flags.d.ts +12 -0
- package/dist/types/utility/feature-flags.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/lib/modules/spend-to-get-history/routers/index.d.ts +0 -2
- package/dist/lib/modules/spend-to-get-history/routers/index.d.ts.map +0 -1
- package/dist/lib/modules/spend-to-get-history/routers/index.js +0 -18
- package/dist/lib/modules/spend-to-get-history/routers/index.js.map +0 -1
- package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js +0 -62
- package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js.map +0 -1
- package/dist/lib/modules/spend-to-get-history/services/index.d.ts +0 -2
- package/dist/lib/modules/spend-to-get-history/services/index.d.ts.map +0 -1
- package/dist/lib/modules/spend-to-get-history/services/index.js +0 -18
- package/dist/lib/modules/spend-to-get-history/services/index.js.map +0 -1
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +0 -24
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts.map +0 -1
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.js +0 -136
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.js.map +0 -1
- package/dist/lib/modules/spend-to-get-history/validations/index.d.ts +0 -2
- package/dist/lib/modules/spend-to-get-history/validations/index.d.ts.map +0 -1
- package/dist/lib/modules/spend-to-get-history/validations/index.js +0 -18
- package/dist/lib/modules/spend-to-get-history/validations/index.js.map +0 -1
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +0 -232
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +0 -1
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js +0 -30
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js.map +0 -1
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts +0 -2
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts.map +0 -1
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js +0 -15
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js.map +0 -1
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts +0 -14
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts.map +0 -1
- package/dist/lib/modules/tournament/match/events/match-ended.event.js +0 -12
- package/dist/lib/modules/tournament/match/events/match-ended.event.js.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts +0 -10
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js +0 -23
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts +0 -9
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.js +0 -82
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.js.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts +0 -10
- package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.schedule.config.js +0 -15
- package/dist/lib/modules/tournament/notification/notification.schedule.config.js.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts +0 -10
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts.map +0 -1
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.js +0 -73
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.js.map +0 -1
- package/dist/types/events/event-initializations.d.ts +0 -2
- package/dist/types/events/event-initializations.d.ts.map +0 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +0 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +0 -1
- package/dist/types/modules/spend-to-get-history/routers/index.d.ts +0 -2
- package/dist/types/modules/spend-to-get-history/routers/index.d.ts.map +0 -1
- package/dist/types/modules/spend-to-get-history/services/index.d.ts +0 -2
- package/dist/types/modules/spend-to-get-history/services/index.d.ts.map +0 -1
- package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +0 -56
- package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts.map +0 -1
- package/dist/types/modules/spend-to-get-history/validations/index.d.ts +0 -2
- package/dist/types/modules/spend-to-get-history/validations/index.d.ts.map +0 -1
- package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +0 -241
- package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +0 -1
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts +0 -201
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts.map +0 -1
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts +0 -2
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts.map +0 -1
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts +0 -14
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts +0 -10
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts +0 -9
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts +0 -10
- package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts.map +0 -1
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts +0 -10
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CouponMetricsRepository.js","sourceRoot":"/","sources":["modules/coupon/services/patterns/repository/CouponMetricsRepository.ts"],"names":[],"mappings":";;;AAAA,sEAA4F;AAE5F,8DAA2D;AAC3D,4DAO2C;AAC3C,gEAAwE;AACxE,4DAAiE;AASjE,oDAAgD;AAChD,0CAAoD;AAEpD,MAAa,uBAAuB;IAClB,KAAK,CAAqB;IACnC,UAAU,CAAoB;IAEtC;QACC,IAAI,CAAC,KAAK,GAAG,oBAAiC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,mBAA+B,CAAC;IACnD,CAAC;IAEO,mBAAmB;QAC1B,OAAO;YACN,cAAc,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;YAClC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,iBAAU,CAAC,aAAa,EAAE,iBAAU,CAAC,eAAe,CAAC,EAAE;YAC5E,SAAS,EAAE,IAAI;SACf,CAAC;IACH,CAAC;IAEO,qCAAqC,CAC5C,SAAe,EACf,OAAa;QAEb,OAAO;YACN,GAAG,IAAI,CAAC,mBAAmB,EAAE;YAC7B,SAAS,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,OAAO;aACb;SACD,CAAC;IACH,CAAC;IAEO,mBAAmB,CAAC,SAAe,EAAE,OAAa;QACzD,OAAO;YACN,QAAQ,EAAE;gBACT,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,OAAO;aACb;YACD,MAAM,EAAE,yBAAkB,CAAC,SAAS;YACpC,+BAA+B,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE;SAC9C,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,qBAAqB,CAAC,GAAS;QAC5C,O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,EAAE;iBACnC;aACD;SACD,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,IAAI,CAAC,CAAC,CAAC;QACxD,MAAM,WAAW,GAAG,IAAA,0BAAiB,EAAC,MAAM,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC;QAChE,MAAM,UAAU,GAAG,MAAM,EAAE,UAAU,IAAI,CAAC,CAAC;QAE3C,OAAO;YACN,UAAU;YACV,eAAe,EAAE,UAAU;YAC3B,OAAO;YACP,WAAW;YACX,cAAc,EAAE,MAAM,EAAE,cAAc,IAAI,CAAC;YAC3C,GAAG,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAiB,EAAC,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;SACnE,CAAC;IACH,CAAC;CACD;AAtyBD,0DAsyBC","sourcesContent":["import { Coupon, CouponModel, OrderModel } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { Duration } from '@lyxa.ai/core/dist/libraries/mongo/models/shared/duration.model';\nimport { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\nimport {\n\tCouponType,\n\tGraphType,\n\tItemType,\n\tOrderType,\n\tRegularOrderStatus,\n\tStatus,\n} from '@lyxa.ai/core/dist/utilities/enum';\nimport { roundBaseCurrency } from '@lyxa.ai/core/dist/utilities/shared';\nimport { LyxaTimezone } from '@lyxa.ai/core/dist/utilities/time';\nimport {\n\tCouponMetricsByTypeDTO,\n\tCouponMetricsOutputDTO,\n\tDateInputDTO,\n\tGraphDTO,\n\tGraphInputDTO,\n\tTotalProfitGraphDTO,\n} from '@modules/coupon/validations/coupon.validation';\nimport { mongoose } from '@typegoose/typegoose';\nimport { fillMissingPeriods } from '@utility/utils';\n\nexport class CouponMetricsRepository {\n\tprivate readonly model: typeof CouponModel;\n\tprivate orderModel: typeof OrderModel;\n\n\tconstructor() {\n\t\tthis.model = CouponModel as typeof CouponModel;\n\t\tthis.orderModel = OrderModel as typeof OrderModel;\n\t}\n\n\tprivate getBaseCouponFilter(): mongoose.FilterQuery<Coupon> {\n\t\treturn {\n\t\t\tupdatedVersion: { $exists: false },\n\t\t\tcouponType: { $nin: [CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD] },\n\t\t\tdeletedAt: null,\n\t\t};\n\t}\n\n\tprivate getCouponCreatedWithinDateRangeFilter(\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): mongoose.FilterQuery<Coupon> {\n\t\treturn {\n\t\t\t...this.getBaseCouponFilter(),\n\t\t\tcreatedAt: {\n\t\t\t\t$gte: startDate,\n\t\t\t\t$lte: endDate,\n\t\t\t},\n\t\t};\n\t}\n\n\tprivate getCouponOrderMatch(startDate: Date, endDate: Date): mongoose.PipelineStage.Match['$match'] {\n\t\treturn {\n\t\t\tplacedAt: {\n\t\t\t\t$gte: startDate,\n\t\t\t\t$lte: endDate,\n\t\t\t},\n\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t\t'adjustedFinance.coupon.coupon': { $ne: null },\n\t\t};\n\t}\n\n\tprivate async getActiveCouponsCount(now: Date): Promise<number> {\n\t\treturn this.model.countDocuments({\n\t\t\tupdatedVersion: { $exists: false },\n\n\t\t\tcouponType: {\n\t\t\t\t$nin: [CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD],\n\t\t\t},\n\n\t\t\tstatus: Status.ACTIVE,\n\n\t\t\tdeletedAt: null,\n\n\t\t\t'duration.start': { $lte: now },\n\n\t\t\t$or: [\n\t\t\t\t{ 'duration.end': { $exists: false } },\n\t\t\t\t{ 'duration.end': null },\n\t\t\t\t{ 'duration.end': { $gte: now } },\n\t\t\t],\n\t\t});\n\t}\n\tprivate async getTotalCreatedCoupons(startDate: Date, endDate: Date) {\n\t\treturn this.model\n\t\t\t.find({\n\t\t\t\t...this.getCouponCreatedWithinDateRangeFilter(startDate, endDate),\n\t\t\t})\n\t\t\t.select('_id');\n\t}\n\n\tprivate async getCouponUsageMetrics(\n\t\tstartDate: Date,\n\t\tendDate: Date,\n\t\tcoupons: mongoose.Types.ObjectId[] = []\n\t) {\n\t\tconst match = {\n\t\t\t...this.getCouponOrderMatch(startDate, endDate),\n\t\t\t'adjustedFinance.coupon.coupon': { $in: coupons },\n\t\t};\n\n\t\tconst [result] = await this.orderModel.aggregate<{\n\t\t\ttotalCouponOrders: number;\n\t\t\ttotalRevenue: number;\n\t\t\ttotalProfit: number;\n\t\t\tredeemedCoupons: number;\n\t\t}>([\n\t\t\t{\n\t\t\t\t$match: match,\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: null,\n\n\t\t\t\t\ttotalCouponOrders: { $sum: 1 },\n\n\t\t\t\t\ttotalRevenue: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t'$adjustedFinance.pricing.subtotal',\n\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.shopProfit.totalProfit', 0] },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\n\t\t\t\t\ttotalProfit: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.companyProfit.profitFromItem',\n\t\t\t\t\t},\n\n\t\t\t\t\tuniqueCoupons: {\n\t\t\t\t\t\t$addToSet: '$adjustedFinance.coupon.coupon',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\ttotalCouponOrders: 1,\n\t\t\t\t\ttotalRevenue: 1,\n\t\t\t\t\ttotalProfit: 1,\n\t\t\t\t\tredeemedCoupons: {\n\t\t\t\t\t\t$size: '$uniqueCoupons',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\treturn (\n\t\t\tresult ?? {\n\t\t\t\ttotalCouponOrders: 0,\n\t\t\t\ttotalRevenue: 0,\n\t\t\t\ttotalProfit: 0,\n\t\t\t\tredeemedCoupons: 0,\n\t\t\t}\n\t\t);\n\t}\n\n\tprivate getEffectiveGraphType(type: GraphType | undefined, startDate: Date, endDate: Date): GraphType {\n\t\tif (type !== undefined && type !== null) {\n\t\t\treturn type;\n\t\t}\n\n\t\tconst durationDays = dayjs(endDate).endOf('day').diff(dayjs(startDate).startOf('day'), 'day') + 1;\n\t\treturn durationDays > 31 ? GraphType.MONTHLY : GraphType.DAILY;\n\t}\n\n\tprivate getMongoDateFormat(type: GraphType): string {\n\t\tif (type === GraphType.YEARLY) return '%Y';\n\t\tif (type === GraphType.MONTHLY) return '%Y-%m';\n\t\treturn '%Y-%m-%d';\n\t}\n\n\tprivate getPeriodKeys(startDate: Date, endDate: Date, type: GraphType): string[] {\n\t\tconst unit = type === GraphType.YEARLY ? 'year' : type === GraphType.MONTHLY ? 'month' : 'day';\n\t\tconst format = type === GraphType.YEARLY ? 'YYYY' : type === GraphType.MONTHLY ? 'YYYY-MM' : 'YYYY-MM-DD';\n\t\tconst keys: string[] = [];\n\t\tlet current = dayjs(startDate).startOf(unit);\n\t\tconst end = dayjs(endDate).startOf(unit);\n\n\t\twhile (current.isBefore(end) || current.isSame(end)) {\n\t\t\tkeys.push(current.format(format));\n\t\t\tcurrent = current.add(1, unit);\n\t\t}\n\n\t\treturn keys;\n\t}\n\n\tprivate formatPeriodLabel(dateKey: string, type: GraphType): string {\n\t\tif (type === GraphType.YEARLY) {\n\t\t\treturn new Date(dateKey).toLocaleString('default', { year: 'numeric' });\n\t\t}\n\n\t\tif (type === GraphType.MONTHLY) {\n\t\t\treturn new Date(dateKey).toLocaleString('default', { month: 'short' });\n\t\t}\n\n\t\treturn new Date(dateKey).toLocaleString('default', { day: 'numeric', month: 'short' });\n\t}\n\n\tpublic async getCouponMetricsByType(duration: DateInputDTO) {\n\t\tconst startDate = dayjs(duration.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(duration.endDate).endOf('day').toDate();\n\n\t\tconst [totalOrders, activeCouponsCount] = await Promise.all([\n\t\t\tthis.orderModel.countDocuments({\n\t\t\t\tplacedAt: {\n\t\t\t\t\t$gte: startDate,\n\t\t\t\t\t$lte: endDate,\n\t\t\t\t},\n\t\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t\t}),\n\t\t\tthis.model.aggregate([\n\t\t\t\t{\n\t\t\t\t\t$match: {\n\t\t\t\t\t\t...this.getBaseCouponFilter(),\n\t\t\t\t\t\tstatus: Status.ACTIVE,\n\t\t\t\t\t\t'duration.start': { $lte: dayjs().toDate() },\n\t\t\t\t\t\t'duration.end': { $gte: dayjs().toDate() },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: '$couponType',\n\t\t\t\t\t\tcount: { $sum: 1 },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]),\n\t\t]);\n\n\t\tconst activeCouponsMap = activeCouponsCount.reduce(\n\t\t\t(acc, curr) => {\n\t\t\t\tacc[curr._id] = curr.count;\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{} as Record<string, number>\n\t\t);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getCouponOrderMatch(startDate, endDate),\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$lookup: {\n\t\t\t\t\tfrom: 'coupons',\n\t\t\t\t\tlocalField: 'adjustedFinance.coupon.coupon',\n\t\t\t\t\tforeignField: '_id',\n\t\t\t\t\tas: 'couponDetails',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$unwind: '$couponDetails',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t'couponDetails.couponType': { $nin: [CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD] },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$couponDetails.couponType',\n\n\t\t\t\t\tcouponType: { $first: '$couponDetails.couponType' },\n\n\t\t\t\t\ttotalCouponOrders: { $sum: 1 },\n\n\t\t\t\t\ttotalOrderAmount: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.pricing.total',\n\t\t\t\t\t},\n\n\t\t\t\t\ttotalRevenue: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t'$adjustedFinance.pricing.total',\n\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.shopProfit.totalProfit', 0] },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\n\t\t\t\t\tamountSpent: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.pricing.couponDiscount',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\taverageOrderValue: {\n\t\t\t\t\t\t$cond: [\n\t\t\t\t\t\t\t{ $eq: ['$totalCouponOrders', 0] },\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$round: [{ $divide: ['$totalOrderAmount', '$totalCouponOrders'] }, 2],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\n\t\t\t\t\tusage: {\n\t\t\t\t\t\t$cond: [\n\t\t\t\t\t\t\t{ $eq: [totalOrders, 0] },\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$multiply: [\n\t\t\t\t\t\t\t\t\t100,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$round: [{ $divide: ['$totalCouponOrders', totalOrders] }, 2],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tcouponType: 1,\n\t\t\t\t\ttotalCouponOrders: 1,\n\t\t\t\t\ttotalRevenue: { $round: ['$totalRevenue', 2] },\n\t\t\t\t\taverageOrderValue: 1,\n\t\t\t\t\tusage: 1,\n\t\t\t\t\tamountSpent: { $round: ['$amountSpent', 2] },\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tthis.fillMissingRows(result);\n\n\t\tconst tableData = result.map(item => ({\n\t\t\t...item,\n\t\t\tcouponTypeTitle: this.getCouponTypeTitle(item.couponType),\n\t\t\tongoing: activeCouponsMap[item.couponType] ?? 0,\n\t\t\tredemptionRate: 0, // calculate after business discussion on how to define redemption rate by coupon type\n\t\t}));\n\n\t\treturn tableData;\n\t}\n\n\tprivate getCouponTypeTitle(couponType: CouponType) {\n\t\tconst couponTypeTitles: Record<CouponType, string> = {\n\t\t\t[CouponType.GLOBAL]: 'Global',\n\t\t\t[CouponType.SHOPS_CATEGORIES]: 'Shop/Category',\n\t\t\t[CouponType.INDIVIDUAL_STORE]: 'Single Shop',\n\t\t\t[CouponType.INDIVIDUAL_USER]: 'Individual User',\n\t\t\t[CouponType.CUSTOM_COUPON]: 'Customized Coupon',\n\t\t\t[CouponType.REFERRAL_CODE]: 'Referral Code',\n\t\t\t[CouponType.REFERRAL_REWARD]: 'Referral Reward',\n\t\t};\n\t\treturn couponTypeTitles[couponType] || 'Unknown';\n\t}\n\n\tprivate fillMissingRows(data: CouponMetricsByTypeDTO[]) {\n\t\tconst missingTypes = Object.values(CouponType).filter(\n\t\t\ttype =>\n\t\t\t\t![CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD].includes(type) &&\n\t\t\t\t!data.some(row => row.couponType === type)\n\t\t);\n\n\t\tmissingTypes.forEach(type => {\n\t\t\tdata.push({\n\t\t\t\tcouponType: type,\n\t\t\t\tcouponTypeTitle: this.getCouponTypeTitle(type),\n\t\t\t\ttotalCouponOrders: 0,\n\t\t\t\ttotalRevenue: 0,\n\t\t\t\taverageOrderValue: 0,\n\t\t\t\tusage: 0,\n\t\t\t\tongoing: 0,\n\t\t\t\tredemptionRate: 0,\n\t\t\t\tamountSpent: 0,\n\t\t\t});\n\t\t});\n\n\t\tdata.sort((a, b) => this.compareCouponTypes(a.couponType, b.couponType));\n\t}\n\n\tprivate compareCouponTypes(a: CouponType, b: CouponType) {\n\t\tconst order = [\n\t\t\tCouponType.GLOBAL,\n\t\t\tCouponType.SHOPS_CATEGORIES,\n\t\t\tCouponType.INDIVIDUAL_STORE,\n\t\t\tCouponType.INDIVIDUAL_USER,\n\t\t\tCouponType.CUSTOM_COUPON,\n\t\t];\n\t\treturn order.indexOf(a) - order.indexOf(b);\n\t}\n\n\tprivate calculateRedemptionRate(totalCreated: number, redeemedCoupons: number) {\n\t\tif (totalCreated <= 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn Number(((redeemedCoupons / totalCreated) * 100).toFixed(2));\n\t}\n\n\tpublic async getCouponMetrics(duration: DateInputDTO): Promise<CouponMetricsOutputDTO> {\n\t\tconst startDate = dayjs(duration.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(duration.endDate).endOf('day').toDate();\n\t\tconst now = new Date();\n\n\t\tconst [activeCoupons, createdCoupons] = await Promise.all([\n\t\t\tthis.getActiveCouponsCount(now),\n\t\t\tthis.getTotalCreatedCoupons(startDate, endDate),\n\t\t]);\n\n\t\tconst createdCouponIds = createdCoupons.map(coupon => coupon._id);\n\n\t\tconst usageMetrics = await this.getCouponUsageMetrics(startDate, endDate, createdCouponIds);\n\n\t\tconst redemptionRate = this.calculateRedemptionRate(\n\t\t\tcreatedCouponIds.length,\n\t\t\tusageMetrics.redeemedCoupons\n\t\t);\n\n\t\treturn {\n\t\t\tactiveCoupons,\n\n\t\t\ttotalCreated: createdCouponIds.length,\n\t\t\ttotalRedeemedCoupons: usageMetrics.totalCouponOrders,\n\t\t\tredemptionRate,\n\n\t\t\ttotalCouponOrders: usageMetrics.totalCouponOrders,\n\t\t\ttotalRevenue: roundBaseCurrency(usageMetrics.totalRevenue),\n\t\t\ttotalProfit: roundBaseCurrency(usageMetrics.totalProfit),\n\t\t};\n\t}\n\n\tpublic getOrderGraphMatchStage(startDate: Date, endDate: Date, itemType?: ItemType) {\n\t\treturn {\n\t\t\tplacedAt: {\n\t\t\t\t$gte: startDate,\n\t\t\t\t$lte: endDate,\n\t\t\t},\n\t\t\torderType: OrderType.REGULAR,\n\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t\t...(itemType\n\t\t\t\t? {\n\t\t\t\t\t\titemType,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t};\n\t}\n\n\tpublic async getCouponOrdersGraphData(data: GraphInputDTO): Promise<GraphDTO> {\n\t\tconst startDate = dayjs(data.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(data.endDate).endOf('day').toDate();\n\n\t\tconst graphType = this.getEffectiveGraphType(data.graphType, data.startDate, data.endDate);\n\t\tconst dateFormat = this.getMongoDateFormat(graphType);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getOrderGraphMatchStage(startDate, endDate, data.itemType),\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\thasCoupon: {\n\t\t\t\t\t\t$cond: [{ $ifNull: ['$adjustedFinance.coupon.coupon', false] }, 1, 0],\n\t\t\t\t\t},\n\t\t\t\t\tdate: {\n\t\t\t\t\t\t$dateToString: {\n\t\t\t\t\t\t\tformat: dateFormat,\n\t\t\t\t\t\t\tdate: '$placedAt',\n\t\t\t\t\t\t\ttimezone: LyxaTimezone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$date',\n\n\t\t\t\t\ttotalOrders: { $sum: 1 },\n\n\t\t\t\t\tordersWithCoupon: {\n\t\t\t\t\t\t$sum: '$hasCoupon',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tdate: '$_id',\n\t\t\t\t\ttotalOrders: 1,\n\t\t\t\t\tordersWithCoupon: 1,\n\t\t\t\t\tordersWithoutCoupon: { $subtract: ['$totalOrders', '$ordersWithCoupon'] },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$sort: { date: 1 },\n\t\t\t},\n\t\t]);\n\n\t\t// Fill in missing dates with zero for graph continuity\n\t\tconst graphData = fillMissingPeriods(result, data.startDate, data.endDate, graphType, {\n\t\t\ttotalOrders: 0,\n\t\t\tordersWithCoupon: 0,\n\t\t\tordersWithoutCoupon: 0,\n\t\t});\n\n\t\treturn this.convertToCouponOrdersGraphFormat(graphData, graphType, data.startDate, data.endDate);\n\t}\n\n\tprivate convertToCouponOrdersGraphFormat(\n\t\tdata: Array<{ date: string; totalOrders: number; ordersWithCoupon: number; ordersWithoutCoupon: number }>,\n\t\tgraphType: GraphType,\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): GraphDTO {\n\t\tconst periodKeys = this.getPeriodKeys(startDate, endDate, graphType);\n\t\tconst categories = periodKeys.map(key => this.formatPeriodLabel(key, graphType));\n\n\t\tconst series = [\n\t\t\t{\n\t\t\t\tname: 'Coupon',\n\t\t\t\tdata: data.map(item => item.ordersWithCoupon),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'No Coupon',\n\t\t\t\tdata: data.map(item => item.ordersWithoutCoupon),\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tcategories,\n\t\t\tseries,\n\t\t};\n\t}\n\n\tpublic async getUsersNewVsReturningGraphData(data: GraphInputDTO): Promise<GraphDTO> {\n\t\tconst startDate = dayjs(data.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(data.endDate).endOf('day').toDate();\n\n\t\tconst graphType = this.getEffectiveGraphType(data.graphType, data.startDate, data.endDate);\n\t\tconst dateFormat = this.getMongoDateFormat(graphType);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t// Orders in selected period\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getOrderGraphMatchStage(startDate, endDate, data.itemType),\n\t\t\t\t\t'adjustedFinance.coupon.coupon': { $ne: null },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Build graph bucket\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\tdate: {\n\t\t\t\t\t\t$dateToString: {\n\t\t\t\t\t\t\tformat: dateFormat,\n\t\t\t\t\t\t\tdate: '$placedAt',\n\t\t\t\t\t\t\ttimezone: LyxaTimezone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Unique user per period bucket\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: {\n\t\t\t\t\t\tuser: '$user',\n\t\t\t\t\t\tdate: '$date',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Lookup prior order (existence check)\n\t\t\t{\n\t\t\t\t$lookup: {\n\t\t\t\t\tfrom: 'orders',\n\t\t\t\t\tlet: { userId: '$_id.user' },\n\t\t\t\t\tpipeline: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$match: {\n\t\t\t\t\t\t\t\t$expr: {\n\t\t\t\t\t\t\t\t\t$and: [\n\t\t\t\t\t\t\t\t\t\t{ $eq: ['$user', '$$userId'] },\n\t\t\t\t\t\t\t\t\t\t{ $eq: ['$status', RegularOrderStatus.DELIVERED] },\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$expr: {\n\t\t\t\t\t\t\t\t\t\t\t\t$lt: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ifNull: ['$placedAt', '$createdAt'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\tstartDate,\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ $limit: 1 },\n\t\t\t\t\t],\n\t\t\t\t\tas: 'previousOrders',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Classify\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\tisReturning: {\n\t\t\t\t\t\t$gt: [{ $size: '$previousOrders' }, 0],\n\t\t\t\t\t},\n\t\t\t\t\tdate: '$_id.date',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Aggregate graph metrics\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$date',\n\n\t\t\t\t\ttotalUsers: { $sum: 1 },\n\n\t\t\t\t\treturningUsers: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$cond: ['$isReturning', 1, 0],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\n\t\t\t\t\tnewUsers: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$cond: ['$isReturning', 0, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tdate: '$_id',\n\t\t\t\t\ttotalUsers: 1,\n\t\t\t\t\tnewUsers: 1,\n\t\t\t\t\treturningUsers: 1,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{ $sort: { date: 1 } },\n\t\t]);\n\n\t\tconst graphData = fillMissingPeriods(result, data.startDate, data.endDate, graphType, {\n\t\t\ttotalUsers: 0,\n\t\t\tnewUsers: 0,\n\t\t\treturningUsers: 0,\n\t\t});\n\n\t\treturn this.convertToUsersNewVsReturningGraphFormat(graphData, graphType, data.startDate, data.endDate);\n\t}\n\n\tprivate convertToUsersNewVsReturningGraphFormat(\n\t\tdata: Array<{ date: string; totalUsers: number; newUsers: number; returningUsers: number }>,\n\t\tgraphType: GraphType,\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): GraphDTO {\n\t\tconst periodKeys = this.getPeriodKeys(startDate, endDate, graphType);\n\t\tconst categories = periodKeys.map(key => this.formatPeriodLabel(key, graphType));\n\n\t\tconst series = [\n\t\t\t{\n\t\t\t\tname: 'New Users',\n\t\t\t\tdata: data.map(item => item.newUsers),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Returning Users',\n\t\t\t\tdata: data.map(item => item.returningUsers),\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tcategories,\n\t\t\tseries,\n\t\t};\n\t}\n\n\tpublic async getCouponProfitGraphData(data: GraphInputDTO): Promise<TotalProfitGraphDTO> {\n\t\tconst startDate = dayjs(data.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(data.endDate).endOf('day').toDate();\n\n\t\tconst graphType = this.getEffectiveGraphType(data.graphType, data.startDate, data.endDate);\n\t\tconst dateFormat = this.getMongoDateFormat(graphType);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getOrderGraphMatchStage(startDate, endDate, data.itemType),\n\t\t\t\t\t'adjustedFinance.coupon.coupon': { $ne: null },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\tdate: {\n\t\t\t\t\t\t$dateToString: {\n\t\t\t\t\t\t\tformat: dateFormat,\n\t\t\t\t\t\t\tdate: '$placedAt',\n\t\t\t\t\t\t\ttimezone: LyxaTimezone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$date',\n\n\t\t\t\t\ttotalProfit: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.companyProfit.totalProfit',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tdate: '$_id',\n\t\t\t\t\ttotalProfit: 1,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$sort: { date: 1 },\n\t\t\t},\n\t\t]);\n\n\t\t// Fill in missing dates with zero for graph continuity\n\t\tconst graphData = fillMissingPeriods(result, data.startDate, data.endDate, graphType, {\n\t\t\ttotalProfit: 0,\n\t\t});\n\n\t\treturn this.convertToCouponProfitGraphFormat(graphData, graphType, data.startDate, data.endDate);\n\t}\n\n\tprivate convertToCouponProfitGraphFormat(\n\t\tdata: Array<{ date: string; totalProfit: number }>,\n\t\tgraphType: GraphType,\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): TotalProfitGraphDTO {\n\t\tconst periodKeys = this.getPeriodKeys(startDate, endDate, graphType);\n\t\tconst categories = periodKeys.map(key => this.formatPeriodLabel(key, graphType));\n\n\t\tconst series = [\n\t\t\t{\n\t\t\t\tname: 'Profit',\n\t\t\t\tdata: data.map(item => item.totalProfit),\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tcategories,\n\t\t\tseries,\n\t\t\ttotalProfit: data.reduce((sum, item) => sum + item.totalProfit, 0),\n\t\t};\n\t}\n\n\tpublic async getMetricsForCoupon(couponId: string, duration?: DateInputDTO): Promise<any> {\n\t\tconst match: mongoose.PipelineStage.Match['$match'] = {\n\t\t\t'adjustedFinance.coupon.coupon': new mongoose.Types.ObjectId(couponId),\n\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t};\n\t\tif (duration?.startDate && duration?.endDate) {\n\t\t\tmatch.placedAt = {\n\t\t\t\t$gte: dayjs(duration.startDate).startOf('day').toDate(),\n\t\t\t\t$lte: dayjs(duration.endDate).endOf('day').toDate(),\n\t\t\t};\n\t\t}\n\n\t\tconst [result] = await this.orderModel.aggregate([\n\t\t\t{ $match: match },\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: null,\n\t\t\t\t\ttotalOrder: { $sum: 1 },\n\t\t\t\t\trevenue: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t'$adjustedFinance.pricing.total',\n\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.shopProfit.totalProfit', 0] },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tamountSpent: { $sum: '$adjustedFinance.pricing.couponDiscount' },\n\t\t\t\t\tusers: { $addToSet: '$user' },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\ttotalOrder: 1,\n\t\t\t\t\trevenue: 1,\n\t\t\t\t\tamountSpent: 1,\n\t\t\t\t\tuserEngagement: { $size: '$users' },\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tconst revenue = roundBaseCurrency(result?.revenue ?? 0);\n\t\tconst amountSpent = roundBaseCurrency(result?.amountSpent ?? 0);\n\t\tconst totalOrder = result?.totalOrder ?? 0;\n\n\t\treturn {\n\t\t\ttotalOrder,\n\t\t\ttotalRedemption: totalOrder,\n\t\t\trevenue,\n\t\t\tamountSpent,\n\t\t\tuserEngagement: result?.userEngagement ?? 0,\n\t\t\troi: amountSpent > 0 ? roundBaseCurrency(revenue / amountSpent) : 0,\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CouponMetricsRepository.js","sourceRoot":"/","sources":["modules/coupon/services/patterns/repository/CouponMetricsRepository.ts"],"names":[],"mappings":";;;AAAA,sEAA4F;AAE5F,8DAA2D;AAC3D,4DAO2C;AAC3C,gEAAwE;AACxE,4DAAiE;AASjE,oDA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AO,EAAE,CAAC;oBACV,WAAW,EAAE,CAAC;oBACd,cAAc,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;iBACnC;aACD;SACD,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,IAAI,CAAC,CAAC,CAAC;QACxD,MAAM,WAAW,GAAG,IAAA,0BAAiB,EAAC,MAAM,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC;QAChE,MAAM,UAAU,GAAG,MAAM,EAAE,UAAU,IAAI,CAAC,CAAC;QAE3C,OAAO;YACN,UAAU;YACV,eAAe,EAAE,UAAU;YAC3B,OAAO;YACP,WAAW;YACX,cAAc,EAAE,MAAM,EAAE,cAAc,IAAI,CAAC;YAC3C,GAAG,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAiB,EAAC,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;SACnE,CAAC;IACH,CAAC;CACD;AArzBD,0DAqzBC","sourcesContent":["import { Coupon, CouponModel, OrderModel } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { Duration } from '@lyxa.ai/core/dist/libraries/mongo/models/shared/duration.model';\nimport { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\nimport {\n\tCouponType,\n\tGraphType,\n\tItemType,\n\tOrderType,\n\tRegularOrderStatus,\n\tStatus,\n} from '@lyxa.ai/core/dist/utilities/enum';\nimport { roundBaseCurrency } from '@lyxa.ai/core/dist/utilities/shared';\nimport { LyxaTimezone } from '@lyxa.ai/core/dist/utilities/time';\nimport {\n\tCouponMetricsByTypeDTO,\n\tCouponMetricsOutputDTO,\n\tDateInputDTO,\n\tGraphDTO,\n\tGraphInputDTO,\n\tTotalProfitGraphDTO,\n} from '@modules/coupon/validations/coupon.validation';\nimport { mongoose } from '@typegoose/typegoose';\nimport { fillMissingPeriods } from '@utility/utils';\n\nexport class CouponMetricsRepository {\n\tprivate readonly model: typeof CouponModel;\n\tprivate orderModel: typeof OrderModel;\n\n\tconstructor() {\n\t\tthis.model = CouponModel as typeof CouponModel;\n\t\tthis.orderModel = OrderModel as typeof OrderModel;\n\t}\n\n\tprivate getBaseCouponFilter(): mongoose.FilterQuery<Coupon> {\n\t\treturn {\n\t\t\tupdatedVersion: { $exists: false },\n\t\t\tcouponType: { $nin: [CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD] },\n\t\t\tdeletedAt: null,\n\t\t};\n\t}\n\n\tprivate getCouponCreatedWithinDateRangeFilter(\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): mongoose.FilterQuery<Coupon> {\n\t\treturn {\n\t\t\t...this.getBaseCouponFilter(),\n\t\t\tcreatedAt: {\n\t\t\t\t$gte: startDate,\n\t\t\t\t$lte: endDate,\n\t\t\t},\n\t\t};\n\t}\n\n\tprivate getCouponOrderMatch(startDate: Date, endDate: Date): mongoose.PipelineStage.Match['$match'] {\n\t\treturn {\n\t\t\tplacedAt: {\n\t\t\t\t$gte: startDate,\n\t\t\t\t$lte: endDate,\n\t\t\t},\n\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t\t'adjustedFinance.coupon.coupon': { $ne: null },\n\t\t};\n\t}\n\n\tprivate async getActiveCouponsCount(now: Date): Promise<number> {\n\t\treturn this.model.countDocuments({\n\t\t\tupdatedVersion: { $exists: false },\n\n\t\t\tcouponType: {\n\t\t\t\t$nin: [CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD],\n\t\t\t},\n\n\t\t\tstatus: Status.ACTIVE,\n\n\t\t\tdeletedAt: null,\n\n\t\t\t'duration.start': { $lte: now },\n\n\t\t\t$or: [\n\t\t\t\t{ 'duration.end': { $exists: false } },\n\t\t\t\t{ 'duration.end': null },\n\t\t\t\t{ 'duration.end': { $gte: now } },\n\t\t\t],\n\t\t});\n\t}\n\tprivate async getTotalCreatedCoupons(startDate: Date, endDate: Date) {\n\t\treturn this.model\n\t\t\t.find({\n\t\t\t\t...this.getCouponCreatedWithinDateRangeFilter(startDate, endDate),\n\t\t\t})\n\t\t\t.select('_id');\n\t}\n\n\tprivate async getCouponUsageMetrics(\n\t\tstartDate: Date,\n\t\tendDate: Date,\n\t\tcoupons: mongoose.Types.ObjectId[] = []\n\t) {\n\t\tconst match = {\n\t\t\t...this.getCouponOrderMatch(startDate, endDate),\n\t\t\t'adjustedFinance.coupon.coupon': { $in: coupons },\n\t\t};\n\n\t\tconst [result] = await this.orderModel.aggregate<{\n\t\t\ttotalCouponOrders: number;\n\t\t\ttotalRevenue: number;\n\t\t\ttotalProfit: number;\n\t\t\tredeemedCoupons: number;\n\t\t}>([\n\t\t\t{\n\t\t\t\t$match: match,\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: null,\n\n\t\t\t\t\ttotalCouponOrders: { $sum: 1 },\n\n\t\t\t\t\ttotalRevenue: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.pricing.subtotal', 0] },\n\t\t\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.coupon.shopCut', 0] },\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.shopProfit.totalProfit', 0] },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\n\t\t\t\t\ttotalProfit: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.companyProfit.profitFromItem',\n\t\t\t\t\t},\n\n\t\t\t\t\tuniqueCoupons: {\n\t\t\t\t\t\t$addToSet: '$adjustedFinance.coupon.coupon',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\ttotalCouponOrders: 1,\n\t\t\t\t\ttotalRevenue: 1,\n\t\t\t\t\ttotalProfit: 1,\n\t\t\t\t\tredeemedCoupons: {\n\t\t\t\t\t\t$size: '$uniqueCoupons',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\treturn (\n\t\t\tresult ?? {\n\t\t\t\ttotalCouponOrders: 0,\n\t\t\t\ttotalRevenue: 0,\n\t\t\t\ttotalProfit: 0,\n\t\t\t\tredeemedCoupons: 0,\n\t\t\t}\n\t\t);\n\t}\n\n\tprivate getEffectiveGraphType(type: GraphType | undefined, startDate: Date, endDate: Date): GraphType {\n\t\tif (type !== undefined && type !== null) {\n\t\t\treturn type;\n\t\t}\n\n\t\tconst durationDays = dayjs(endDate).endOf('day').diff(dayjs(startDate).startOf('day'), 'day') + 1;\n\t\treturn durationDays > 31 ? GraphType.MONTHLY : GraphType.DAILY;\n\t}\n\n\tprivate getMongoDateFormat(type: GraphType): string {\n\t\tif (type === GraphType.YEARLY) return '%Y';\n\t\tif (type === GraphType.MONTHLY) return '%Y-%m';\n\t\treturn '%Y-%m-%d';\n\t}\n\n\tprivate getPeriodKeys(startDate: Date, endDate: Date, type: GraphType): string[] {\n\t\tconst unit = type === GraphType.YEARLY ? 'year' : type === GraphType.MONTHLY ? 'month' : 'day';\n\t\tconst format = type === GraphType.YEARLY ? 'YYYY' : type === GraphType.MONTHLY ? 'YYYY-MM' : 'YYYY-MM-DD';\n\t\tconst keys: string[] = [];\n\t\tlet current = dayjs(startDate).startOf(unit);\n\t\tconst end = dayjs(endDate).startOf(unit);\n\n\t\twhile (current.isBefore(end) || current.isSame(end)) {\n\t\t\tkeys.push(current.format(format));\n\t\t\tcurrent = current.add(1, unit);\n\t\t}\n\n\t\treturn keys;\n\t}\n\n\tprivate formatPeriodLabel(dateKey: string, type: GraphType): string {\n\t\tif (type === GraphType.YEARLY) {\n\t\t\treturn new Date(dateKey).toLocaleString('default', { year: 'numeric' });\n\t\t}\n\n\t\tif (type === GraphType.MONTHLY) {\n\t\t\treturn new Date(dateKey).toLocaleString('default', { month: 'short' });\n\t\t}\n\n\t\treturn new Date(dateKey).toLocaleString('default', { day: 'numeric', month: 'short' });\n\t}\n\n\tpublic async getCouponMetricsByType(duration: DateInputDTO) {\n\t\tconst startDate = dayjs(duration.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(duration.endDate).endOf('day').toDate();\n\n\t\tconst [totalOrders, activeCouponsCount] = await Promise.all([\n\t\t\tthis.orderModel.countDocuments({\n\t\t\t\tplacedAt: {\n\t\t\t\t\t$gte: startDate,\n\t\t\t\t\t$lte: endDate,\n\t\t\t\t},\n\t\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t\t}),\n\t\t\tthis.model.aggregate([\n\t\t\t\t{\n\t\t\t\t\t$match: {\n\t\t\t\t\t\t...this.getBaseCouponFilter(),\n\t\t\t\t\t\tstatus: Status.ACTIVE,\n\t\t\t\t\t\t'duration.start': { $lte: dayjs().toDate() },\n\t\t\t\t\t\t'duration.end': { $gte: dayjs().toDate() },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: '$couponType',\n\t\t\t\t\t\tcount: { $sum: 1 },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]),\n\t\t]);\n\n\t\tconst activeCouponsMap = activeCouponsCount.reduce(\n\t\t\t(acc, curr) => {\n\t\t\t\tacc[curr._id] = curr.count;\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{} as Record<string, number>\n\t\t);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getCouponOrderMatch(startDate, endDate),\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$lookup: {\n\t\t\t\t\tfrom: 'coupons',\n\t\t\t\t\tlocalField: 'adjustedFinance.coupon.coupon',\n\t\t\t\t\tforeignField: '_id',\n\t\t\t\t\tas: 'couponDetails',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$unwind: '$couponDetails',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t'couponDetails.couponType': { $nin: [CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD] },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$couponDetails.couponType',\n\n\t\t\t\t\tcouponType: { $first: '$couponDetails.couponType' },\n\n\t\t\t\t\ttotalCouponOrders: { $sum: 1 },\n\n\t\t\t\t\ttotalOrderAmount: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.pricing.total',\n\t\t\t\t\t},\n\n\t\t\t\t\ttotalRevenue: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.pricing.subtotal', 0] },\n\t\t\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.coupon.shopCut', 0] },\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.shopProfit.totalProfit', 0] },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\n\t\t\t\t\tamountSpent: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.pricing.couponDiscount',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\taverageOrderValue: {\n\t\t\t\t\t\t$cond: [\n\t\t\t\t\t\t\t{ $eq: ['$totalCouponOrders', 0] },\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$round: [{ $divide: ['$totalOrderAmount', '$totalCouponOrders'] }, 2],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\n\t\t\t\t\tusage: {\n\t\t\t\t\t\t$cond: [\n\t\t\t\t\t\t\t{ $eq: [totalOrders, 0] },\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$multiply: [\n\t\t\t\t\t\t\t\t\t100,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$round: [{ $divide: ['$totalCouponOrders', totalOrders] }, 2],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tcouponType: 1,\n\t\t\t\t\ttotalCouponOrders: 1,\n\t\t\t\t\ttotalRevenue: { $round: ['$totalRevenue', 2] },\n\t\t\t\t\taverageOrderValue: 1,\n\t\t\t\t\tusage: 1,\n\t\t\t\t\tamountSpent: { $round: ['$amountSpent', 2] },\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tthis.fillMissingRows(result);\n\n\t\tconst tableData = result.map(item => ({\n\t\t\t...item,\n\t\t\tcouponTypeTitle: this.getCouponTypeTitle(item.couponType),\n\t\t\tongoing: activeCouponsMap[item.couponType] ?? 0,\n\t\t\tredemptionRate: 0, // calculate after business discussion on how to define redemption rate by coupon type\n\t\t}));\n\n\t\treturn tableData;\n\t}\n\n\tprivate getCouponTypeTitle(couponType: CouponType) {\n\t\tconst couponTypeTitles: Record<CouponType, string> = {\n\t\t\t[CouponType.GLOBAL]: 'Global',\n\t\t\t[CouponType.SHOPS_CATEGORIES]: 'Shop/Category',\n\t\t\t[CouponType.INDIVIDUAL_STORE]: 'Single Shop',\n\t\t\t[CouponType.INDIVIDUAL_USER]: 'Individual User',\n\t\t\t[CouponType.CUSTOM_COUPON]: 'Customized Coupon',\n\t\t\t[CouponType.REFERRAL_CODE]: 'Referral Code',\n\t\t\t[CouponType.REFERRAL_REWARD]: 'Referral Reward',\n\t\t};\n\t\treturn couponTypeTitles[couponType] || 'Unknown';\n\t}\n\n\tprivate fillMissingRows(data: CouponMetricsByTypeDTO[]) {\n\t\tconst missingTypes = Object.values(CouponType).filter(\n\t\t\ttype =>\n\t\t\t\t![CouponType.REFERRAL_CODE, CouponType.REFERRAL_REWARD].includes(type) &&\n\t\t\t\t!data.some(row => row.couponType === type)\n\t\t);\n\n\t\tmissingTypes.forEach(type => {\n\t\t\tdata.push({\n\t\t\t\tcouponType: type,\n\t\t\t\tcouponTypeTitle: this.getCouponTypeTitle(type),\n\t\t\t\ttotalCouponOrders: 0,\n\t\t\t\ttotalRevenue: 0,\n\t\t\t\taverageOrderValue: 0,\n\t\t\t\tusage: 0,\n\t\t\t\tongoing: 0,\n\t\t\t\tredemptionRate: 0,\n\t\t\t\tamountSpent: 0,\n\t\t\t});\n\t\t});\n\n\t\tdata.sort((a, b) => this.compareCouponTypes(a.couponType, b.couponType));\n\t}\n\n\tprivate compareCouponTypes(a: CouponType, b: CouponType) {\n\t\tconst order = [\n\t\t\tCouponType.GLOBAL,\n\t\t\tCouponType.SHOPS_CATEGORIES,\n\t\t\tCouponType.INDIVIDUAL_STORE,\n\t\t\tCouponType.INDIVIDUAL_USER,\n\t\t\tCouponType.CUSTOM_COUPON,\n\t\t];\n\t\treturn order.indexOf(a) - order.indexOf(b);\n\t}\n\n\tprivate calculateRedemptionRate(totalCreated: number, redeemedCoupons: number) {\n\t\tif (totalCreated <= 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn Number(((redeemedCoupons / totalCreated) * 100).toFixed(2));\n\t}\n\n\tpublic async getCouponMetrics(duration: DateInputDTO): Promise<CouponMetricsOutputDTO> {\n\t\tconst startDate = dayjs(duration.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(duration.endDate).endOf('day').toDate();\n\t\tconst now = new Date();\n\n\t\tconst [activeCoupons, createdCoupons] = await Promise.all([\n\t\t\tthis.getActiveCouponsCount(now),\n\t\t\tthis.getTotalCreatedCoupons(startDate, endDate),\n\t\t]);\n\n\t\tconst createdCouponIds = createdCoupons.map(coupon => coupon._id);\n\n\t\tconst usageMetrics = await this.getCouponUsageMetrics(startDate, endDate, createdCouponIds);\n\n\t\tconst redemptionRate = this.calculateRedemptionRate(\n\t\t\tcreatedCouponIds.length,\n\t\t\tusageMetrics.redeemedCoupons\n\t\t);\n\n\t\treturn {\n\t\t\tactiveCoupons,\n\n\t\t\ttotalCreated: createdCouponIds.length,\n\t\t\ttotalRedeemedCoupons: usageMetrics.totalCouponOrders,\n\t\t\tredemptionRate,\n\n\t\t\ttotalCouponOrders: usageMetrics.totalCouponOrders,\n\t\t\ttotalRevenue: roundBaseCurrency(usageMetrics.totalRevenue),\n\t\t\ttotalProfit: roundBaseCurrency(usageMetrics.totalProfit),\n\t\t};\n\t}\n\n\tpublic getOrderGraphMatchStage(startDate: Date, endDate: Date, itemType?: ItemType) {\n\t\treturn {\n\t\t\tplacedAt: {\n\t\t\t\t$gte: startDate,\n\t\t\t\t$lte: endDate,\n\t\t\t},\n\t\t\torderType: OrderType.REGULAR,\n\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t\t...(itemType\n\t\t\t\t? {\n\t\t\t\t\t\titemType,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t};\n\t}\n\n\tpublic async getCouponOrdersGraphData(data: GraphInputDTO): Promise<GraphDTO> {\n\t\tconst startDate = dayjs(data.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(data.endDate).endOf('day').toDate();\n\n\t\tconst graphType = this.getEffectiveGraphType(data.graphType, data.startDate, data.endDate);\n\t\tconst dateFormat = this.getMongoDateFormat(graphType);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getOrderGraphMatchStage(startDate, endDate, data.itemType),\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\thasCoupon: {\n\t\t\t\t\t\t$cond: [{ $ifNull: ['$adjustedFinance.coupon.coupon', false] }, 1, 0],\n\t\t\t\t\t},\n\t\t\t\t\tdate: {\n\t\t\t\t\t\t$dateToString: {\n\t\t\t\t\t\t\tformat: dateFormat,\n\t\t\t\t\t\t\tdate: '$placedAt',\n\t\t\t\t\t\t\ttimezone: LyxaTimezone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$date',\n\n\t\t\t\t\ttotalOrders: { $sum: 1 },\n\n\t\t\t\t\tordersWithCoupon: {\n\t\t\t\t\t\t$sum: '$hasCoupon',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tdate: '$_id',\n\t\t\t\t\ttotalOrders: 1,\n\t\t\t\t\tordersWithCoupon: 1,\n\t\t\t\t\tordersWithoutCoupon: { $subtract: ['$totalOrders', '$ordersWithCoupon'] },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$sort: { date: 1 },\n\t\t\t},\n\t\t]);\n\n\t\t// Fill in missing dates with zero for graph continuity\n\t\tconst graphData = fillMissingPeriods(result, data.startDate, data.endDate, graphType, {\n\t\t\ttotalOrders: 0,\n\t\t\tordersWithCoupon: 0,\n\t\t\tordersWithoutCoupon: 0,\n\t\t});\n\n\t\treturn this.convertToCouponOrdersGraphFormat(graphData, graphType, data.startDate, data.endDate);\n\t}\n\n\tprivate convertToCouponOrdersGraphFormat(\n\t\tdata: Array<{ date: string; totalOrders: number; ordersWithCoupon: number; ordersWithoutCoupon: number }>,\n\t\tgraphType: GraphType,\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): GraphDTO {\n\t\tconst periodKeys = this.getPeriodKeys(startDate, endDate, graphType);\n\t\tconst categories = periodKeys.map(key => this.formatPeriodLabel(key, graphType));\n\n\t\tconst series = [\n\t\t\t{\n\t\t\t\tname: 'Coupon',\n\t\t\t\tdata: data.map(item => item.ordersWithCoupon),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'No Coupon',\n\t\t\t\tdata: data.map(item => item.ordersWithoutCoupon),\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tcategories,\n\t\t\tseries,\n\t\t};\n\t}\n\n\tpublic async getUsersNewVsReturningGraphData(data: GraphInputDTO): Promise<GraphDTO> {\n\t\tconst startDate = dayjs(data.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(data.endDate).endOf('day').toDate();\n\n\t\tconst graphType = this.getEffectiveGraphType(data.graphType, data.startDate, data.endDate);\n\t\tconst dateFormat = this.getMongoDateFormat(graphType);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t// Orders in selected period\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getOrderGraphMatchStage(startDate, endDate, data.itemType),\n\t\t\t\t\t'adjustedFinance.coupon.coupon': { $ne: null },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Build graph bucket\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\tdate: {\n\t\t\t\t\t\t$dateToString: {\n\t\t\t\t\t\t\tformat: dateFormat,\n\t\t\t\t\t\t\tdate: '$placedAt',\n\t\t\t\t\t\t\ttimezone: LyxaTimezone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Unique user per period bucket\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: {\n\t\t\t\t\t\tuser: '$user',\n\t\t\t\t\t\tdate: '$date',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Lookup prior order (existence check)\n\t\t\t{\n\t\t\t\t$lookup: {\n\t\t\t\t\tfrom: 'orders',\n\t\t\t\t\tlet: { userId: '$_id.user' },\n\t\t\t\t\tpipeline: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$match: {\n\t\t\t\t\t\t\t\t$expr: {\n\t\t\t\t\t\t\t\t\t$and: [\n\t\t\t\t\t\t\t\t\t\t{ $eq: ['$user', '$$userId'] },\n\t\t\t\t\t\t\t\t\t\t{ $eq: ['$status', RegularOrderStatus.DELIVERED] },\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$expr: {\n\t\t\t\t\t\t\t\t\t\t\t\t$lt: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ifNull: ['$placedAt', '$createdAt'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\tstartDate,\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ $limit: 1 },\n\t\t\t\t\t],\n\t\t\t\t\tas: 'previousOrders',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Classify\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\tisReturning: {\n\t\t\t\t\t\t$gt: [{ $size: '$previousOrders' }, 0],\n\t\t\t\t\t},\n\t\t\t\t\tdate: '$_id.date',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Aggregate graph metrics\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$date',\n\n\t\t\t\t\ttotalUsers: { $sum: 1 },\n\n\t\t\t\t\treturningUsers: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$cond: ['$isReturning', 1, 0],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\n\t\t\t\t\tnewUsers: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$cond: ['$isReturning', 0, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tdate: '$_id',\n\t\t\t\t\ttotalUsers: 1,\n\t\t\t\t\tnewUsers: 1,\n\t\t\t\t\treturningUsers: 1,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{ $sort: { date: 1 } },\n\t\t]);\n\n\t\tconst graphData = fillMissingPeriods(result, data.startDate, data.endDate, graphType, {\n\t\t\ttotalUsers: 0,\n\t\t\tnewUsers: 0,\n\t\t\treturningUsers: 0,\n\t\t});\n\n\t\treturn this.convertToUsersNewVsReturningGraphFormat(graphData, graphType, data.startDate, data.endDate);\n\t}\n\n\tprivate convertToUsersNewVsReturningGraphFormat(\n\t\tdata: Array<{ date: string; totalUsers: number; newUsers: number; returningUsers: number }>,\n\t\tgraphType: GraphType,\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): GraphDTO {\n\t\tconst periodKeys = this.getPeriodKeys(startDate, endDate, graphType);\n\t\tconst categories = periodKeys.map(key => this.formatPeriodLabel(key, graphType));\n\n\t\tconst series = [\n\t\t\t{\n\t\t\t\tname: 'New Users',\n\t\t\t\tdata: data.map(item => item.newUsers),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Returning Users',\n\t\t\t\tdata: data.map(item => item.returningUsers),\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tcategories,\n\t\t\tseries,\n\t\t};\n\t}\n\n\tpublic async getCouponProfitGraphData(data: GraphInputDTO): Promise<TotalProfitGraphDTO> {\n\t\tconst startDate = dayjs(data.startDate).startOf('day').toDate();\n\t\tconst endDate = dayjs(data.endDate).endOf('day').toDate();\n\n\t\tconst graphType = this.getEffectiveGraphType(data.graphType, data.startDate, data.endDate);\n\t\tconst dateFormat = this.getMongoDateFormat(graphType);\n\n\t\tconst result = await this.orderModel.aggregate([\n\t\t\t{\n\t\t\t\t$match: {\n\t\t\t\t\t...this.getOrderGraphMatchStage(startDate, endDate, data.itemType),\n\t\t\t\t\t'adjustedFinance.coupon.coupon': { $ne: null },\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$addFields: {\n\t\t\t\t\tdate: {\n\t\t\t\t\t\t$dateToString: {\n\t\t\t\t\t\t\tformat: dateFormat,\n\t\t\t\t\t\t\tdate: '$placedAt',\n\t\t\t\t\t\t\ttimezone: LyxaTimezone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: '$date',\n\n\t\t\t\t\ttotalProfit: {\n\t\t\t\t\t\t$sum: '$adjustedFinance.companyProfit.totalProfit',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tdate: '$_id',\n\t\t\t\t\ttotalProfit: 1,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t$sort: { date: 1 },\n\t\t\t},\n\t\t]);\n\n\t\t// Fill in missing dates with zero for graph continuity\n\t\tconst graphData = fillMissingPeriods(result, data.startDate, data.endDate, graphType, {\n\t\t\ttotalProfit: 0,\n\t\t});\n\n\t\treturn this.convertToCouponProfitGraphFormat(graphData, graphType, data.startDate, data.endDate);\n\t}\n\n\tprivate convertToCouponProfitGraphFormat(\n\t\tdata: Array<{ date: string; totalProfit: number }>,\n\t\tgraphType: GraphType,\n\t\tstartDate: Date,\n\t\tendDate: Date\n\t): TotalProfitGraphDTO {\n\t\tconst periodKeys = this.getPeriodKeys(startDate, endDate, graphType);\n\t\tconst categories = periodKeys.map(key => this.formatPeriodLabel(key, graphType));\n\n\t\tconst series = [\n\t\t\t{\n\t\t\t\tname: 'Profit',\n\t\t\t\tdata: data.map(item => item.totalProfit),\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tcategories,\n\t\t\tseries,\n\t\t\ttotalProfit: data.reduce((sum, item) => sum + item.totalProfit, 0),\n\t\t};\n\t}\n\n\tpublic async getMetricsForCoupon(couponId: string, duration?: DateInputDTO): Promise<any> {\n\t\tconst match: mongoose.PipelineStage.Match['$match'] = {\n\t\t\t'adjustedFinance.coupon.coupon': new mongoose.Types.ObjectId(couponId),\n\t\t\tstatus: RegularOrderStatus.DELIVERED,\n\t\t};\n\t\tif (duration?.startDate && duration?.endDate) {\n\t\t\tmatch.placedAt = {\n\t\t\t\t$gte: dayjs(duration.startDate).startOf('day').toDate(),\n\t\t\t\t$lte: dayjs(duration.endDate).endOf('day').toDate(),\n\t\t\t};\n\t\t}\n\n\t\tconst [result] = await this.orderModel.aggregate([\n\t\t\t{ $match: match },\n\t\t\t{\n\t\t\t\t$group: {\n\t\t\t\t\t_id: null,\n\t\t\t\t\ttotalOrder: { $sum: 1 },\n\t\t\t\t\trevenue: {\n\t\t\t\t\t\t$sum: {\n\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$subtract: [\n\t\t\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.pricing.subtotal', 0] },\n\t\t\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.coupon.shopCut', 0] },\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{ $ifNull: ['$adjustedFinance.shopProfit.totalProfit', 0] },\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tamountSpent: { $sum: '$adjustedFinance.pricing.couponDiscount' },\n\t\t\t\t\tusers: { $addToSet: '$user' },\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t$project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\ttotalOrder: 1,\n\t\t\t\t\trevenue: 1,\n\t\t\t\t\tamountSpent: 1,\n\t\t\t\t\tuserEngagement: { $size: '$users' },\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\n\t\tconst revenue = roundBaseCurrency(result?.revenue ?? 0);\n\t\tconst amountSpent = roundBaseCurrency(result?.amountSpent ?? 0);\n\t\tconst totalOrder = result?.totalOrder ?? 0;\n\n\t\treturn {\n\t\t\ttotalOrder,\n\t\t\ttotalRedemption: totalOrder,\n\t\t\trevenue,\n\t\t\tamountSpent,\n\t\t\tuserEngagement: result?.userEngagement ?? 0,\n\t\t\troi: amountSpent > 0 ? roundBaseCurrency(revenue / amountSpent) : 0,\n\t\t};\n\t}\n}\n"]}
|
|
@@ -2946,13 +2946,13 @@ export declare const CouponResponseSchema: z.ZodObject<{
|
|
|
2946
2946
|
totalElements: z.ZodNumber;
|
|
2947
2947
|
totalPages: z.ZodNumber;
|
|
2948
2948
|
}, "strip", z.ZodTypeAny, {
|
|
2949
|
-
page: number;
|
|
2950
2949
|
size: number;
|
|
2950
|
+
page: number;
|
|
2951
2951
|
totalElements: number;
|
|
2952
2952
|
totalPages: number;
|
|
2953
2953
|
}, {
|
|
2954
|
-
page: number;
|
|
2955
2954
|
size: number;
|
|
2955
|
+
page: number;
|
|
2956
2956
|
totalElements: number;
|
|
2957
2957
|
totalPages: number;
|
|
2958
2958
|
}>>;
|
|
@@ -3893,8 +3893,8 @@ export declare const CouponResponseSchema: z.ZodObject<{
|
|
|
3893
3893
|
_id: 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>]>>;
|
|
3894
3894
|
}, z.ZodTypeAny, "passthrough">)[];
|
|
3895
3895
|
metadata?: {
|
|
3896
|
-
page: number;
|
|
3897
3896
|
size: number;
|
|
3897
|
+
page: number;
|
|
3898
3898
|
totalElements: number;
|
|
3899
3899
|
totalPages: number;
|
|
3900
3900
|
} | undefined;
|
|
@@ -4212,8 +4212,8 @@ export declare const CouponResponseSchema: z.ZodObject<{
|
|
|
4212
4212
|
_id: 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>]>>;
|
|
4213
4213
|
}, z.ZodTypeAny, "passthrough">)[];
|
|
4214
4214
|
metadata?: {
|
|
4215
|
-
page: number;
|
|
4216
4215
|
size: number;
|
|
4216
|
+
page: number;
|
|
4217
4217
|
totalElements: number;
|
|
4218
4218
|
totalPages: number;
|
|
4219
4219
|
} | undefined;
|
|
@@ -5468,8 +5468,8 @@ export declare const CouponResponseSchema: z.ZodObject<{
|
|
|
5468
5468
|
_id: 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>]>>;
|
|
5469
5469
|
}, z.ZodTypeAny, "passthrough">)[];
|
|
5470
5470
|
metadata?: {
|
|
5471
|
-
page: number;
|
|
5472
5471
|
size: number;
|
|
5472
|
+
page: number;
|
|
5473
5473
|
totalElements: number;
|
|
5474
5474
|
totalPages: number;
|
|
5475
5475
|
} | undefined;
|
|
@@ -6102,8 +6102,8 @@ export declare const CouponResponseSchema: z.ZodObject<{
|
|
|
6102
6102
|
_id: 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>]>>;
|
|
6103
6103
|
}, z.ZodTypeAny, "passthrough">)[];
|
|
6104
6104
|
metadata?: {
|
|
6105
|
-
page: number;
|
|
6106
6105
|
size: number;
|
|
6106
|
+
page: number;
|
|
6107
6107
|
totalElements: number;
|
|
6108
6108
|
totalPages: number;
|
|
6109
6109
|
} | undefined;
|
|
@@ -1304,13 +1304,13 @@ export declare const CouponValidationResponseSchema: z.ZodObject<{
|
|
|
1304
1304
|
totalElements: z.ZodNumber;
|
|
1305
1305
|
totalPages: z.ZodNumber;
|
|
1306
1306
|
}, "strip", z.ZodTypeAny, {
|
|
1307
|
-
page: number;
|
|
1308
1307
|
size: number;
|
|
1308
|
+
page: number;
|
|
1309
1309
|
totalElements: number;
|
|
1310
1310
|
totalPages: number;
|
|
1311
1311
|
}, {
|
|
1312
|
-
page: number;
|
|
1313
1312
|
size: number;
|
|
1313
|
+
page: number;
|
|
1314
1314
|
totalElements: number;
|
|
1315
1315
|
totalPages: number;
|
|
1316
1316
|
}>>;
|
|
@@ -1369,8 +1369,8 @@ export declare const CouponValidationResponseSchema: z.ZodObject<{
|
|
|
1369
1369
|
couponInfo?: Record<string, unknown> | undefined;
|
|
1370
1370
|
}[];
|
|
1371
1371
|
metadata?: {
|
|
1372
|
-
page: number;
|
|
1373
1372
|
size: number;
|
|
1373
|
+
page: number;
|
|
1374
1374
|
totalElements: number;
|
|
1375
1375
|
totalPages: number;
|
|
1376
1376
|
} | undefined;
|
|
@@ -1394,8 +1394,8 @@ export declare const CouponValidationResponseSchema: z.ZodObject<{
|
|
|
1394
1394
|
couponInfo?: Record<string, unknown> | undefined;
|
|
1395
1395
|
}[];
|
|
1396
1396
|
metadata?: {
|
|
1397
|
-
page: number;
|
|
1398
1397
|
size: number;
|
|
1398
|
+
page: number;
|
|
1399
1399
|
totalElements: number;
|
|
1400
1400
|
totalPages: number;
|
|
1401
1401
|
} | undefined;
|
|
@@ -1474,8 +1474,8 @@ export declare const CouponValidationResponseSchema: z.ZodObject<{
|
|
|
1474
1474
|
couponInfo?: Record<string, unknown> | undefined;
|
|
1475
1475
|
}[];
|
|
1476
1476
|
metadata?: {
|
|
1477
|
-
page: number;
|
|
1478
1477
|
size: number;
|
|
1478
|
+
page: number;
|
|
1479
1479
|
totalElements: number;
|
|
1480
1480
|
totalPages: number;
|
|
1481
1481
|
} | undefined;
|
|
@@ -1520,8 +1520,8 @@ export declare const CouponValidationResponseSchema: z.ZodObject<{
|
|
|
1520
1520
|
couponInfo?: Record<string, unknown> | undefined;
|
|
1521
1521
|
}[];
|
|
1522
1522
|
metadata?: {
|
|
1523
|
-
page: number;
|
|
1524
1523
|
size: number;
|
|
1524
|
+
page: number;
|
|
1525
1525
|
totalElements: number;
|
|
1526
1526
|
totalPages: number;
|
|
1527
1527
|
} | undefined;
|
|
@@ -1929,13 +1929,13 @@ export declare const CouponMetricsResponseSchema: z.ZodObject<{
|
|
|
1929
1929
|
totalElements: z.ZodNumber;
|
|
1930
1930
|
totalPages: z.ZodNumber;
|
|
1931
1931
|
}, "strip", z.ZodTypeAny, {
|
|
1932
|
-
page: number;
|
|
1933
1932
|
size: number;
|
|
1933
|
+
page: number;
|
|
1934
1934
|
totalElements: number;
|
|
1935
1935
|
totalPages: number;
|
|
1936
1936
|
}, {
|
|
1937
|
-
page: number;
|
|
1938
1937
|
size: number;
|
|
1938
|
+
page: number;
|
|
1939
1939
|
totalElements: number;
|
|
1940
1940
|
totalPages: number;
|
|
1941
1941
|
}>>;
|
|
@@ -1967,8 +1967,8 @@ export declare const CouponMetricsResponseSchema: z.ZodObject<{
|
|
|
1967
1967
|
totalProfit?: number | undefined;
|
|
1968
1968
|
}[];
|
|
1969
1969
|
metadata?: {
|
|
1970
|
-
page: number;
|
|
1971
1970
|
size: number;
|
|
1971
|
+
page: number;
|
|
1972
1972
|
totalElements: number;
|
|
1973
1973
|
totalPages: number;
|
|
1974
1974
|
} | undefined;
|
|
@@ -1983,8 +1983,8 @@ export declare const CouponMetricsResponseSchema: z.ZodObject<{
|
|
|
1983
1983
|
totalProfit?: number | undefined;
|
|
1984
1984
|
}[];
|
|
1985
1985
|
metadata?: {
|
|
1986
|
-
page: number;
|
|
1987
1986
|
size: number;
|
|
1987
|
+
page: number;
|
|
1988
1988
|
totalElements: number;
|
|
1989
1989
|
totalPages: number;
|
|
1990
1990
|
} | undefined;
|
|
@@ -2027,8 +2027,8 @@ export declare const CouponMetricsResponseSchema: z.ZodObject<{
|
|
|
2027
2027
|
totalProfit?: number | undefined;
|
|
2028
2028
|
}[];
|
|
2029
2029
|
metadata?: {
|
|
2030
|
-
page: number;
|
|
2031
2030
|
size: number;
|
|
2031
|
+
page: number;
|
|
2032
2032
|
totalElements: number;
|
|
2033
2033
|
totalPages: number;
|
|
2034
2034
|
} | undefined;
|
|
@@ -2055,8 +2055,8 @@ export declare const CouponMetricsResponseSchema: z.ZodObject<{
|
|
|
2055
2055
|
totalProfit?: number | undefined;
|
|
2056
2056
|
}[];
|
|
2057
2057
|
metadata?: {
|
|
2058
|
-
page: number;
|
|
2059
2058
|
size: number;
|
|
2059
|
+
page: number;
|
|
2060
2060
|
totalElements: number;
|
|
2061
2061
|
totalPages: number;
|
|
2062
2062
|
} | undefined;
|
|
@@ -2072,13 +2072,13 @@ export declare const CouponMetricsByTypeResponseSchema: z.ZodObject<{
|
|
|
2072
2072
|
totalElements: z.ZodNumber;
|
|
2073
2073
|
totalPages: z.ZodNumber;
|
|
2074
2074
|
}, "strip", z.ZodTypeAny, {
|
|
2075
|
-
page: number;
|
|
2076
2075
|
size: number;
|
|
2076
|
+
page: number;
|
|
2077
2077
|
totalElements: number;
|
|
2078
2078
|
totalPages: number;
|
|
2079
2079
|
}, {
|
|
2080
|
-
page: number;
|
|
2081
2080
|
size: number;
|
|
2081
|
+
page: number;
|
|
2082
2082
|
totalElements: number;
|
|
2083
2083
|
totalPages: number;
|
|
2084
2084
|
}>>;
|
|
@@ -2116,8 +2116,8 @@ export declare const CouponMetricsByTypeResponseSchema: z.ZodObject<{
|
|
|
2116
2116
|
amountSpent?: number | undefined;
|
|
2117
2117
|
}[][];
|
|
2118
2118
|
metadata?: {
|
|
2119
|
-
page: number;
|
|
2120
2119
|
size: number;
|
|
2120
|
+
page: number;
|
|
2121
2121
|
totalElements: number;
|
|
2122
2122
|
totalPages: number;
|
|
2123
2123
|
} | undefined;
|
|
@@ -2134,8 +2134,8 @@ export declare const CouponMetricsByTypeResponseSchema: z.ZodObject<{
|
|
|
2134
2134
|
amountSpent?: number | undefined;
|
|
2135
2135
|
}[][];
|
|
2136
2136
|
metadata?: {
|
|
2137
|
-
page: number;
|
|
2138
2137
|
size: number;
|
|
2138
|
+
page: number;
|
|
2139
2139
|
totalElements: number;
|
|
2140
2140
|
totalPages: number;
|
|
2141
2141
|
} | undefined;
|
|
@@ -2186,8 +2186,8 @@ export declare const CouponMetricsByTypeResponseSchema: z.ZodObject<{
|
|
|
2186
2186
|
amountSpent?: number | undefined;
|
|
2187
2187
|
}[][];
|
|
2188
2188
|
metadata?: {
|
|
2189
|
-
page: number;
|
|
2190
2189
|
size: number;
|
|
2190
|
+
page: number;
|
|
2191
2191
|
totalElements: number;
|
|
2192
2192
|
totalPages: number;
|
|
2193
2193
|
} | undefined;
|
|
@@ -2218,8 +2218,8 @@ export declare const CouponMetricsByTypeResponseSchema: z.ZodObject<{
|
|
|
2218
2218
|
amountSpent?: number | undefined;
|
|
2219
2219
|
}[][];
|
|
2220
2220
|
metadata?: {
|
|
2221
|
-
page: number;
|
|
2222
2221
|
size: number;
|
|
2222
|
+
page: number;
|
|
2223
2223
|
totalElements: number;
|
|
2224
2224
|
totalPages: number;
|
|
2225
2225
|
} | undefined;
|
|
@@ -2235,13 +2235,13 @@ export declare const GraphResponseSchema: z.ZodObject<{
|
|
|
2235
2235
|
totalElements: z.ZodNumber;
|
|
2236
2236
|
totalPages: z.ZodNumber;
|
|
2237
2237
|
}, "strip", z.ZodTypeAny, {
|
|
2238
|
-
page: number;
|
|
2239
2238
|
size: number;
|
|
2239
|
+
page: number;
|
|
2240
2240
|
totalElements: number;
|
|
2241
2241
|
totalPages: number;
|
|
2242
2242
|
}, {
|
|
2243
|
-
page: number;
|
|
2244
2243
|
size: number;
|
|
2244
|
+
page: number;
|
|
2245
2245
|
totalElements: number;
|
|
2246
2246
|
totalPages: number;
|
|
2247
2247
|
}>>;
|
|
@@ -2267,8 +2267,8 @@ export declare const GraphResponseSchema: z.ZodObject<{
|
|
|
2267
2267
|
}[];
|
|
2268
2268
|
}[];
|
|
2269
2269
|
metadata?: {
|
|
2270
|
-
page: number;
|
|
2271
2270
|
size: number;
|
|
2271
|
+
page: number;
|
|
2272
2272
|
totalElements: number;
|
|
2273
2273
|
totalPages: number;
|
|
2274
2274
|
} | undefined;
|
|
@@ -2281,8 +2281,8 @@ export declare const GraphResponseSchema: z.ZodObject<{
|
|
|
2281
2281
|
}[];
|
|
2282
2282
|
}[];
|
|
2283
2283
|
metadata?: {
|
|
2284
|
-
page: number;
|
|
2285
2284
|
size: number;
|
|
2285
|
+
page: number;
|
|
2286
2286
|
totalElements: number;
|
|
2287
2287
|
totalPages: number;
|
|
2288
2288
|
} | undefined;
|
|
@@ -2317,8 +2317,8 @@ export declare const GraphResponseSchema: z.ZodObject<{
|
|
|
2317
2317
|
}[];
|
|
2318
2318
|
}[];
|
|
2319
2319
|
metadata?: {
|
|
2320
|
-
page: number;
|
|
2321
2320
|
size: number;
|
|
2321
|
+
page: number;
|
|
2322
2322
|
totalElements: number;
|
|
2323
2323
|
totalPages: number;
|
|
2324
2324
|
} | undefined;
|
|
@@ -2341,8 +2341,8 @@ export declare const GraphResponseSchema: z.ZodObject<{
|
|
|
2341
2341
|
}[];
|
|
2342
2342
|
}[];
|
|
2343
2343
|
metadata?: {
|
|
2344
|
-
page: number;
|
|
2345
2344
|
size: number;
|
|
2345
|
+
page: number;
|
|
2346
2346
|
totalElements: number;
|
|
2347
2347
|
totalPages: number;
|
|
2348
2348
|
} | undefined;
|
|
@@ -2358,13 +2358,13 @@ export declare const TotalProfitGraphResponseSchema: z.ZodObject<{
|
|
|
2358
2358
|
totalElements: z.ZodNumber;
|
|
2359
2359
|
totalPages: z.ZodNumber;
|
|
2360
2360
|
}, "strip", z.ZodTypeAny, {
|
|
2361
|
-
page: number;
|
|
2362
2361
|
size: number;
|
|
2362
|
+
page: number;
|
|
2363
2363
|
totalElements: number;
|
|
2364
2364
|
totalPages: number;
|
|
2365
2365
|
}, {
|
|
2366
|
-
page: number;
|
|
2367
2366
|
size: number;
|
|
2367
|
+
page: number;
|
|
2368
2368
|
totalElements: number;
|
|
2369
2369
|
totalPages: number;
|
|
2370
2370
|
}>>;
|
|
@@ -2393,8 +2393,8 @@ export declare const TotalProfitGraphResponseSchema: z.ZodObject<{
|
|
|
2393
2393
|
totalProfit?: number | undefined;
|
|
2394
2394
|
}[];
|
|
2395
2395
|
metadata?: {
|
|
2396
|
-
page: number;
|
|
2397
2396
|
size: number;
|
|
2397
|
+
page: number;
|
|
2398
2398
|
totalElements: number;
|
|
2399
2399
|
totalPages: number;
|
|
2400
2400
|
} | undefined;
|
|
@@ -2408,8 +2408,8 @@ export declare const TotalProfitGraphResponseSchema: z.ZodObject<{
|
|
|
2408
2408
|
totalProfit?: number | undefined;
|
|
2409
2409
|
}[];
|
|
2410
2410
|
metadata?: {
|
|
2411
|
-
page: number;
|
|
2412
2411
|
size: number;
|
|
2412
|
+
page: number;
|
|
2413
2413
|
totalElements: number;
|
|
2414
2414
|
totalPages: number;
|
|
2415
2415
|
} | undefined;
|
|
@@ -2448,8 +2448,8 @@ export declare const TotalProfitGraphResponseSchema: z.ZodObject<{
|
|
|
2448
2448
|
totalProfit?: number | undefined;
|
|
2449
2449
|
}[];
|
|
2450
2450
|
metadata?: {
|
|
2451
|
-
page: number;
|
|
2452
2451
|
size: number;
|
|
2452
|
+
page: number;
|
|
2453
2453
|
totalElements: number;
|
|
2454
2454
|
totalPages: number;
|
|
2455
2455
|
} | undefined;
|
|
@@ -2474,8 +2474,8 @@ export declare const TotalProfitGraphResponseSchema: z.ZodObject<{
|
|
|
2474
2474
|
totalProfit?: number | undefined;
|
|
2475
2475
|
}[];
|
|
2476
2476
|
metadata?: {
|
|
2477
|
-
page: number;
|
|
2478
2477
|
size: number;
|
|
2478
|
+
page: number;
|
|
2479
2479
|
totalElements: number;
|
|
2480
2480
|
totalPages: number;
|
|
2481
2481
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-coupon.validation.d.ts","sourceRoot":"/","sources":["modules/coupon/validations/create-coupon.validation.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9B,CAAC"}
|
|
@@ -3,10 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CreateCouponSchema = void 0;
|
|
4
4
|
const all_coupons_validation_1 = require("./all-coupons.validation");
|
|
5
5
|
exports.CreateCouponSchema = all_coupons_validation_1.AllCouponsValidationSchema.refine((data) => {
|
|
6
|
-
if (data.orderLimitPerUser === null ||
|
|
7
|
-
data.totalOrderLimit === null ||
|
|
8
|
-
!data.isOrderLimitPerUserEnabled ||
|
|
9
|
-
!data.isTotalOrderLimitEnabled)
|
|
6
|
+
if (data.orderLimitPerUser === null || data.totalOrderLimit === null)
|
|
10
7
|
return true;
|
|
11
8
|
return data.orderLimitPerUser <= data.totalOrderLimit;
|
|
12
9
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-coupon.validation.js","sourceRoot":"/","sources":["modules/coupon/validations/create-coupon.validation.ts"],"names":[],"mappings":";;;AAAA,qEAA8F;AAEjF,QAAA,kBAAkB,GAAG,mDAA0B,CAAC,MAAM,CAClE,CAAC,IAAS,EAAE,EAAE;IACb,
|
|
1
|
+
{"version":3,"file":"create-coupon.validation.js","sourceRoot":"/","sources":["modules/coupon/validations/create-coupon.validation.ts"],"names":[],"mappings":";;;AAAA,qEAA8F;AAEjF,QAAA,kBAAkB,GAAG,mDAA0B,CAAC,MAAM,CAClE,CAAC,IAAS,EAAE,EAAE;IACb,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClF,OAAO,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,eAAe,CAAC;AACvD,CAAC,EACD;IACC,OAAO,EAAE,mEAAmE;IAC5E,IAAI,EAAE,CAAC,mBAAmB,CAAC;CAC3B,CACD,CAAC","sourcesContent":["import { AllCouponsValidationSchema, AllCouponsUpdateSchema } from './all-coupons.validation';\n\nexport const CreateCouponSchema = AllCouponsValidationSchema.refine(\n\t(data: any) => {\n\t\tif (data.orderLimitPerUser === null || data.totalOrderLimit === null) return true;\n\t\treturn data.orderLimitPerUser <= data.totalOrderLimit;\n\t},\n\t{\n\t\tmessage: 'Order limit per user cannot be greater than the total order limit',\n\t\tpath: ['orderLimitPerUser'],\n\t}\n);\n"]}
|
|
@@ -45,8 +45,8 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
45
45
|
_id: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
46
46
|
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
47
47
|
metadata?: {
|
|
48
|
-
page: number;
|
|
49
48
|
size: number;
|
|
49
|
+
page: number;
|
|
50
50
|
totalElements: number;
|
|
51
51
|
totalPages: number;
|
|
52
52
|
} | undefined;
|
|
@@ -78,8 +78,8 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
78
78
|
_id: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
79
79
|
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
80
80
|
metadata?: {
|
|
81
|
-
page: number;
|
|
82
81
|
size: number;
|
|
82
|
+
page: number;
|
|
83
83
|
totalElements: number;
|
|
84
84
|
totalPages: number;
|
|
85
85
|
} | undefined;
|
|
@@ -89,15 +89,15 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
89
89
|
}>;
|
|
90
90
|
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
91
91
|
input: {
|
|
92
|
+
sort?: Record<string, 1 | -1> | undefined;
|
|
92
93
|
search?: {
|
|
93
94
|
searchKey: string;
|
|
94
95
|
searchFields?: string[] | undefined;
|
|
95
96
|
} | undefined;
|
|
96
|
-
sort?: Record<string, 1 | -1> | undefined;
|
|
97
|
-
page?: number | undefined;
|
|
98
97
|
select?: Record<string, 0 | 1> | undefined;
|
|
99
|
-
size?: number | undefined;
|
|
100
98
|
populate?: any;
|
|
99
|
+
size?: number | undefined;
|
|
100
|
+
page?: number | undefined;
|
|
101
101
|
query?: Record<string, any> | undefined;
|
|
102
102
|
} | undefined;
|
|
103
103
|
output: {
|
|
@@ -122,8 +122,8 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
122
122
|
_id: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
123
123
|
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
124
124
|
metadata?: {
|
|
125
|
-
page: number;
|
|
126
125
|
size: number;
|
|
126
|
+
page: number;
|
|
127
127
|
totalElements: number;
|
|
128
128
|
totalPages: number;
|
|
129
129
|
} | undefined;
|
|
@@ -165,8 +165,8 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
165
165
|
_id: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
166
166
|
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
167
167
|
metadata?: {
|
|
168
|
-
page: number;
|
|
169
168
|
size: number;
|
|
169
|
+
page: number;
|
|
170
170
|
totalElements: number;
|
|
171
171
|
totalPages: number;
|
|
172
172
|
} | undefined;
|
|
@@ -207,8 +207,8 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
207
207
|
_id: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
208
208
|
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
209
209
|
metadata?: {
|
|
210
|
-
page: number;
|
|
211
210
|
size: number;
|
|
211
|
+
page: number;
|
|
212
212
|
totalElements: number;
|
|
213
213
|
totalPages: number;
|
|
214
214
|
} | undefined;
|
|
@@ -243,8 +243,8 @@ export declare const dealSettingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
243
243
|
_id: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
244
244
|
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
245
245
|
metadata?: {
|
|
246
|
-
page: number;
|
|
247
246
|
size: number;
|
|
247
|
+
page: number;
|
|
248
248
|
totalElements: number;
|
|
249
249
|
totalPages: number;
|
|
250
250
|
} | undefined;
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAsBtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCP,CAAC"}
|