@lyxa.ai/marketing 1.0.59 → 1.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/event/event-initializations.d.ts.map +1 -1
- package/dist/lib/event/event-initializations.js +0 -1
- package/dist/lib/event/event-initializations.js.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.d.ts +0 -1
- package/dist/lib/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.js +12 -62
- package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
- package/dist/lib/event/events/marketing-product-seed.event.d.ts +2 -1
- package/dist/lib/event/events/marketing-product-seed.event.d.ts.map +1 -1
- package/dist/lib/event/events/marketing-product-seed.event.js.map +1 -1
- package/dist/lib/index.d.ts +11 -7869
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +0 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts +2 -7630
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js +7 -0
- package/dist/lib/modules/coupon/routers/coupon.router.js.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.d.ts +1 -0
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +4 -3
- package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +2 -2
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +6 -6
- package/dist/lib/modules/coupon/validations/coupon.validation.js +2 -2
- package/dist/lib/modules/coupon/validations/coupon.validation.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 +1 -4
- 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 +1 -4
- 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 +0 -3
- 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 +8 -54
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js +0 -11
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js +0 -6
- package/dist/lib/modules/limited-time-offer/campaign/jobs/index.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js +6 -2
- package/dist/lib/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +3 -16
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +3 -22
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +0 -2
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js +0 -12
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +35 -242
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js +1 -19
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +1 -6
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js +1 -45
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +0 -3
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js +8 -66
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js +19 -37
- 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 +10 -241
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts +0 -2
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.service.js +3 -15
- 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 +2 -10
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +1 -4
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +0 -10
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +0 -43
- 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 +2 -187
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js +0 -29
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +0 -395
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js +6 -16
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +4 -7
- 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 +6 -31
- 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 +3 -14
- 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 +16 -76
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +0 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +46 -60
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +3 -2
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.js +13 -42
- package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js +27 -95
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts +1 -0
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js +49 -2
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js.map +1 -1
- package/dist/types/event/event-initializations.d.ts.map +1 -1
- package/dist/types/event/event-listeners/event-listeners.d.ts +0 -1
- package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/types/event/events/marketing-product-seed.event.d.ts +2 -1
- package/dist/types/event/events/marketing-product-seed.event.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -7869
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +2 -7630
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/coupon.service.d.ts +1 -0
- package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts +6 -6
- 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 +8 -54
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/index.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts +1 -0
- package/dist/types/modules/limited-time-offer/campaign/jobs/limited-time-offer-campaign.worker.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +3 -16
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +0 -2
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +35 -242
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +1 -6
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts +0 -3
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-scheduler.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts +1 -1
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +10 -241
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts +0 -2
- package/dist/types/modules/limited-time-offer/limited-time-offer.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/notification/limited-time-offer-notification.constants.d.ts +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +2 -10
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +0 -10
- 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 +2 -187
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +0 -395
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +4 -7
- 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 +3 -14
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts +0 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts +3 -7
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/synchronize-product-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts +5 -0
- package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/lib/event/events/marketing-product-sync.event.d.ts +0 -11
- package/dist/lib/event/events/marketing-product-sync.event.d.ts.map +0 -1
- package/dist/lib/event/events/marketing-product-sync.event.js +0 -12
- package/dist/lib/event/events/marketing-product-sync.event.js.map +0 -1
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +0 -13
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +0 -1
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js +0 -75
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.js.map +0 -1
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +0 -21
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +0 -1
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js +0 -83
- package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js.map +0 -1
- package/dist/types/event/events/marketing-product-sync.event.d.ts +0 -11
- package/dist/types/event/events/marketing-product-sync.event.d.ts.map +0 -1
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts +0 -13
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.d.ts.map +0 -1
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts +0 -21
- package/dist/types/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts.map +0 -1
|
@@ -197,9 +197,7 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
197
197
|
startDate: string | Date;
|
|
198
198
|
endDate: string | Date;
|
|
199
199
|
title?: string | undefined;
|
|
200
|
-
campaignType?: import("@lyxa.ai/core/dist/utilities/enum").MarketingType | undefined;
|
|
201
200
|
subTitle?: string | undefined;
|
|
202
|
-
repeatDays?: number[] | undefined;
|
|
203
201
|
};
|
|
204
202
|
output: {
|
|
205
203
|
message: string;
|
|
@@ -214,10 +212,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
214
212
|
updatedAt?: Date | null | undefined;
|
|
215
213
|
title?: string | undefined;
|
|
216
214
|
subTitle?: string | undefined;
|
|
217
|
-
|
|
215
|
+
archivedAt?: Date | null | undefined;
|
|
218
216
|
discountOptions?: number[] | undefined;
|
|
219
217
|
maxDiscountCaps?: number[] | undefined;
|
|
220
|
-
archivedAt?: Date | null | undefined;
|
|
221
218
|
} | {
|
|
222
219
|
documents: {
|
|
223
220
|
status: import("@lyxa.ai/core/dist/utilities/enum").LimitedTimeOfferCampaignStatus;
|
|
@@ -229,10 +226,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
229
226
|
updatedAt?: Date | null | undefined;
|
|
230
227
|
title?: string | undefined;
|
|
231
228
|
subTitle?: string | undefined;
|
|
232
|
-
|
|
229
|
+
archivedAt?: Date | null | undefined;
|
|
233
230
|
discountOptions?: number[] | undefined;
|
|
234
231
|
maxDiscountCaps?: number[] | undefined;
|
|
235
|
-
archivedAt?: Date | null | undefined;
|
|
236
232
|
}[];
|
|
237
233
|
metadata?: {
|
|
238
234
|
page: number;
|
|
@@ -259,10 +255,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
259
255
|
updatedAt?: Date | null | undefined;
|
|
260
256
|
title?: string | undefined;
|
|
261
257
|
subTitle?: string | undefined;
|
|
262
|
-
|
|
258
|
+
archivedAt?: Date | null | undefined;
|
|
263
259
|
discountOptions?: number[] | undefined;
|
|
264
260
|
maxDiscountCaps?: number[] | undefined;
|
|
265
|
-
archivedAt?: Date | null | undefined;
|
|
266
261
|
} | {
|
|
267
262
|
documents: ({
|
|
268
263
|
status: import("@lyxa.ai/core/dist/utilities/enum").LimitedTimeOfferCampaignStatus;
|
|
@@ -274,10 +269,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
274
269
|
updatedAt?: Date | null | undefined;
|
|
275
270
|
title?: string | undefined;
|
|
276
271
|
subTitle?: string | undefined;
|
|
277
|
-
|
|
272
|
+
archivedAt?: Date | null | undefined;
|
|
278
273
|
discountOptions?: number[] | undefined;
|
|
279
274
|
maxDiscountCaps?: number[] | undefined;
|
|
280
|
-
archivedAt?: Date | null | undefined;
|
|
281
275
|
} | null)[];
|
|
282
276
|
metadata?: {
|
|
283
277
|
page: number;
|
|
@@ -306,10 +300,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
306
300
|
updatedAt?: Date | null | undefined;
|
|
307
301
|
title?: string | undefined;
|
|
308
302
|
subTitle?: string | undefined;
|
|
309
|
-
|
|
303
|
+
archivedAt?: Date | null | undefined;
|
|
310
304
|
discountOptions?: number[] | undefined;
|
|
311
305
|
maxDiscountCaps?: number[] | undefined;
|
|
312
|
-
archivedAt?: Date | null | undefined;
|
|
313
306
|
} | {
|
|
314
307
|
documents: {
|
|
315
308
|
status: import("@lyxa.ai/core/dist/utilities/enum").LimitedTimeOfferCampaignStatus;
|
|
@@ -321,10 +314,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
321
314
|
updatedAt?: Date | null | undefined;
|
|
322
315
|
title?: string | undefined;
|
|
323
316
|
subTitle?: string | undefined;
|
|
324
|
-
|
|
317
|
+
archivedAt?: Date | null | undefined;
|
|
325
318
|
discountOptions?: number[] | undefined;
|
|
326
319
|
maxDiscountCaps?: number[] | undefined;
|
|
327
|
-
archivedAt?: Date | null | undefined;
|
|
328
320
|
}[];
|
|
329
321
|
metadata?: {
|
|
330
322
|
page: number;
|
|
@@ -380,7 +372,6 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
380
372
|
endDate: string | Date;
|
|
381
373
|
title?: string | undefined;
|
|
382
374
|
subTitle?: string | undefined;
|
|
383
|
-
repeatDays?: number[] | undefined;
|
|
384
375
|
discountOptions?: number[] | undefined;
|
|
385
376
|
maxDiscountCaps?: number[] | undefined;
|
|
386
377
|
confirmActive?: boolean | undefined;
|
|
@@ -398,10 +389,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
398
389
|
updatedAt?: Date | null | undefined;
|
|
399
390
|
title?: string | undefined;
|
|
400
391
|
subTitle?: string | undefined;
|
|
401
|
-
|
|
392
|
+
archivedAt?: Date | null | undefined;
|
|
402
393
|
discountOptions?: number[] | undefined;
|
|
403
394
|
maxDiscountCaps?: number[] | undefined;
|
|
404
|
-
archivedAt?: Date | null | undefined;
|
|
405
395
|
} | {
|
|
406
396
|
documents: {
|
|
407
397
|
status: import("@lyxa.ai/core/dist/utilities/enum").LimitedTimeOfferCampaignStatus;
|
|
@@ -413,10 +403,9 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
413
403
|
updatedAt?: Date | null | undefined;
|
|
414
404
|
title?: string | undefined;
|
|
415
405
|
subTitle?: string | undefined;
|
|
416
|
-
|
|
406
|
+
archivedAt?: Date | null | undefined;
|
|
417
407
|
discountOptions?: number[] | undefined;
|
|
418
408
|
maxDiscountCaps?: number[] | undefined;
|
|
419
|
-
archivedAt?: Date | null | undefined;
|
|
420
409
|
}[];
|
|
421
410
|
metadata?: {
|
|
422
411
|
page: number;
|
|
@@ -460,41 +449,6 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
460
449
|
};
|
|
461
450
|
meta: object;
|
|
462
451
|
}>;
|
|
463
|
-
getSessions: import("@trpc/server").TRPCQueryProcedure<{
|
|
464
|
-
input: {
|
|
465
|
-
campaignId: string | import("mongoose").Types.ObjectId;
|
|
466
|
-
page?: number | undefined;
|
|
467
|
-
size?: number | undefined;
|
|
468
|
-
};
|
|
469
|
-
output: {
|
|
470
|
-
message: string;
|
|
471
|
-
success: boolean;
|
|
472
|
-
data?: {
|
|
473
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
474
|
-
startDate: Date;
|
|
475
|
-
endDate: Date;
|
|
476
|
-
shopCount: number;
|
|
477
|
-
archivedAt: Date;
|
|
478
|
-
campaign: string | import("mongoose").Types.ObjectId;
|
|
479
|
-
} | {
|
|
480
|
-
documents: {
|
|
481
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
482
|
-
startDate: Date;
|
|
483
|
-
endDate: Date;
|
|
484
|
-
shopCount: number;
|
|
485
|
-
archivedAt: Date;
|
|
486
|
-
campaign: string | import("mongoose").Types.ObjectId;
|
|
487
|
-
}[];
|
|
488
|
-
metadata?: {
|
|
489
|
-
page: number;
|
|
490
|
-
size: number;
|
|
491
|
-
totalElements: number;
|
|
492
|
-
totalPages: number;
|
|
493
|
-
} | undefined;
|
|
494
|
-
} | undefined;
|
|
495
|
-
};
|
|
496
|
-
meta: object;
|
|
497
|
-
}>;
|
|
498
452
|
cancel: import("@trpc/server").TRPCMutationProcedure<{
|
|
499
453
|
input: {
|
|
500
454
|
campaignId: string | import("mongoose").Types.ObjectId;
|
|
@@ -699,130 +653,6 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
699
653
|
};
|
|
700
654
|
meta: object;
|
|
701
655
|
}>;
|
|
702
|
-
enrollShops: import("@trpc/server").TRPCMutationProcedure<{
|
|
703
|
-
input: {
|
|
704
|
-
shops: {
|
|
705
|
-
isEntireMenu: boolean;
|
|
706
|
-
shopId: string | import("mongoose").Types.ObjectId;
|
|
707
|
-
discountPercentage: number;
|
|
708
|
-
maxDiscountCap: number;
|
|
709
|
-
isOrderCapacityEnabled: boolean;
|
|
710
|
-
products?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
711
|
-
maxOrderCapacity?: number | undefined;
|
|
712
|
-
shopCategories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
713
|
-
}[];
|
|
714
|
-
};
|
|
715
|
-
output: {
|
|
716
|
-
message: string;
|
|
717
|
-
success: boolean;
|
|
718
|
-
data?: {
|
|
719
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
720
|
-
shop: string | import("mongoose").Types.ObjectId;
|
|
721
|
-
isEntireMenu: boolean;
|
|
722
|
-
joinedAt: Date;
|
|
723
|
-
campaign: string | import("mongoose").Types.ObjectId;
|
|
724
|
-
isOrderCapacityEnabled: boolean;
|
|
725
|
-
isWithdrawn: boolean;
|
|
726
|
-
createdAt?: Date | null | undefined;
|
|
727
|
-
updatedAt?: Date | null | undefined;
|
|
728
|
-
products?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
729
|
-
discountPercentage?: number | undefined;
|
|
730
|
-
maxDiscountCap?: number | undefined;
|
|
731
|
-
maxOrderCapacity?: number | undefined;
|
|
732
|
-
withdrawnAt?: Date | null | undefined;
|
|
733
|
-
}[] | {
|
|
734
|
-
documents: {
|
|
735
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
736
|
-
shop: string | import("mongoose").Types.ObjectId;
|
|
737
|
-
isEntireMenu: boolean;
|
|
738
|
-
joinedAt: Date;
|
|
739
|
-
campaign: string | import("mongoose").Types.ObjectId;
|
|
740
|
-
isOrderCapacityEnabled: boolean;
|
|
741
|
-
isWithdrawn: boolean;
|
|
742
|
-
createdAt?: Date | null | undefined;
|
|
743
|
-
updatedAt?: Date | null | undefined;
|
|
744
|
-
products?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
745
|
-
discountPercentage?: number | undefined;
|
|
746
|
-
maxDiscountCap?: number | undefined;
|
|
747
|
-
maxOrderCapacity?: number | undefined;
|
|
748
|
-
withdrawnAt?: Date | null | undefined;
|
|
749
|
-
}[][];
|
|
750
|
-
metadata?: {
|
|
751
|
-
page: number;
|
|
752
|
-
size: number;
|
|
753
|
-
totalElements: number;
|
|
754
|
-
totalPages: number;
|
|
755
|
-
} | undefined;
|
|
756
|
-
} | undefined;
|
|
757
|
-
};
|
|
758
|
-
meta: object;
|
|
759
|
-
}>;
|
|
760
|
-
updateShop: import("@trpc/server").TRPCMutationProcedure<{
|
|
761
|
-
input: {
|
|
762
|
-
isEntireMenu: boolean;
|
|
763
|
-
shopId: string | import("mongoose").Types.ObjectId;
|
|
764
|
-
discountPercentage: number;
|
|
765
|
-
maxDiscountCap: number;
|
|
766
|
-
isOrderCapacityEnabled: boolean;
|
|
767
|
-
products?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
768
|
-
maxOrderCapacity?: number | undefined;
|
|
769
|
-
shopCategories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
770
|
-
};
|
|
771
|
-
output: {
|
|
772
|
-
message: string;
|
|
773
|
-
success: boolean;
|
|
774
|
-
data?: {
|
|
775
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
776
|
-
shop: string | import("mongoose").Types.ObjectId;
|
|
777
|
-
isEntireMenu: boolean;
|
|
778
|
-
joinedAt: Date;
|
|
779
|
-
campaign: string | import("mongoose").Types.ObjectId;
|
|
780
|
-
isOrderCapacityEnabled: boolean;
|
|
781
|
-
isWithdrawn: boolean;
|
|
782
|
-
createdAt?: Date | null | undefined;
|
|
783
|
-
updatedAt?: Date | null | undefined;
|
|
784
|
-
products?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
785
|
-
discountPercentage?: number | undefined;
|
|
786
|
-
maxDiscountCap?: number | undefined;
|
|
787
|
-
maxOrderCapacity?: number | undefined;
|
|
788
|
-
withdrawnAt?: Date | null | undefined;
|
|
789
|
-
} | {
|
|
790
|
-
documents: {
|
|
791
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
792
|
-
shop: string | import("mongoose").Types.ObjectId;
|
|
793
|
-
isEntireMenu: boolean;
|
|
794
|
-
joinedAt: Date;
|
|
795
|
-
campaign: string | import("mongoose").Types.ObjectId;
|
|
796
|
-
isOrderCapacityEnabled: boolean;
|
|
797
|
-
isWithdrawn: boolean;
|
|
798
|
-
createdAt?: Date | null | undefined;
|
|
799
|
-
updatedAt?: Date | null | undefined;
|
|
800
|
-
products?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
801
|
-
discountPercentage?: number | undefined;
|
|
802
|
-
maxDiscountCap?: number | undefined;
|
|
803
|
-
maxOrderCapacity?: number | undefined;
|
|
804
|
-
withdrawnAt?: Date | null | undefined;
|
|
805
|
-
}[];
|
|
806
|
-
metadata?: {
|
|
807
|
-
page: number;
|
|
808
|
-
size: number;
|
|
809
|
-
totalElements: number;
|
|
810
|
-
totalPages: number;
|
|
811
|
-
} | undefined;
|
|
812
|
-
} | undefined;
|
|
813
|
-
};
|
|
814
|
-
meta: object;
|
|
815
|
-
}>;
|
|
816
|
-
withdrawShop: import("@trpc/server").TRPCMutationProcedure<{
|
|
817
|
-
input: {
|
|
818
|
-
shopId: string | import("mongoose").Types.ObjectId;
|
|
819
|
-
};
|
|
820
|
-
output: {
|
|
821
|
-
message: string;
|
|
822
|
-
success: boolean;
|
|
823
|
-
};
|
|
824
|
-
meta: object;
|
|
825
|
-
}>;
|
|
826
656
|
getParticipants: import("@trpc/server").TRPCQueryProcedure<{
|
|
827
657
|
input: {
|
|
828
658
|
campaignId: string | import("mongoose").Types.ObjectId;
|
|
@@ -837,78 +667,17 @@ export declare const limitedTimeOfferRouter: import("@trpc/server").TRPCBuiltRou
|
|
|
837
667
|
shopId: string | import("mongoose").Types.ObjectId;
|
|
838
668
|
joinedAt: Date;
|
|
839
669
|
shopName: string | null;
|
|
840
|
-
shopPhoto?: string | null | undefined;
|
|
841
670
|
discountPercentage?: number | undefined;
|
|
842
671
|
maxDiscountCap?: number | undefined;
|
|
672
|
+
shopPhoto?: string | null | undefined;
|
|
843
673
|
} | {
|
|
844
674
|
documents: {
|
|
845
675
|
shopId: string | import("mongoose").Types.ObjectId;
|
|
846
676
|
joinedAt: Date;
|
|
847
677
|
shopName: string | null;
|
|
848
|
-
shopPhoto?: string | null | undefined;
|
|
849
|
-
discountPercentage?: number | undefined;
|
|
850
|
-
maxDiscountCap?: number | undefined;
|
|
851
|
-
}[];
|
|
852
|
-
metadata?: {
|
|
853
|
-
page: number;
|
|
854
|
-
size: number;
|
|
855
|
-
totalElements: number;
|
|
856
|
-
totalPages: number;
|
|
857
|
-
} | undefined;
|
|
858
|
-
} | undefined;
|
|
859
|
-
};
|
|
860
|
-
meta: object;
|
|
861
|
-
}>;
|
|
862
|
-
getParticipantByShop: import("@trpc/server").TRPCQueryProcedure<{
|
|
863
|
-
input: {
|
|
864
|
-
shopId: string | import("mongoose").Types.ObjectId;
|
|
865
|
-
};
|
|
866
|
-
output: {
|
|
867
|
-
message: string;
|
|
868
|
-
success: boolean;
|
|
869
|
-
data?: {
|
|
870
|
-
campaignState: import("./participant/limited-time-offer-participant.validation").LtoCardState;
|
|
871
|
-
campaign?: {
|
|
872
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
873
|
-
startDate?: Date | null | undefined;
|
|
874
|
-
endDate?: Date | null | undefined;
|
|
875
|
-
title?: string | undefined;
|
|
876
|
-
subTitle?: string | undefined;
|
|
877
|
-
discountOptions?: number[] | undefined;
|
|
878
|
-
maxDiscountCaps?: number[] | undefined;
|
|
879
|
-
} | undefined;
|
|
880
|
-
participant?: {
|
|
881
|
-
isEntireMenu: boolean;
|
|
882
|
-
joinedAt: Date;
|
|
883
|
-
isOrderCapacityEnabled: boolean;
|
|
884
|
-
productIds?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
885
|
-
marketingId?: string | import("mongoose").Types.ObjectId | undefined;
|
|
886
678
|
discountPercentage?: number | undefined;
|
|
887
679
|
maxDiscountCap?: number | undefined;
|
|
888
|
-
|
|
889
|
-
} | undefined;
|
|
890
|
-
} | {
|
|
891
|
-
documents: {
|
|
892
|
-
campaignState: import("./participant/limited-time-offer-participant.validation").LtoCardState;
|
|
893
|
-
campaign?: {
|
|
894
|
-
_id: string | import("mongoose").Types.ObjectId;
|
|
895
|
-
startDate?: Date | null | undefined;
|
|
896
|
-
endDate?: Date | null | undefined;
|
|
897
|
-
title?: string | undefined;
|
|
898
|
-
subTitle?: string | undefined;
|
|
899
|
-
discountOptions?: number[] | undefined;
|
|
900
|
-
maxDiscountCaps?: number[] | undefined;
|
|
901
|
-
} | undefined;
|
|
902
|
-
participant?: {
|
|
903
|
-
isEntireMenu: boolean;
|
|
904
|
-
joinedAt: Date;
|
|
905
|
-
isOrderCapacityEnabled: boolean;
|
|
906
|
-
productIds?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
907
|
-
marketingId?: string | import("mongoose").Types.ObjectId | undefined;
|
|
908
|
-
discountPercentage?: number | undefined;
|
|
909
|
-
maxDiscountCap?: number | undefined;
|
|
910
|
-
maxOrderCapacity?: number | undefined;
|
|
911
|
-
} | undefined;
|
|
680
|
+
shopPhoto?: string | null | undefined;
|
|
912
681
|
}[];
|
|
913
682
|
metadata?: {
|
|
914
683
|
page: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer.router.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/limited-time-offer.router.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"limited-time-offer.router.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/limited-time-offer.router.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwBjC,CAAC"}
|
|
@@ -2,11 +2,9 @@ import { mongoose } from '@typegoose/typegoose';
|
|
|
2
2
|
import { GetActiveCampaignDTO } from '../limited-time-offer/campaign/limited-time-offer-campaign.validation';
|
|
3
3
|
export declare class LimitedTimeOfferService {
|
|
4
4
|
private campaignService;
|
|
5
|
-
private lifecycle;
|
|
6
5
|
private participantService;
|
|
7
6
|
private notificationService;
|
|
8
7
|
constructor();
|
|
9
|
-
activateCampaign(campaignId: mongoose.Types.ObjectId): Promise<void>;
|
|
10
8
|
getActiveCampaign(input: GetActiveCampaignDTO): Promise<{
|
|
11
9
|
_id: mongoose.Types.ObjectId;
|
|
12
10
|
title?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer.service.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/limited-time-offer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"limited-time-offer.service.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/limited-time-offer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAK9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,6EAA6E,CAAC;AAejH,qBACa,uBAAuB;IAChC,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,kBAAkB,CAAqC;IAC/D,OAAO,CAAC,mBAAmB,CAAsC;;IAQpD,iBAAiB,CAAC,KAAK,EAAE,oBAAoB;;;;;;;IAQ7C,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAOlE,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAIlF;AAED,eAAO,MAAM,uBAAuB,yBAAyC,CAAC"}
|
|
@@ -45,28 +45,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
45
45
|
exports.limitedTimeOfferService = exports.LimitedTimeOfferService = void 0;
|
|
46
46
|
const typedi_1 = __importStar(require("typedi"));
|
|
47
47
|
const limited_time_offer_campaign_service_1 = require("../limited-time-offer/campaign/services/limited-time-offer-campaign.service");
|
|
48
|
-
const limited_time_offer_campaign_lifecycle_service_1 = require("../limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service");
|
|
49
48
|
const limited_time_offer_participant_service_1 = require("../limited-time-offer/participant/services/limited-time-offer-participant.service");
|
|
50
49
|
const limited_time_offer_notification_service_1 = require("../limited-time-offer/notification/limited-time-offer-notification.service");
|
|
51
50
|
const limited_time_offer_notification_constants_1 = require("../limited-time-offer/notification/limited-time-offer-notification.constants");
|
|
52
51
|
let LimitedTimeOfferService = class LimitedTimeOfferService {
|
|
53
52
|
campaignService;
|
|
54
|
-
lifecycle;
|
|
55
53
|
participantService;
|
|
56
54
|
notificationService;
|
|
57
55
|
constructor() {
|
|
58
56
|
this.campaignService = limited_time_offer_campaign_service_1.ltoCampaignService;
|
|
59
|
-
this.lifecycle = typedi_1.default.get(limited_time_offer_campaign_lifecycle_service_1.LtoCampaignLifecycleService);
|
|
60
57
|
this.participantService = limited_time_offer_participant_service_1.ltoParticipantService;
|
|
61
58
|
this.notificationService = typedi_1.default.get(limited_time_offer_notification_service_1.LimitedTimeOfferNotificationService);
|
|
62
59
|
}
|
|
63
|
-
async activateCampaign(campaignId) {
|
|
64
|
-
const campaign = await this.campaignService.getById(campaignId);
|
|
65
|
-
await this.lifecycle.activateCampaign(campaignId);
|
|
66
|
-
if ((campaign.repeatDays ?? []).length > 0) {
|
|
67
|
-
await this.participantService.reactivateMarketings(campaign);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
60
|
async getActiveCampaign(input) {
|
|
71
61
|
const campaign = await this.campaignService.getActive();
|
|
72
62
|
if (!campaign)
|
|
@@ -77,14 +67,12 @@ let LimitedTimeOfferService = class LimitedTimeOfferService {
|
|
|
77
67
|
async cancelCampaign(campaignId) {
|
|
78
68
|
await this.campaignService.cancel(campaignId);
|
|
79
69
|
const participantIds = await this.participantService.getParticipantIdsByCampaignId(campaignId);
|
|
80
|
-
await this.participantService.
|
|
70
|
+
await this.participantService.removeCampaignMarketings(campaignId);
|
|
81
71
|
await this.notificationService.send(limited_time_offer_notification_constants_1.NotificationType.Cancel, participantIds, { campaignId });
|
|
82
72
|
}
|
|
83
73
|
async expireCampaign(campaignId) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
await this.participantService.cleanupCampaignMarketings(campaignId);
|
|
87
|
-
}
|
|
74
|
+
await this.campaignService.expire(campaignId);
|
|
75
|
+
await this.participantService.removeCampaignMarketings(campaignId);
|
|
88
76
|
}
|
|
89
77
|
};
|
|
90
78
|
exports.LimitedTimeOfferService = LimitedTimeOfferService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer.service.js","sourceRoot":"/","sources":["modules/limited-time-offer/limited-time-offer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,2IAG2F;
|
|
1
|
+
{"version":3,"file":"limited-time-offer.service.js","sourceRoot":"/","sources":["modules/limited-time-offer/limited-time-offer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,2IAG2F;AAE3F,oJAGiG;AACjG,8IAE0F;AAC1F,kJAAoH;AAQ7G,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACxB,eAAe,CAAqB;IACpC,kBAAkB,CAAqC;IACvD,mBAAmB,CAAsC;IAEjE;QACI,IAAI,CAAC,eAAe,GAAG,wDAAkB,CAAC;QAC1C,IAAI,CAAC,kBAAkB,GAAG,8DAAqB,CAAC;QAChD,IAAI,CAAC,mBAAmB,GAAG,gBAAS,CAAC,GAAG,CAAC,6EAAmC,CAAC,CAAC;IAClF,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,KAA2B;QACtD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;QACxD,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC;QAE3B,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACxF,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3D,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,UAAmC;QAC3D,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAA;QAC9F,MAAM,IAAI,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;QACnE,MAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,4DAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,EAAC,UAAU,EAAC,CAAC,CAAA;IAC9F,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,UAAmC;QAC3D,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,IAAI,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACvE,CAAC;CACJ,CAAA;AA9BY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,gBAAO,GAAE;;GACG,uBAAuB,CA8BnC;AAEY,QAAA,uBAAuB,GAAG,gBAAS,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {mongoose} from '@typegoose/typegoose';\nimport {\n ltoCampaignService,\n LtoCampaignService,\n} from '@modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service';\nimport {GetActiveCampaignDTO} from '@modules/limited-time-offer/campaign/limited-time-offer-campaign.validation';\nimport {\n LimitedTimeOfferParticipantService,\n ltoParticipantService,\n} from '@modules/limited-time-offer/participant/services/limited-time-offer-participant.service';\nimport {\n LimitedTimeOfferNotificationService\n} from \"@modules/limited-time-offer/notification/limited-time-offer-notification.service\";\nimport {NotificationType} from \"@modules/limited-time-offer/notification/limited-time-offer-notification.constants\";\n\n/**\n * Application/orchestration layer for the Limited Time Offer module. Owns every flow that spans the\n * campaign and participant aggregates so neither domain service has to reach across the boundary.\n * Pure single-aggregate operations stay on their respective domain services.\n */\n@Service()\nexport class LimitedTimeOfferService {\n private campaignService: LtoCampaignService;\n private participantService: LimitedTimeOfferParticipantService;\n private notificationService: LimitedTimeOfferNotificationService;\n\n constructor() {\n this.campaignService = ltoCampaignService;\n this.participantService = ltoParticipantService;\n this.notificationService = Container.get(LimitedTimeOfferNotificationService);\n }\n\n public async getActiveCampaign(input: GetActiveCampaignDTO) {\n const campaign = await this.campaignService.getActive();\n if (!campaign) return null;\n\n const nearbyParticipants = await this.participantService.getNearby(campaign._id, input);\n return nearbyParticipants.length > 0 ? campaign : null;\n }\n\n public async cancelCampaign(campaignId: mongoose.Types.ObjectId): Promise<void> {\n await this.campaignService.cancel(campaignId);\n const participantIds = await this.participantService.getParticipantIdsByCampaignId(campaignId)\n await this.participantService.removeCampaignMarketings(campaignId);\n await this.notificationService.send(NotificationType.Cancel, participantIds, {campaignId})\n }\n\n public async expireCampaign(campaignId: mongoose.Types.ObjectId): Promise<void> {\n await this.campaignService.expire(campaignId);\n await this.participantService.removeCampaignMarketings(campaignId);\n }\n}\n\nexport const limitedTimeOfferService = Container.get(LimitedTimeOfferService);\n"]}
|
|
@@ -8,7 +8,7 @@ export declare const TARGET_ACCOUNT_TYPES: readonly [NotificationAccountType.SHO
|
|
|
8
8
|
export declare const NOTIFICATIONS: {
|
|
9
9
|
readonly CAMPAIGN_CANCELLED: {
|
|
10
10
|
readonly title: "Lyxa deleted the current campaign";
|
|
11
|
-
readonly body: "The ongoing limited time offer campaign has been deleted by
|
|
11
|
+
readonly body: "The ongoing limited time offer campaign has been deleted by lyxa.";
|
|
12
12
|
readonly sound: "notification_sound";
|
|
13
13
|
};
|
|
14
14
|
readonly CAMPAIGN_ACTIVATED: {
|
|
@@ -14,7 +14,7 @@ const CUSTOM_NOTIFICATION_SOUND = 'notification_sound';
|
|
|
14
14
|
exports.NOTIFICATIONS = {
|
|
15
15
|
CAMPAIGN_CANCELLED: {
|
|
16
16
|
title: "Lyxa deleted the current campaign",
|
|
17
|
-
body: "The ongoing limited time offer campaign has been deleted by
|
|
17
|
+
body: "The ongoing limited time offer campaign has been deleted by lyxa.",
|
|
18
18
|
sound: CUSTOM_NOTIFICATION_SOUND
|
|
19
19
|
},
|
|
20
20
|
CAMPAIGN_ACTIVATED: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-notification.constants.js","sourceRoot":"/","sources":["modules/limited-time-offer/notification/limited-time-offer-notification.constants.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAE7D,QAAA,gBAAgB,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACd,CAAC;AAME,QAAA,oBAAoB,GAAG;IAChC,8BAAuB,CAAC,IAAI;IAC5B,8BAAuB,CAAC,YAAY;CAC9B,CAAC;AAEX,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAE1C,QAAA,aAAa,GAAG;IACzB,kBAAkB,EAAE;QAChB,KAAK,EAAE,mCAAmC;QAC1C,IAAI,EAAE,mEAAmE;QACzE,KAAK,EAAE,yBAAyB;KACnC;IACD,kBAAkB,EAAE;QAChB,KAAK,EAAE,6BAA6B;QACpC,IAAI,EAAE,yDAAyD;QAC/D,KAAK,EAAE,yBAAyB;KACnC;CACK,CAAC","sourcesContent":["import {NotificationAccountType} from \"@lyxa.ai/core/dist/utilities/enum\";\n\nexport const NotificationType = {\n Cancel: \"cancel\",\n Activate: \"activate\",\n} as const;\n\nexport type NotificationType =\n (typeof NotificationType)[keyof typeof NotificationType];\n\n\nexport const TARGET_ACCOUNT_TYPES = [\n NotificationAccountType.SHOP,\n NotificationAccountType.SHOP_CONSOLE,\n] as const;\n\nconst CUSTOM_NOTIFICATION_SOUND = 'notification_sound';\n\nexport const NOTIFICATIONS = {\n CAMPAIGN_CANCELLED: {\n title: \"Lyxa deleted the current campaign\",\n body: \"The ongoing limited time offer campaign has been deleted by
|
|
1
|
+
{"version":3,"file":"limited-time-offer-notification.constants.js","sourceRoot":"/","sources":["modules/limited-time-offer/notification/limited-time-offer-notification.constants.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAE7D,QAAA,gBAAgB,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACd,CAAC;AAME,QAAA,oBAAoB,GAAG;IAChC,8BAAuB,CAAC,IAAI;IAC5B,8BAAuB,CAAC,YAAY;CAC9B,CAAC;AAEX,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAE1C,QAAA,aAAa,GAAG;IACzB,kBAAkB,EAAE;QAChB,KAAK,EAAE,mCAAmC;QAC1C,IAAI,EAAE,mEAAmE;QACzE,KAAK,EAAE,yBAAyB;KACnC;IACD,kBAAkB,EAAE;QAChB,KAAK,EAAE,6BAA6B;QACpC,IAAI,EAAE,yDAAyD;QAC/D,KAAK,EAAE,yBAAyB;KACnC;CACK,CAAC","sourcesContent":["import {NotificationAccountType} from \"@lyxa.ai/core/dist/utilities/enum\";\n\nexport const NotificationType = {\n Cancel: \"cancel\",\n Activate: \"activate\",\n} as const;\n\nexport type NotificationType =\n (typeof NotificationType)[keyof typeof NotificationType];\n\n\nexport const TARGET_ACCOUNT_TYPES = [\n NotificationAccountType.SHOP,\n NotificationAccountType.SHOP_CONSOLE,\n] as const;\n\nconst CUSTOM_NOTIFICATION_SOUND = 'notification_sound';\n\nexport const NOTIFICATIONS = {\n CAMPAIGN_CANCELLED: {\n title: \"Lyxa deleted the current campaign\",\n body: \"The ongoing limited time offer campaign has been deleted by lyxa.\",\n sound: CUSTOM_NOTIFICATION_SOUND\n },\n CAMPAIGN_ACTIVATED: {\n title: \"Limited Time Offer is Live!\",\n body: \"A new limited time offer has started. Check it out now!\",\n sound: CUSTOM_NOTIFICATION_SOUND\n },\n} as const;"]}
|
package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mongoose } from '@typegoose/typegoose';
|
|
2
2
|
import { LimitedTimeOfferCampaign } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
-
import {
|
|
3
|
+
import { MarketingStatus, MarketingType, ValueType } from '@lyxa.ai/core/dist/utilities/enum';
|
|
4
4
|
import { GetLtoCampaignParticipantsDTO } from '../campaign/limited-time-offer-campaign.validation';
|
|
5
5
|
import { JoinLtoCampaignDTO } from './limited-time-offer-participant.validation';
|
|
6
6
|
export declare class LtoParticipantQueryBuilder {
|
|
@@ -9,13 +9,7 @@ export declare class LtoParticipantQueryBuilder {
|
|
|
9
9
|
isWithdrawn: boolean;
|
|
10
10
|
};
|
|
11
11
|
static buildSearchTerm(dto: GetLtoCampaignParticipantsDTO): string | undefined;
|
|
12
|
-
static buildCreateInput(
|
|
13
|
-
campaignId: mongoose.Types.ObjectId;
|
|
14
|
-
shopId: mongoose.Types.ObjectId;
|
|
15
|
-
marketingId: mongoose.Types.ObjectId;
|
|
16
|
-
dto: JoinLtoCampaignDTO;
|
|
17
|
-
pausedMarketings?: mongoose.Types.ObjectId[];
|
|
18
|
-
}): {
|
|
12
|
+
static buildCreateInput(campaignId: mongoose.Types.ObjectId, shopId: mongoose.Types.ObjectId, marketingId: mongoose.Types.ObjectId, dto: JoinLtoCampaignDTO): {
|
|
19
13
|
campaign: mongoose.Types.ObjectId;
|
|
20
14
|
shop: mongoose.Types.ObjectId;
|
|
21
15
|
marketing: mongoose.Types.ObjectId;
|
|
@@ -27,14 +21,12 @@ export declare class LtoParticipantQueryBuilder {
|
|
|
27
21
|
isOrderCapacityEnabled: boolean;
|
|
28
22
|
maxOrderCapacity: number | undefined;
|
|
29
23
|
isWithdrawn: boolean;
|
|
30
|
-
pausedMarketings: mongoose.Types.ObjectId[];
|
|
31
24
|
};
|
|
32
25
|
static buildMarketingInput(shopId: mongoose.Types.ObjectId, campaign: LimitedTimeOfferCampaign & {
|
|
33
26
|
_id: mongoose.Types.ObjectId;
|
|
34
27
|
}, dto: JoinLtoCampaignDTO): {
|
|
35
28
|
shop: mongoose.Types.ObjectId;
|
|
36
29
|
marketingType: MarketingType;
|
|
37
|
-
campaignType: MarketingCampaignType;
|
|
38
30
|
isAppliedByCompany: boolean;
|
|
39
31
|
duration: {
|
|
40
32
|
start: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-participant.builder.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/participant/limited-time-offer-participant.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"limited-time-offer-participant.builder.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/participant/limited-time-offer-participant.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,wBAAwB,EAAC,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAC,eAAe,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5F,OAAO,EAAC,6BAA6B,EAAC,MAAM,oDAAoD,CAAC;AACjG,OAAO,EAAC,kBAAkB,EAAC,MAAM,6CAA6C,CAAC;AAE/E,qBAAa,0BAA0B;IACnC,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE,6BAA6B;;;;IAI7D,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,6BAA6B,GAAG,MAAM,GAAG,SAAS;IAI9E,MAAM,CAAC,gBAAgB,CACnB,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACpC,GAAG,EAAE,kBAAkB;;;;;;;;;;;;;IAiB3B,MAAM,CAAC,mBAAmB,CACtB,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,QAAQ,EAAE,wBAAwB,GAAG;QAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAA;KAAC,EACnE,GAAG,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;CA2B9B"}
|
package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js
CHANGED
|
@@ -9,8 +9,7 @@ class LtoParticipantQueryBuilder {
|
|
|
9
9
|
static buildSearchTerm(dto) {
|
|
10
10
|
return dto.search?.trim() || undefined;
|
|
11
11
|
}
|
|
12
|
-
static buildCreateInput(
|
|
13
|
-
const { campaignId, shopId, marketingId, dto, pausedMarketings = [] } = input;
|
|
12
|
+
static buildCreateInput(campaignId, shopId, marketingId, dto) {
|
|
14
13
|
return {
|
|
15
14
|
campaign: campaignId,
|
|
16
15
|
shop: shopId,
|
|
@@ -23,14 +22,12 @@ class LtoParticipantQueryBuilder {
|
|
|
23
22
|
isOrderCapacityEnabled: dto.isOrderCapacityEnabled,
|
|
24
23
|
maxOrderCapacity: dto.maxOrderCapacity,
|
|
25
24
|
isWithdrawn: false,
|
|
26
|
-
pausedMarketings,
|
|
27
25
|
};
|
|
28
26
|
}
|
|
29
27
|
static buildMarketingInput(shopId, campaign, dto) {
|
|
30
28
|
return {
|
|
31
29
|
shop: shopId,
|
|
32
30
|
marketingType: enum_1.MarketingType.DISCOUNT,
|
|
33
|
-
campaignType: enum_1.MarketingCampaignType.LIMITED_TIME_OFFER,
|
|
34
31
|
isAppliedByCompany: false,
|
|
35
32
|
duration: { start: campaign.startDate, end: campaign.endDate },
|
|
36
33
|
status: enum_1.MarketingStatus.ACTIVE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-participant.builder.js","sourceRoot":"/","sources":["modules/limited-time-offer/participant/limited-time-offer-participant.builder.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"limited-time-offer-participant.builder.js","sourceRoot":"/","sources":["modules/limited-time-offer/participant/limited-time-offer-participant.builder.ts"],"names":[],"mappings":";;;AAEA,4DAA4F;AAI5F,MAAa,0BAA0B;IACnC,MAAM,CAAC,mBAAmB,CAAC,GAAkC;QACzD,OAAO,EAAC,QAAQ,EAAE,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,EAAC,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,GAAkC;QACrD,OAAO,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,gBAAgB,CACnB,UAAmC,EACnC,MAA+B,EAC/B,WAAoC,EACpC,GAAuB;QAEvB,OAAO;YACH,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,WAAW;YACtB,QAAQ,EAAE,IAAI,IAAI,EAAE;YACpB,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE;YAC5B,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;YAC1C,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,sBAAsB,EAAE,GAAG,CAAC,sBAAsB;YAClD,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;YACtC,WAAW,EAAE,KAAK;SACrB,CAAC;IACN,CAAC;IAED,MAAM,CAAC,mBAAmB,CACtB,MAA+B,EAC/B,QAAmE,EACnE,GAAuB;QAEvB,OAAO;YACH,IAAI,EAAE,MAAM;YACZ,aAAa,EAAE,oBAAa,CAAC,QAAQ;YACrC,kBAAkB,EAAE,KAAK;YACzB,QAAQ,EAAE,EAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,CAAC,OAAO,EAAC;YAC5D,MAAM,EAAE,sBAAe,CAAC,MAAM;YAC9B,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS;YAC5D,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAS,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YAC9D,QAAQ,EAAE,GAAG,CAAC,YAAY;gBACtB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;oBAC7B,OAAO,EAAE,SAAS;oBAClB,KAAK,EAAE,GAAG,CAAC,kBAAkB;oBAC7B,SAAS,EAAE,gBAAS,CAAC,UAAU;iBAClC,CAAC,CAAC;YACP,mBAAmB,EAAE,GAAG,CAAC,cAAc;YACvC,4BAA4B,EAAE,GAAG,CAAC,cAAc,GAAG,CAAC;YACpD,UAAU,EAAE,EAAE;YACd,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,CAAC;YACb,mBAAmB,EAAE,KAAK;YAC1B,mBAAmB,EAAE,KAAK;SAC7B,CAAC;IACN,CAAC;CACJ;AA5DD,gEA4DC","sourcesContent":["import {mongoose} from '@typegoose/typegoose';\nimport {LimitedTimeOfferCampaign} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {MarketingStatus, MarketingType, ValueType} from '@lyxa.ai/core/dist/utilities/enum';\nimport {GetLtoCampaignParticipantsDTO} from '../campaign/limited-time-offer-campaign.validation';\nimport {JoinLtoCampaignDTO} from './limited-time-offer-participant.validation';\n\nexport class LtoParticipantQueryBuilder {\n static buildCampaignFilter(dto: GetLtoCampaignParticipantsDTO) {\n return {campaign: dto.campaignId, isWithdrawn: false};\n }\n\n static buildSearchTerm(dto: GetLtoCampaignParticipantsDTO): string | undefined {\n return dto.search?.trim() || undefined;\n }\n\n static buildCreateInput(\n campaignId: mongoose.Types.ObjectId,\n shopId: mongoose.Types.ObjectId,\n marketingId: mongoose.Types.ObjectId,\n dto: JoinLtoCampaignDTO,\n ) {\n return {\n campaign: campaignId,\n shop: shopId,\n marketing: marketingId,\n joinedAt: new Date(),\n products: dto.products ?? [],\n isEntireMenu: dto.isEntireMenu,\n discountPercentage: dto.discountPercentage,\n maxDiscountCap: dto.maxDiscountCap,\n isOrderCapacityEnabled: dto.isOrderCapacityEnabled,\n maxOrderCapacity: dto.maxOrderCapacity,\n isWithdrawn: false,\n };\n }\n\n static buildMarketingInput(\n shopId: mongoose.Types.ObjectId,\n campaign: LimitedTimeOfferCampaign & {_id: mongoose.Types.ObjectId},\n dto: JoinLtoCampaignDTO,\n ) {\n return {\n shop: shopId,\n marketingType: MarketingType.DISCOUNT,\n isAppliedByCompany: false,\n duration: {start: campaign.startDate, end: campaign.endDate},\n status: MarketingStatus.ACTIVE,\n isEntireMenu: dto.isEntireMenu,\n value: dto.isEntireMenu ? dto.discountPercentage : undefined,\n valueType: dto.isEntireMenu ? ValueType.PERCENTAGE : undefined,\n products: dto.isEntireMenu\n ? []\n : dto.products.map(productId => ({\n product: productId,\n value: dto.discountPercentage,\n valueType: ValueType.PERCENTAGE,\n })),\n maxDiscountPerOrder: dto.maxDiscountCap,\n isMaxDiscountPerOrderEnabled: dto.maxDiscountCap > 0,\n categories: [],\n excludeProducts: [],\n spendLimit: 0,\n isSpendLimitEnabled: false,\n isOnlyForSubscriber: false,\n };\n }\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DocumentType, mongoose } from '@typegoose/typegoose';
|
|
2
2
|
import { LimitedTimeOfferParticipant as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
-
import { MarketingStatus, MarketingType } from '@lyxa.ai/core/dist/utilities/enum';
|
|
4
3
|
import { GetLtoCampaignParticipantsDTO, LtoCampaignParticipantItemDTO } from '../campaign/limited-time-offer-campaign.validation';
|
|
5
4
|
import { ActiveParticipantMarketingDTO, ParticipantSummaryDTO, UpdateParticipantDataDTO } from './limited-time-offer-participant.validation';
|
|
6
5
|
export declare class LtoParticipantRepository {
|
|
@@ -25,15 +24,6 @@ export declare class LtoParticipantRepository {
|
|
|
25
24
|
countShopProducts(shopId: mongoose.Types.ObjectId, productIds: mongoose.Types.ObjectId[]): Promise<number>;
|
|
26
25
|
findProductIdsByCategories(shopId: mongoose.Types.ObjectId, categoryIds: mongoose.Types.ObjectId[]): Promise<mongoose.Types.ObjectId[]>;
|
|
27
26
|
findMarketingIdsByCampaign(campaignId: mongoose.Types.ObjectId): Promise<mongoose.Types.ObjectId[]>;
|
|
28
|
-
countNonWithdrawnByCampaign(campaignId: mongoose.Types.ObjectId): Promise<number>;
|
|
29
|
-
findAllActiveByCampaign(campaignId: mongoose.Types.ObjectId): Promise<DocumentType<Model>[]>;
|
|
30
|
-
findPausedMarketingIdsByCampaign(campaignId: mongoose.Types.ObjectId): Promise<mongoose.Types.ObjectId[]>;
|
|
31
|
-
findActiveMarketingIdsByShop(shopId: mongoose.Types.ObjectId, marketingType: MarketingType): Promise<mongoose.Types.ObjectId[]>;
|
|
32
|
-
findRevivableMarketings(ids: mongoose.Types.ObjectId[]): Promise<Array<{
|
|
33
|
-
_id: mongoose.Types.ObjectId;
|
|
34
|
-
shop: mongoose.Types.ObjectId;
|
|
35
|
-
}>>;
|
|
36
|
-
updateMarketingStatus(ids: mongoose.Types.ObjectId[], status: MarketingStatus): Promise<void>;
|
|
37
27
|
findParticipantIdsByCampaignId(campaignId: mongoose.Types.ObjectId): Promise<mongoose.Types.ObjectId[]>;
|
|
38
28
|
findByCampaign(dto: GetLtoCampaignParticipantsDTO): Promise<{
|
|
39
29
|
documents: LtoCampaignParticipantItemDTO[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-participant.repository.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/participant/limited-time-offer-participant.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACN,2BAA2B,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"limited-time-offer-participant.repository.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/participant/limited-time-offer-participant.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACN,2BAA2B,IAAI,KAAK,EAIpC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,EAC7B,6BAA6B,EAC7B,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EACN,6BAA6B,EAC7B,qBAAqB,EACrB,wBAAwB,EACxB,MAAM,6CAA6C,CAAC;AAErD,qBACa,wBAAwB;IACpC,OAAO,CAAC,KAAK,CAAmE;IAChF,OAAO,CAAC,SAAS,CAAmB;;IAQvB,UAAU,CACtB,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,KAAK,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KAClB,EACD,WAAW,EAAE,MAAM;IA2Cd,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAGnD,uBAAuB,CAC5B,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,sBAAsB,EAAE,OAAO,EAC/B,gBAAgB,CAAC,EAAE,MAAM;;;;;IAapB,2BAA2B,CAChC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAC7B,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAYlC,QAAQ,CACb,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAC7B,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAQhC,6BAA6B,CAClC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAC7B,OAAO,CAAC,OAAO,CAAC;IAIb,mBAAmB,CACxB,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAC7B,OAAO,CAAC,6BAA6B,GAAG,IAAI,CAAC;IAS1C,iBAAiB,CACtB,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,IAAI,EAAE,wBAAwB,GAC5B,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAQhC,iBAAiB,CACtB,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,GACnC,OAAO,CAAC,MAAM,CAAC;IAKZ,0BAA0B,CAC/B,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,GACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAa/B,0BAA0B,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAQnG,8BAA8B,CACnC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAU/B,cAAc,CACnB,GAAG,EAAE,6BAA6B,GAChC,OAAO,CAAC;QAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CA8CzE;AAED,eAAO,MAAM,wBAAwB,0BAA0C,CAAC"}
|