@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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DocumentType, mongoose } from '@typegoose/typegoose';
|
|
2
|
-
import {
|
|
3
|
-
import { AdminEnrollShopEntryDTO, JoinLtoCampaignDTO, ParticipantStatusDTO } from '../limited-time-offer-participant.validation';
|
|
2
|
+
import { JoinLtoCampaignDTO, ParticipantStatusDTO } from '../limited-time-offer-participant.validation';
|
|
4
3
|
import { GetLtoCampaignParticipantsDTO } from '../../campaign/limited-time-offer-campaign.validation';
|
|
5
4
|
export declare class LimitedTimeOfferParticipantService {
|
|
6
5
|
private repository;
|
|
@@ -8,16 +7,7 @@ export declare class LimitedTimeOfferParticipantService {
|
|
|
8
7
|
private marketingService;
|
|
9
8
|
constructor();
|
|
10
9
|
join(shopId: mongoose.Types.ObjectId, dto: JoinLtoCampaignDTO): Promise<DocumentType<import("@lyxa.ai/core/dist/libraries/mongo/models").LimitedTimeOfferParticipant>>;
|
|
11
|
-
enrollShops(entries: AdminEnrollShopEntryDTO[]): Promise<(mongoose.Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, import("@lyxa.ai/core/dist/libraries/mongo/models").LimitedTimeOfferParticipant, Record<string, any>, {}> & import("@lyxa.ai/core/dist/libraries/mongo/models").LimitedTimeOfferParticipant & {
|
|
12
|
-
_id: mongoose.Types.ObjectId;
|
|
13
|
-
} & {
|
|
14
|
-
__v: number;
|
|
15
|
-
} & import("@typegoose/typegoose/lib/types").IObjectWithTypegooseFunction)[]>;
|
|
16
|
-
private joinShop;
|
|
17
|
-
private pauseIfLive;
|
|
18
10
|
withdraw(shopId: mongoose.Types.ObjectId): Promise<void>;
|
|
19
|
-
cleanupCampaignMarketings(campaignId: mongoose.Types.ObjectId): Promise<void>;
|
|
20
|
-
isActiveParticipant(shopId: mongoose.Types.ObjectId): Promise<boolean>;
|
|
21
11
|
getStatus(shopId: mongoose.Types.ObjectId): Promise<ParticipantStatusDTO>;
|
|
22
12
|
update(shopId: mongoose.Types.ObjectId, dto: JoinLtoCampaignDTO): Promise<DocumentType<import("@lyxa.ai/core/dist/libraries/mongo/models").LimitedTimeOfferParticipant> | null>;
|
|
23
13
|
getParticipants(dto: GetLtoCampaignParticipantsDTO): Promise<{
|
|
@@ -25,9 +15,9 @@ export declare class LimitedTimeOfferParticipantService {
|
|
|
25
15
|
shopId: mongoose.Types.ObjectId;
|
|
26
16
|
joinedAt: Date;
|
|
27
17
|
shopName: string | null;
|
|
28
|
-
shopPhoto?: string | null | undefined;
|
|
29
18
|
discountPercentage?: number | undefined;
|
|
30
19
|
maxDiscountCap?: number | undefined;
|
|
20
|
+
shopPhoto?: string | null | undefined;
|
|
31
21
|
}[];
|
|
32
22
|
metadata: {
|
|
33
23
|
page: number;
|
|
@@ -41,8 +31,7 @@ export declare class LimitedTimeOfferParticipantService {
|
|
|
41
31
|
latitude: number;
|
|
42
32
|
longitude: number;
|
|
43
33
|
}): Promise<any[]>;
|
|
44
|
-
|
|
45
|
-
private applyMarketingWithRollback;
|
|
34
|
+
removeCampaignMarketings(campaignId: mongoose.Types.ObjectId): Promise<void>;
|
|
46
35
|
private fetchCurrentCampaignOrThrow;
|
|
47
36
|
private assertNotAlreadyJoined;
|
|
48
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-participant.service.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/participant/services/limited-time-offer-participant.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"limited-time-offer-participant.service.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/participant/services/limited-time-offer-participant.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAM5D,OAAO,EACN,kBAAkB,EAElB,oBAA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
|
private unExpireMarketingsBelowSpendLimits;
|
|
47
47
|
recomputeAndSyncAllMarketingSpent(): Promise<void>;
|
|
48
|
-
private publishEntireMenuSeedEvents;
|
|
49
48
|
reseedEntireMenuMarketing(marketingId: mongoose.Types.ObjectId): Promise<void>;
|
|
50
49
|
assignMarketingToProducts(marketing: DocumentType<Buy1Get1Marketing | DiscountMarketing>): Promise<void>;
|
|
51
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketing.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/marketing.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EAMjB,SAAS,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"marketing.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/marketing.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EAMjB,SAAS,IAAI,KAAK,EAMlB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEN,0BAA0B,EAE1B,oCAAoC,EACpC,kBAAkB,IAAI,SAAS,EAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AA0C3D,qBACa,gBAAgB;IAC5B,OAAO,CAAC,KAAK,CAAiD;IAC9D,OAAO,CAAC,SAAS,CAA2C;IAC5D,OAAO,CAAC,UAAU,CAA2D;IAC7E,OAAO,CAAC,0BAA0B,CAA6B;IAC/D,OAAO,CAAC,gCAAgC,CACM;;IAY9C;;;OAGG;IACU,MAAM,CAClB,IAAI,EAAE,0BAA0B,EAChC,KA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AC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqC9E,yBAAyB,CAAC,SAAS,EAAE,YAAY,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;CA0CrG;AAED,eAAO,MAAM,gBAAgB,kBAAkC,CAAC"}
|
|
@@ -56,15 +56,11 @@ export declare class ProductMarketingService {
|
|
|
56
56
|
* @param products Array of product IDs
|
|
57
57
|
*/
|
|
58
58
|
checkProductMarketingAvailability(products: mongoose.Types.ObjectId[], isAppliedByCompany?: boolean): Promise<boolean>;
|
|
59
|
-
/**
|
|
60
|
-
* Pause any standard (non-LTO) marketing already covering these products, so a
|
|
61
|
-
* Limited Time Offer marketing can take them over instead of being blocked by it.
|
|
62
|
-
* @param products Array of product IDs
|
|
63
|
-
*/
|
|
64
|
-
pauseConflictingMarketings(products: mongoose.Types.ObjectId[]): Promise<mongoose.Types.ObjectId[]>;
|
|
65
59
|
upsertProductMarketingsForPage(data: {
|
|
60
|
+
shop: mongoose.Types.ObjectId;
|
|
66
61
|
marketingId: mongoose.Types.ObjectId;
|
|
67
|
-
|
|
62
|
+
page: number;
|
|
63
|
+
pageSize: number;
|
|
68
64
|
isAppliedByCompany: boolean;
|
|
69
65
|
isBuy1Get1: boolean;
|
|
70
66
|
value?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-marketing.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/product-marketing.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"product-marketing.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/product-marketing.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAEN,gBAAgB,IAAI,KAAK,EAEzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACN,oCAAoC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ronize-product-marketing.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synchronize-product-marketing.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/synchronize-product-marketing.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"synchronize-product-marketing.service.d.ts","sourceRoot":"/","sources":["modules/marketing/services/synchronize-product-marketing.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAWhD,OAAO,EAAE,6CAA6C,EAAE,MAAM,0FAA0F,CAAC;AAIzJ,qBACa,kCAAkC;IAC9C,OAAO,CAAC,YAAY,CAA+C;IACnE,OAAO,CAAC,qBAAqB,CAAmE;;IAQnF,kDAAkD;IAKxD,2CAA2C,CACjD,OAAO,EAAE,6CAA6C,GACpD,MAAM;IAKF,4BAA4B,QAAa,OAAO,CAAC,GAAG,CAAC,CAqC1D;YAEY,oBAAoB;YA2CpB,kCAAkC;IAsCnC,mCAAmC,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ;IAqCtE,oCAAoC,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE;IA8D1E,sCAAsC,CAAC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE;CAY3F;AAED,eAAO,MAAM,kCAAkC,oCAAoD,CAAC"}
|
package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts
CHANGED
|
@@ -58,6 +58,11 @@ export declare class PunchMarketingHistoryService {
|
|
|
58
58
|
* @param data Data to use for validating discount
|
|
59
59
|
*/
|
|
60
60
|
getPunchDiscount(data: ValidateCouponDTO): Promise<CouponValidationOutputDTO>;
|
|
61
|
+
/**
|
|
62
|
+
* Get punch discount for adjust order
|
|
63
|
+
* @param data Data to use for validating discount
|
|
64
|
+
*/
|
|
65
|
+
getPunchDiscountForAdjust(data: ValidateCouponDTO): Promise<CouponValidationOutputDTO>;
|
|
61
66
|
getPunchCoupon(user: mongoose.Types.ObjectId, shop: mongoose.Types.ObjectId): Promise<any>;
|
|
62
67
|
returnPunchCoupon(orderId: mongoose.Types.ObjectId): Promise<void>;
|
|
63
68
|
}
|
package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"punch-marketing-history.service.d.ts","sourceRoot":"/","sources":["modules/punch-marketing-history/services/punch-marketing-history.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAEN,qBAAqB,IAAI,KAAK,EAK9B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,8BAA8B,IAAI,SAAS,EAC3C,mBAAmB,EACnB,8BAA8B,IAAI,SAAS,EAC3C,MAAM,8CAA8C,CAAC;AAWtD,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAO3F,qBACa,4BAA4B;IACxC,OAAO,CAAC,KAAK,CAA6D;IAC1E,OAAO,CAAC,cAAc,CAA+D;IACrF,OAAO,CAAC,UAAU,CAA2D;;IAQ7E;;;OAGG;IACU,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAIlE;;;OAGG;IACU,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAczF;;;OAGG;IACU,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAqBxG;;;OAGG;IACU,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC;IAkCtE;;;;OAIG;IACU,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAuB9E;;;OAGG;IACU,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAczD;;;;OAIG;IACU,oBAAoB,CAChC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAC/B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAC9B,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"punch-marketing-history.service.d.ts","sourceRoot":"/","sources":["modules/punch-marketing-history/services/punch-marketing-history.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAEN,qBAAqB,IAAI,KAAK,EAK9B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,8BAA8B,IAAI,SAAS,EAC3C,mBAAmB,EACnB,8BAA8B,IAAI,SAAS,EAC3C,MAAM,8CAA8C,CAAC;AAWtD,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAO3F,qBACa,4BAA4B;IACxC,OAAO,CAAC,KAAK,CAA6D;IAC1E,OAAO,CAAC,cAAc,CAA+D;IACrF,OAAO,CAAC,UAAU,CAA2D;;IAQ7E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QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA6C1F,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAkB/E;AAED,eAAO,MAAM,4BAA4B,8BAA8C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/marketing",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
4
4
|
"description": "The Lyxa Marketing microservice",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/lib/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test:watch": "jest --watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@lyxa.ai/core": "1.4.
|
|
22
|
+
"@lyxa.ai/core": "1.4.242",
|
|
23
23
|
"@lyxa.ai/notification": "^1.0.7",
|
|
24
24
|
"@trpc/client": "^11.4.3",
|
|
25
25
|
"@trpc/server": "^11.4.3",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';
|
|
2
|
-
export declare const MARKETING_PRODUCT_SYNC_EVENT = "marketing_product_sync_event";
|
|
3
|
-
export interface MarketingProductSyncPayload {
|
|
4
|
-
marketingId: string;
|
|
5
|
-
shopId: string;
|
|
6
|
-
productIds: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare class MarketingProductSyncEvent extends BaseEvent<MarketingProductSyncPayload> {
|
|
9
|
-
constructor(payload: MarketingProductSyncPayload);
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=marketing-product-sync.event.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marketing-product-sync.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-sync.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qBAAa,yBAA0B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBACxE,OAAO,EAAE,2BAA2B;CAGhD"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarketingProductSyncEvent = exports.MARKETING_PRODUCT_SYNC_EVENT = void 0;
|
|
4
|
-
const BaseEvent_1 = require("@lyxa.ai/core/dist/libraries/event/BaseEvent");
|
|
5
|
-
exports.MARKETING_PRODUCT_SYNC_EVENT = 'marketing_product_sync_event';
|
|
6
|
-
class MarketingProductSyncEvent extends BaseEvent_1.BaseEvent {
|
|
7
|
-
constructor(payload) {
|
|
8
|
-
super(exports.MARKETING_PRODUCT_SYNC_EVENT, payload);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.MarketingProductSyncEvent = MarketingProductSyncEvent;
|
|
12
|
-
//# sourceMappingURL=marketing-product-sync.event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marketing-product-sync.event.js","sourceRoot":"/","sources":["event/events/marketing-product-sync.event.ts"],"names":[],"mappings":";;;AAAA,4EAAyE;AAE5D,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAQ3E,MAAa,yBAA0B,SAAQ,qBAAsC;IACpF,YAAY,OAAoC;QAC/C,KAAK,CAAC,oCAA4B,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;CACD;AAJD,8DAIC","sourcesContent":["import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';\n\nexport const MARKETING_PRODUCT_SYNC_EVENT = 'marketing_product_sync_event';\n\nexport interface MarketingProductSyncPayload {\n\tmarketingId: string;\n\tshopId: string;\n\tproductIds: string[];\n}\n\nexport class MarketingProductSyncEvent extends BaseEvent<MarketingProductSyncPayload> {\n\tconstructor(payload: MarketingProductSyncPayload) {\n\t\tsuper(MARKETING_PRODUCT_SYNC_EVENT, payload);\n\t}\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
-
import { LimitedTimeOfferCampaignSession as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
-
export declare class LtoCampaignSessionRepository {
|
|
4
|
-
private model;
|
|
5
|
-
constructor();
|
|
6
|
-
create(data: object): Promise<InstanceType<typeof Model>>;
|
|
7
|
-
findByCampaign(campaignId: mongoose.Types.ObjectId, page: number, size: number): Promise<{
|
|
8
|
-
documents: InstanceType<typeof Model>[];
|
|
9
|
-
total: number;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
export declare const ltoCampaignSessionRepository: LtoCampaignSessionRepository;
|
|
13
|
-
//# sourceMappingURL=limited-time-offer-campaign-session.repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-campaign-session.repository.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACH,+BAA+B,IAAI,KAAK,EAE3C,MAAM,2CAA2C,CAAC;AAEnD,qBACa,4BAA4B;IACrC,OAAO,CAAC,KAAK,CAA8C;;IAMrD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC;IAIzD,cAAc,CAChB,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACb,OAAO,CAAC;QAAC,SAAS,EAAE,YAAY,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;CAYvE;AAED,eAAO,MAAM,4BAA4B,8BAA8C,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
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.ltoCampaignSessionRepository = exports.LtoCampaignSessionRepository = void 0;
|
|
46
|
-
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
-
const models_1 = require("@lyxa.ai/core/dist/libraries/mongo/models");
|
|
48
|
-
let LtoCampaignSessionRepository = class LtoCampaignSessionRepository {
|
|
49
|
-
model;
|
|
50
|
-
constructor() {
|
|
51
|
-
this.model = models_1.LimitedTimeOfferCampaignSessionModel;
|
|
52
|
-
}
|
|
53
|
-
async create(data) {
|
|
54
|
-
return this.model.create(data);
|
|
55
|
-
}
|
|
56
|
-
async findByCampaign(campaignId, page, size) {
|
|
57
|
-
const [documents, total] = await Promise.all([
|
|
58
|
-
this.model
|
|
59
|
-
.find({ campaign: campaignId })
|
|
60
|
-
.sort({ archivedAt: -1 })
|
|
61
|
-
.skip((page - 1) * size)
|
|
62
|
-
.limit(size)
|
|
63
|
-
.lean(),
|
|
64
|
-
this.model.countDocuments({ campaign: campaignId }),
|
|
65
|
-
]);
|
|
66
|
-
return { documents, total };
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
exports.LtoCampaignSessionRepository = LtoCampaignSessionRepository;
|
|
70
|
-
exports.LtoCampaignSessionRepository = LtoCampaignSessionRepository = __decorate([
|
|
71
|
-
(0, typedi_1.Service)(),
|
|
72
|
-
__metadata("design:paramtypes", [])
|
|
73
|
-
], LtoCampaignSessionRepository);
|
|
74
|
-
exports.ltoCampaignSessionRepository = typedi_1.default.get(LtoCampaignSessionRepository);
|
|
75
|
-
//# sourceMappingURL=limited-time-offer-campaign-session.repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-campaign-session.repository.js","sourceRoot":"/","sources":["modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAE1C,sEAGmD;AAG5C,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAC7B,KAAK,CAA8C;IAE3D;QACI,IAAI,CAAC,KAAK,GAAG,6CAAoC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,UAAmC,EACnC,IAAY,EACZ,IAAY;QAEZ,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACzC,IAAI,CAAC,KAAK;iBACL,IAAI,CAAC,EAAC,QAAQ,EAAE,UAAU,EAAC,CAAC;iBAC5B,IAAI,CAAC,EAAC,UAAU,EAAE,CAAC,CAAC,EAAC,CAAC;iBACtB,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;iBACvB,KAAK,CAAC,IAAI,CAAC;iBACX,IAAI,EAAS;YAClB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,EAAC,QAAQ,EAAE,UAAU,EAAC,CAAC;SACpD,CAAC,CAAC;QACH,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC;IAC9B,CAAC;CACJ,CAAA;AA3BY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,gBAAO,GAAE;;GACG,4BAA4B,CA2BxC;AAEY,QAAA,4BAA4B,GAAG,gBAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {mongoose} from '@typegoose/typegoose';\nimport {\n LimitedTimeOfferCampaignSession as Model,\n LimitedTimeOfferCampaignSessionModel,\n} from '@lyxa.ai/core/dist/libraries/mongo/models';\n\n@Service()\nexport class LtoCampaignSessionRepository {\n private model: typeof LimitedTimeOfferCampaignSessionModel;\n\n constructor() {\n this.model = LimitedTimeOfferCampaignSessionModel;\n }\n\n async create(data: object): Promise<InstanceType<typeof Model>> {\n return this.model.create(data) as any;\n }\n\n async findByCampaign(\n campaignId: mongoose.Types.ObjectId,\n page: number,\n size: number,\n ): Promise<{documents: InstanceType<typeof Model>[]; total: number}> {\n const [documents, total] = await Promise.all([\n this.model\n .find({campaign: campaignId})\n .sort({archivedAt: -1})\n .skip((page - 1) * size)\n .limit(size)\n .lean() as any,\n this.model.countDocuments({campaign: campaignId}),\n ]);\n return {documents, total};\n }\n}\n\nexport const ltoCampaignSessionRepository = Container.get(LtoCampaignSessionRepository);\n"]}
|
package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DocumentType, mongoose } from '@typegoose/typegoose';
|
|
2
|
-
import { LimitedTimeOfferCampaign } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
-
export interface LtoCampaignSessionItemDTO {
|
|
4
|
-
_id: mongoose.Types.ObjectId;
|
|
5
|
-
campaign: mongoose.Types.ObjectId;
|
|
6
|
-
startDate: Date;
|
|
7
|
-
endDate: Date;
|
|
8
|
-
shopCount: number;
|
|
9
|
-
archivedAt: Date;
|
|
10
|
-
}
|
|
11
|
-
export declare class LtoCampaignSessionService {
|
|
12
|
-
private repository;
|
|
13
|
-
constructor();
|
|
14
|
-
logSession(campaign: DocumentType<LimitedTimeOfferCampaign>, shopCount: number): Promise<void>;
|
|
15
|
-
getSessionsByCampaign(campaignId: mongoose.Types.ObjectId, page: number, size: number): Promise<{
|
|
16
|
-
documents: LtoCampaignSessionItemDTO[];
|
|
17
|
-
total: number;
|
|
18
|
-
}>;
|
|
19
|
-
}
|
|
20
|
-
export declare const ltoCampaignSessionService: LtoCampaignSessionService;
|
|
21
|
-
//# sourceMappingURL=limited-time-offer-campaign-session.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-campaign-session.service.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/session/limited-time-offer-campaign-session.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAC,wBAAwB,EAAC,MAAM,2CAA2C,CAAC;AAGnF,MAAM,WAAW,yBAAyB;IACtC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;CACpB;AAED,qBACa,yBAAyB;IAClC,OAAO,CAAC,UAAU,CAA+B;;IAMpC,UAAU,CACnB,QAAQ,EAAE,YAAY,CAAC,wBAAwB,CAAC,EAChD,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAUH,qBAAqB,CAC9B,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACb,OAAO,CAAC;QAAC,SAAS,EAAE,yBAAyB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;CActE;AAED,eAAO,MAAM,yBAAyB,2BAA2C,CAAC"}
|
package/dist/lib/modules/limited-time-offer/session/limited-time-offer-campaign-session.service.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
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.ltoCampaignSessionService = exports.LtoCampaignSessionService = void 0;
|
|
46
|
-
const typedi_1 = __importStar(require("typedi"));
|
|
47
|
-
const limited_time_offer_campaign_session_repository_1 = require("./limited-time-offer-campaign-session.repository");
|
|
48
|
-
let LtoCampaignSessionService = class LtoCampaignSessionService {
|
|
49
|
-
repository;
|
|
50
|
-
constructor() {
|
|
51
|
-
this.repository = typedi_1.default.get(limited_time_offer_campaign_session_repository_1.LtoCampaignSessionRepository);
|
|
52
|
-
}
|
|
53
|
-
async logSession(campaign, shopCount) {
|
|
54
|
-
await this.repository.create({
|
|
55
|
-
campaign: campaign._id,
|
|
56
|
-
startDate: campaign.startDate,
|
|
57
|
-
endDate: campaign.endDate,
|
|
58
|
-
shopCount,
|
|
59
|
-
archivedAt: new Date(),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
async getSessionsByCampaign(campaignId, page, size) {
|
|
63
|
-
const { documents, total } = await this.repository.findByCampaign(campaignId, page, size);
|
|
64
|
-
return {
|
|
65
|
-
documents: documents.map((d) => ({
|
|
66
|
-
_id: d._id,
|
|
67
|
-
campaign: d.campaign,
|
|
68
|
-
startDate: d.startDate,
|
|
69
|
-
endDate: d.endDate,
|
|
70
|
-
shopCount: d.shopCount ?? 0,
|
|
71
|
-
archivedAt: d.archivedAt,
|
|
72
|
-
})),
|
|
73
|
-
total,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
exports.LtoCampaignSessionService = LtoCampaignSessionService;
|
|
78
|
-
exports.LtoCampaignSessionService = LtoCampaignSessionService = __decorate([
|
|
79
|
-
(0, typedi_1.Service)(),
|
|
80
|
-
__metadata("design:paramtypes", [])
|
|
81
|
-
], LtoCampaignSessionService);
|
|
82
|
-
exports.ltoCampaignSessionService = typedi_1.default.get(LtoCampaignSessionService);
|
|
83
|
-
//# sourceMappingURL=limited-time-offer-campaign-session.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-campaign-session.service.js","sourceRoot":"/","sources":["modules/limited-time-offer/session/limited-time-offer-campaign-session.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAG1C,qHAA8F;AAYvF,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAC1B,UAAU,CAA+B;IAEjD;QACI,IAAI,CAAC,UAAU,GAAG,gBAAS,CAAC,GAAG,CAAC,6EAA4B,CAAC,CAAC;IAClE,CAAC;IAEM,KAAK,CAAC,UAAU,CACnB,QAAgD,EAChD,SAAiB;QAEjB,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YACzB,QAAQ,EAAE,QAAQ,CAAC,GAAG;YACtB,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,SAAS;YACT,UAAU,EAAE,IAAI,IAAI,EAAE;SACzB,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAC9B,UAAmC,EACnC,IAAY,EACZ,IAAY;QAEZ,MAAM,EAAC,SAAS,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACxF,OAAO;YACH,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC;gBAClC,GAAG,EAAE,CAAC,CAAC,GAAG;gBACV,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,SAAS,EAAE,CAAC,CAAC,SAAS;gBACtB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC;gBAC3B,UAAU,EAAE,CAAC,CAAC,UAAU;aAC3B,CAAC,CAAC;YACH,KAAK;SACR,CAAC;IACN,CAAC;CACJ,CAAA;AAtCY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,gBAAO,GAAE;;GACG,yBAAyB,CAsCrC;AAEY,QAAA,yBAAyB,GAAG,gBAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC","sourcesContent":["import Container, {Service} from 'typedi';\nimport {DocumentType, mongoose} from '@typegoose/typegoose';\nimport {LimitedTimeOfferCampaign} from '@lyxa.ai/core/dist/libraries/mongo/models';\nimport {LtoCampaignSessionRepository} from './limited-time-offer-campaign-session.repository';\n\nexport interface LtoCampaignSessionItemDTO {\n _id: mongoose.Types.ObjectId;\n campaign: mongoose.Types.ObjectId;\n startDate: Date;\n endDate: Date;\n shopCount: number;\n archivedAt: Date;\n}\n\n@Service()\nexport class LtoCampaignSessionService {\n private repository: LtoCampaignSessionRepository;\n\n constructor() {\n this.repository = Container.get(LtoCampaignSessionRepository);\n }\n\n public async logSession(\n campaign: DocumentType<LimitedTimeOfferCampaign>,\n shopCount: number,\n ): Promise<void> {\n await this.repository.create({\n campaign: campaign._id,\n startDate: campaign.startDate,\n endDate: campaign.endDate,\n shopCount,\n archivedAt: new Date(),\n });\n }\n\n public async getSessionsByCampaign(\n campaignId: mongoose.Types.ObjectId,\n page: number,\n size: number,\n ): Promise<{documents: LtoCampaignSessionItemDTO[]; total: number}> {\n const {documents, total} = await this.repository.findByCampaign(campaignId, page, size);\n return {\n documents: documents.map((d: any) => ({\n _id: d._id,\n campaign: d.campaign,\n startDate: d.startDate,\n endDate: d.endDate,\n shopCount: d.shopCount ?? 0,\n archivedAt: d.archivedAt,\n })),\n total,\n };\n }\n}\n\nexport const ltoCampaignSessionService = Container.get(LtoCampaignSessionService);\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseEvent } from '@lyxa.ai/core/dist/libraries/event/BaseEvent';
|
|
2
|
-
export declare const MARKETING_PRODUCT_SYNC_EVENT = "marketing_product_sync_event";
|
|
3
|
-
export interface MarketingProductSyncPayload {
|
|
4
|
-
marketingId: string;
|
|
5
|
-
shopId: string;
|
|
6
|
-
productIds: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare class MarketingProductSyncEvent extends BaseEvent<MarketingProductSyncPayload> {
|
|
9
|
-
constructor(payload: MarketingProductSyncPayload);
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=marketing-product-sync.event.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marketing-product-sync.event.d.ts","sourceRoot":"/","sources":["event/events/marketing-product-sync.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qBAAa,yBAA0B,SAAQ,SAAS,CAAC,2BAA2B,CAAC;gBACxE,OAAO,EAAE,2BAA2B;CAGhD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mongoose } from '@typegoose/typegoose';
|
|
2
|
-
import { LimitedTimeOfferCampaignSession as Model } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
-
export declare class LtoCampaignSessionRepository {
|
|
4
|
-
private model;
|
|
5
|
-
constructor();
|
|
6
|
-
create(data: object): Promise<InstanceType<typeof Model>>;
|
|
7
|
-
findByCampaign(campaignId: mongoose.Types.ObjectId, page: number, size: number): Promise<{
|
|
8
|
-
documents: InstanceType<typeof Model>[];
|
|
9
|
-
total: number;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
export declare const ltoCampaignSessionRepository: LtoCampaignSessionRepository;
|
|
13
|
-
//# sourceMappingURL=limited-time-offer-campaign-session.repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-campaign-session.repository.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/session/limited-time-offer-campaign-session.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACH,+BAA+B,IAAI,KAAK,EAE3C,MAAM,2CAA2C,CAAC;AAEnD,qBACa,4BAA4B;IACrC,OAAO,CAAC,KAAK,CAA8C;;IAMrD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC;IAIzD,cAAc,CAChB,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACb,OAAO,CAAC;QAAC,SAAS,EAAE,YAAY,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;CAYvE;AAED,eAAO,MAAM,4BAA4B,8BAA8C,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DocumentType, mongoose } from '@typegoose/typegoose';
|
|
2
|
-
import { LimitedTimeOfferCampaign } from '@lyxa.ai/core/dist/libraries/mongo/models';
|
|
3
|
-
export interface LtoCampaignSessionItemDTO {
|
|
4
|
-
_id: mongoose.Types.ObjectId;
|
|
5
|
-
campaign: mongoose.Types.ObjectId;
|
|
6
|
-
startDate: Date;
|
|
7
|
-
endDate: Date;
|
|
8
|
-
shopCount: number;
|
|
9
|
-
archivedAt: Date;
|
|
10
|
-
}
|
|
11
|
-
export declare class LtoCampaignSessionService {
|
|
12
|
-
private repository;
|
|
13
|
-
constructor();
|
|
14
|
-
logSession(campaign: DocumentType<LimitedTimeOfferCampaign>, shopCount: number): Promise<void>;
|
|
15
|
-
getSessionsByCampaign(campaignId: mongoose.Types.ObjectId, page: number, size: number): Promise<{
|
|
16
|
-
documents: LtoCampaignSessionItemDTO[];
|
|
17
|
-
total: number;
|
|
18
|
-
}>;
|
|
19
|
-
}
|
|
20
|
-
export declare const ltoCampaignSessionService: LtoCampaignSessionService;
|
|
21
|
-
//# sourceMappingURL=limited-time-offer-campaign-session.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limited-time-offer-campaign-session.service.d.ts","sourceRoot":"/","sources":["modules/limited-time-offer/session/limited-time-offer-campaign-session.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAC,wBAAwB,EAAC,MAAM,2CAA2C,CAAC;AAGnF,MAAM,WAAW,yBAAyB;IACtC,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;CACpB;AAED,qBACa,yBAAyB;IAClC,OAAO,CAAC,UAAU,CAA+B;;IAMpC,UAAU,CACnB,QAAQ,EAAE,YAAY,CAAC,wBAAwB,CAAC,EAChD,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAUH,qBAAqB,CAC9B,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACb,OAAO,CAAC;QAAC,SAAS,EAAE,yBAAyB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;CActE;AAED,eAAO,MAAM,yBAAyB,2BAA2C,CAAC"}
|