@lyxa.ai/marketing 1.0.59 → 1.0.61
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 +1 -0
- package/dist/lib/event/event-initializations.js.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.d.ts +1 -0
- package/dist/lib/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.js +7 -0
- package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
- package/dist/lib/index.d.ts +303 -19
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +12 -12
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +2 -0
- 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 +22 -3
- 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/limited-time-offer.router.d.ts +18 -18
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +14 -1
- 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 +15 -0
- 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.router.d.ts +18 -18
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +57 -57
- 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 +15 -5
- 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 +1 -1
- 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 +27 -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 +135 -0
- package/dist/lib/modules/marketing/services/marketing-conflict.service.js.map +1 -0
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +6 -2
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +39 -7
- package/dist/lib/modules/marketing/services/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 +99 -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/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/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/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/product-marketing.validation.d.ts +2 -2
- 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/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
- package/dist/lib/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
- package/dist/lib/modules/spend-to-get-history/routers/index.d.ts +2 -0
- package/dist/lib/modules/spend-to-get-history/routers/index.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/routers/index.js +18 -0
- package/dist/lib/modules/spend-to-get-history/routers/index.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js +62 -0
- package/dist/lib/modules/spend-to-get-history/routers/spend-to-get-history.router.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/services/index.d.ts +2 -0
- package/dist/lib/modules/spend-to-get-history/services/index.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/services/index.js +18 -0
- package/dist/lib/modules/spend-to-get-history/services/index.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +24 -0
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.js +136 -0
- package/dist/lib/modules/spend-to-get-history/services/spend-to-get-history.service.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/lib/modules/spend-to-get-history/validations/index.d.ts +2 -0
- package/dist/lib/modules/spend-to-get-history/validations/index.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/validations/index.js +18 -0
- package/dist/lib/modules/spend-to-get-history/validations/index.js.map +1 -0
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +232 -0
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +1 -0
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js +30 -0
- package/dist/lib/modules/spend-to-get-history/validations/spend-to-get-history.validation.js.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js +15 -0
- package/dist/lib/modules/tournament/match/events/match-ended.consumer.js.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts +14 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.js +12 -0
- package/dist/lib/modules/tournament/match/events/match-ended.event.js.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts +10 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js +23 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.producer.js.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts +9 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.js +82 -0
- package/dist/lib/modules/tournament/notification/jobs/notification.worker.js.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
- package/dist/lib/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.schedule.config.js +15 -0
- package/dist/lib/modules/tournament/notification/notification.schedule.config.js.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.js +73 -0
- package/dist/lib/modules/tournament/notification/notification.scheduler.service.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 +1 -0
- package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/types/events/event-initializations.d.ts +2 -0
- package/dist/types/events/event-initializations.d.ts.map +1 -0
- package/dist/types/index.d.ts +303 -19
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +12 -12
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +2 -0
- 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/limited-time-offer.router.d.ts +18 -18
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +14 -1
- 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.router.d.ts +18 -18
- 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 +57 -57
- 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 +1 -1
- 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 +41 -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 +6 -2
- package/dist/types/modules/marketing/services/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/validations/all-marketings.validation.d.ts.map +1 -1
- 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/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/product-marketing.validation.d.ts +2 -2
- 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/punch-marketing-history/routers/punch-marketing-history.router.d.ts +1 -1
- package/dist/types/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +2 -2
- package/dist/types/modules/spend-to-get-history/routers/index.d.ts +2 -0
- package/dist/types/modules/spend-to-get-history/routers/index.d.ts.map +1 -0
- package/dist/types/modules/spend-to-get-history/services/index.d.ts +2 -0
- package/dist/types/modules/spend-to-get-history/services/index.d.ts.map +1 -0
- package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.d.ts +56 -0
- package/dist/types/modules/spend-to-get-history/services/spend-to-get-history.service.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/dist/types/modules/spend-to-get-history/validations/index.d.ts +2 -0
- package/dist/types/modules/spend-to-get-history/validations/index.d.ts.map +1 -0
- package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts +241 -0
- package/dist/types/modules/spend-to-get-history/validations/spend-to-get-history.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts +201 -0
- package/dist/types/modules/tournament/config/tournament-config.validation.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts +2 -0
- package/dist/types/modules/tournament/match/events/match-ended.consumer.d.ts.map +1 -0
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts +14 -0
- package/dist/types/modules/tournament/match/events/match-ended.event.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts +10 -0
- package/dist/types/modules/tournament/notification/jobs/notification.producer.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts +9 -0
- package/dist/types/modules/tournament/notification/jobs/notification.worker.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts +10 -0
- package/dist/types/modules/tournament/notification/notification.schedule.config.d.ts.map +1 -0
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts +10 -0
- package/dist/types/modules/tournament/notification/notification.scheduler.service.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DocumentType, mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { SpendToGetMarketing as Model } from '@lyxa.ai/core/dist/libraries/mongo/models/';
|
|
3
|
+
import { CreateSpendToGetMarketingDTO as CreateDTO, UpdateSpendToGetMarketingDTO as UpdateDTO } from '../../marketing/validations';
|
|
4
|
+
export declare class SpendToGetMarketingService {
|
|
5
|
+
private repository;
|
|
6
|
+
constructor();
|
|
7
|
+
create(data: CreateDTO): Promise<DocumentType<Model>>;
|
|
8
|
+
update(_id: mongoose.Types.ObjectId, data: UpdateDTO): Promise<DocumentType<Model>>;
|
|
9
|
+
}
|
|
10
|
+
export declare const spendToGetMarketingService: SpendToGetMarketingService;
|
|
11
|
+
//# sourceMappingURL=spend-to-get-marketing.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-marketing.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/spend-to-get-marketing.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,IAAI,KAAK,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EACN,4BAA4B,IAAI,SAAS,EACzC,4BAA4B,IAAI,SAAS,EACzC,MAAM,gCAAgC,CAAC;AAIxC,qBACa,0BAA0B;IACtC,OAAO,CAAC,UAAU,CAAgC;;IAUrC,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAgBrD,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;CA+BhG;AAED,eAAO,MAAM,0BAA0B,4BAA4C,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
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.spendToGetMarketingService = exports.SpendToGetMarketingService = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const server_1 = require("@trpc/server");
|
|
48
|
+
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
49
|
+
const marketing_conflict_service_1 = require("./marketing-conflict.service");
|
|
50
|
+
const spend_to_get_marketing_repository_1 = require("./spend-to-get-marketing.repository");
|
|
51
|
+
let SpendToGetMarketingService = class SpendToGetMarketingService {
|
|
52
|
+
repository;
|
|
53
|
+
constructor() {
|
|
54
|
+
this.repository = typedi_1.default.get(spend_to_get_marketing_repository_1.SpendToGetMarketingRepository);
|
|
55
|
+
}
|
|
56
|
+
async create(data) {
|
|
57
|
+
const shop = await this.repository.findShopById(data.shop);
|
|
58
|
+
if (!shop) {
|
|
59
|
+
throw new server_1.TRPCError({
|
|
60
|
+
code: 'NOT_FOUND',
|
|
61
|
+
message: `Shop not found`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return await this.repository.create(data);
|
|
65
|
+
}
|
|
66
|
+
async update(_id, data) {
|
|
67
|
+
if (data.tiers) {
|
|
68
|
+
const existing = await this.repository.findById(_id);
|
|
69
|
+
if (existing && existing.status === enum_1.MarketingStatus.ACTIVE) {
|
|
70
|
+
const oldGroups = marketing_conflict_service_1.marketingConflictService.getRewardTypeGroups(existing.marketingType, existing.tiers);
|
|
71
|
+
const newGroups = marketing_conflict_service_1.marketingConflictService.getRewardTypeGroups(existing.marketingType, data.tiers);
|
|
72
|
+
const addedGroups = newGroups.filter(group => !oldGroups.includes(group));
|
|
73
|
+
if (addedGroups.length > 0) {
|
|
74
|
+
await marketing_conflict_service_1.marketingConflictService.assertNoConflict({
|
|
75
|
+
shop: existing.shop,
|
|
76
|
+
duration: data.duration ?? existing.duration,
|
|
77
|
+
rewardTypeGroups: addedGroups,
|
|
78
|
+
excludeMarketingId: _id,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const record = await this.repository.updateById(_id, data);
|
|
84
|
+
if (!record) {
|
|
85
|
+
throw new server_1.TRPCError({
|
|
86
|
+
code: 'NOT_FOUND',
|
|
87
|
+
message: `Record not found`,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return record;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.SpendToGetMarketingService = SpendToGetMarketingService;
|
|
94
|
+
exports.SpendToGetMarketingService = SpendToGetMarketingService = __decorate([
|
|
95
|
+
(0, typedi_1.Service)(),
|
|
96
|
+
__metadata("design:paramtypes", [])
|
|
97
|
+
], SpendToGetMarketingService);
|
|
98
|
+
exports.spendToGetMarketingService = typedi_1.default.get(SpendToGetMarketingService);
|
|
99
|
+
//# sourceMappingURL=spend-to-get-marketing.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-marketing.service.js","sourceRoot":"/","sources":["modules/marketing/services/spend-to-get-marketing.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAC5C,yCAAyC;AAGzC,4DAAoE;AAKpE,6EAAwE;AACxE,2FAAoF;AAG7E,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAC9B,UAAU,CAAgC;IAElD;QACC,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,iEAA6B,CAAC,CAAC;IAChE,CAAC;IAMM,KAAK,CAAC,MAAM,CAAC,IAAe;QAClC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,gBAAgB;aACzB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAOM,KAAK,CAAC,MAAM,CAAC,GAA4B,EAAE,IAAe;QAChE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAErD,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,sBAAe,CAAC,MAAM,EAAE,CAAC;gBAC5D,MAAM,SAAS,GAAG,qDAAwB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvG,MAAM,SAAS,GAAG,qDAAwB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBACnG,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;gBAE1E,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5B,MAAM,qDAAwB,CAAC,gBAAgB,CAAC;wBAC/C,IAAI,EAAE,QAAQ,CAAC,IAA+B;wBAC9C,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ;wBAC5C,gBAAgB,EAAE,WAAW;wBAC7B,kBAAkB,EAAE,GAAG;qBACvB,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;QACF,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAE3D,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,kBAAkB;aAC3B,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAA;AA1DY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,gBAAO,GAAE;;GACG,0BAA0B,CA0DtC;AAEY,QAAA,0BAA0B,GAAG,gBAAS,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { TRPCError } from '@trpc/server';\nimport { DocumentType, mongoose } from '@typegoose/typegoose';\nimport { SpendToGetMarketing as Model } from '@lyxa.ai/core/dist/libraries/mongo/models/';\nimport { MarketingStatus } from '@lyxa.ai/core/dist/utilities/enum';\nimport {\n\tCreateSpendToGetMarketingDTO as CreateDTO,\n\tUpdateSpendToGetMarketingDTO as UpdateDTO,\n} from '@modules/marketing/validations';\nimport { marketingConflictService } from './marketing-conflict.service';\nimport { SpendToGetMarketingRepository } from './spend-to-get-marketing.repository';\n\n@Service()\nexport class SpendToGetMarketingService {\n\tprivate repository: SpendToGetMarketingRepository;\n\n\tconstructor() {\n\t\tthis.repository = Container.get(SpendToGetMarketingRepository);\n\t}\n\n\t/**\n\t * Create a new record\n\t * @param data Data for the new record\n\t */\n\tpublic async create(data: CreateDTO): Promise<DocumentType<Model>> {\n\t\tconst shop = await this.repository.findShopById(data.shop);\n\t\tif (!shop) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: `Shop not found`,\n\t\t\t});\n\t\t}\n\t\treturn await this.repository.create(data);\n\t}\n\n\t/**\n\t * Update record\n\t * @param id ID of the record\n\t * @param data Data to update\n\t */\n\tpublic async update(_id: mongoose.Types.ObjectId, data: UpdateDTO): Promise<DocumentType<Model>> {\n\t\tif (data.tiers) {\n\t\t\tconst existing = await this.repository.findById(_id);\n\n\t\t\tif (existing && existing.status === MarketingStatus.ACTIVE) {\n\t\t\t\tconst oldGroups = marketingConflictService.getRewardTypeGroups(existing.marketingType, existing.tiers);\n\t\t\t\tconst newGroups = marketingConflictService.getRewardTypeGroups(existing.marketingType, data.tiers);\n\t\t\t\tconst addedGroups = newGroups.filter(group => !oldGroups.includes(group));\n\n\t\t\t\tif (addedGroups.length > 0) {\n\t\t\t\t\tawait marketingConflictService.assertNoConflict({\n\t\t\t\t\t\tshop: existing.shop as mongoose.Types.ObjectId,\n\t\t\t\t\t\tduration: data.duration ?? existing.duration,\n\t\t\t\t\t\trewardTypeGroups: addedGroups,\n\t\t\t\t\t\texcludeMarketingId: _id,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst record = await this.repository.updateById(_id, data);\n\n\t\tif (!record) {\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'NOT_FOUND',\n\t\t\t\tmessage: `Record not found`,\n\t\t\t});\n\t\t}\n\n\t\treturn record;\n\t}\n}\n\nexport const spendToGetMarketingService = Container.get(SpendToGetMarketingService);\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocumentType, mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { SpendToGetMarketing } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
+
export declare class SpendToGetProgressRepository {
|
|
4
|
+
private model;
|
|
5
|
+
constructor();
|
|
6
|
+
findActiveByShop(shop: mongoose.Types.ObjectId, now: Date): Promise<DocumentType<SpendToGetMarketing> | null>;
|
|
7
|
+
}
|
|
8
|
+
export declare const spendToGetProgressRepository: SpendToGetProgressRepository;
|
|
9
|
+
//# sourceMappingURL=spend-to-get-progress.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-progress.repository.d.ts","sourceRoot":"/","sources":["modules/marketing/services/spend-to-get-progress.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAA4B,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAI1G,qBACa,4BAA4B;IACxC,OAAO,CAAC,KAAK,CAAyE;;IAOhF,gBAAgB,CACrB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC7B,GAAG,EAAE,IAAI,GACP,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC;CAQpD;AAED,eAAO,MAAM,4BAA4B,8BAA8C,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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.spendToGetProgressRepository = exports.SpendToGetProgressRepository = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
|
|
48
|
+
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
49
|
+
let SpendToGetProgressRepository = class SpendToGetProgressRepository {
|
|
50
|
+
model;
|
|
51
|
+
constructor() {
|
|
52
|
+
this.model = models_1.SpendToGetMarketingModel;
|
|
53
|
+
}
|
|
54
|
+
async findActiveByShop(shop, now) {
|
|
55
|
+
return this.model.findOne({
|
|
56
|
+
shop,
|
|
57
|
+
status: enum_1.MarketingStatus.ACTIVE,
|
|
58
|
+
'duration.start': { $lte: now },
|
|
59
|
+
$or: [{ 'duration.end': { $exists: false } }, { 'duration.end': { $gt: now } }],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.SpendToGetProgressRepository = SpendToGetProgressRepository;
|
|
64
|
+
exports.SpendToGetProgressRepository = SpendToGetProgressRepository = __decorate([
|
|
65
|
+
(0, typedi_1.Service)(),
|
|
66
|
+
__metadata("design:paramtypes", [])
|
|
67
|
+
], SpendToGetProgressRepository);
|
|
68
|
+
exports.spendToGetProgressRepository = typedi_1.default.get(SpendToGetProgressRepository);
|
|
69
|
+
//# sourceMappingURL=spend-to-get-progress.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-progress.repository.js","sourceRoot":"/","sources":["modules/marketing/services/spend-to-get-progress.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAE5C,sEAA0G;AAC1G,4DAAoE;AAI7D,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAChC,KAAK,CAAyE;IAEtF;QACC,IAAI,CAAC,KAAK,GAAG,iCACwB,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,gBAAgB,CACrB,IAA6B,EAC7B,GAAS;QAET,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YACzB,IAAI;YACJ,MAAM,EAAE,sBAAe,CAAC,MAAM;YAC9B,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YAC/B,GAAG,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;SAC/E,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AAnBY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,gBAAO,GAAE;;GACG,4BAA4B,CAmBxC;AAEY,QAAA,4BAA4B,GAAG,gBAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { DocumentType, mongoose } from '@typegoose/typegoose';\nimport { SpendToGetMarketingModel, SpendToGetMarketing } from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport { MarketingStatus } from '@lyxa.ai/core/dist/utilities/enum';\nimport { SoftDeleteModel } from '@lyxa.ai/core/dist/libraries/mongo/plugins/soft-delete-plugin';\n\n@Service()\nexport class SpendToGetProgressRepository {\n\tprivate model: typeof SpendToGetMarketingModel & SoftDeleteModel<SpendToGetMarketing>;\n\n\tconstructor() {\n\t\tthis.model = SpendToGetMarketingModel as typeof SpendToGetMarketingModel &\n\t\t\tSoftDeleteModel<SpendToGetMarketing>;\n\t}\n\n\tasync findActiveByShop(\n\t\tshop: mongoose.Types.ObjectId,\n\t\tnow: Date\n\t): Promise<DocumentType<SpendToGetMarketing> | null> {\n\t\treturn this.model.findOne({\n\t\t\tshop,\n\t\t\tstatus: MarketingStatus.ACTIVE,\n\t\t\t'duration.start': { $lte: now },\n\t\t\t$or: [{ 'duration.end': { $exists: false } }, { 'duration.end': { $gt: now } }],\n\t\t});\n\t}\n}\n\nexport const spendToGetProgressRepository = Container.get(SpendToGetProgressRepository);\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
+
import { SpendToGetRewardType } from '@lyxa.ai/core/dist/utilities/enum';
|
|
3
|
+
export interface SpendToGetTierProgress {
|
|
4
|
+
minSpend: number;
|
|
5
|
+
rewardType: SpendToGetRewardType;
|
|
6
|
+
rewardValue?: number;
|
|
7
|
+
maxDiscountCap?: number;
|
|
8
|
+
isMaxDiscountCapEnabled?: boolean;
|
|
9
|
+
isUnlocked: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SpendToGetProgressResult {
|
|
12
|
+
marketing?: mongoose.Types.ObjectId;
|
|
13
|
+
tiers: SpendToGetTierProgress[];
|
|
14
|
+
appliedTier?: SpendToGetTierProgress;
|
|
15
|
+
discountAmount: number;
|
|
16
|
+
nextTier?: SpendToGetTierProgress;
|
|
17
|
+
amountToNextTier?: number;
|
|
18
|
+
isRedeemable: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class SpendToGetProgressService {
|
|
21
|
+
private repository;
|
|
22
|
+
constructor();
|
|
23
|
+
getProgress(params: {
|
|
24
|
+
shop: mongoose.Types.ObjectId;
|
|
25
|
+
basketTotal: number;
|
|
26
|
+
userId?: mongoose.Types.ObjectId;
|
|
27
|
+
}): Promise<SpendToGetProgressResult>;
|
|
28
|
+
private calculateDiscountAmount;
|
|
29
|
+
}
|
|
30
|
+
export declare const spendToGetProgressService: SpendToGetProgressService;
|
|
31
|
+
//# sourceMappingURL=spend-to-get-progress.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-progress.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/spend-to-get-progress.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAKzE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,oBAAoB,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACxC,SAAS,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IACpC,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;CACtB;AAQD,qBACa,yBAAyB;IACrC,OAAO,CAAC,UAAU,CAA+B;;IAYpC,WAAW,CAAC,MAAM,EAAE;QAChC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC9B,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;KACjC,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA2DrC,OAAO,CAAC,uBAAuB;CAgB/B;AAED,eAAO,MAAM,yBAAyB,2BAA2C,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
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.spendToGetProgressService = exports.SpendToGetProgressService = void 0;
|
|
46
|
+
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
+
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
48
|
+
const dayjs_1 = require("@lyxa.ai/core/dist/utilities/dayjs");
|
|
49
|
+
const spend_to_get_history_service_1 = require("../../spend-to-get-history/spend-to-get-history.service");
|
|
50
|
+
const spend_to_get_progress_repository_1 = require("./spend-to-get-progress.repository");
|
|
51
|
+
const EMPTY_PROGRESS = {
|
|
52
|
+
tiers: [],
|
|
53
|
+
discountAmount: 0,
|
|
54
|
+
isRedeemable: false,
|
|
55
|
+
};
|
|
56
|
+
let SpendToGetProgressService = class SpendToGetProgressService {
|
|
57
|
+
repository;
|
|
58
|
+
constructor() {
|
|
59
|
+
this.repository = typedi_1.default.get(spend_to_get_progress_repository_1.SpendToGetProgressRepository);
|
|
60
|
+
}
|
|
61
|
+
async getProgress(params) {
|
|
62
|
+
const now = (0, dayjs_1.dayjs)().toDate();
|
|
63
|
+
const marketing = await this.repository.findActiveByShop(params.shop, now);
|
|
64
|
+
if (!marketing || marketing.tiers.length === 0) {
|
|
65
|
+
return EMPTY_PROGRESS;
|
|
66
|
+
}
|
|
67
|
+
const budgetExhausted = Boolean(marketing.isSpendLimitEnabled && marketing.spendLimit && (marketing.amountSpent ?? 0) >= marketing.spendLimit);
|
|
68
|
+
const userLimitReached = Boolean(params.userId) && Boolean(marketing.isPerUserLimitEnabled) && Boolean(marketing.perUserLimit)
|
|
69
|
+
? await spend_to_get_history_service_1.spendToGetHistoryService.hasUserReachedLimit(params.userId, marketing._id, marketing.perUserLimit)
|
|
70
|
+
: false;
|
|
71
|
+
const isRedeemable = !budgetExhausted && !userLimitReached;
|
|
72
|
+
const tierProgressList = [...marketing.tiers]
|
|
73
|
+
.sort((a, b) => a.minSpend - b.minSpend)
|
|
74
|
+
.map(tier => ({
|
|
75
|
+
minSpend: tier.minSpend,
|
|
76
|
+
rewardType: tier.rewardType,
|
|
77
|
+
rewardValue: tier.rewardValue,
|
|
78
|
+
maxDiscountCap: tier.maxDiscountCap,
|
|
79
|
+
isMaxDiscountCapEnabled: tier.isMaxDiscountCapEnabled,
|
|
80
|
+
isUnlocked: params.basketTotal >= tier.minSpend,
|
|
81
|
+
}));
|
|
82
|
+
let appliedTier;
|
|
83
|
+
let nextTier;
|
|
84
|
+
for (const tier of tierProgressList) {
|
|
85
|
+
if (tier.isUnlocked) {
|
|
86
|
+
appliedTier = tier;
|
|
87
|
+
}
|
|
88
|
+
else if (!nextTier) {
|
|
89
|
+
nextTier = tier;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const discountAmount = isRedeemable && appliedTier ? this.calculateDiscountAmount(appliedTier, params.basketTotal) : 0;
|
|
93
|
+
return {
|
|
94
|
+
marketing: marketing._id,
|
|
95
|
+
tiers: tierProgressList,
|
|
96
|
+
appliedTier: isRedeemable ? appliedTier : undefined,
|
|
97
|
+
discountAmount,
|
|
98
|
+
nextTier,
|
|
99
|
+
amountToNextTier: nextTier ? Math.max(nextTier.minSpend - params.basketTotal, 0) : undefined,
|
|
100
|
+
isRedeemable: isRedeemable && Boolean(appliedTier),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
calculateDiscountAmount(tier, basketTotal) {
|
|
104
|
+
if (tier.rewardType === enum_1.SpendToGetRewardType.FREE_DELIVERY) {
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
if (tier.rewardType === enum_1.SpendToGetRewardType.FIXED) {
|
|
108
|
+
return tier.rewardValue ?? 0;
|
|
109
|
+
}
|
|
110
|
+
let amount = ((tier.rewardValue ?? 0) / 100) * basketTotal;
|
|
111
|
+
if (tier.isMaxDiscountCapEnabled && tier.maxDiscountCap) {
|
|
112
|
+
amount = Math.min(amount, tier.maxDiscountCap);
|
|
113
|
+
}
|
|
114
|
+
return amount;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
exports.SpendToGetProgressService = SpendToGetProgressService;
|
|
118
|
+
exports.SpendToGetProgressService = SpendToGetProgressService = __decorate([
|
|
119
|
+
(0, typedi_1.Service)(),
|
|
120
|
+
__metadata("design:paramtypes", [])
|
|
121
|
+
], SpendToGetProgressService);
|
|
122
|
+
exports.spendToGetProgressService = typedi_1.default.get(SpendToGetProgressService);
|
|
123
|
+
//# sourceMappingURL=spend-to-get-progress.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spend-to-get-progress.service.js","sourceRoot":"/","sources":["modules/marketing/services/spend-to-get-progress.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAE5C,4DAAyE;AACzE,8DAA2D;AAC3D,0GAAmG;AACnG,yFAAkF;AAqBlF,MAAM,cAAc,GAA6B;IAChD,KAAK,EAAE,EAAE;IACT,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,KAAK;CACnB,CAAC;AAGK,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAC7B,UAAU,CAA+B;IAEjD;QACC,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,+DAA4B,CAAC,CAAC;IAC/D,CAAC;IAQM,KAAK,CAAC,WAAW,CAAC,MAIxB;QACA,MAAM,GAAG,GAAG,IAAA,aAAK,GAAE,CAAC,MAAM,EAAE,CAAC;QAE7B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAE3E,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChD,OAAO,cAAc,CAAC;QACvB,CAAC;QAED,MAAM,eAAe,GAAG,OAAO,CAC9B,SAAS,CAAC,mBAAmB,IAAI,SAAS,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,SAAS,CAAC,UAAU,CAC7G,CAAC;QAEF,MAAM,gBAAgB,GACrB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC;YACpG,CAAC,CAAC,MAAM,uDAAwB,CAAC,mBAAmB,CAClD,MAAM,CAAC,MAAiC,EACxC,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,YAAsB,CAChC;YACF,CAAC,CAAC,KAAK,CAAC;QAEV,MAAM,YAAY,GAAG,CAAC,eAAe,IAAI,CAAC,gBAAgB,CAAC;QAE3D,MAAM,gBAAgB,GAA6B,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC;aACrE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;aACvC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;YACrD,UAAU,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,QAAQ;SAC/C,CAAC,CAAC,CAAC;QAEL,IAAI,WAA+C,CAAC;QACpD,IAAI,QAA4C,CAAC;QACjD,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACrB,WAAW,GAAG,IAAI,CAAC;YACpB,CAAC;iBAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACtB,QAAQ,GAAG,IAAI,CAAC;YACjB,CAAC;QACF,CAAC;QAED,MAAM,cAAc,GACnB,YAAY,IAAI,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjG,OAAO;YACN,SAAS,EAAE,SAAS,CAAC,GAAG;YACxB,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;YACnD,cAAc;YACd,QAAQ;YACR,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YAC5F,YAAY,EAAE,YAAY,IAAI,OAAO,CAAC,WAAW,CAAC;SAClD,CAAC;IACH,CAAC;IAEO,uBAAuB,CAAC,IAA4B,EAAE,WAAmB;QAChF,IAAI,IAAI,CAAC,UAAU,KAAK,2BAAoB,CAAC,aAAa,EAAE,CAAC;YAE5D,OAAO,CAAC,CAAC;QACV,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,2BAAoB,CAAC,KAAK,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,WAAW,CAAC;QAC3D,IAAI,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACzD,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAA;AA5FY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,gBAAO,GAAE;;GACG,yBAAyB,CA4FrC;AAEY,QAAA,yBAAyB,GAAG,gBAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC","sourcesContent":["import Container, { Service } from 'typedi';\nimport { mongoose } from '@typegoose/typegoose';\nimport { SpendToGetRewardType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\nimport { spendToGetHistoryService } from '../../spend-to-get-history/spend-to-get-history.service';\nimport { SpendToGetProgressRepository } from './spend-to-get-progress.repository';\n\nexport interface SpendToGetTierProgress {\n\tminSpend: number;\n\trewardType: SpendToGetRewardType;\n\trewardValue?: number;\n\tmaxDiscountCap?: number;\n\tisMaxDiscountCapEnabled?: boolean;\n\tisUnlocked: boolean;\n}\n\nexport interface SpendToGetProgressResult {\n\tmarketing?: mongoose.Types.ObjectId;\n\ttiers: SpendToGetTierProgress[];\n\tappliedTier?: SpendToGetTierProgress;\n\tdiscountAmount: number;\n\tnextTier?: SpendToGetTierProgress;\n\tamountToNextTier?: number;\n\tisRedeemable: boolean;\n}\n\nconst EMPTY_PROGRESS: SpendToGetProgressResult = {\n\ttiers: [],\n\tdiscountAmount: 0,\n\tisRedeemable: false,\n};\n\n@Service()\nexport class SpendToGetProgressService {\n\tprivate repository: SpendToGetProgressRepository;\n\n\tconstructor() {\n\t\tthis.repository = Container.get(SpendToGetProgressRepository);\n\t}\n\n\t/**\n\t * Live progress + eligibility for a shop's active Spend-to-Get promotion, given a basket total.\n\t * Only the highest qualifying tier's reward ever applies (no stacking). Global spend-limit\n\t * exhaustion is read off the existing amountSpent/spendLimit status-flip fields (Marketing base\n\t * model), same source of truth the checkout path uses — no separate live aggregation here.\n\t */\n\tpublic async getProgress(params: {\n\t\tshop: mongoose.Types.ObjectId;\n\t\tbasketTotal: number;\n\t\tuserId?: mongoose.Types.ObjectId;\n\t}): Promise<SpendToGetProgressResult> {\n\t\tconst now = dayjs().toDate();\n\n\t\tconst marketing = await this.repository.findActiveByShop(params.shop, now);\n\n\t\tif (!marketing || marketing.tiers.length === 0) {\n\t\t\treturn EMPTY_PROGRESS;\n\t\t}\n\n\t\tconst budgetExhausted = Boolean(\n\t\t\tmarketing.isSpendLimitEnabled && marketing.spendLimit && (marketing.amountSpent ?? 0) >= marketing.spendLimit\n\t\t);\n\n\t\tconst userLimitReached =\n\t\t\tBoolean(params.userId) && Boolean(marketing.isPerUserLimitEnabled) && Boolean(marketing.perUserLimit)\n\t\t\t\t? await spendToGetHistoryService.hasUserReachedLimit(\n\t\t\t\t\t\tparams.userId as mongoose.Types.ObjectId,\n\t\t\t\t\t\tmarketing._id,\n\t\t\t\t\t\tmarketing.perUserLimit as number\n\t\t\t\t\t)\n\t\t\t\t: false;\n\n\t\tconst isRedeemable = !budgetExhausted && !userLimitReached;\n\n\t\tconst tierProgressList: SpendToGetTierProgress[] = [...marketing.tiers]\n\t\t\t.sort((a, b) => a.minSpend - b.minSpend)\n\t\t\t.map(tier => ({\n\t\t\t\tminSpend: tier.minSpend,\n\t\t\t\trewardType: tier.rewardType,\n\t\t\t\trewardValue: tier.rewardValue,\n\t\t\t\tmaxDiscountCap: tier.maxDiscountCap,\n\t\t\t\tisMaxDiscountCapEnabled: tier.isMaxDiscountCapEnabled,\n\t\t\t\tisUnlocked: params.basketTotal >= tier.minSpend,\n\t\t\t}));\n\n\t\tlet appliedTier: SpendToGetTierProgress | undefined;\n\t\tlet nextTier: SpendToGetTierProgress | undefined;\n\t\tfor (const tier of tierProgressList) {\n\t\t\tif (tier.isUnlocked) {\n\t\t\t\tappliedTier = tier;\n\t\t\t} else if (!nextTier) {\n\t\t\t\tnextTier = tier;\n\t\t\t}\n\t\t}\n\n\t\tconst discountAmount =\n\t\t\tisRedeemable && appliedTier ? this.calculateDiscountAmount(appliedTier, params.basketTotal) : 0;\n\n\t\treturn {\n\t\t\tmarketing: marketing._id,\n\t\t\ttiers: tierProgressList,\n\t\t\tappliedTier: isRedeemable ? appliedTier : undefined,\n\t\t\tdiscountAmount,\n\t\t\tnextTier,\n\t\t\tamountToNextTier: nextTier ? Math.max(nextTier.minSpend - params.basketTotal, 0) : undefined,\n\t\t\tisRedeemable: isRedeemable && Boolean(appliedTier),\n\t\t};\n\t}\n\n\tprivate calculateDiscountAmount(tier: SpendToGetTierProgress, basketTotal: number): number {\n\t\tif (tier.rewardType === SpendToGetRewardType.FREE_DELIVERY) {\n\t\t\t// Free delivery isn't a basket discount amount — the caller applies it as a delivery-fee override.\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (tier.rewardType === SpendToGetRewardType.FIXED) {\n\t\t\treturn tier.rewardValue ?? 0;\n\t\t}\n\n\t\tlet amount = ((tier.rewardValue ?? 0) / 100) * basketTotal;\n\t\tif (tier.isMaxDiscountCapEnabled && tier.maxDiscountCap) {\n\t\t\tamount = Math.min(amount, tier.maxDiscountCap);\n\t\t}\n\t\treturn amount;\n\t}\n}\n\nexport const spendToGetProgressService = Container.get(SpendToGetProgressService);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-marketings.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"all-marketings.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAuBjC,eAAO,MAAM,6BAA6B,EAAE,OAO1C,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,OAOhC,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,OAOtC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4C,CAAC;AAEjF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACvF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -10,6 +10,7 @@ exports.AllMarketingsValidationSchema = zod_1.z.union([
|
|
|
10
10
|
_1.FeaturedMarketingValidationSchema,
|
|
11
11
|
_1.FreeDeliveryMarketingValidationSchema,
|
|
12
12
|
_1.PunchMarketingValidationSchema,
|
|
13
|
+
_1.SpendToGetMarketingValidationSchema,
|
|
13
14
|
]);
|
|
14
15
|
exports.AllMarketingsSchema = zod_1.z.union([
|
|
15
16
|
_1.DiscountMarketingSchema,
|
|
@@ -17,6 +18,7 @@ exports.AllMarketingsSchema = zod_1.z.union([
|
|
|
17
18
|
_1.PunchMarketingSchema,
|
|
18
19
|
_1.FeaturedMarketingSchema,
|
|
19
20
|
_1.FreeDeliveryMarketingSchema,
|
|
21
|
+
_1.SpendToGetMarketingSchema,
|
|
20
22
|
]);
|
|
21
23
|
exports.AllMarketingsUpdateSchema = zod_1.z.union([
|
|
22
24
|
_1.UpdateDiscountMarketingSchema,
|
|
@@ -24,6 +26,7 @@ exports.AllMarketingsUpdateSchema = zod_1.z.union([
|
|
|
24
26
|
_1.UpdatePunchMarketingSchema,
|
|
25
27
|
_1.UpdateFeaturedMarketingSchema,
|
|
26
28
|
_1.UpdateFreeDeliveryMarketingSchema,
|
|
29
|
+
_1.UpdateSpendToGetMarketingSchema,
|
|
27
30
|
]);
|
|
28
31
|
exports.MarketingResponseSchema = (0, validation_1.createResponseSchema)(exports.AllMarketingsSchema);
|
|
29
32
|
//# sourceMappingURL=all-marketings.validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-marketings.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"all-marketings.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/all-marketings.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAiC;AACjC,wBAmBW;AACX,wEAA+E;AAElE,QAAA,6BAA6B,GAAY,OAAC,CAAC,KAAK,CAAC;IAC7D,oCAAiC;IACjC,oCAAiC;IACjC,oCAAiC;IACjC,wCAAqC;IACrC,iCAA8B;IAC9B,sCAAmC;CACnC,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAY,OAAC,CAAC,KAAK,CAAC;IACnD,0BAAuB;IACvB,0BAAuB;IACvB,uBAAoB;IACpB,0BAAuB;IACvB,8BAA2B;IAC3B,4BAAyB;CACzB,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAY,OAAC,CAAC,KAAK,CAAC;IACzD,gCAA6B;IAC7B,gCAA6B;IAC7B,6BAA0B;IAC1B,gCAA6B;IAC7B,oCAAiC;IACjC,kCAA+B;CAC/B,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,IAAA,iCAAoB,EAAC,2BAAmB,CAAC,CAAC","sourcesContent":["import { z, ZodType } from 'zod';\nimport {\n\tBuy1Get1MarketingSchema,\n\tBuy1Get1MarketingValidationSchema,\n\tDiscountMarketingSchema,\n\tDiscountMarketingValidationSchema,\n\tFeaturedMarketingSchema,\n\tFeaturedMarketingValidationSchema,\n\tFreeDeliveryMarketingSchema,\n\tFreeDeliveryMarketingValidationSchema,\n\tPunchMarketingSchema,\n\tPunchMarketingValidationSchema,\n\tSpendToGetMarketingSchema,\n\tSpendToGetMarketingValidationSchema,\n\tUpdateBuy1Get1MarketingSchema,\n\tUpdateDiscountMarketingSchema,\n\tUpdateFeaturedMarketingSchema,\n\tUpdateFreeDeliveryMarketingSchema,\n\tUpdatePunchMarketingSchema,\n\tUpdateSpendToGetMarketingSchema,\n} from '.';\nimport { createResponseSchema } from '@lyxa.ai/core/dist/utilities/validation';\n\nexport const AllMarketingsValidationSchema: ZodType = z.union([\n\tBuy1Get1MarketingValidationSchema,\n\tDiscountMarketingValidationSchema,\n\tFeaturedMarketingValidationSchema,\n\tFreeDeliveryMarketingValidationSchema,\n\tPunchMarketingValidationSchema,\n\tSpendToGetMarketingValidationSchema,\n]);\n\nexport const AllMarketingsSchema: ZodType = z.union([\n\tDiscountMarketingSchema,\n\tBuy1Get1MarketingSchema,\n\tPunchMarketingSchema,\n\tFeaturedMarketingSchema,\n\tFreeDeliveryMarketingSchema,\n\tSpendToGetMarketingSchema,\n]);\n\nexport const AllMarketingsUpdateSchema: ZodType = z.union([\n\tUpdateDiscountMarketingSchema,\n\tUpdateBuy1Get1MarketingSchema,\n\tUpdatePunchMarketingSchema,\n\tUpdateFeaturedMarketingSchema,\n\tUpdateFreeDeliveryMarketingSchema,\n\tUpdateSpendToGetMarketingSchema,\n]);\n\nexport const MarketingResponseSchema = createResponseSchema(AllMarketingsSchema);\n\nexport type AllMarketingsValidationDTO = z.infer<typeof AllMarketingsValidationSchema>;\nexport type AllMarketingsDTO = z.infer<typeof AllMarketingsSchema>;\n"]}
|
|
@@ -59,6 +59,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
59
59
|
isAppliedByCompany: boolean;
|
|
60
60
|
isEntireMenu: boolean;
|
|
61
61
|
pausedAt: Date | null;
|
|
62
|
+
marketingType: MarketingType.BUY1GET1;
|
|
62
63
|
products: {
|
|
63
64
|
product: import("mongoose").Types.ObjectId;
|
|
64
65
|
value?: number | undefined;
|
|
@@ -67,7 +68,6 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
67
68
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
68
69
|
isBuy1Get1?: boolean | undefined;
|
|
69
70
|
}[];
|
|
70
|
-
marketingType: MarketingType.BUY1GET1;
|
|
71
71
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
72
72
|
isOnlyForSubscriber: boolean;
|
|
73
73
|
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -437,6 +437,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
437
437
|
isAppliedByCompany: boolean;
|
|
438
438
|
isEntireMenu: boolean;
|
|
439
439
|
pausedAt: Date | null;
|
|
440
|
+
marketingType: MarketingType.BUY1GET1;
|
|
440
441
|
products: {
|
|
441
442
|
product: import("mongoose").Types.ObjectId;
|
|
442
443
|
value?: number | undefined;
|
|
@@ -445,7 +446,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
445
446
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
446
447
|
isBuy1Get1?: boolean | undefined;
|
|
447
448
|
}[];
|
|
448
|
-
marketingType: MarketingType.BUY1GET1;
|
|
449
449
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
450
450
|
isOnlyForSubscriber: boolean;
|
|
451
451
|
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -487,6 +487,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
487
487
|
isAppliedByCompany: boolean;
|
|
488
488
|
isEntireMenu: boolean;
|
|
489
489
|
pausedAt: Date | null;
|
|
490
|
+
marketingType: MarketingType.BUY1GET1;
|
|
490
491
|
products: {
|
|
491
492
|
product: import("mongoose").Types.ObjectId;
|
|
492
493
|
value?: number | undefined;
|
|
@@ -495,7 +496,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
495
496
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
496
497
|
isBuy1Get1?: boolean | undefined;
|
|
497
498
|
}[];
|
|
498
|
-
marketingType: MarketingType.BUY1GET1;
|
|
499
499
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
500
500
|
isOnlyForSubscriber: boolean;
|
|
501
501
|
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
@@ -67,6 +67,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
|
|
|
67
67
|
isMaxDiscountPerOrderEnabled: boolean;
|
|
68
68
|
maxDiscountPerOrder: number;
|
|
69
69
|
pausedAt: Date | null;
|
|
70
|
+
marketingType: MarketingType.DISCOUNT;
|
|
70
71
|
products: {
|
|
71
72
|
product: import("mongoose").Types.ObjectId;
|
|
72
73
|
value?: number | undefined;
|
|
@@ -75,7 +76,6 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
|
|
|
75
76
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
76
77
|
isBuy1Get1?: boolean | undefined;
|
|
77
78
|
}[];
|
|
78
|
-
marketingType: MarketingType.DISCOUNT;
|
|
79
79
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
80
80
|
isOnlyForSubscriber: boolean;
|
|
81
81
|
value?: number | undefined;
|
|
@@ -337,6 +337,7 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
337
337
|
isMaxDiscountPerOrderEnabled: boolean;
|
|
338
338
|
maxDiscountPerOrder: number;
|
|
339
339
|
pausedAt: Date | null;
|
|
340
|
+
marketingType: MarketingType.DISCOUNT;
|
|
340
341
|
products: {
|
|
341
342
|
product: import("mongoose").Types.ObjectId;
|
|
342
343
|
value?: number | undefined;
|
|
@@ -345,7 +346,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
345
346
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
346
347
|
isBuy1Get1?: boolean | undefined;
|
|
347
348
|
}[];
|
|
348
|
-
marketingType: MarketingType.DISCOUNT;
|
|
349
349
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
350
350
|
isOnlyForSubscriber: boolean;
|
|
351
351
|
value?: number | undefined;
|
|
@@ -399,6 +399,7 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
399
399
|
isMaxDiscountPerOrderEnabled: boolean;
|
|
400
400
|
maxDiscountPerOrder: number;
|
|
401
401
|
pausedAt: Date | null;
|
|
402
|
+
marketingType: MarketingType.DISCOUNT;
|
|
402
403
|
products: {
|
|
403
404
|
product: import("mongoose").Types.ObjectId;
|
|
404
405
|
value?: number | undefined;
|
|
@@ -407,7 +408,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
407
408
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
408
409
|
isBuy1Get1?: boolean | undefined;
|
|
409
410
|
}[];
|
|
410
|
-
marketingType: MarketingType.DISCOUNT;
|
|
411
411
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
412
412
|
isOnlyForSubscriber: boolean;
|
|
413
413
|
value?: number | undefined;
|
|
@@ -3,6 +3,7 @@ export * from './discount-marketing.validation';
|
|
|
3
3
|
export * from './featured-marketing.validation';
|
|
4
4
|
export * from './free-delivery-marketing.validation';
|
|
5
5
|
export * from './punch-marketing.validation';
|
|
6
|
+
export * from './spend-to-get-marketing.validation';
|
|
6
7
|
export * from './product-marketing.validation';
|
|
7
8
|
export * from './marketing.validation';
|
|
8
9
|
export * from './all-marketings.validation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./discount-marketing.validation"), exports);
|
|
|
19
19
|
__exportStar(require("./featured-marketing.validation"), exports);
|
|
20
20
|
__exportStar(require("./free-delivery-marketing.validation"), exports);
|
|
21
21
|
__exportStar(require("./punch-marketing.validation"), exports);
|
|
22
|
+
__exportStar(require("./spend-to-get-marketing.validation"), exports);
|
|
22
23
|
__exportStar(require("./product-marketing.validation"), exports);
|
|
23
24
|
__exportStar(require("./marketing.validation"), exports);
|
|
24
25
|
__exportStar(require("./all-marketings.validation"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,kEAAgD;AAChD,kEAAgD;AAChD,uEAAqD;AACrD,+DAA6C;AAC7C,iEAA+C;AAC/C,yDAAuC;AACvC,8DAA4C","sourcesContent":["export * from './buy1-get1-marketing.validation';\nexport * from './discount-marketing.validation';\nexport * from './featured-marketing.validation';\nexport * from './free-delivery-marketing.validation';\nexport * from './punch-marketing.validation';\nexport * from './product-marketing.validation';\nexport * from './marketing.validation';\nexport * from './all-marketings.validation';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/marketing/validations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,kEAAgD;AAChD,kEAAgD;AAChD,uEAAqD;AACrD,+DAA6C;AAC7C,sEAAoD;AACpD,iEAA+C;AAC/C,yDAAuC;AACvC,8DAA4C","sourcesContent":["export * from './buy1-get1-marketing.validation';\nexport * from './discount-marketing.validation';\nexport * from './featured-marketing.validation';\nexport * from './free-delivery-marketing.validation';\nexport * from './punch-marketing.validation';\nexport * from './spend-to-get-marketing.validation';\nexport * from './product-marketing.validation';\nexport * from './marketing.validation';\nexport * from './all-marketings.validation';\n"]}
|
|
@@ -184,6 +184,19 @@ export declare const ProductEntireMenuMarketingHandlerSchema: z.ZodObject<{
|
|
|
184
184
|
shop: string | import("mongoose").Types.ObjectId;
|
|
185
185
|
product: string | import("mongoose").Types.ObjectId;
|
|
186
186
|
}>;
|
|
187
|
+
export declare const SpendToGetProgressInputSchema: z.ZodObject<{
|
|
188
|
+
shop: 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>]>;
|
|
189
|
+
basketTotal: z.ZodNumber;
|
|
190
|
+
userId: 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>]>>;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
shop: import("mongoose").Types.ObjectId;
|
|
193
|
+
basketTotal: number;
|
|
194
|
+
userId?: import("mongoose").Types.ObjectId | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
shop: string | import("mongoose").Types.ObjectId;
|
|
197
|
+
basketTotal: number;
|
|
198
|
+
userId?: string | import("mongoose").Types.ObjectId | undefined;
|
|
199
|
+
}>;
|
|
187
200
|
export declare const MarketingSpendLimitsEvaluationSchema: z.ZodObject<{
|
|
188
201
|
marketings: z.ZodArray<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>]>, "many">;
|
|
189
202
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -230,6 +243,7 @@ export declare const MarketingMetricsSchema: z.ZodObject<{
|
|
|
230
243
|
count?: number | undefined;
|
|
231
244
|
percentageIncrease?: number | undefined;
|
|
232
245
|
}>>;
|
|
246
|
+
totalRedemptions: z.ZodOptional<z.ZodNumber>;
|
|
233
247
|
}, "strip", z.ZodTypeAny, {
|
|
234
248
|
numberOfItems?: number | undefined;
|
|
235
249
|
orderIncreaseWithDiscount?: {
|
|
@@ -240,6 +254,7 @@ export declare const MarketingMetricsSchema: z.ZodObject<{
|
|
|
240
254
|
count: number;
|
|
241
255
|
percentageIncrease: number;
|
|
242
256
|
} | undefined;
|
|
257
|
+
totalRedemptions?: number | undefined;
|
|
243
258
|
}, {
|
|
244
259
|
numberOfItems?: number | undefined;
|
|
245
260
|
orderIncreaseWithDiscount?: {
|
|
@@ -250,6 +265,7 @@ export declare const MarketingMetricsSchema: z.ZodObject<{
|
|
|
250
265
|
count?: number | undefined;
|
|
251
266
|
percentageIncrease?: number | undefined;
|
|
252
267
|
} | undefined;
|
|
268
|
+
totalRedemptions?: number | undefined;
|
|
253
269
|
}>;
|
|
254
270
|
export declare const MarketingGraphInputSchema: z.ZodObject<{
|
|
255
271
|
marketingId: z.ZodType<string | import("mongoose").Types.ObjectId, z.ZodTypeDef, string | import("mongoose").Types.ObjectId>;
|
|
@@ -301,6 +317,7 @@ export type CreateMarketingDTO = DTO<typeof MarketingValidationSchema>;
|
|
|
301
317
|
export type MarketingDTO = DTO<typeof MarketingSchema>;
|
|
302
318
|
export type UpdateMarketingDTO = DTO<typeof UpdateMarketingSchema>;
|
|
303
319
|
export type ProductEntireMenuMarketingHandlerDTO = DTO<typeof ProductEntireMenuMarketingHandlerSchema>;
|
|
320
|
+
export type SpendToGetProgressInputDTO = DTO<typeof SpendToGetProgressInputSchema>;
|
|
304
321
|
export type IncreaseDuringDiscountDTO = DTO<typeof IncreaseDuringDiscountSchema>;
|
|
305
322
|
export type MarketingMetricsDTO = DTO<typeof MarketingMetricsSchema>;
|
|
306
323
|
export type MarketingGraphInputDTO = DTO<typeof MarketingGraphInputSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAO9F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAQ/B,CAAC;AAYF,QAAA,MACa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACvB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCACnB,iBAAiB,mNACb,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACgB,CAAC;AAKrD,OAAO,EACN,yBAAyB,EACzB,eAAe,EACf,iBAAiB,IAAI,2BAA2B,EAChD,qBAAqB,GACrB,CAAC;AAEF,eAAO,MAAM,uCAAuC;;;;;;;;;EAGlD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;EAE/C,CAAC;AAEH,eAAO,MAAM,6CAA6C;;;;;;EAExD,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;EAKvC,CAAC;AAEH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAO9F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAQ/B,CAAC;AAYF,QAAA,MACa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACvB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCACnB,iBAAiB,mNACb,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACgB,CAAC;AAKrD,OAAO,EACN,yBAAyB,EACzB,eAAe,EACf,iBAAiB,IAAI,2BAA2B,EAChD,qBAAqB,GACrB,CAAC;AAEF,eAAO,MAAM,uCAAuC;;;;;;;;;EAGlD,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAIxC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;EAE/C,CAAC;AAEH,eAAO,MAAM,6CAA6C;;;;;;EAExD,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;EAKvC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;WAK5C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;WAK/C,CAAC;AAEF,eAAO,MAAM,qCAAqC;;;;;;;;;WAKjD,CAAC;AAKF,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACvE,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACnE,MAAM,MAAM,oCAAoC,GAAG,GAAG,CAAC,OAAO,uCAAuC,CAAC,CAAC;AACvG,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACnF,MAAM,MAAM,yBAAyB,GAAG,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC;AACzF,MAAM,MAAM,gCAAgC,GAAG,GAAG,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAC/F,MAAM,MAAM,kCAAkC,GAAG,GAAG,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
|