@lyxa.ai/marketing 1.0.37 → 1.0.40

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.
Files changed (59) hide show
  1. package/dist/lib/index.d.ts +87 -7
  2. package/dist/lib/index.d.ts.map +1 -1
  3. package/dist/lib/modules/coupon/services/coupon.service.d.ts +3 -0
  4. package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
  5. package/dist/lib/modules/coupon/services/coupon.service.js +122 -5
  6. package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
  7. package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
  8. package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +7 -0
  9. package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js.map +1 -1
  10. package/dist/lib/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
  11. package/dist/lib/modules/coupon/validations/coupon.validation.js +5 -14
  12. package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
  13. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +39 -0
  14. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -0
  15. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js +539 -0
  16. package/dist/lib/modules/marketing/patterns/repository/MarketingMetricsRepository.js.map +1 -0
  17. package/dist/lib/modules/marketing/routers/marketing.router.d.ts +87 -7
  18. package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  19. package/dist/lib/modules/marketing/routers/marketing.router.js +27 -8
  20. package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
  21. package/dist/lib/modules/marketing/services/marketing.service.d.ts +4 -8
  22. package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
  23. package/dist/lib/modules/marketing/services/marketing.service.js +65 -355
  24. package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
  25. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts +1 -0
  26. package/dist/lib/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  27. package/dist/lib/modules/marketing/services/product-marketing.service.js +4 -0
  28. package/dist/lib/modules/marketing/services/product-marketing.service.js.map +1 -1
  29. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +106 -1
  30. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  31. package/dist/lib/modules/marketing/validations/marketing.validation.js +31 -1
  32. package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
  33. package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
  34. package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js +19 -1
  35. package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js.map +1 -1
  36. package/dist/lib/utility/utils.d.ts +3 -0
  37. package/dist/lib/utility/utils.d.ts.map +1 -0
  38. package/dist/lib/utility/utils.js +31 -0
  39. package/dist/lib/utility/utils.js.map +1 -0
  40. package/dist/types/index.d.ts +87 -7
  41. package/dist/types/index.d.ts.map +1 -1
  42. package/dist/types/modules/coupon/services/coupon.service.d.ts +3 -0
  43. package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
  44. package/dist/types/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
  45. package/dist/types/modules/coupon/validations/coupon.validation.d.ts.map +1 -1
  46. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts +39 -0
  47. package/dist/types/modules/marketing/patterns/repository/MarketingMetricsRepository.d.ts.map +1 -0
  48. package/dist/types/modules/marketing/routers/marketing.router.d.ts +87 -7
  49. package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  50. package/dist/types/modules/marketing/services/marketing.service.d.ts +4 -8
  51. package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
  52. package/dist/types/modules/marketing/services/product-marketing.service.d.ts +1 -0
  53. package/dist/types/modules/marketing/services/product-marketing.service.d.ts.map +1 -1
  54. package/dist/types/modules/marketing/validations/marketing.validation.d.ts +106 -1
  55. package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  56. package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
  57. package/dist/types/utility/utils.d.ts +15 -0
  58. package/dist/types/utility/utils.d.ts.map +1 -0
  59. package/package.json +2 -2
@@ -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;AAGnF;;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;AAGH;;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"}
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"}
@@ -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;AAK3F,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;IAgDlB;;;;OAIG;YACW,gBAAgB;IA+CjB,yBAAyB,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ;IAgCxG;;;OAGG;IACU,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAiD7E,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"}
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.37",
3
+ "version": "1.0.40",
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.158",
22
+ "@lyxa.ai/core": "1.3.176",
23
23
  "@lyxa.ai/notification": "^1.0.7",
24
24
  "@trpc/client": "^11.4.3",
25
25
  "@trpc/server": "^11.4.3",