@lyxa.ai/marketing 1.0.42 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/event/event-initializations.d.ts.map +1 -1
- package/dist/lib/event/event-initializations.js +1 -0
- package/dist/lib/event/event-initializations.js.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.d.ts +1 -0
- package/dist/lib/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/lib/event/event-listeners/event-listeners.js +52 -0
- package/dist/lib/event/event-listeners/event-listeners.js.map +1 -1
- package/dist/lib/event/events/marketing-product-seed.event.d.ts +17 -0
- package/dist/lib/event/events/marketing-product-seed.event.d.ts.map +1 -0
- package/dist/lib/event/events/marketing-product-seed.event.js +12 -0
- package/dist/lib/event/events/marketing-product-seed.event.js.map +1 -0
- package/dist/lib/index.d.ts +165 -83
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts +116 -0
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js +33 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts +32 -0
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -0
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js +503 -0
- package/dist/lib/modules/coupon/services/patterns/repository/CouponMetricsRepository.js.map +1 -0
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +407 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js +39 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
- package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts +1118 -0
- package/dist/lib/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -0
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js +13 -0
- package/dist/lib/modules/coupon/validations/create-coupon.validation.js.map +1 -0
- package/dist/lib/modules/coupon/validations/index.d.ts +1 -0
- package/dist/lib/modules/coupon/validations/index.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/index.js +1 -0
- package/dist/lib/modules/coupon/validations/index.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.d.ts +29 -72
- 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 +3 -16
- package/dist/lib/modules/limited-time-offer/campaign/campaign.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +36 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js +48 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +22 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js +131 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +78 -78
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +1 -2
- 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 +6 -11
- 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.service.d.ts +16 -51
- 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 +33 -156
- package/dist/lib/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.builder.d.ts +8 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.builder.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.builder.js +13 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.builder.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.repository.d.ts +14 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.repository.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.repository.js +77 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.repository.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts +1 -2
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.js +19 -26
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer-config.service.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/config/limited-time-offer.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts +35 -78
- package/dist/lib/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +53 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js +55 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.builder.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +18 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js +126 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.repository.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +6 -6
- 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 +1 -2
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.router.js.map +1 -1
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.d.ts.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js +2 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.service.js.map +1 -0
- package/dist/lib/modules/limited-time-offer/participant/limited-time-offer-participant.validation.d.ts +24 -24
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +3 -1
- 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 +13 -38
- 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 +19 -8
- 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 +19 -27
- package/dist/lib/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.js.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts +12 -3
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.js +7 -0
- package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js +11 -9
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/discount-marketing.service.js +15 -13
- package/dist/lib/modules/marketing/services/discount-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +1 -0
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +57 -7
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +11 -0
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.js +23 -0
- 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 +6 -31
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +2 -2
- package/dist/lib/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +2 -2
- package/dist/lib/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +4 -4
- package/dist/types/event/event-initializations.d.ts.map +1 -1
- package/dist/types/event/event-listeners/event-listeners.d.ts +1 -0
- package/dist/types/event/event-listeners/event-listeners.d.ts.map +1 -1
- package/dist/types/event/events/marketing-product-seed.event.d.ts +17 -0
- package/dist/types/event/events/marketing-product-seed.event.d.ts.map +1 -0
- package/dist/types/index.d.ts +165 -83
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +116 -0
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts +32 -0
- package/dist/types/modules/coupon/services/patterns/repository/CouponMetricsRepository.d.ts.map +1 -0
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts +407 -1
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts +1118 -0
- package/dist/types/modules/coupon/validations/create-coupon.validation.d.ts.map +1 -0
- package/dist/types/modules/coupon/validations/index.d.ts +1 -0
- package/dist/types/modules/coupon/validations/index.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts +29 -72
- package/dist/types/modules/limited-time-offer/campaign/campaign.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts +36 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.builder.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts +22 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.repository.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/campaign/limited-time-offer-campaign.validation.d.ts +78 -78
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign-lifecycle.service.d.ts +1 -2
- 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.service.d.ts +16 -51
- package/dist/types/modules/limited-time-offer/campaign/services/limited-time-offer-campaign.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.builder.d.ts +8 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.builder.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.repository.d.ts +14 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.repository.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts +1 -2
- package/dist/types/modules/limited-time-offer/config/limited-time-offer-config.service.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/config/limited-time-offer.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts +35 -78
- package/dist/types/modules/limited-time-offer/limited-time-offer.router.d.ts.map +1 -1
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts +53 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.builder.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts +18 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.repository.d.ts.map +1 -0
- package/dist/types/modules/limited-time-offer/participant/limited-time-offer-participant.router.d.ts +6 -6
- 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 +24 -24
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant-marketing.service.d.ts +3 -1
- 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 +19 -8
- package/dist/types/modules/limited-time-offer/participant/services/limited-time-offer-participant.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/routers/marketing.router.d.ts +12 -3
- package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts +1 -0
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts +11 -0
- 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/marketing/validations/marketing.validation.d.ts +2 -2
- package/dist/types/modules/marketing/validations/product-marketing.validation.d.ts +2 -2
- package/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts +2 -2
- package/dist/types/modules/punch-marketing-history/validations/punch-marketing-history.validation.d.ts +4 -4
- package/package.json +2 -2
- package/dist/types/events/event-initializations.d.ts +0 -2
- package/dist/types/events/event-initializations.d.ts.map +0 -1
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAaL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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").TRPCBuiltRouter<{
|
|
|
5398
5398
|
};
|
|
5399
5399
|
meta: object;
|
|
5400
5400
|
}>;
|
|
5401
|
+
getCouponMetrics: import("@trpc/server").TRPCQueryProcedure<{
|
|
5402
|
+
input: {
|
|
5403
|
+
startDate: string | Date;
|
|
5404
|
+
endDate: string | Date;
|
|
5405
|
+
};
|
|
5406
|
+
output: {
|
|
5407
|
+
message: string;
|
|
5408
|
+
success: boolean;
|
|
5409
|
+
data?: {
|
|
5410
|
+
activeCoupons?: number | undefined;
|
|
5411
|
+
totalCreated?: number | undefined;
|
|
5412
|
+
redemptionRate?: number | undefined;
|
|
5413
|
+
totalCouponOrders?: number | undefined;
|
|
5414
|
+
totalRevenue?: number | undefined;
|
|
5415
|
+
totalProfit?: number | undefined;
|
|
5416
|
+
} | {
|
|
5417
|
+
documents: {
|
|
5418
|
+
activeCoupons?: number | undefined;
|
|
5419
|
+
totalCreated?: number | undefined;
|
|
5420
|
+
redemptionRate?: number | undefined;
|
|
5421
|
+
totalCouponOrders?: number | undefined;
|
|
5422
|
+
totalRevenue?: number | undefined;
|
|
5423
|
+
totalProfit?: number | undefined;
|
|
5424
|
+
}[];
|
|
5425
|
+
metadata?: {
|
|
5426
|
+
page: number;
|
|
5427
|
+
size: number;
|
|
5428
|
+
totalElements: number;
|
|
5429
|
+
totalPages: number;
|
|
5430
|
+
} | undefined;
|
|
5431
|
+
} | undefined;
|
|
5432
|
+
};
|
|
5433
|
+
meta: object;
|
|
5434
|
+
}>;
|
|
5435
|
+
getCouponMetricsByType: import("@trpc/server").TRPCQueryProcedure<{
|
|
5436
|
+
input: {
|
|
5437
|
+
startDate: string | Date;
|
|
5438
|
+
endDate: string | Date;
|
|
5439
|
+
};
|
|
5440
|
+
output: {
|
|
5441
|
+
message: string;
|
|
5442
|
+
success: boolean;
|
|
5443
|
+
data?: {
|
|
5444
|
+
couponType: import("@lyxa.ai/core/dist/utilities/enum").CouponType;
|
|
5445
|
+
couponTypeTitle: string;
|
|
5446
|
+
redemptionRate?: number | undefined;
|
|
5447
|
+
totalCouponOrders?: number | undefined;
|
|
5448
|
+
totalRevenue?: number | undefined;
|
|
5449
|
+
totalProfit?: number | undefined;
|
|
5450
|
+
averageOrderValue?: number | undefined;
|
|
5451
|
+
usage?: number | undefined;
|
|
5452
|
+
ongoing?: number | undefined;
|
|
5453
|
+
}[] | {
|
|
5454
|
+
documents: {
|
|
5455
|
+
couponType: import("@lyxa.ai/core/dist/utilities/enum").CouponType;
|
|
5456
|
+
couponTypeTitle: string;
|
|
5457
|
+
redemptionRate?: number | undefined;
|
|
5458
|
+
totalCouponOrders?: number | undefined;
|
|
5459
|
+
totalRevenue?: number | undefined;
|
|
5460
|
+
totalProfit?: number | undefined;
|
|
5461
|
+
averageOrderValue?: number | undefined;
|
|
5462
|
+
usage?: number | undefined;
|
|
5463
|
+
ongoing?: number | undefined;
|
|
5464
|
+
}[][];
|
|
5465
|
+
metadata?: {
|
|
5466
|
+
page: number;
|
|
5467
|
+
size: number;
|
|
5468
|
+
totalElements: number;
|
|
5469
|
+
totalPages: number;
|
|
5470
|
+
} | undefined;
|
|
5471
|
+
} | undefined;
|
|
5472
|
+
};
|
|
5473
|
+
meta: object;
|
|
5474
|
+
}>;
|
|
5475
|
+
getCouponOrdersGraphData: import("@trpc/server").TRPCQueryProcedure<{
|
|
5476
|
+
input: {
|
|
5477
|
+
startDate: string | Date;
|
|
5478
|
+
endDate: string | Date;
|
|
5479
|
+
graphType?: import("@lyxa.ai/core/dist/utilities/enum").GraphType | undefined;
|
|
5480
|
+
itemType?: import("@lyxa.ai/core/dist/utilities/enum").ItemType | undefined;
|
|
5481
|
+
};
|
|
5482
|
+
output: {
|
|
5483
|
+
success: boolean;
|
|
5484
|
+
message: string;
|
|
5485
|
+
data: any[] | undefined;
|
|
5486
|
+
};
|
|
5487
|
+
meta: object;
|
|
5488
|
+
}>;
|
|
5489
|
+
getUsersNewVsReturningGraphData: import("@trpc/server").TRPCQueryProcedure<{
|
|
5490
|
+
input: {
|
|
5491
|
+
startDate: string | Date;
|
|
5492
|
+
endDate: string | Date;
|
|
5493
|
+
graphType?: import("@lyxa.ai/core/dist/utilities/enum").GraphType | undefined;
|
|
5494
|
+
itemType?: import("@lyxa.ai/core/dist/utilities/enum").ItemType | undefined;
|
|
5495
|
+
};
|
|
5496
|
+
output: {
|
|
5497
|
+
success: boolean;
|
|
5498
|
+
message: string;
|
|
5499
|
+
data: any[] | undefined;
|
|
5500
|
+
};
|
|
5501
|
+
meta: object;
|
|
5502
|
+
}>;
|
|
5503
|
+
getCouponProfitGraphData: import("@trpc/server").TRPCQueryProcedure<{
|
|
5504
|
+
input: {
|
|
5505
|
+
startDate: string | Date;
|
|
5506
|
+
endDate: string | Date;
|
|
5507
|
+
graphType?: import("@lyxa.ai/core/dist/utilities/enum").GraphType | undefined;
|
|
5508
|
+
itemType?: import("@lyxa.ai/core/dist/utilities/enum").ItemType | undefined;
|
|
5509
|
+
};
|
|
5510
|
+
output: {
|
|
5511
|
+
success: boolean;
|
|
5512
|
+
message: string;
|
|
5513
|
+
data: any[] | undefined;
|
|
5514
|
+
};
|
|
5515
|
+
meta: object;
|
|
5516
|
+
}>;
|
|
5401
5517
|
}>>;
|
|
5402
5518
|
//# sourceMappingURL=coupon.router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coupon.router.d.ts","sourceRoot":"/","sources":["modules/coupon/routers/coupon.router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coupon.router.d.ts","sourceRoot":"/","sources":["modules/coupon/routers/coupon.router.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiRgmuB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAD1nuB,CAAC"}
|
|
@@ -13,9 +13,10 @@ const auth_2 = require("@lyxa.ai/core/dist/libraries/auth");
|
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const zod_1 = require("zod");
|
|
15
15
|
const publicUserDecoder_1 = require("@lyxa.ai/core/dist/libraries/trpc/middlewares/publicUserDecoder");
|
|
16
|
+
const CouponMetricsRepository_1 = require("../../coupon/services/patterns/repository/CouponMetricsRepository");
|
|
16
17
|
exports.couponRouter = (0, trpc_1.createTRPCRouter)({
|
|
17
18
|
create: (0, auth_1.createAuthenticatedProcedure)({ entityTypes: [auth_2.AuthEntityType.CRM] })
|
|
18
|
-
.input(validations_1.
|
|
19
|
+
.input(validations_1.CreateCouponSchema)
|
|
19
20
|
.output(validations_1.CouponResponseSchema)
|
|
20
21
|
.mutation(async ({ ctx, input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
21
22
|
await services_1.couponService.create({ ...input, createdBy: new typegoose_1.mongoose.Types.ObjectId(ctx.entity?.id) });
|
|
@@ -162,5 +163,36 @@ exports.couponRouter = (0, trpc_1.createTRPCRouter)({
|
|
|
162
163
|
const result = await services_1.couponService.updateCouponGiftBoxShown(new typegoose_1.mongoose.Types.ObjectId(ctx.entity?.id), input);
|
|
163
164
|
return (0, response_1.response)('Gift box shown status updated successfully', result);
|
|
164
165
|
})),
|
|
166
|
+
getCouponMetrics: trpc_1.publicProcedure
|
|
167
|
+
.input(validations_1.DateInputSchema)
|
|
168
|
+
.output(validations_1.CouponMetricsResponseSchema)
|
|
169
|
+
.query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
170
|
+
const couponMetricsRepository = new CouponMetricsRepository_1.CouponMetricsRepository();
|
|
171
|
+
const result = await couponMetricsRepository.getCouponMetrics(input);
|
|
172
|
+
return (0, response_1.response)('Coupon metrics fetched successfully', result);
|
|
173
|
+
})),
|
|
174
|
+
getCouponMetricsByType: trpc_1.publicProcedure
|
|
175
|
+
.input(validations_1.DateInputSchema)
|
|
176
|
+
.output(validations_1.CouponMetricsByTypeResponseSchema)
|
|
177
|
+
.query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
178
|
+
const couponMetricsRepository = new CouponMetricsRepository_1.CouponMetricsRepository();
|
|
179
|
+
const result = await couponMetricsRepository.getCouponMetricsByType(input);
|
|
180
|
+
return (0, response_1.response)('Coupon metrics fetched successfully', result);
|
|
181
|
+
})),
|
|
182
|
+
getCouponOrdersGraphData: trpc_1.publicProcedure.input(validations_1.GraphInputSchema).query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
183
|
+
const couponMetricsRepository = new CouponMetricsRepository_1.CouponMetricsRepository();
|
|
184
|
+
const result = await couponMetricsRepository.getCouponOrdersGraphData(input);
|
|
185
|
+
return (0, response_1.response)('Coupon orders graph data fetched successfully', result);
|
|
186
|
+
})),
|
|
187
|
+
getUsersNewVsReturningGraphData: trpc_1.publicProcedure.input(validations_1.GraphInputSchema).query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
188
|
+
const couponMetricsRepository = new CouponMetricsRepository_1.CouponMetricsRepository();
|
|
189
|
+
const result = await couponMetricsRepository.getUsersNewVsReturningGraphData(input);
|
|
190
|
+
return (0, response_1.response)('Users new vs returning graph data fetched successfully', result);
|
|
191
|
+
})),
|
|
192
|
+
getCouponProfitGraphData: trpc_1.publicProcedure.input(validations_1.GraphInputSchema).query(async ({ input }) => error_handler_1.ErrorHandler.wrapAsync(async () => {
|
|
193
|
+
const couponMetricsRepository = new CouponMetricsRepository_1.CouponMetricsRepository();
|
|
194
|
+
const result = await couponMetricsRepository.getCouponProfitGraphData(input);
|
|
195
|
+
return (0, response_1.response)('Coupon profit graph data fetched successfully', result);
|
|
196
|
+
})),
|
|
165
197
|
});
|
|
166
198
|
//# sourceMappingURL=coupon.router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coupon.router.js","sourceRoot":"/","sources":["modules/coupon/routers/coupon.router.ts"],"names":[],"mappings":";;;AAAA,4DAAsF;AACtF,uDAIkC;AAClC,6DAeqC;AACrC,+DAAmF;AACnF,wEAKiD;AACjD,8EAA0E;AAC1E,oEAAiE;AACjE,6EAAkG;AAClG,4DAAmE;AACnE,oDAAgD;AAChD,6BAAwB;AACxB,uGAAoG;AAEvF,QAAA,YAAY,GAAG,IAAA,uBAAgB,EAAC;IAC5C,MAAM,EAAE,IAAA,mCAA4B,EAAC,EAAE,WAAW,EAAE,CAAC,qBAAc,CAAC,GAAG,CAAC,EAAE,CAAC;SACzE,KAAK,CAAC,wCAA0B,CAAC;SACjC,MAAM,CAAC,kCAAc,CAAC;SACtB,QAAQ,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAClC,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,wBAAO,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3F,OAAO,IAAA,mBAAQ,EAAC,6BAA6B,CAAC,CAAC;IAChD,CAAC,CAAC,CACF;IAEF,OAAO,EAAE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C;KAClC,CAAC;SACA,KAAK,CAAC,yCAA2B,CAAC;SAClC,QAAQ,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAClC,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,wBAAO,CAAC,wBAAwB,CACpD,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,EAC3C,KAAK,CACL,CAAC;QACF,OAAO,IAAA,mBAAQ,EAAC,4CAA4C,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CACF;CACF,CAAC,CAAC","sourcesContent":["import { createTRPCRouter, publicProcedure } from '@lyxa.ai/core/dist/libraries/trpc';\nimport {\n\treferralCodeCouponService,\n\treferralRewardCouponService,\n\tcouponService as service,\n} from '@modules/coupon/services';\nimport {\n\tCouponSchema as Schema,\n\tCouponIdValidationSchema as IdSchema,\n\tAllCouponsUpdateSchema as UpdateSchema,\n\tAllCouponsValidationSchema,\n\tCouponResponseSchema as ResponseSchema,\n\tGetUserCouponSchema,\n\tValidateCouponSchema,\n\tCouponValidationResponseSchema,\n\tCouponCodeSchema,\n\tUpdateCouponStatusSchema,\n\tCheckExistingNewUserCouponOutputSchema,\n\tCouponSchema,\n\tDeviceIdSchema,\n\tIsNewUserGiftBoxShownSchema,\n} from '@modules/coupon/validations';\nimport { allCouponTransformer as transformer } from '@modules/coupon/transformers';\nimport {\n\tDeleteSchema,\n\tFilterSchema,\n\tShareableLinkResponseSchema,\n\tStringSchema,\n} from '@lyxa.ai/core/dist/utilities/validation';\nimport { ErrorHandler } from '@lyxa.ai/core/dist/utilities/error-handler';\nimport { response } from '@lyxa.ai/core/dist/utilities/response';\nimport { createAuthenticatedProcedure } from '@lyxa.ai/core/dist/libraries/trpc/middlewares/auth';\nimport { AuthEntityType } from '@lyxa.ai/core/dist/libraries/auth';\nimport { mongoose } from '@typegoose/typegoose';\nimport { z } from 'zod';\nimport { publicUserDecoder } from '@lyxa.ai/core/dist/libraries/trpc/middlewares/publicUserDecoder';\n\nexport const couponRouter = createTRPCRouter({\n\tcreate: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(AllCouponsValidationSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.create({ ...input, createdBy: new mongoose.Types.ObjectId(ctx.entity?.id) });\n\t\t\t\treturn response('Coupon created successfully');\n\t\t\t})\n\t\t),\n\n\tgetById: publicProcedure\n\t\t.input(IdSchema)\n\t\t.output(ResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.findById(input);\n\t\t\t\tconst transformedResult = transformer.transformToBasicView(result);\n\t\t\t\treturn response('Coupon fetched successfully', transformedResult);\n\t\t\t})\n\t\t),\n\n\tget: publicProcedure\n\t\t.input(FilterSchema)\n\t\t.output(ResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.find(input);\n\t\t\t\treturn response('Coupons fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tcheckExistingNewUserCoupon: publicProcedure.output(ResponseSchema).query(async () =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst result = await service.checkExistingNewUserCoupon();\n\t\t\treturn response('Coupon checked successfully', result);\n\t\t})\n\t),\n\n\tupdate: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(UpdateSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst { _id, data } = input;\n\t\t\t\tawait service.update(String(_id), {\n\t\t\t\t\t...data,\n\t\t\t\t\tcreatedBy: new mongoose.Types.ObjectId(ctx.entity?.id),\n\t\t\t\t});\n\t\t\t\treturn response('Coupon updated successfully');\n\t\t\t})\n\t\t),\n\n\tupdateStatus: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(UpdateCouponStatusSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst { _id, status } = input;\n\t\t\t\tawait service.updateStatus(String(_id), status);\n\t\t\t\treturn response('Coupon updated successfully');\n\t\t\t})\n\t\t),\n\n\tdeleteById: publicProcedure\n\t\t.input(DeleteSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.deleteById(input);\n\t\t\t\treturn response('Coupon deleted successfully');\n\t\t\t})\n\t\t),\n\n\tgetUserCoupons: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM, AuthEntityType.USER] })\n\t\t.input(GetUserCouponSchema)\n\t\t// .output(ResponseSchema)\n\t\t.query(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst isAdmin = ctx.entity?.type == AuthEntityType.CRM;\n\t\t\t\tconst id = new mongoose.Types.ObjectId(ctx.entity?.id);\n\t\t\t\tconst result = await service.getUserCoupons(\n\t\t\t\t\tisAdmin ? input.user : id,\n\t\t\t\t\tinput.shop,\n\t\t\t\t\tinput.page,\n\t\t\t\t\tinput.size\n\t\t\t\t);\n\t\t\t\treturn result;\n\t\t\t\t// return response('Coupons fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tgetUserCouponList: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(FilterSchema)\n\t\t// .output(ResponseSchema)\n\t\t.query(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.getUserCouponList(input);\n\t\t\t\treturn result;\n\t\t\t\t// return response('Coupons fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tvalidateCoupon: publicProcedure\n\t\t.input(ValidateCouponSchema)\n\t\t.output(CouponValidationResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.validateCoupon(input);\n\t\t\t\treturn response('Coupon validated successfully', result);\n\t\t\t})\n\t\t),\n\n\tvalidateCouponMutation: publicProcedure\n\t\t.input(ValidateCouponSchema)\n\t\t.output(CouponValidationResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.validateCoupon(input);\n\t\t\t\tconst message = result.isValid ? 'Coupon validated successfully' : 'Coupon validation failed';\n\t\t\t\treturn response(message, result);\n\t\t\t})\n\t\t),\n\n\tcreateReferralCodeForUser: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.CRM, AuthEntityType.USER],\n\t})\n\t\t.input(GetUserCouponSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst isAdmin = ctx.entity?.type == AuthEntityType.CRM;\n\t\t\t\tconst id = new mongoose.Types.ObjectId(ctx.entity?.id);\n\t\t\t\tconst result = await referralCodeCouponService.createReferralCodeForUser(isAdmin ? input.user : id);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\tgetReferralCodeCoupon: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.USER],\n\t}).query(async ({ ctx, input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst id = new mongoose.Types.ObjectId(ctx.entity?.id);\n\t\t\tconst result = await referralCodeCouponService.getReferralCodeCoupon(id);\n\t\t\treturn result;\n\t\t})\n\t),\n\n\taddCouponToUser: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.USER],\n\t})\n\t\t.input(CouponCodeSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.addCouponToUser(ctx.entity?.id as string, input.couponCode);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\tgetShareableLink: publicProcedure\n\t\t.input(StringSchema)\n\t\t.output(ShareableLinkResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.getShareableLink(input);\n\t\t\t\treturn response('Invite friend shareable link fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\thandleCouponExpiry: publicProcedure.input(z.object({ couponId: z.string() })).mutation(async ({ input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst result = await service.handleCouponExpiry(new mongoose.Types.ObjectId(input.couponId));\n\t\t\treturn result;\n\t\t})\n\t),\n\n\tsyncCouponExpiry: publicProcedure.mutation(async ({ input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst result = await service.syncCouponExpiry();\n\t\t\treturn result;\n\t\t})\n\t),\n\n\taddExistingCouponsToNewUser: publicProcedure\n\t\t.input(z.object({ userId: z.string() }))\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.addExistingCouponsToNewUser(new mongoose.Types.ObjectId(input.userId));\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\tgiveReferralRewardToReferrer: publicProcedure\n\t\t.input(z.object({ orderId: z.string() }))\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await referralRewardCouponService.giveReferralRewardToReferrer(\n\t\t\t\t\tnew mongoose.Types.ObjectId(input.orderId)\n\t\t\t\t);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\t// Coupon gift box details - before login\n\tgetCouponGiftBox: publicUserDecoder({ entityTypes: [AuthEntityType.USER] })\n\t\t.input(DeviceIdSchema)\n\t\t.query(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst userId = ctx.entity ? new mongoose.Types.ObjectId(ctx.entity?.id) : null;\n\t\t\t\tconst result = await service.handleCouponGiftBox(input.deviceId, userId);\n\t\t\t\treturn response('Coupon gift box fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\t// Update new user coupon flag\n\tupdateCouponGiftBoxShown: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.USER],\n\t})\n\t\t.input(IsNewUserGiftBoxShownSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.updateCouponGiftBoxShown(\n\t\t\t\t\tnew mongoose.Types.ObjectId(ctx.entity?.id),\n\t\t\t\t\tinput\n\t\t\t\t);\n\t\t\t\treturn response('Gift box shown status updated successfully', result);\n\t\t\t})\n\t\t),\n});\n"]}
|
|
1
|
+
{"version":3,"file":"coupon.router.js","sourceRoot":"/","sources":["modules/coupon/routers/coupon.router.ts"],"names":[],"mappings":";;;AAAA,4DAAsF;AACtF,uDAIkC;AAClC,6DAgBqC;AACrC,+DAAmF;AACnF,wEAKiD;AACjD,8EAA0E;AAC1E,oEAAiE;AACjE,6EAAkG;AAClG,4DAAmE;AACnE,oDAAgD;AAChD,6BAAwB;AACxB,uGAAoG;AACpG,kHAA+G;AAElG,QAAA,YAAY,GAAG,IAAA,uBAAgB,EAAC;IAC5C,MAAM,EAAE,IAAA,mCAA4B,EAAC,EAAE,WAAW,EAAE,CAAC,qBAAc,CAAC,GAAG,CAAC,EAAE,CAAC;SACzE,KAAK,CAAC,gCAAkB,CAAC;SACzB,MAAM,CAAC,kCAAc,CAAC;SACtB,QAAQ,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAClC,4BAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,wBAAO,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,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M,MAAM,GAAG,MAAM,uBAAuB,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAC7E,OAAO,IAAA,mBAAQ,EAAC,+CAA+C,EAAE,MAAM,CAAC,CAAC;IAC1E,CAAC,CAAC,CACF;CACD,CAAC,CAAC","sourcesContent":["import { createTRPCRouter, publicProcedure } from '@lyxa.ai/core/dist/libraries/trpc';\nimport {\n\treferralCodeCouponService,\n\treferralRewardCouponService,\n\tcouponService as service,\n} from '@modules/coupon/services';\nimport {\n\tCouponIdValidationSchema as IdSchema,\n\tAllCouponsUpdateSchema as UpdateSchema,\n\tCouponResponseSchema as ResponseSchema,\n\tGetUserCouponSchema,\n\tValidateCouponSchema,\n\tCouponValidationResponseSchema,\n\tCouponCodeSchema,\n\tUpdateCouponStatusSchema,\n\tDeviceIdSchema,\n\tIsNewUserGiftBoxShownSchema,\n\tDateInputSchema,\n\tGraphInputSchema,\n\tCouponMetricsResponseSchema,\n\tCouponMetricsByTypeResponseSchema,\n\tCreateCouponSchema,\n} from '@modules/coupon/validations';\nimport { allCouponTransformer as transformer } from '@modules/coupon/transformers';\nimport {\n\tDeleteSchema,\n\tFilterSchema,\n\tShareableLinkResponseSchema,\n\tStringSchema,\n} from '@lyxa.ai/core/dist/utilities/validation';\nimport { ErrorHandler } from '@lyxa.ai/core/dist/utilities/error-handler';\nimport { response } from '@lyxa.ai/core/dist/utilities/response';\nimport { createAuthenticatedProcedure } from '@lyxa.ai/core/dist/libraries/trpc/middlewares/auth';\nimport { AuthEntityType } from '@lyxa.ai/core/dist/libraries/auth';\nimport { mongoose } from '@typegoose/typegoose';\nimport { z } from 'zod';\nimport { publicUserDecoder } from '@lyxa.ai/core/dist/libraries/trpc/middlewares/publicUserDecoder';\nimport { CouponMetricsRepository } from '@modules/coupon/services/patterns/repository/CouponMetricsRepository';\n\nexport const couponRouter = createTRPCRouter({\n\tcreate: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(CreateCouponSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.create({ ...input, createdBy: new mongoose.Types.ObjectId(ctx.entity?.id) });\n\t\t\t\treturn response('Coupon created successfully');\n\t\t\t})\n\t\t),\n\n\tgetById: publicProcedure\n\t\t.input(IdSchema)\n\t\t.output(ResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.findById(input);\n\t\t\t\tconst transformedResult = transformer.transformToBasicView(result);\n\t\t\t\treturn response('Coupon fetched successfully', transformedResult);\n\t\t\t})\n\t\t),\n\n\tget: publicProcedure\n\t\t.input(FilterSchema)\n\t\t.output(ResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.find(input);\n\t\t\t\treturn response('Coupons fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tcheckExistingNewUserCoupon: publicProcedure.output(ResponseSchema).query(async () =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst result = await service.checkExistingNewUserCoupon();\n\t\t\treturn response('Coupon checked successfully', result);\n\t\t})\n\t),\n\n\tupdate: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(UpdateSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst { _id, data } = input;\n\t\t\t\tawait service.update(String(_id), {\n\t\t\t\t\t...data,\n\t\t\t\t\tcreatedBy: new mongoose.Types.ObjectId(ctx.entity?.id),\n\t\t\t\t});\n\t\t\t\treturn response('Coupon updated successfully');\n\t\t\t})\n\t\t),\n\n\tupdateStatus: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(UpdateCouponStatusSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst { _id, status } = input;\n\t\t\t\tawait service.updateStatus(String(_id), status);\n\t\t\t\treturn response('Coupon updated successfully');\n\t\t\t})\n\t\t),\n\n\tdeleteById: publicProcedure\n\t\t.input(DeleteSchema)\n\t\t.output(ResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tawait service.deleteById(input);\n\t\t\t\treturn response('Coupon deleted successfully');\n\t\t\t})\n\t\t),\n\n\tgetUserCoupons: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM, AuthEntityType.USER] })\n\t\t.input(GetUserCouponSchema)\n\t\t// .output(ResponseSchema)\n\t\t.query(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst isAdmin = ctx.entity?.type == AuthEntityType.CRM;\n\t\t\t\tconst id = new mongoose.Types.ObjectId(ctx.entity?.id);\n\t\t\t\tconst result = await service.getUserCoupons(\n\t\t\t\t\tisAdmin ? input.user : id,\n\t\t\t\t\tinput.shop,\n\t\t\t\t\tinput.page,\n\t\t\t\t\tinput.size\n\t\t\t\t);\n\t\t\t\treturn result;\n\t\t\t\t// return response('Coupons fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tgetUserCouponList: createAuthenticatedProcedure({ entityTypes: [AuthEntityType.CRM] })\n\t\t.input(FilterSchema)\n\t\t// .output(ResponseSchema)\n\t\t.query(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.getUserCouponList(input);\n\t\t\t\treturn result;\n\t\t\t\t// return response('Coupons fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tvalidateCoupon: publicProcedure\n\t\t.input(ValidateCouponSchema)\n\t\t.output(CouponValidationResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.validateCoupon(input);\n\t\t\t\treturn response('Coupon validated successfully', result);\n\t\t\t})\n\t\t),\n\n\tvalidateCouponMutation: publicProcedure\n\t\t.input(ValidateCouponSchema)\n\t\t.output(CouponValidationResponseSchema)\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.validateCoupon(input);\n\t\t\t\tconst message = result.isValid ? 'Coupon validated successfully' : 'Coupon validation failed';\n\t\t\t\treturn response(message, result);\n\t\t\t})\n\t\t),\n\n\tcreateReferralCodeForUser: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.CRM, AuthEntityType.USER],\n\t})\n\t\t.input(GetUserCouponSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst isAdmin = ctx.entity?.type == AuthEntityType.CRM;\n\t\t\t\tconst id = new mongoose.Types.ObjectId(ctx.entity?.id);\n\t\t\t\tconst result = await referralCodeCouponService.createReferralCodeForUser(isAdmin ? input.user : id);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\tgetReferralCodeCoupon: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.USER],\n\t}).query(async ({ ctx, input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst id = new mongoose.Types.ObjectId(ctx.entity?.id);\n\t\t\tconst result = await referralCodeCouponService.getReferralCodeCoupon(id);\n\t\t\treturn result;\n\t\t})\n\t),\n\n\taddCouponToUser: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.USER],\n\t})\n\t\t.input(CouponCodeSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.addCouponToUser(ctx.entity?.id as string, input.couponCode);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\tgetShareableLink: publicProcedure\n\t\t.input(StringSchema)\n\t\t.output(ShareableLinkResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.getShareableLink(input);\n\t\t\t\treturn response('Invite friend shareable link fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\thandleCouponExpiry: publicProcedure.input(z.object({ couponId: z.string() })).mutation(async ({ input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst result = await service.handleCouponExpiry(new mongoose.Types.ObjectId(input.couponId));\n\t\t\treturn result;\n\t\t})\n\t),\n\n\tsyncCouponExpiry: publicProcedure.mutation(async ({ input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst result = await service.syncCouponExpiry();\n\t\t\treturn result;\n\t\t})\n\t),\n\n\taddExistingCouponsToNewUser: publicProcedure\n\t\t.input(z.object({ userId: z.string() }))\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.addExistingCouponsToNewUser(new mongoose.Types.ObjectId(input.userId));\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\tgiveReferralRewardToReferrer: publicProcedure\n\t\t.input(z.object({ orderId: z.string() }))\n\t\t.mutation(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await referralRewardCouponService.giveReferralRewardToReferrer(\n\t\t\t\t\tnew mongoose.Types.ObjectId(input.orderId)\n\t\t\t\t);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t),\n\n\t// Coupon gift box details - before login\n\tgetCouponGiftBox: publicUserDecoder({ entityTypes: [AuthEntityType.USER] })\n\t\t.input(DeviceIdSchema)\n\t\t.query(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst userId = ctx.entity ? new mongoose.Types.ObjectId(ctx.entity?.id) : null;\n\t\t\t\tconst result = await service.handleCouponGiftBox(input.deviceId, userId);\n\t\t\t\treturn response('Coupon gift box fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\t// Update new user coupon flag\n\tupdateCouponGiftBoxShown: createAuthenticatedProcedure({\n\t\tentityTypes: [AuthEntityType.USER],\n\t})\n\t\t.input(IsNewUserGiftBoxShownSchema)\n\t\t.mutation(async ({ ctx, input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst result = await service.updateCouponGiftBoxShown(\n\t\t\t\t\tnew mongoose.Types.ObjectId(ctx.entity?.id),\n\t\t\t\t\tinput\n\t\t\t\t);\n\t\t\t\treturn response('Gift box shown status updated successfully', result);\n\t\t\t})\n\t\t),\n\n\tgetCouponMetrics: publicProcedure\n\t\t.input(DateInputSchema)\n\t\t.output(CouponMetricsResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst couponMetricsRepository = new CouponMetricsRepository();\n\t\t\t\tconst result = await couponMetricsRepository.getCouponMetrics(input);\n\t\t\t\treturn response('Coupon metrics fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tgetCouponMetricsByType: publicProcedure\n\t\t.input(DateInputSchema)\n\t\t.output(CouponMetricsByTypeResponseSchema)\n\t\t.query(async ({ input }) =>\n\t\t\tErrorHandler.wrapAsync(async () => {\n\t\t\t\tconst couponMetricsRepository = new CouponMetricsRepository();\n\t\t\t\tconst result = await couponMetricsRepository.getCouponMetricsByType(input);\n\t\t\t\treturn response('Coupon metrics fetched successfully', result);\n\t\t\t})\n\t\t),\n\n\tgetCouponOrdersGraphData: publicProcedure.input(GraphInputSchema).query(async ({ input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst couponMetricsRepository = new CouponMetricsRepository();\n\t\t\tconst result = await couponMetricsRepository.getCouponOrdersGraphData(input);\n\t\t\treturn response('Coupon orders graph data fetched successfully', result);\n\t\t})\n\t),\n\n\tgetUsersNewVsReturningGraphData: publicProcedure.input(GraphInputSchema).query(async ({ input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst couponMetricsRepository = new CouponMetricsRepository();\n\t\t\tconst result = await couponMetricsRepository.getUsersNewVsReturningGraphData(input);\n\t\t\treturn response('Users new vs returning graph data fetched successfully', result);\n\t\t})\n\t),\n\n\tgetCouponProfitGraphData: publicProcedure.input(GraphInputSchema).query(async ({ input }) =>\n\t\tErrorHandler.wrapAsync(async () => {\n\t\t\tconst couponMetricsRepository = new CouponMetricsRepository();\n\t\t\tconst result = await couponMetricsRepository.getCouponProfitGraphData(input);\n\t\t\treturn response('Coupon profit graph data fetched successfully', result);\n\t\t})\n\t),\n});\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ItemType, OrderType, RegularOrderStatus } from '@lyxa.ai/core/dist/utilities/enum';
|
|
2
|
+
import { CouponMetricsOutputDTO, DateInputDTO, GraphInputDTO } from '../../../../coupon/validations/coupon.validation';
|
|
3
|
+
export declare class CouponMetricsRepository {
|
|
4
|
+
private readonly model;
|
|
5
|
+
private orderModel;
|
|
6
|
+
constructor();
|
|
7
|
+
private getBaseCouponFilter;
|
|
8
|
+
private getCouponCreatedWithinDateRangeFilter;
|
|
9
|
+
private getCouponOrderMatch;
|
|
10
|
+
private getActiveCouponsCount;
|
|
11
|
+
private getTotalCreatedCoupons;
|
|
12
|
+
private getCouponUsageMetrics;
|
|
13
|
+
getCouponMetricsByType(duration: DateInputDTO): Promise<any[]>;
|
|
14
|
+
private getCouponTypeTitle;
|
|
15
|
+
private fillMissingRows;
|
|
16
|
+
private compareCouponTypes;
|
|
17
|
+
private calculateRedemptionRate;
|
|
18
|
+
getCouponMetrics(duration: DateInputDTO): Promise<CouponMetricsOutputDTO>;
|
|
19
|
+
getOrderGraphMatchStage(startDate: Date, endDate: Date, itemType?: ItemType): {
|
|
20
|
+
itemType?: ItemType | undefined;
|
|
21
|
+
placedAt: {
|
|
22
|
+
$gte: Date;
|
|
23
|
+
$lte: Date;
|
|
24
|
+
};
|
|
25
|
+
orderType: OrderType;
|
|
26
|
+
status: RegularOrderStatus;
|
|
27
|
+
};
|
|
28
|
+
getCouponOrdersGraphData(data: GraphInputDTO): Promise<any[]>;
|
|
29
|
+
getUsersNewVsReturningGraphData(data: GraphInputDTO): Promise<any[]>;
|
|
30
|
+
getCouponProfitGraphData(data: GraphInputDTO): Promise<any[]>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=CouponMetricsRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CouponMetricsRepository.d.ts","sourceRoot":"/","sources":["modules/coupon/services/patterns/repository/CouponMetricsRepository.ts"],"names":[],"mappings":"AAGA,OAAO,EAGN,QAAQ,EACR,SAAS,EACT,kBAAkB,EAElB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAEN,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,MAAM,+CAA+C,CAAC;AAIvD,qBAAa,uBAAuB;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,UAAU,CAAoB;;IAOtC,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,qCAAqC;IAa7C,OAAO,CAAC,mBAAmB;YAWb,qBAAqB;YASrB,sBAAsB;YAQtB,qBAAqB;IA+DtB,sBAAsB,CAAC,QAAQ,EAAE,YAAY;IA4I1D,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,eAAe;IAwBvB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,uBAAuB;IAQlB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA+B/E,uBAAuB,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,QAAQ;;;;;;;;;IAgBrE,wBAAwB,CAAC,IAAI,EAAE,aAAa;IAiE5C,+BAA+B,CAAC,IAAI,EAAE,aAAa;IA2HnD,wBAAwB,CAAC,IAAI,EAAE,aAAa;CAwDzD"}
|