@lyxa.ai/marketing 1.0.62 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/event/event-initializations.d.ts.map +1 -1
- package/dist/lib/event/event-initializations.js +2 -0
- package/dist/lib/event/event-initializations.js.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.d.ts +2 -0
- package/dist/lib/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.js +69 -12
- package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
- package/dist/lib/event/events/marketing-product-seed.event.d.ts +1 -2
- 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/event/events/marketing-product-sync.event.d.ts +11 -0
- package/dist/lib/event/events/marketing-product-sync.event.d.ts.map +1 -0
- package/dist/lib/event/events/marketing-product-sync.event.js +12 -0
- package/dist/lib/event/events/marketing-product-sync.event.js.map +1 -0
- package/dist/lib/index.d.ts +533 -18
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +5 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js +4 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js +4 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
- package/dist/lib/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
- package/dist/lib/modules/featured-setting/services/featured-setting.service.js +3 -0
- package/dist/lib/modules/featured-setting/services/featured-setting.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +11 -0
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js +6 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +2 -6
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +22 -3
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js +12 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +19 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +8 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +64 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js +66 -8
- 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 +37 -19
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +249 -18
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +15 -3
- 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 +24 -3
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +19 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +43 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +195 -10
- 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 +29 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js +2 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +427 -32
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +16 -6
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +7 -4
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js +42 -7
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +15 -3
- 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 +84 -18
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js +75 -0
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js +83 -0
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js.map +1 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +29 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts +14 -0
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.js +5 -0
- package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
- package/dist/lib/modules/marketing/services/index.d.ts +3 -0
- package/dist/lib/modules/marketing/services/index.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/index.js +3 -0
- package/dist/lib/modules/marketing/services/index.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing-conflict.repository.d.ts +9 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.repository.d.ts.map +1 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.repository.js +63 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.repository.js.map +1 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.service.d.ts +28 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.service.d.ts.map +1 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.service.js +139 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.service.js.map +1 -0
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +7 -2
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +100 -51
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +2 -3
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.js +42 -13
- package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.d.ts +14 -0
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.d.ts.map +1 -0
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.js +82 -0
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.repository.js.map +1 -0
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.d.ts +11 -0
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.d.ts.map +1 -0
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.js +100 -0
- package/dist/lib/modules/marketing/services/spend-to-get-marketing.service.js.map +1 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.d.ts +9 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.d.ts.map +1 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.js +69 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.repository.js.map +1 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts +31 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.service.d.ts.map +1 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.service.js +123 -0
- package/dist/lib/modules/marketing/services/spend-to-get-progress.service.js.map +1 -0
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js +95 -27
- 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.map +1 -1
- package/dist/lib/modules/marketing/validations/all-marketings.validation.js +3 -0
- package/dist/lib/modules/marketing/validations/all-marketings.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/index.d.ts +1 -0
- package/dist/lib/modules/marketing/validations/index.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/index.js +1 -0
- package/dist/lib/modules/marketing/validations/index.js.map +1 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +17 -0
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.js +7 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.d.ts +617 -0
- package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -0
- package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js +119 -0
- package/dist/lib/modules/marketing/validations/spend-to-get-marketing.validation.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +24 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js +97 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.repository.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts +271 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.js +62 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.router.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts +24 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.js +116 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.service.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +232 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.js +30 -0
- package/dist/lib/modules/spend-to-get-history/spend-to-get-history.validation.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 +2 -0
- package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/types/event/events/marketing-product-seed.event.d.ts +1 -2
- package/dist/types/event/events/marketing-product-seed.event.d.ts.map +1 -1
- package/dist/types/event/events/marketing-product-sync.event.d.ts +11 -0
- package/dist/types/event/events/marketing-product-sync.event.d.ts.map +1 -0
- package/dist/types/index.d.ts +533 -18
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
- package/dist/types/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +54 -8
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +0 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +16 -3
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +2 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +242 -35
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +8 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +3 -0
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +249 -18
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts +2 -0
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +24 -3
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +10 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +195 -10
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +427 -32
- 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 +7 -4
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts +15 -3
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +13 -0
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +21 -0
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +1 -0
- package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +1 -0
- package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -1
- package/dist/types/modules/marketing/routers/marketing.router.d.ts +14 -0
- package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/index.d.ts +3 -0
- package/dist/types/modules/marketing/services/index.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing-conflict.repository.d.ts +9 -0
- package/dist/types/modules/marketing/services/marketing-conflict.repository.d.ts.map +1 -0
- package/dist/types/modules/marketing/services/marketing-conflict.service.d.ts +46 -0
- package/dist/types/modules/marketing/services/marketing-conflict.service.d.ts.map +1 -0
- package/dist/types/modules/marketing/services/marketing.service.d.ts +7 -2
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts +7 -3
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/spend-to-get-marketing.repository.d.ts +14 -0
- package/dist/types/modules/marketing/services/spend-to-get-marketing.repository.d.ts.map +1 -0
- package/dist/types/modules/marketing/services/spend-to-get-marketing.service.d.ts +20 -0
- package/dist/types/modules/marketing/services/spend-to-get-marketing.service.d.ts.map +1 -0
- package/dist/types/modules/marketing/services/spend-to-get-progress.repository.d.ts +9 -0
- package/dist/types/modules/marketing/services/spend-to-get-progress.repository.d.ts.map +1 -0
- package/dist/types/modules/marketing/services/spend-to-get-progress.service.d.ts +37 -0
- package/dist/types/modules/marketing/services/spend-to-get-progress.service.d.ts.map +1 -0
- 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.map +1 -1
- package/dist/types/modules/marketing/validations/index.d.ts +1 -0
- package/dist/types/modules/marketing/validations/index.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts +17 -0
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/spend-to-get-marketing.validation.d.ts +630 -0
- package/dist/types/modules/marketing/validations/spend-to-get-marketing.validation.d.ts.map +1 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts +24 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.repository.d.ts.map +1 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts +271 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.router.d.ts.map +1 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts +56 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.service.d.ts.map +1 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts +241 -0
- package/dist/types/modules/spend-to-get-history/spend-to-get-history.validation.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpendToGetTierSchema = exports.UpdateSpendToGetMarketingSchema = exports.SpendToGetMarketingIdValidationSchema = exports.SpendToGetMarketingSchema = exports.SpendToGetMarketingValidationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const global_validation_1 = require("@lyxa.ai/core/dist/utilities/validation/global-validation");
|
|
6
|
+
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
7
|
+
const marketing_validation_1 = require("./marketing.validation");
|
|
8
|
+
const SpendToGetTierSchema = zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
minSpend: global_validation_1.ZodValidation.number('Minimum spend', { isNonnegative: true }),
|
|
11
|
+
rewardType: global_validation_1.ZodValidation.enumType(enum_1.SpendToGetRewardType, 'Reward type'),
|
|
12
|
+
rewardValue: global_validation_1.ZodValidation.number('Reward value').optional(),
|
|
13
|
+
maxDiscountCap: global_validation_1.ZodValidation.number('Maximum discount cap').optional(),
|
|
14
|
+
isMaxDiscountCapEnabled: global_validation_1.ZodValidation.boolean('Is maximum discount cap enabled').default(false),
|
|
15
|
+
})
|
|
16
|
+
.superRefine((tier, ctx) => {
|
|
17
|
+
if (tier.rewardType === enum_1.SpendToGetRewardType.FREE_DELIVERY) {
|
|
18
|
+
if (tier.rewardValue !== undefined) {
|
|
19
|
+
ctx.addIssue({
|
|
20
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
21
|
+
message: 'Reward value is not applicable for Free Delivery',
|
|
22
|
+
path: ['rewardValue'],
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (tier.rewardValue === undefined) {
|
|
27
|
+
ctx.addIssue({
|
|
28
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
29
|
+
message: 'Reward value is required',
|
|
30
|
+
path: ['rewardValue'],
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else if (tier.rewardType === enum_1.SpendToGetRewardType.PERCENTAGE) {
|
|
34
|
+
if (tier.rewardValue < 1 || tier.rewardValue > 100) {
|
|
35
|
+
ctx.addIssue({
|
|
36
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
37
|
+
message: 'Percentage reward value must be between 1 and 100',
|
|
38
|
+
path: ['rewardValue'],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (tier.rewardType === enum_1.SpendToGetRewardType.FIXED) {
|
|
43
|
+
if (tier.rewardValue <= 0) {
|
|
44
|
+
ctx.addIssue({
|
|
45
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
46
|
+
message: 'Fixed reward value must be greater than 0',
|
|
47
|
+
path: ['rewardValue'],
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (tier.rewardValue >= tier.minSpend) {
|
|
51
|
+
ctx.addIssue({
|
|
52
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
53
|
+
message: "Fixed reward value must be less than the tier's minimum spend",
|
|
54
|
+
path: ['rewardValue'],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (tier.maxDiscountCap !== undefined && tier.rewardType !== enum_1.SpendToGetRewardType.PERCENTAGE) {
|
|
59
|
+
ctx.addIssue({
|
|
60
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
61
|
+
message: 'Maximum discount cap only applies to Percentage rewards',
|
|
62
|
+
path: ['maxDiscountCap'],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
exports.SpendToGetTierSchema = SpendToGetTierSchema;
|
|
67
|
+
const baseFields = {
|
|
68
|
+
...marketing_validation_1.baseMarketingFields,
|
|
69
|
+
marketingType: zod_1.z.literal(enum_1.MarketingType.SPEND_TO_GET),
|
|
70
|
+
tiers: global_validation_1.ZodValidation.array(SpendToGetTierSchema, 'Tiers', 1),
|
|
71
|
+
perUserLimit: global_validation_1.ZodValidation.number('Per user limit', { isPositive: true }).optional(),
|
|
72
|
+
isPerUserLimitEnabled: global_validation_1.ZodValidation.boolean('Is per user limit enabled').default(false),
|
|
73
|
+
spendLimit: global_validation_1.ZodValidation.number('Spend limit').default(0),
|
|
74
|
+
isSpendLimitEnabled: global_validation_1.ZodValidation.boolean('Is spend limit enabled').default(false),
|
|
75
|
+
};
|
|
76
|
+
const schemaBuilder = (0, global_validation_1.createSchemaBuilder)(baseFields);
|
|
77
|
+
const { BaseSchema: SpendToGetMarketingValidationSchemaWithoutRefinement, EntitySchema: SpendToGetMarketingSchema, IdSchema: SpendToGetMarketingIdSchema, UpdateSchema: UpdateSpendToGetMarketingSchemaWithoutRefinement, } = schemaBuilder.getAllSchemas({ createdAt: true });
|
|
78
|
+
exports.SpendToGetMarketingSchema = SpendToGetMarketingSchema;
|
|
79
|
+
exports.SpendToGetMarketingIdValidationSchema = SpendToGetMarketingIdSchema;
|
|
80
|
+
function addAscendingTierIssues(tiers, ctx) {
|
|
81
|
+
for (let i = 1; i < tiers.length; i++) {
|
|
82
|
+
if (tiers[i].minSpend <= tiers[i - 1].minSpend) {
|
|
83
|
+
ctx.addIssue({
|
|
84
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
85
|
+
message: "Each tier's minimum spend must be higher than the previous tier.",
|
|
86
|
+
path: ['tiers', i, 'minSpend'],
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function addLimitIssues(data, ctx) {
|
|
92
|
+
if (data.isSpendLimitEnabled && (!data.spendLimit || data.spendLimit <= 0)) {
|
|
93
|
+
ctx.addIssue({
|
|
94
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
95
|
+
message: 'Spend limit must be greater than 0 when enabled',
|
|
96
|
+
path: ['spendLimit', 'isSpendLimitEnabled'],
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (data.isPerUserLimitEnabled && (!data.perUserLimit || data.perUserLimit <= 0)) {
|
|
100
|
+
ctx.addIssue({
|
|
101
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
102
|
+
message: 'Per user limit must be greater than 0 when enabled',
|
|
103
|
+
path: ['perUserLimit', 'isPerUserLimitEnabled'],
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const SpendToGetMarketingValidationSchema = SpendToGetMarketingValidationSchemaWithoutRefinement.superRefine((data, ctx) => {
|
|
108
|
+
addAscendingTierIssues(data.tiers, ctx);
|
|
109
|
+
addLimitIssues(data, ctx);
|
|
110
|
+
});
|
|
111
|
+
exports.SpendToGetMarketingValidationSchema = SpendToGetMarketingValidationSchema;
|
|
112
|
+
const UpdateSpendToGetMarketingSchema = UpdateSpendToGetMarketingSchemaWithoutRefinement.superRefine((data, ctx) => {
|
|
113
|
+
if (data.tiers) {
|
|
114
|
+
addAscendingTierIssues(data.tiers, ctx);
|
|
115
|
+
}
|
|
116
|
+
addLimitIssues(data, ctx);
|
|
117
|
+
});
|
|
118
|
+
exports.UpdateSpendToGetMarketingSchema = UpdateSpendToGetMarketingSchema;
|
|
119
|
+
//# sourceMappingURL=spend-to-get-marketing.validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/spend-to-get-marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,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import {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO,\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { MarketingType, SpendToGetRewardType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { baseMarketingFields } from './marketing.validation';\n\n/**\n * Single spend tier: minimum spend + reward. Reward value is required for\n * PERCENTAGE/FIXED and forbidden for FREE_DELIVERY; maxDiscountCap only applies to PERCENTAGE.\n */\nconst SpendToGetTierSchema = z\n\t.object({\n\t\tminSpend: ZodValidation.number('Minimum spend', { isNonnegative: true }),\n\t\trewardType: ZodValidation.enumType(SpendToGetRewardType, 'Reward type'),\n\t\trewardValue: ZodValidation.number('Reward value').optional(),\n\t\tmaxDiscountCap: ZodValidation.number('Maximum discount cap').optional(),\n\t\tisMaxDiscountCapEnabled: ZodValidation.boolean('Is maximum discount cap enabled').default(false),\n\t})\n\t.superRefine((tier, ctx) => {\n\t\tif (tier.rewardType === SpendToGetRewardType.FREE_DELIVERY) {\n\t\t\tif (tier.rewardValue !== undefined) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: 'Reward value is not applicable for Free Delivery',\n\t\t\t\t\tpath: ['rewardValue'],\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (tier.rewardValue === undefined) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Reward value is required',\n\t\t\t\tpath: ['rewardValue'],\n\t\t\t});\n\t\t} else if (tier.rewardType === SpendToGetRewardType.PERCENTAGE) {\n\t\t\tif (tier.rewardValue < 1 || tier.rewardValue > 100) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: 'Percentage reward value must be between 1 and 100',\n\t\t\t\t\tpath: ['rewardValue'],\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (tier.rewardType === SpendToGetRewardType.FIXED) {\n\t\t\tif (tier.rewardValue <= 0) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: 'Fixed reward value must be greater than 0',\n\t\t\t\t\tpath: ['rewardValue'],\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (tier.rewardValue >= tier.minSpend) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: \"Fixed reward value must be less than the tier's minimum spend\",\n\t\t\t\t\tpath: ['rewardValue'],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (tier.maxDiscountCap !== undefined && tier.rewardType !== SpendToGetRewardType.PERCENTAGE) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Maximum discount cap only applies to Percentage rewards',\n\t\t\t\tpath: ['maxDiscountCap'],\n\t\t\t});\n\t\t}\n\t});\n\n/**\n * Define the base parent schema fields\n */\nconst baseFields = {\n\t...baseMarketingFields,\n\tmarketingType: z.literal(MarketingType.SPEND_TO_GET),\n\ttiers: ZodValidation.array(SpendToGetTierSchema, 'Tiers', 1),\n\tperUserLimit: ZodValidation.number('Per user limit', { isPositive: true }).optional(),\n\tisPerUserLimitEnabled: ZodValidation.boolean('Is per user limit enabled').default(false),\n\tspendLimit: ZodValidation.number('Spend limit').default(0),\n\tisSpendLimitEnabled: ZodValidation.boolean('Is spend limit enabled').default(false),\n};\n\n/**\n * Create schema builder for Parent entity\n * - Includes timestamps\n * - Excludes 'createdAt' from update operations\n */\nconst schemaBuilder = createSchemaBuilder(baseFields);\n\n/**\n * Get all schemas for the Parent entity\n */\nconst {\n\tBaseSchema: SpendToGetMarketingValidationSchemaWithoutRefinement,\n\tEntitySchema: SpendToGetMarketingSchema,\n\tIdSchema: SpendToGetMarketingIdSchema,\n\tUpdateSchema: UpdateSpendToGetMarketingSchemaWithoutRefinement,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nfunction addAscendingTierIssues(tiers: { minSpend: number }[], ctx: z.RefinementCtx): void {\n\tfor (let i = 1; i < tiers.length; i++) {\n\t\tif (tiers[i].minSpend <= tiers[i - 1].minSpend) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: \"Each tier's minimum spend must be higher than the previous tier.\",\n\t\t\t\tpath: ['tiers', i, 'minSpend'],\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction addLimitIssues(\n\tdata: {\n\t\tisSpendLimitEnabled?: boolean;\n\t\tspendLimit?: number;\n\t\tisPerUserLimitEnabled?: boolean;\n\t\tperUserLimit?: number;\n\t},\n\tctx: z.RefinementCtx\n): void {\n\tif (data.isSpendLimitEnabled && (!data.spendLimit || data.spendLimit <= 0)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: 'Spend limit must be greater than 0 when enabled',\n\t\t\tpath: ['spendLimit', 'isSpendLimitEnabled'],\n\t\t});\n\t}\n\n\tif (data.isPerUserLimitEnabled && (!data.perUserLimit || data.perUserLimit <= 0)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: 'Per user limit must be greater than 0 when enabled',\n\t\t\tpath: ['perUserLimit', 'isPerUserLimitEnabled'],\n\t\t});\n\t}\n}\n\nconst SpendToGetMarketingValidationSchema = SpendToGetMarketingValidationSchemaWithoutRefinement.superRefine(\n\t(data, ctx) => {\n\t\taddAscendingTierIssues(data.tiers, ctx);\n\t\taddLimitIssues(data, ctx);\n\t}\n);\n\nconst UpdateSpendToGetMarketingSchema = UpdateSpendToGetMarketingSchemaWithoutRefinement.superRefine(\n\t(data, ctx) => {\n\t\tif (data.tiers) {\n\t\t\taddAscendingTierIssues(data.tiers, ctx);\n\t\t}\n\t\taddLimitIssues(data, ctx);\n\t}\n);\n\n/**\n * Export schemas\n */\nexport {\n\tSpendToGetMarketingValidationSchema,\n\tSpendToGetMarketingSchema,\n\tSpendToGetMarketingIdSchema as SpendToGetMarketingIdValidationSchema,\n\tUpdateSpendToGetMarketingSchema,\n\tSpendToGetTierSchema,\n};\n\n/**\n * Export DTO types\n */\nexport type CreateSpendToGetMarketingDTO = DTO<typeof SpendToGetMarketingValidationSchema>;\nexport type SpendToGetMarketingDTO = DTO<typeof SpendToGetMarketingSchema>;\nexport type UpdateSpendToGetMarketingDTO = DTO<typeof UpdateSpendToGetMarketingSchema>;\nexport type SpendToGetTierDTO = DTO<typeof SpendToGetTierSchema>;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DocumentType, mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { ModelType } from '@typegoose/typegoose/lib/types';
|
|
3
|
+
import { SpendToGetHistory as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
4
|
+
import { FilterDTO, PaginatedResponse } from '@lyxa.ai/core/dist/utilities/validation';
|
|
5
|
+
import { CreateSpendToGetHistoryDTO as CreateDTO, UpdateSpendToGetHistoryDTO as UpdateDTO } from './spend-to-get-history.validation';
|
|
6
|
+
export declare class SpendToGetHistoryRepository {
|
|
7
|
+
private model;
|
|
8
|
+
constructor();
|
|
9
|
+
create(data: CreateDTO): Promise<DocumentType<Model>>;
|
|
10
|
+
findById(id: string | mongoose.Types.ObjectId): Promise<DocumentType<Model> | null>;
|
|
11
|
+
paginate(data?: Partial<FilterDTO>): Promise<PaginatedResponse<DocumentType<ModelType<Model>>>>;
|
|
12
|
+
updateById(id: string, data: UpdateDTO): Promise<DocumentType<Model> | null>;
|
|
13
|
+
deleteById(id: string | mongoose.Types.ObjectId, softDelete: boolean): Promise<unknown>;
|
|
14
|
+
incrementRedemption(params: {
|
|
15
|
+
user: mongoose.Types.ObjectId;
|
|
16
|
+
shop: mongoose.Types.ObjectId;
|
|
17
|
+
marketing: mongoose.Types.ObjectId;
|
|
18
|
+
order: mongoose.Types.ObjectId;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
decrementRedemption(orderId: mongoose.Types.ObjectId): Promise<void>;
|
|
21
|
+
findByUserAndMarketing(userId: mongoose.Types.ObjectId, marketingId: mongoose.Types.ObjectId): Promise<DocumentType<Model> | null>;
|
|
22
|
+
}
|
|
23
|
+
export declare const spendToGetHistoryRepository: SpendToGetHistoryRepository;
|
|
24
|
+
//# sourceMappingURL=spend-to-get-history.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-history.repository.d.ts","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAA0B,iBAAiB,IAAI,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAG/G,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EACN,0BAA0B,IAAI,SAAS,EACvC,0BAA0B,IAAI,SAAS,EACvC,MAAM,mCAAmC,CAAC;AAE3C,qBACa,2BAA2B;IACvC,OAAO,CAAC,KAAK,CAAyD;;IAMhE,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAIrD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAInF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAa/F,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAO5E,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvF,mBAAmB,CAAC,MAAM,EAAE;QACjC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC9B,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC9B,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC;IAQX,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpE,sBAAsB,CAC3B,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAClC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;CAGtC;AAED,eAAO,MAAM,2BAA2B,6BAA6C,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.spendToGetHistoryRepository = exports.SpendToGetHistoryRepository = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
|
|
48
|
+
const pagination_1 = require("@lyxa.ai/core/dist/utilities/pagination");
|
|
49
|
+
let SpendToGetHistoryRepository = class SpendToGetHistoryRepository {
|
|
50
|
+
model;
|
|
51
|
+
constructor() {
|
|
52
|
+
this.model = models_1.SpendToGetHistoryModel;
|
|
53
|
+
}
|
|
54
|
+
async create(data) {
|
|
55
|
+
return this.model.create(data);
|
|
56
|
+
}
|
|
57
|
+
async findById(id) {
|
|
58
|
+
return this.model.findOne({ _id: id, deletedAt: null });
|
|
59
|
+
}
|
|
60
|
+
async paginate(data) {
|
|
61
|
+
const paginate = (0, pagination_1.createRawDocumentPaginatorObject)(this.model);
|
|
62
|
+
const options = {
|
|
63
|
+
page: data?.page,
|
|
64
|
+
size: data?.size,
|
|
65
|
+
sort: data?.sort,
|
|
66
|
+
query: data?.query,
|
|
67
|
+
select: data?.select,
|
|
68
|
+
populate: data?.populate,
|
|
69
|
+
};
|
|
70
|
+
return paginate(options);
|
|
71
|
+
}
|
|
72
|
+
async updateById(id, data) {
|
|
73
|
+
return this.model.findOneAndUpdate({ _id: id, deletedAt: null }, data, {
|
|
74
|
+
new: true,
|
|
75
|
+
runValidators: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async deleteById(id, softDelete) {
|
|
79
|
+
return this.model.deleteRecord({ _id: id, deletedAt: null }, softDelete);
|
|
80
|
+
}
|
|
81
|
+
async incrementRedemption(params) {
|
|
82
|
+
await this.model.findOneAndUpdate({ user: params.user, marketing: params.marketing }, { $inc: { redemptionCount: 1 }, $set: { shop: params.shop, lastOrder: params.order } }, { upsert: true, runValidators: true });
|
|
83
|
+
}
|
|
84
|
+
async decrementRedemption(orderId) {
|
|
85
|
+
await this.model.findOneAndUpdate({ lastOrder: orderId, redemptionCount: { $gt: 0 } }, { $inc: { redemptionCount: -1 } }, { runValidators: true });
|
|
86
|
+
}
|
|
87
|
+
async findByUserAndMarketing(userId, marketingId) {
|
|
88
|
+
return this.model.findOne({ user: userId, marketing: marketingId });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
exports.SpendToGetHistoryRepository = SpendToGetHistoryRepository;
|
|
92
|
+
exports.SpendToGetHistoryRepository = SpendToGetHistoryRepository = __decorate([
|
|
93
|
+
(0, typedi_1.Service)(),
|
|
94
|
+
__metadata("design:paramtypes", [])
|
|
95
|
+
], SpendToGetHistoryRepository);
|
|
96
|
+
exports.spendToGetHistoryRepository = typedi_1.default.get(SpendToGetHistoryRepository);
|
|
97
|
+
//# sourceMappingURL=spend-to-get-history.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-history.repository.js","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAG5C,sEAA+G;AAE/G,wEAA6G;AAQtG,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAC/B,KAAK,CAAyD;IAEtE;QACC,IAAI,CAAC,KAAK,GAAG,+BAAgF,CAAC;IAC/F,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAe;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAoC;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,IAAyB;QACvC,MAAM,QAAQ,GAAG,IAAA,6CAAgC,EAAC,IAAI,CAAC,KAA2C,CAAC,CAAC;QACpG,MAAM,OAAO,GAAmC;YAC/C,I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O,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EACnD,EAAE,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,EACjC,EAAE,aAAa,EAAE,IAAI,EAAE,CACvB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,sBAAsB,CAC3B,MAA+B,EAC/B,WAAoC;QAEpC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;IACrE,CAAC;CACD,CAAA;AAlEY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,gBAAO,GAAE;;GACG,2BAA2B,CAkEvC;AAEY,QAAA,2BAA2B,GAAG,gBAAS,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { DocumentType, mongoose, ReturnModelType } from '@typegoose/typegoose';\nimport { ModelType } from '@typegoose/typegoose/lib/types';\nimport { SpendToGetHistoryModel, SpendToGetHistory as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { SoftDeleteModel } from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\nimport { createRawDocumentPaginatorObject, PaginatorOptions } from '@lyxa.ai/core/dist/utilities/pagination';\nimport { FilterDTO, PaginatedResponse } from '@lyxa.ai/core/dist/utilities/validation';\nimport {\n\tCreateSpendToGetHistoryDTO as CreateDTO,\n\tUpdateSpendToGetHistoryDTO as UpdateDTO,\n} from './spend-to-get-history.validation';\n\n@Service()\nexport class SpendToGetHistoryRepository {\n\tprivate model: typeof SpendToGetHistoryModel & SoftDeleteModel<Model>;\n\n\tconstructor() {\n\t\tthis.model = SpendToGetHistoryModel as typeof SpendToGetHistoryModel & SoftDeleteModel<Model>;\n\t}\n\n\tasync create(data: CreateDTO): Promise<DocumentType<Model>> {\n\t\treturn this.model.create(data);\n\t}\n\n\tasync findById(id: string | mongoose.Types.ObjectId): Promise<DocumentType<Model> | null> {\n\t\treturn this.model.findOne({ _id: id, deletedAt: null });\n\t}\n\n\tasync paginate(data?: Partial<FilterDTO>): Promise<PaginatedResponse<DocumentType<ModelType<Model>>>> {\n\t\tconst paginate = createRawDocumentPaginatorObject(this.model as ReturnModelType<typeof this.model>);\n\t\tconst options: PaginatorOptions<typeof Model> = {\n\t\t\tpage: data?.page,\n\t\t\tsize: data?.size,\n\t\t\tsort: data?.sort,\n\t\t\tquery: data?.query,\n\t\t\tselect: data?.select,\n\t\t\tpopulate: data?.populate,\n\t\t};\n\t\treturn paginate(options);\n\t}\n\n\tasync updateById(id: string, data: UpdateDTO): Promise<DocumentType<Model> | null> {\n\t\treturn this.model.findOneAndUpdate({ _id: id, deletedAt: null }, data, {\n\t\t\tnew: true,\n\t\t\trunValidators: true,\n\t\t});\n\t}\n\n\tasync deleteById(id: string | mongoose.Types.ObjectId, softDelete: boolean): Promise<unknown> {\n\t\treturn this.model.deleteRecord({ _id: id, deletedAt: null }, softDelete);\n\t}\n\n\tasync incrementRedemption(params: {\n\t\tuser: mongoose.Types.ObjectId;\n\t\tshop: mongoose.Types.ObjectId;\n\t\tmarketing: mongoose.Types.ObjectId;\n\t\torder: mongoose.Types.ObjectId;\n\t}): Promise<void> {\n\t\tawait this.model.findOneAndUpdate(\n\t\t\t{ user: params.user, marketing: params.marketing },\n\t\t\t{ $inc: { redemptionCount: 1 }, $set: { shop: params.shop, lastOrder: params.order } },\n\t\t\t{ upsert: true, runValidators: true }\n\t\t);\n\t}\n\n\tasync decrementRedemption(orderId: mongoose.Types.ObjectId): Promise<void> {\n\t\tawait this.model.findOneAndUpdate(\n\t\t\t{ lastOrder: orderId, redemptionCount: { $gt: 0 } },\n\t\t\t{ $inc: { redemptionCount: -1 } },\n\t\t\t{ runValidators: true }\n\t\t);\n\t}\n\n\tasync findByUserAndMarketing(\n\t\tuserId: mongoose.Types.ObjectId,\n\t\tmarketingId: mongoose.Types.ObjectId\n\t): Promise<DocumentType<Model> | null> {\n\t\treturn this.model.findOne({ user: userId, marketing: marketingId });\n\t}\n}\n\nexport const spendToGetHistoryRepository = Container.get(SpendToGetHistoryRepository);\n"]}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
export declare const spendToGetHistoryRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
2
|
+
ctx: import("@lyxa.ai/core/dist/libraries/trpc/context").LyxaHTTPContext;
|
|
3
|
+
meta: object;
|
|
4
|
+
errorShape: {
|
|
5
|
+
message: string;
|
|
6
|
+
data: {
|
|
7
|
+
stack: undefined;
|
|
8
|
+
path: undefined;
|
|
9
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
10
|
+
httpStatus: number;
|
|
11
|
+
};
|
|
12
|
+
stack: undefined;
|
|
13
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
14
|
+
};
|
|
15
|
+
transformer: false;
|
|
16
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
17
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
18
|
+
input: {
|
|
19
|
+
user: string | import("mongoose").Types.ObjectId;
|
|
20
|
+
shop: string | import("mongoose").Types.ObjectId;
|
|
21
|
+
marketing: string | import("mongoose").Types.ObjectId;
|
|
22
|
+
redemptionCount?: number | undefined;
|
|
23
|
+
lastOrder?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
24
|
+
};
|
|
25
|
+
output: {
|
|
26
|
+
message: string;
|
|
27
|
+
success: boolean;
|
|
28
|
+
data?: import("zod").objectInputType<{
|
|
29
|
+
user: 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>]>>;
|
|
30
|
+
marketing: 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>]>>;
|
|
31
|
+
shop: 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>]>>;
|
|
32
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
33
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
34
|
+
_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>]>>;
|
|
35
|
+
}, import("zod").ZodTypeAny, "passthrough"> | {
|
|
36
|
+
documents: import("zod").objectInputType<{
|
|
37
|
+
user: 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>]>>;
|
|
38
|
+
marketing: 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>]>>;
|
|
39
|
+
shop: 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>]>>;
|
|
40
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
41
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
42
|
+
_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>]>>;
|
|
43
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
44
|
+
metadata?: {
|
|
45
|
+
page: number;
|
|
46
|
+
size: number;
|
|
47
|
+
totalElements: number;
|
|
48
|
+
totalPages: number;
|
|
49
|
+
} | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
};
|
|
52
|
+
meta: object;
|
|
53
|
+
}>;
|
|
54
|
+
getById: import("@trpc/server").TRPCQueryProcedure<{
|
|
55
|
+
input: string | import("mongoose").Types.ObjectId;
|
|
56
|
+
output: {
|
|
57
|
+
message: string;
|
|
58
|
+
success: boolean;
|
|
59
|
+
data?: import("zod").objectInputType<{
|
|
60
|
+
user: 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>]>>;
|
|
61
|
+
marketing: 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>]>>;
|
|
62
|
+
shop: 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>]>>;
|
|
63
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
64
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
65
|
+
_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>]>>;
|
|
66
|
+
}, import("zod").ZodTypeAny, "passthrough"> | {
|
|
67
|
+
documents: import("zod").objectInputType<{
|
|
68
|
+
user: 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>]>>;
|
|
69
|
+
marketing: 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>]>>;
|
|
70
|
+
shop: 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>]>>;
|
|
71
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
72
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
73
|
+
_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>]>>;
|
|
74
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
75
|
+
metadata?: {
|
|
76
|
+
page: number;
|
|
77
|
+
size: number;
|
|
78
|
+
totalElements: number;
|
|
79
|
+
totalPages: number;
|
|
80
|
+
} | undefined;
|
|
81
|
+
} | undefined;
|
|
82
|
+
};
|
|
83
|
+
meta: object;
|
|
84
|
+
}>;
|
|
85
|
+
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
86
|
+
input: {
|
|
87
|
+
search?: {
|
|
88
|
+
searchKey: string;
|
|
89
|
+
searchFields?: string[] | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
sort?: Record<string, 1 | -1> | undefined;
|
|
92
|
+
page?: number | undefined;
|
|
93
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
94
|
+
size?: number | undefined;
|
|
95
|
+
populate?: any;
|
|
96
|
+
query?: Record<string, any> | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
output: {
|
|
99
|
+
message: string;
|
|
100
|
+
success: boolean;
|
|
101
|
+
data?: import("zod").objectInputType<{
|
|
102
|
+
user: 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>]>>;
|
|
103
|
+
marketing: 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>]>>;
|
|
104
|
+
shop: 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>]>>;
|
|
105
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
106
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
107
|
+
_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>]>>;
|
|
108
|
+
}, import("zod").ZodTypeAny, "passthrough"> | {
|
|
109
|
+
documents: import("zod").objectInputType<{
|
|
110
|
+
user: 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>]>>;
|
|
111
|
+
marketing: 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>]>>;
|
|
112
|
+
shop: 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>]>>;
|
|
113
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
114
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
115
|
+
_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>]>>;
|
|
116
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
117
|
+
metadata?: {
|
|
118
|
+
page: number;
|
|
119
|
+
size: number;
|
|
120
|
+
totalElements: number;
|
|
121
|
+
totalPages: number;
|
|
122
|
+
} | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
};
|
|
125
|
+
meta: object;
|
|
126
|
+
}>;
|
|
127
|
+
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
128
|
+
input: {
|
|
129
|
+
[x: string]: any;
|
|
130
|
+
} | import("zod").objectInputType<{
|
|
131
|
+
user: 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>]>>;
|
|
132
|
+
marketing: 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>]>>;
|
|
133
|
+
shop: 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>]>>;
|
|
134
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
135
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
136
|
+
_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>]>>;
|
|
137
|
+
}, import("zod").ZodTypeAny, "passthrough">;
|
|
138
|
+
output: {
|
|
139
|
+
message: string;
|
|
140
|
+
success: boolean;
|
|
141
|
+
data?: import("zod").objectInputType<{
|
|
142
|
+
user: 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>]>>;
|
|
143
|
+
marketing: 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>]>>;
|
|
144
|
+
shop: 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>]>>;
|
|
145
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
146
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
147
|
+
_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>]>>;
|
|
148
|
+
}, import("zod").ZodTypeAny, "passthrough"> | {
|
|
149
|
+
documents: import("zod").objectInputType<{
|
|
150
|
+
user: 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>]>>;
|
|
151
|
+
marketing: 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>]>>;
|
|
152
|
+
shop: 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>]>>;
|
|
153
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
154
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
155
|
+
_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>]>>;
|
|
156
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
157
|
+
metadata?: {
|
|
158
|
+
page: number;
|
|
159
|
+
size: number;
|
|
160
|
+
totalElements: number;
|
|
161
|
+
totalPages: number;
|
|
162
|
+
} | undefined;
|
|
163
|
+
} | undefined;
|
|
164
|
+
};
|
|
165
|
+
meta: object;
|
|
166
|
+
}>;
|
|
167
|
+
deleteById: import("@trpc/server").TRPCMutationProcedure<{
|
|
168
|
+
input: {
|
|
169
|
+
_id: string | import("mongoose").Types.ObjectId;
|
|
170
|
+
softDelete?: boolean | undefined;
|
|
171
|
+
};
|
|
172
|
+
output: {
|
|
173
|
+
message: string;
|
|
174
|
+
success: boolean;
|
|
175
|
+
data?: import("zod").objectInputType<{
|
|
176
|
+
user: 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>]>>;
|
|
177
|
+
marketing: 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>]>>;
|
|
178
|
+
shop: 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>]>>;
|
|
179
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
180
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
181
|
+
_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>]>>;
|
|
182
|
+
}, import("zod").ZodTypeAny, "passthrough"> | {
|
|
183
|
+
documents: import("zod").objectInputType<{
|
|
184
|
+
user: 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>]>>;
|
|
185
|
+
marketing: 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>]>>;
|
|
186
|
+
shop: 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>]>>;
|
|
187
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
188
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
189
|
+
_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>]>>;
|
|
190
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
191
|
+
metadata?: {
|
|
192
|
+
page: number;
|
|
193
|
+
size: number;
|
|
194
|
+
totalElements: number;
|
|
195
|
+
totalPages: number;
|
|
196
|
+
} | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
};
|
|
199
|
+
meta: object;
|
|
200
|
+
}>;
|
|
201
|
+
recordRedemption: import("@trpc/server").TRPCMutationProcedure<{
|
|
202
|
+
input: {
|
|
203
|
+
user: string | import("mongoose").Types.ObjectId;
|
|
204
|
+
shop: string | import("mongoose").Types.ObjectId;
|
|
205
|
+
order: string | import("mongoose").Types.ObjectId;
|
|
206
|
+
marketing: string | import("mongoose").Types.ObjectId;
|
|
207
|
+
};
|
|
208
|
+
output: {
|
|
209
|
+
message: string;
|
|
210
|
+
success: boolean;
|
|
211
|
+
data?: import("zod").objectInputType<{
|
|
212
|
+
user: 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>]>>;
|
|
213
|
+
marketing: 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>]>>;
|
|
214
|
+
shop: 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>]>>;
|
|
215
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
216
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
217
|
+
_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>]>>;
|
|
218
|
+
}, import("zod").ZodTypeAny, "passthrough"> | {
|
|
219
|
+
documents: import("zod").objectInputType<{
|
|
220
|
+
user: 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>]>>;
|
|
221
|
+
marketing: 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>]>>;
|
|
222
|
+
shop: 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>]>>;
|
|
223
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
224
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
225
|
+
_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>]>>;
|
|
226
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
227
|
+
metadata?: {
|
|
228
|
+
page: number;
|
|
229
|
+
size: number;
|
|
230
|
+
totalElements: number;
|
|
231
|
+
totalPages: number;
|
|
232
|
+
} | undefined;
|
|
233
|
+
} | undefined;
|
|
234
|
+
};
|
|
235
|
+
meta: object;
|
|
236
|
+
}>;
|
|
237
|
+
returnRedemption: import("@trpc/server").TRPCMutationProcedure<{
|
|
238
|
+
input: {
|
|
239
|
+
order: string | import("mongoose").Types.ObjectId;
|
|
240
|
+
};
|
|
241
|
+
output: {
|
|
242
|
+
message: string;
|
|
243
|
+
success: boolean;
|
|
244
|
+
data?: import("zod").objectInputType<{
|
|
245
|
+
user: 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>]>>;
|
|
246
|
+
marketing: 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>]>>;
|
|
247
|
+
shop: 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>]>>;
|
|
248
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
249
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
250
|
+
_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>]>>;
|
|
251
|
+
}, import("zod").ZodTypeAny, "passthrough"> | {
|
|
252
|
+
documents: import("zod").objectInputType<{
|
|
253
|
+
user: 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>]>>;
|
|
254
|
+
marketing: 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>]>>;
|
|
255
|
+
shop: 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>]>>;
|
|
256
|
+
redemptionCount: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
257
|
+
lastOrder: import("zod").ZodOptional<import("zod").ZodNullable<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>]>>>>;
|
|
258
|
+
_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>]>>;
|
|
259
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
260
|
+
metadata?: {
|
|
261
|
+
page: number;
|
|
262
|
+
size: number;
|
|
263
|
+
totalElements: number;
|
|
264
|
+
totalPages: number;
|
|
265
|
+
} | undefined;
|
|
266
|
+
} | undefined;
|
|
267
|
+
};
|
|
268
|
+
meta: object;
|
|
269
|
+
}>;
|
|
270
|
+
}>>;
|
|
271
|
+
//# sourceMappingURL=spend-to-get-history.router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-history.router.d.ts","sourceRoot":"/","sources":["modules/spend-to-get-history/spend-to-get-history.router.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA2Bc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CjD,CAAC"}
|