@lyxa.ai/marketing 1.0.38 → 1.0.41
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/index.d.ts +89 -9
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts +4 -0
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.d.ts +3 -0
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +111 -6
- package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts +28 -2
- package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.js +13 -33
- package/dist/lib/modules/coupon/services/custom-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/helper.service.d.ts +30 -2
- package/dist/lib/modules/coupon/services/helper.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/helper.service.js +112 -4
- package/dist/lib/modules/coupon/services/helper.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts +29 -3
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.js +10 -62
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +16 -6
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js.map +1 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.d.ts +9 -0
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.js +96 -29
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts +29 -3
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.js +10 -63
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts +13 -0
- package/dist/lib/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js +6 -14
- package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js +4 -4
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +39 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +539 -0
- package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -0
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts +85 -9
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.js +26 -8
- package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts +2 -8
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +35 -354
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +1 -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 +4 -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 +28 -7
- package/dist/lib/modules/marketing/services/synchronize-product-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +12 -12
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +12 -12
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +106 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.js +31 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
- 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 +19 -1
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js.map +1 -1
- package/dist/lib/utility/utils.d.ts +3 -0
- package/dist/lib/utility/utils.d.ts.map +1 -0
- package/dist/lib/utility/utils.js +31 -0
- package/dist/lib/utility/utils.js.map +1 -0
- package/dist/types/index.d.ts +89 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +4 -0
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/coupon.service.d.ts +3 -0
- package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/custom-coupon.service.d.ts +28 -2
- package/dist/types/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/helper.service.d.ts +30 -2
- package/dist/types/modules/coupon/services/helper.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts +29 -3
- package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/referral-code-coupon.service.d.ts +57 -0
- package/dist/types/modules/coupon/services/referral-code-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts +29 -3
- package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/validations/coupon.validation.d.ts +13 -0
- package/dist/types/modules/coupon/validations/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/marketing/patterns/repository/MarketingMetricsRepository.d.ts +39 -0
- package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -0
- package/dist/types/modules/marketing/routers/marketing.router.d.ts +85 -9
- package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts +2 -8
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/product-marketing.service.d.ts +1 -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/buy1-get1-marketing.validation.d.ts +12 -12
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +12 -12
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts +106 -1
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
- package/dist/types/utility/utils.d.ts +15 -0
- package/dist/types/utility/utils.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -55,9 +55,6 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
55
55
|
spendLimit: number;
|
|
56
56
|
isSpendLimitEnabled: boolean;
|
|
57
57
|
shop: import("mongoose").Types.ObjectId;
|
|
58
|
-
marketingType: MarketingType.BUY1GET1;
|
|
59
|
-
isAppliedByCompany: boolean;
|
|
60
|
-
pausedAt: Date | null;
|
|
61
58
|
products: {
|
|
62
59
|
product: import("mongoose").Types.ObjectId;
|
|
63
60
|
value?: number | undefined;
|
|
@@ -65,6 +62,9 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
65
62
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
66
63
|
isBuy1Get1?: boolean | undefined;
|
|
67
64
|
}[];
|
|
65
|
+
marketingType: MarketingType.BUY1GET1;
|
|
66
|
+
isAppliedByCompany: boolean;
|
|
67
|
+
pausedAt: Date | null;
|
|
68
68
|
categories: import("mongoose").Types.ObjectId[];
|
|
69
69
|
isEntireMenu: boolean;
|
|
70
70
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
@@ -82,7 +82,6 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
82
82
|
spendLimit?: number | undefined;
|
|
83
83
|
isSpendLimitEnabled?: boolean | undefined;
|
|
84
84
|
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
85
|
-
pausedAt?: string | Date | null | undefined;
|
|
86
85
|
products?: {
|
|
87
86
|
product: string | import("mongoose").Types.ObjectId;
|
|
88
87
|
value?: number | undefined;
|
|
@@ -90,6 +89,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
90
89
|
marketing?: string | import("mongoose").Types.ObjectId | undefined;
|
|
91
90
|
isBuy1Get1?: boolean | undefined;
|
|
92
91
|
}[] | undefined;
|
|
92
|
+
pausedAt?: string | Date | null | undefined;
|
|
93
93
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
94
94
|
isEntireMenu?: boolean | undefined;
|
|
95
95
|
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
@@ -410,9 +410,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
410
410
|
spendLimit: number;
|
|
411
411
|
isSpendLimitEnabled: boolean;
|
|
412
412
|
shop: import("mongoose").Types.ObjectId;
|
|
413
|
-
marketingType: MarketingType.BUY1GET1;
|
|
414
|
-
isAppliedByCompany: boolean;
|
|
415
|
-
pausedAt: Date | null;
|
|
416
413
|
products: {
|
|
417
414
|
product: import("mongoose").Types.ObjectId;
|
|
418
415
|
value?: number | undefined;
|
|
@@ -420,6 +417,9 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
420
417
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
421
418
|
isBuy1Get1?: boolean | undefined;
|
|
422
419
|
}[];
|
|
420
|
+
marketingType: MarketingType.BUY1GET1;
|
|
421
|
+
isAppliedByCompany: boolean;
|
|
422
|
+
pausedAt: Date | null;
|
|
423
423
|
categories: import("mongoose").Types.ObjectId[];
|
|
424
424
|
isEntireMenu: boolean;
|
|
425
425
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
@@ -437,7 +437,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
437
437
|
spendLimit?: number | undefined;
|
|
438
438
|
isSpendLimitEnabled?: boolean | undefined;
|
|
439
439
|
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
440
|
-
pausedAt?: string | Date | null | undefined;
|
|
441
440
|
products?: {
|
|
442
441
|
product: string | import("mongoose").Types.ObjectId;
|
|
443
442
|
value?: number | undefined;
|
|
@@ -445,6 +444,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
445
444
|
marketing?: string | import("mongoose").Types.ObjectId | undefined;
|
|
446
445
|
isBuy1Get1?: boolean | undefined;
|
|
447
446
|
}[] | undefined;
|
|
447
|
+
pausedAt?: string | Date | null | undefined;
|
|
448
448
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
449
449
|
isEntireMenu?: boolean | undefined;
|
|
450
450
|
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
@@ -458,9 +458,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
458
458
|
spendLimit: number;
|
|
459
459
|
isSpendLimitEnabled: boolean;
|
|
460
460
|
shop: import("mongoose").Types.ObjectId;
|
|
461
|
-
marketingType: MarketingType.BUY1GET1;
|
|
462
|
-
isAppliedByCompany: boolean;
|
|
463
|
-
pausedAt: Date | null;
|
|
464
461
|
products: {
|
|
465
462
|
product: import("mongoose").Types.ObjectId;
|
|
466
463
|
value?: number | undefined;
|
|
@@ -468,6 +465,9 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
468
465
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
469
466
|
isBuy1Get1?: boolean | undefined;
|
|
470
467
|
}[];
|
|
468
|
+
marketingType: MarketingType.BUY1GET1;
|
|
469
|
+
isAppliedByCompany: boolean;
|
|
470
|
+
pausedAt: Date | null;
|
|
471
471
|
categories: import("mongoose").Types.ObjectId[];
|
|
472
472
|
isEntireMenu: boolean;
|
|
473
473
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
@@ -485,7 +485,6 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
485
485
|
spendLimit?: number | undefined;
|
|
486
486
|
isSpendLimitEnabled?: boolean | undefined;
|
|
487
487
|
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
488
|
-
pausedAt?: string | Date | null | undefined;
|
|
489
488
|
products?: {
|
|
490
489
|
product: string | import("mongoose").Types.ObjectId;
|
|
491
490
|
value?: number | undefined;
|
|
@@ -493,6 +492,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
493
492
|
marketing?: string | import("mongoose").Types.ObjectId | undefined;
|
|
494
493
|
isBuy1Get1?: boolean | undefined;
|
|
495
494
|
}[] | undefined;
|
|
495
|
+
pausedAt?: string | Date | null | undefined;
|
|
496
496
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
497
497
|
isEntireMenu?: boolean | undefined;
|
|
498
498
|
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
@@ -61,9 +61,6 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
|
|
|
61
61
|
spendLimit: number;
|
|
62
62
|
isSpendLimitEnabled: boolean;
|
|
63
63
|
shop: import("mongoose").Types.ObjectId;
|
|
64
|
-
marketingType: MarketingType.DISCOUNT;
|
|
65
|
-
isAppliedByCompany: boolean;
|
|
66
|
-
pausedAt: Date | null;
|
|
67
64
|
products: {
|
|
68
65
|
product: import("mongoose").Types.ObjectId;
|
|
69
66
|
value?: number | undefined;
|
|
@@ -71,6 +68,9 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
|
|
|
71
68
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
72
69
|
isBuy1Get1?: boolean | undefined;
|
|
73
70
|
}[];
|
|
71
|
+
marketingType: MarketingType.DISCOUNT;
|
|
72
|
+
isAppliedByCompany: boolean;
|
|
73
|
+
pausedAt: Date | null;
|
|
74
74
|
categories: import("mongoose").Types.ObjectId[];
|
|
75
75
|
isEntireMenu: boolean;
|
|
76
76
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
@@ -96,7 +96,6 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
|
|
|
96
96
|
spendLimit?: number | undefined;
|
|
97
97
|
isSpendLimitEnabled?: boolean | undefined;
|
|
98
98
|
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
99
|
-
pausedAt?: string | Date | null | undefined;
|
|
100
99
|
products?: {
|
|
101
100
|
product: string | import("mongoose").Types.ObjectId;
|
|
102
101
|
value?: number | undefined;
|
|
@@ -104,6 +103,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
|
|
|
104
103
|
marketing?: string | import("mongoose").Types.ObjectId | undefined;
|
|
105
104
|
isBuy1Get1?: boolean | undefined;
|
|
106
105
|
}[] | undefined;
|
|
106
|
+
pausedAt?: string | Date | null | undefined;
|
|
107
107
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
108
108
|
isEntireMenu?: boolean | undefined;
|
|
109
109
|
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
@@ -317,9 +317,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
317
317
|
spendLimit: number;
|
|
318
318
|
isSpendLimitEnabled: boolean;
|
|
319
319
|
shop: import("mongoose").Types.ObjectId;
|
|
320
|
-
marketingType: MarketingType.DISCOUNT;
|
|
321
|
-
isAppliedByCompany: boolean;
|
|
322
|
-
pausedAt: Date | null;
|
|
323
320
|
products: {
|
|
324
321
|
product: import("mongoose").Types.ObjectId;
|
|
325
322
|
value?: number | undefined;
|
|
@@ -327,6 +324,9 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
327
324
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
328
325
|
isBuy1Get1?: boolean | undefined;
|
|
329
326
|
}[];
|
|
327
|
+
marketingType: MarketingType.DISCOUNT;
|
|
328
|
+
isAppliedByCompany: boolean;
|
|
329
|
+
pausedAt: Date | null;
|
|
330
330
|
categories: import("mongoose").Types.ObjectId[];
|
|
331
331
|
isEntireMenu: boolean;
|
|
332
332
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
@@ -352,7 +352,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
352
352
|
spendLimit?: number | undefined;
|
|
353
353
|
isSpendLimitEnabled?: boolean | undefined;
|
|
354
354
|
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
355
|
-
pausedAt?: string | Date | null | undefined;
|
|
356
355
|
products?: {
|
|
357
356
|
product: string | import("mongoose").Types.ObjectId;
|
|
358
357
|
value?: number | undefined;
|
|
@@ -360,6 +359,7 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
360
359
|
marketing?: string | import("mongoose").Types.ObjectId | undefined;
|
|
361
360
|
isBuy1Get1?: boolean | undefined;
|
|
362
361
|
}[] | undefined;
|
|
362
|
+
pausedAt?: string | Date | null | undefined;
|
|
363
363
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
364
364
|
isEntireMenu?: boolean | undefined;
|
|
365
365
|
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
@@ -377,9 +377,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
377
377
|
spendLimit: number;
|
|
378
378
|
isSpendLimitEnabled: boolean;
|
|
379
379
|
shop: import("mongoose").Types.ObjectId;
|
|
380
|
-
marketingType: MarketingType.DISCOUNT;
|
|
381
|
-
isAppliedByCompany: boolean;
|
|
382
|
-
pausedAt: Date | null;
|
|
383
380
|
products: {
|
|
384
381
|
product: import("mongoose").Types.ObjectId;
|
|
385
382
|
value?: number | undefined;
|
|
@@ -387,6 +384,9 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
387
384
|
marketing?: import("mongoose").Types.ObjectId | undefined;
|
|
388
385
|
isBuy1Get1?: boolean | undefined;
|
|
389
386
|
}[];
|
|
387
|
+
marketingType: MarketingType.DISCOUNT;
|
|
388
|
+
isAppliedByCompany: boolean;
|
|
389
|
+
pausedAt: Date | null;
|
|
390
390
|
categories: import("mongoose").Types.ObjectId[];
|
|
391
391
|
isEntireMenu: boolean;
|
|
392
392
|
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
@@ -412,7 +412,6 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
412
412
|
spendLimit?: number | undefined;
|
|
413
413
|
isSpendLimitEnabled?: boolean | undefined;
|
|
414
414
|
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
415
|
-
pausedAt?: string | Date | null | undefined;
|
|
416
415
|
products?: {
|
|
417
416
|
product: string | import("mongoose").Types.ObjectId;
|
|
418
417
|
value?: number | undefined;
|
|
@@ -420,6 +419,7 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
420
419
|
marketing?: string | import("mongoose").Types.ObjectId | undefined;
|
|
421
420
|
isBuy1Get1?: boolean | undefined;
|
|
422
421
|
}[] | undefined;
|
|
422
|
+
pausedAt?: string | Date | null | undefined;
|
|
423
423
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
424
424
|
isEntireMenu?: boolean | undefined;
|
|
425
425
|
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { DTO } from '@lyxa.ai/core/dist/utilities/validation/global-validation';
|
|
3
|
-
import { MarketingStatus, MarketingType } from '@lyxa.ai/core/dist/utilities/enum';
|
|
3
|
+
import { GraphType, MarketingStatus, MarketingType } from '@lyxa.ai/core/dist/utilities/enum';
|
|
4
4
|
/**
|
|
5
5
|
* Define the base parent schema fields
|
|
6
6
|
*/
|
|
@@ -207,6 +207,105 @@ export declare const SyncProductMarketingForMultipleProductsSchema: z.ZodObject<
|
|
|
207
207
|
}, {
|
|
208
208
|
productIds: (string | import("mongoose").Types.ObjectId)[];
|
|
209
209
|
}>;
|
|
210
|
+
export declare const IncreaseDuringDiscountSchema: z.ZodObject<{
|
|
211
|
+
count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
212
|
+
percentageIncrease: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
count: number;
|
|
215
|
+
percentageIncrease: number;
|
|
216
|
+
}, {
|
|
217
|
+
count?: number | undefined;
|
|
218
|
+
percentageIncrease?: number | undefined;
|
|
219
|
+
}>;
|
|
220
|
+
export declare const MarketingMetricsSchema: z.ZodObject<{
|
|
221
|
+
numberOfItems: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
orderIncreaseWithDiscount: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
224
|
+
percentageIncrease: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
count: number;
|
|
227
|
+
percentageIncrease: number;
|
|
228
|
+
}, {
|
|
229
|
+
count?: number | undefined;
|
|
230
|
+
percentageIncrease?: number | undefined;
|
|
231
|
+
}>>;
|
|
232
|
+
customerIncreaseWithDiscount: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
234
|
+
percentageIncrease: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
count: number;
|
|
237
|
+
percentageIncrease: number;
|
|
238
|
+
}, {
|
|
239
|
+
count?: number | undefined;
|
|
240
|
+
percentageIncrease?: number | undefined;
|
|
241
|
+
}>>;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
numberOfItems?: number | undefined;
|
|
244
|
+
orderIncreaseWithDiscount?: {
|
|
245
|
+
count: number;
|
|
246
|
+
percentageIncrease: number;
|
|
247
|
+
} | undefined;
|
|
248
|
+
customerIncreaseWithDiscount?: {
|
|
249
|
+
count: number;
|
|
250
|
+
percentageIncrease: number;
|
|
251
|
+
} | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
numberOfItems?: number | undefined;
|
|
254
|
+
orderIncreaseWithDiscount?: {
|
|
255
|
+
count?: number | undefined;
|
|
256
|
+
percentageIncrease?: number | undefined;
|
|
257
|
+
} | undefined;
|
|
258
|
+
customerIncreaseWithDiscount?: {
|
|
259
|
+
count?: number | undefined;
|
|
260
|
+
percentageIncrease?: number | undefined;
|
|
261
|
+
} | undefined;
|
|
262
|
+
}>;
|
|
263
|
+
export declare const MarketingGraphInputSchema: z.ZodObject<{
|
|
264
|
+
marketingId: z.ZodType<string | import("mongoose").Types.ObjectId, z.ZodTypeDef, string | import("mongoose").Types.ObjectId>;
|
|
265
|
+
startDate: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>, Date, string | Date>;
|
|
266
|
+
endDate: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>, Date, string | Date>;
|
|
267
|
+
type: z.ZodDefault<z.ZodNativeEnum<typeof GraphType>>;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
type: GraphType;
|
|
270
|
+
startDate: Date;
|
|
271
|
+
marketingId: string | import("mongoose").Types.ObjectId;
|
|
272
|
+
endDate: Date;
|
|
273
|
+
}, {
|
|
274
|
+
startDate: string | Date;
|
|
275
|
+
marketingId: string | import("mongoose").Types.ObjectId;
|
|
276
|
+
endDate: string | Date;
|
|
277
|
+
type?: GraphType | undefined;
|
|
278
|
+
}>;
|
|
279
|
+
export declare const MarketingOrdersGraphOutputSchema: z.ZodArray<z.ZodObject<{
|
|
280
|
+
date: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
281
|
+
orders: z.ZodDefault<z.ZodNumber>;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
date: string;
|
|
284
|
+
orders: number;
|
|
285
|
+
}, {
|
|
286
|
+
date: string;
|
|
287
|
+
orders?: number | undefined;
|
|
288
|
+
}>, "many">;
|
|
289
|
+
export declare const MarketingCustomersGraphOutputSchema: z.ZodArray<z.ZodObject<{
|
|
290
|
+
date: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
291
|
+
customers: z.ZodDefault<z.ZodNumber>;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
date: string;
|
|
294
|
+
customers: number;
|
|
295
|
+
}, {
|
|
296
|
+
date: string;
|
|
297
|
+
customers?: number | undefined;
|
|
298
|
+
}>, "many">;
|
|
299
|
+
export declare const MarketingAmountSpentGraphOutputSchema: z.ZodArray<z.ZodObject<{
|
|
300
|
+
date: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
301
|
+
amount: z.ZodDefault<z.ZodNumber>;
|
|
302
|
+
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
date: string;
|
|
304
|
+
amount: number;
|
|
305
|
+
}, {
|
|
306
|
+
date: string;
|
|
307
|
+
amount?: number | undefined;
|
|
308
|
+
}>, "many">;
|
|
210
309
|
/**
|
|
211
310
|
* Export DTO types
|
|
212
311
|
*/
|
|
@@ -214,4 +313,10 @@ export type CreateMarketingDTO = DTO<typeof MarketingValidationSchema>;
|
|
|
214
313
|
export type MarketingDTO = DTO<typeof MarketingSchema>;
|
|
215
314
|
export type UpdateMarketingDTO = DTO<typeof UpdateMarketingSchema>;
|
|
216
315
|
export type ProductEntireMenuMarketingHandlerDTO = DTO<typeof ProductEntireMenuMarketingHandlerSchema>;
|
|
316
|
+
export type IncreaseDuringDiscountDTO = DTO<typeof IncreaseDuringDiscountSchema>;
|
|
317
|
+
export type MarketingMetricsDTO = DTO<typeof MarketingMetricsSchema>;
|
|
318
|
+
export type MarketingGraphInputDTO = DTO<typeof MarketingGraphInputSchema>;
|
|
319
|
+
export type MarketingOrdersGraphOutputDTO = DTO<typeof MarketingOrdersGraphOutputSchema>;
|
|
320
|
+
export type MarketingCustomersGraphOutputDTO = DTO<typeof MarketingCustomersGraphOutputSchema>;
|
|
321
|
+
export type MarketingAmountSpentGraphOutputDTO = DTO<typeof MarketingAmountSpentGraphOutputSchema>;
|
|
217
322
|
//# sourceMappingURL=marketing.validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAI9F;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAQ/B,CAAC;AASF;;GAEG;AACH,QAAA,MACa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACvB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCACnB,iBAAiB,mNACb,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACgB,CAAC;AAErD;;GAEG;AACH,OAAO,EACN,yBAAyB,EACzB,eAAe,EACf,iBAAiB,IAAI,2BAA2B,EAChD,qBAAqB,GACrB,CAAC;AAEF,eAAO,MAAM,uCAAuC;;;;;;;;;EAGlD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;EAE/C,CAAC;AAEH,eAAO,MAAM,6CAA6C;;;;;;EAExD,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;EAKvC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;WAK5C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;WAK/C,CAAC;AAEF,eAAO,MAAM,qCAAqC;;;;;;;;;WAKjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACvE,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACnE,MAAM,MAAM,oCAAoC,GAAG,GAAG,CAAC,OAAO,uCAAuC,CAAC,CAAC;AACvG,MAAM,MAAM,yBAAyB,GAAG,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC,OAAO,gCAAgC,CAAC,CAAC;AACzF,MAAM,MAAM,gCAAgC,GAAG,GAAG,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAC/F,MAAM,MAAM,kCAAkC,GAAG,GAAG,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
|
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;
|
|
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;IAqDlB;;;;OAIG;YACW,gBAAgB;IA+CjB,yBAAyB,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ;IAsCxG;;;OAGG;IACU,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA2D7E,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;CA4CvG;AAED,eAAO,MAAM,4BAA4B,8BAA8C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GraphType } from '@lyxa.ai/core/dist/utilities/enum';
|
|
2
|
+
/**
|
|
3
|
+
* Fills in missing periods (daily or monthly) between two dates in a time-series dataset,
|
|
4
|
+
* assigning default values for fields when data is missing.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The shape of the result item, must include a `date` field.
|
|
7
|
+
* @param results - Original array of time-series data with `date` keys.
|
|
8
|
+
* @param startDate - The start date of the period to cover.
|
|
9
|
+
* @param endDate - The end date of the period to cover.
|
|
10
|
+
* @param type - Graph type (e.g., daily or monthly).
|
|
11
|
+
* @param defaultFields - Default values to assign when a date is missing.
|
|
12
|
+
* @returns A new array with missing dates filled in and populated with default values.
|
|
13
|
+
*/
|
|
14
|
+
export declare function fillMissingPeriods<T extends Record<string, any>>(results: T[], startDate: Date, endDate: Date, type: GraphType, defaultFields: Omit<T, 'date'>): T[];
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"/","sources":["utility/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5D,OAAO,EAAE,CAAC,EAAE,EACZ,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,IAAI,EAAE,SAAS,EACf,aAAa,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,GAC/B,CAAC,EAAE,CAqCL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/marketing",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
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.3.
|
|
22
|
+
"@lyxa.ai/core": "1.3.190",
|
|
23
23
|
"@lyxa.ai/notification": "^1.0.7",
|
|
24
24
|
"@trpc/client": "^11.4.3",
|
|
25
25
|
"@trpc/server": "^11.4.3",
|