@lyxa.ai/marketing 1.0.27 → 1.0.28

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 (79) hide show
  1. package/dist/lib/index.d.ts +4 -4
  2. package/dist/lib/index.d.ts.map +1 -1
  3. package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  4. package/dist/lib/modules/marketing/routers/marketing.router.d.ts +4 -4
  5. package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  6. package/dist/lib/modules/marketing/routers/marketing.router.js +0 -2
  7. package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
  8. package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
  9. package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js +38 -18
  10. package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js.map +1 -1
  11. package/dist/lib/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
  12. package/dist/lib/modules/marketing/services/discount-marketing.service.js +37 -17
  13. package/dist/lib/modules/marketing/services/discount-marketing.service.js.map +1 -1
  14. package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
  15. package/dist/lib/modules/marketing/services/marketing.service.js +4 -1
  16. package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
  17. package/dist/lib/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts +2 -0
  18. package/dist/lib/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts.map +1 -1
  19. package/dist/lib/modules/marketing/transformers/discount-marketing.transformer.d.ts +2 -0
  20. package/dist/lib/modules/marketing/transformers/discount-marketing.transformer.d.ts.map +1 -1
  21. package/dist/lib/modules/marketing/transformers/featured-marketing.transformer.d.ts +1 -0
  22. package/dist/lib/modules/marketing/transformers/featured-marketing.transformer.d.ts.map +1 -1
  23. package/dist/lib/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts +1 -0
  24. package/dist/lib/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts.map +1 -1
  25. package/dist/lib/modules/marketing/transformers/punch-marketing.transformer.d.ts +1 -0
  26. package/dist/lib/modules/marketing/transformers/punch-marketing.transformer.d.ts.map +1 -1
  27. package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +28 -0
  28. package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts.map +1 -1
  29. package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.js +1 -0
  30. package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.js.map +1 -1
  31. package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +254 -123
  32. package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts.map +1 -1
  33. package/dist/lib/modules/marketing/validations/discount-marketing.validation.js +19 -3
  34. package/dist/lib/modules/marketing/validations/discount-marketing.validation.js.map +1 -1
  35. package/dist/lib/modules/marketing/validations/featured-marketing.validation.d.ts +14 -0
  36. package/dist/lib/modules/marketing/validations/featured-marketing.validation.d.ts.map +1 -1
  37. package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.d.ts +107 -26
  38. package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.d.ts.map +1 -1
  39. package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.js +34 -2
  40. package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.js.map +1 -1
  41. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +10 -0
  42. package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  43. package/dist/lib/modules/marketing/validations/marketing.validation.js +1 -0
  44. package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
  45. package/dist/lib/modules/marketing/validations/punch-marketing.validation.d.ts +127 -30
  46. package/dist/lib/modules/marketing/validations/punch-marketing.validation.d.ts.map +1 -1
  47. package/dist/lib/modules/marketing/validations/punch-marketing.validation.js +80 -2
  48. package/dist/lib/modules/marketing/validations/punch-marketing.validation.js.map +1 -1
  49. package/dist/types/index.d.ts +4 -4
  50. package/dist/types/index.d.ts.map +1 -1
  51. package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
  52. package/dist/types/modules/marketing/routers/marketing.router.d.ts +4 -4
  53. package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
  54. package/dist/types/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
  55. package/dist/types/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
  56. package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
  57. package/dist/types/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts +2 -0
  58. package/dist/types/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts.map +1 -1
  59. package/dist/types/modules/marketing/transformers/discount-marketing.transformer.d.ts +2 -0
  60. package/dist/types/modules/marketing/transformers/discount-marketing.transformer.d.ts.map +1 -1
  61. package/dist/types/modules/marketing/transformers/featured-marketing.transformer.d.ts +1 -0
  62. package/dist/types/modules/marketing/transformers/featured-marketing.transformer.d.ts.map +1 -1
  63. package/dist/types/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts +1 -0
  64. package/dist/types/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts.map +1 -1
  65. package/dist/types/modules/marketing/transformers/punch-marketing.transformer.d.ts +1 -0
  66. package/dist/types/modules/marketing/transformers/punch-marketing.transformer.d.ts.map +1 -1
  67. package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +28 -0
  68. package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts.map +1 -1
  69. package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +254 -123
  70. package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts.map +1 -1
  71. package/dist/types/modules/marketing/validations/featured-marketing.validation.d.ts +14 -0
  72. package/dist/types/modules/marketing/validations/featured-marketing.validation.d.ts.map +1 -1
  73. package/dist/types/modules/marketing/validations/free-delivery-marketing.validation.d.ts +107 -26
  74. package/dist/types/modules/marketing/validations/free-delivery-marketing.validation.d.ts.map +1 -1
  75. package/dist/types/modules/marketing/validations/marketing.validation.d.ts +10 -0
  76. package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
  77. package/dist/types/modules/marketing/validations/punch-marketing.validation.d.ts +127 -30
  78. package/dist/types/modules/marketing/validations/punch-marketing.validation.d.ts.map +1 -1
  79. package/package.json +2 -2
@@ -28,6 +28,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
28
28
  isBuy1Get1?: boolean | undefined;
29
29
  valueType?: ValueType | null | undefined;
30
30
  }>, "many">>>;
31
+ excludeProducts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>;
31
32
  maxDiscountPerOrder: z.ZodDefault<z.ZodNumber>;
32
33
  isMaxDiscountPerOrderEnabled: z.ZodDefault<z.ZodBoolean>;
33
34
  spendLimit: z.ZodDefault<z.ZodNumber>;
@@ -47,6 +48,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
47
48
  }>;
48
49
  status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
49
50
  pausedAt: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>;
51
+ admin: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>;
50
52
  }, "strict", z.ZodTypeAny, {
51
53
  isAppliedByCompany: boolean;
52
54
  shop: import("mongoose").Types.ObjectId;
@@ -66,12 +68,14 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
66
68
  }[];
67
69
  categories: import("mongoose").Types.ObjectId[];
68
70
  isEntireMenu: boolean;
71
+ excludeProducts: import("mongoose").Types.ObjectId[];
69
72
  spendLimit: number;
70
73
  isSpendLimitEnabled: boolean;
71
74
  isOnlyForSubscriber: boolean;
72
75
  maxDiscountPerOrder: number;
73
76
  isMaxDiscountPerOrderEnabled: boolean;
74
77
  value?: number | undefined;
78
+ admin?: import("mongoose").Types.ObjectId | null | undefined;
75
79
  valueType?: ValueType | undefined;
76
80
  categoryValueType?: ValueType | undefined;
77
81
  categoryValue?: number | undefined;
@@ -86,6 +90,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
86
90
  value?: number | undefined;
87
91
  status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
88
92
  pausedAt?: string | Date | null | undefined;
93
+ admin?: string | import("mongoose").Types.ObjectId | null | undefined;
89
94
  valueType?: ValueType | undefined;
90
95
  products?: {
91
96
  product: string | import("mongoose").Types.ObjectId;
@@ -96,6 +101,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
96
101
  }[] | undefined;
97
102
  categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
98
103
  isEntireMenu?: boolean | undefined;
104
+ excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
99
105
  spendLimit?: number | undefined;
100
106
  isSpendLimitEnabled?: boolean | undefined;
101
107
  isOnlyForSubscriber?: boolean | undefined;
@@ -130,6 +136,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
130
136
  isBuy1Get1?: boolean | undefined;
131
137
  valueType?: ValueType | null | undefined;
132
138
  }>, "many">>>>;
139
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
133
140
  maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
134
141
  isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
135
142
  spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -149,6 +156,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
149
156
  }>>;
150
157
  status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
151
158
  pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
159
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
152
160
  _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
153
161
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
154
162
  marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.DISCOUNT>>;
@@ -177,6 +185,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
177
185
  isBuy1Get1?: boolean | undefined;
178
186
  valueType?: ValueType | null | undefined;
179
187
  }>, "many">>>>;
188
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
180
189
  maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
181
190
  isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
182
191
  spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -196,6 +205,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
196
205
  }>>;
197
206
  status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
198
207
  pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
208
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
199
209
  _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
200
210
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
201
211
  marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.DISCOUNT>>;
@@ -224,6 +234,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
224
234
  isBuy1Get1?: boolean | undefined;
225
235
  valueType?: ValueType | null | undefined;
226
236
  }>, "many">>>>;
237
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
227
238
  maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
228
239
  isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
229
240
  spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -243,14 +254,189 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
243
254
  }>>;
244
255
  status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
245
256
  pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
257
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
246
258
  _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
247
- }, z.ZodTypeAny, "passthrough">>, DiscountMarketingIdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, UpdateDiscountMarketingSchema: z.ZodObject<{
259
+ }, z.ZodTypeAny, "passthrough">>, DiscountMarketingIdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
260
+ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject<{
261
+ marketingType: z.ZodLiteral<MarketingType.DISCOUNT>;
262
+ categoryValueType: z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>;
263
+ categoryValue: z.ZodOptional<z.ZodNumber>;
264
+ categories: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>;
265
+ isEntireMenu: z.ZodDefault<z.ZodBoolean>;
266
+ valueType: z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>;
267
+ value: z.ZodOptional<z.ZodNumber>;
268
+ products: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
269
+ product: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
270
+ marketing: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
271
+ isBuy1Get1: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
272
+ valueType: z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof ValueType>>>>;
273
+ value: z.ZodOptional<z.ZodNumber>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ product: import("mongoose").Types.ObjectId;
276
+ value?: number | undefined;
277
+ marketing?: import("mongoose").Types.ObjectId | undefined;
278
+ isBuy1Get1?: boolean | undefined;
279
+ valueType?: ValueType | null | undefined;
280
+ }, {
281
+ product: string | import("mongoose").Types.ObjectId;
282
+ value?: number | undefined;
283
+ marketing?: string | import("mongoose").Types.ObjectId | undefined;
284
+ isBuy1Get1?: boolean | undefined;
285
+ valueType?: ValueType | null | undefined;
286
+ }>, "many">>>;
287
+ excludeProducts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>;
288
+ maxDiscountPerOrder: z.ZodDefault<z.ZodNumber>;
289
+ isMaxDiscountPerOrderEnabled: z.ZodDefault<z.ZodBoolean>;
290
+ spendLimit: z.ZodDefault<z.ZodNumber>;
291
+ isSpendLimitEnabled: z.ZodDefault<z.ZodBoolean>;
292
+ isOnlyForSubscriber: z.ZodDefault<z.ZodBoolean>;
293
+ shop: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
294
+ isAppliedByCompany: z.ZodBoolean;
295
+ duration: z.ZodObject<{
296
+ start: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
297
+ end: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ start: Date;
300
+ end?: Date | undefined;
301
+ }, {
302
+ start: string | Date;
303
+ end?: string | Date | undefined;
304
+ }>;
305
+ status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
306
+ pausedAt: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>;
307
+ admin: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>;
308
+ }, "strict", z.ZodTypeAny, {
309
+ isAppliedByCompany: boolean;
310
+ shop: import("mongoose").Types.ObjectId;
311
+ status: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus;
312
+ marketingType: MarketingType.DISCOUNT;
313
+ duration: {
314
+ start: Date;
315
+ end?: Date | undefined;
316
+ };
317
+ pausedAt: Date | null;
318
+ products: {
319
+ product: import("mongoose").Types.ObjectId;
320
+ value?: number | undefined;
321
+ marketing?: import("mongoose").Types.ObjectId | undefined;
322
+ isBuy1Get1?: boolean | undefined;
323
+ valueType?: ValueType | null | undefined;
324
+ }[];
325
+ categories: import("mongoose").Types.ObjectId[];
326
+ isEntireMenu: boolean;
327
+ excludeProducts: import("mongoose").Types.ObjectId[];
328
+ spendLimit: number;
329
+ isSpendLimitEnabled: boolean;
330
+ isOnlyForSubscriber: boolean;
331
+ maxDiscountPerOrder: number;
332
+ isMaxDiscountPerOrderEnabled: boolean;
333
+ value?: number | undefined;
334
+ admin?: import("mongoose").Types.ObjectId | null | undefined;
335
+ valueType?: ValueType | undefined;
336
+ categoryValueType?: ValueType | undefined;
337
+ categoryValue?: number | undefined;
338
+ }, {
339
+ isAppliedByCompany: boolean;
340
+ shop: string | import("mongoose").Types.ObjectId;
341
+ marketingType: MarketingType.DISCOUNT;
342
+ duration: {
343
+ start: string | Date;
344
+ end?: string | Date | undefined;
345
+ };
346
+ value?: number | undefined;
347
+ status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
348
+ pausedAt?: string | Date | null | undefined;
349
+ admin?: string | import("mongoose").Types.ObjectId | null | undefined;
350
+ valueType?: ValueType | undefined;
351
+ products?: {
352
+ product: string | import("mongoose").Types.ObjectId;
353
+ value?: number | undefined;
354
+ marketing?: string | import("mongoose").Types.ObjectId | undefined;
355
+ isBuy1Get1?: boolean | undefined;
356
+ valueType?: ValueType | null | undefined;
357
+ }[] | undefined;
358
+ categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
359
+ isEntireMenu?: boolean | undefined;
360
+ excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
361
+ spendLimit?: number | undefined;
362
+ isSpendLimitEnabled?: boolean | undefined;
363
+ isOnlyForSubscriber?: boolean | undefined;
364
+ categoryValueType?: ValueType | undefined;
365
+ categoryValue?: number | undefined;
366
+ maxDiscountPerOrder?: number | undefined;
367
+ isMaxDiscountPerOrderEnabled?: boolean | undefined;
368
+ }>, {
369
+ isAppliedByCompany: boolean;
370
+ shop: import("mongoose").Types.ObjectId;
371
+ status: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus;
372
+ marketingType: MarketingType.DISCOUNT;
373
+ duration: {
374
+ start: Date;
375
+ end?: Date | undefined;
376
+ };
377
+ pausedAt: Date | null;
378
+ products: {
379
+ product: import("mongoose").Types.ObjectId;
380
+ value?: number | undefined;
381
+ marketing?: import("mongoose").Types.ObjectId | undefined;
382
+ isBuy1Get1?: boolean | undefined;
383
+ valueType?: ValueType | null | undefined;
384
+ }[];
385
+ categories: import("mongoose").Types.ObjectId[];
386
+ isEntireMenu: boolean;
387
+ excludeProducts: import("mongoose").Types.ObjectId[];
388
+ spendLimit: number;
389
+ isSpendLimitEnabled: boolean;
390
+ isOnlyForSubscriber: boolean;
391
+ maxDiscountPerOrder: number;
392
+ isMaxDiscountPerOrderEnabled: boolean;
393
+ value?: number | undefined;
394
+ admin?: import("mongoose").Types.ObjectId | null | undefined;
395
+ valueType?: ValueType | undefined;
396
+ categoryValueType?: ValueType | undefined;
397
+ categoryValue?: number | undefined;
398
+ }, {
399
+ isAppliedByCompany: boolean;
400
+ shop: string | import("mongoose").Types.ObjectId;
401
+ marketingType: MarketingType.DISCOUNT;
402
+ duration: {
403
+ start: string | Date;
404
+ end?: string | Date | undefined;
405
+ };
406
+ value?: number | undefined;
407
+ status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
408
+ pausedAt?: string | Date | null | undefined;
409
+ admin?: string | import("mongoose").Types.ObjectId | null | undefined;
410
+ valueType?: ValueType | undefined;
411
+ products?: {
412
+ product: string | import("mongoose").Types.ObjectId;
413
+ value?: number | undefined;
414
+ marketing?: string | import("mongoose").Types.ObjectId | undefined;
415
+ isBuy1Get1?: boolean | undefined;
416
+ valueType?: ValueType | null | undefined;
417
+ }[] | undefined;
418
+ categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
419
+ isEntireMenu?: boolean | undefined;
420
+ excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
421
+ spendLimit?: number | undefined;
422
+ isSpendLimitEnabled?: boolean | undefined;
423
+ isOnlyForSubscriber?: boolean | undefined;
424
+ categoryValueType?: ValueType | undefined;
425
+ categoryValue?: number | undefined;
426
+ maxDiscountPerOrder?: number | undefined;
427
+ isMaxDiscountPerOrderEnabled?: boolean | undefined;
428
+ }>;
429
+ declare const UpdateDiscountMarketingSchema: z.ZodEffects<z.ZodObject<{
248
430
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
249
431
  }, "strict", z.ZodTypeAny, {
250
432
  [x: string]: any;
251
433
  }, {
252
434
  [x: string]: any;
253
- }> | z.ZodObject<{
435
+ }>, {
436
+ [x: string]: any;
437
+ }, {
438
+ [x: string]: any;
439
+ }> | z.ZodEffects<z.ZodObject<{
254
440
  marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.DISCOUNT>>;
255
441
  categoryValueType: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>>;
256
442
  categoryValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
@@ -277,6 +463,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
277
463
  isBuy1Get1?: boolean | undefined;
278
464
  valueType?: ValueType | null | undefined;
279
465
  }>, "many">>>>;
466
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
280
467
  maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
281
468
  isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
282
469
  spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -296,6 +483,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
296
483
  }>>;
297
484
  status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
298
485
  pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
486
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
299
487
  _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
300
488
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
301
489
  marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.DISCOUNT>>;
@@ -324,6 +512,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
324
512
  isBuy1Get1?: boolean | undefined;
325
513
  valueType?: ValueType | null | undefined;
326
514
  }>, "many">>>>;
515
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
327
516
  maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
328
517
  isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
329
518
  spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -343,6 +532,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
343
532
  }>>;
344
533
  status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
345
534
  pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
535
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
346
536
  _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
347
537
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
348
538
  marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.DISCOUNT>>;
@@ -371,6 +561,7 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
371
561
  isBuy1Get1?: boolean | undefined;
372
562
  valueType?: ValueType | null | undefined;
373
563
  }>, "many">>>>;
564
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
374
565
  maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
375
566
  isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
376
567
  spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -390,17 +581,17 @@ declare const DiscountMarketingValidationSchema: z.ZodObject<{
390
581
  }>>;
391
582
  status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
392
583
  pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
584
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
393
585
  _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
394
- }, z.ZodTypeAny, "passthrough">>;
395
- declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject<{
396
- marketingType: z.ZodLiteral<MarketingType.DISCOUNT>;
397
- categoryValueType: z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>;
398
- categoryValue: z.ZodOptional<z.ZodNumber>;
399
- categories: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>;
400
- isEntireMenu: z.ZodDefault<z.ZodBoolean>;
401
- valueType: z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>;
402
- value: z.ZodOptional<z.ZodNumber>;
403
- products: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
586
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
587
+ marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.DISCOUNT>>;
588
+ categoryValueType: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>>;
589
+ categoryValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
590
+ categories: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
591
+ isEntireMenu: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
592
+ valueType: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>>;
593
+ value: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
594
+ products: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
404
595
  product: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
405
596
  marketing: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
406
597
  isBuy1Get1: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
@@ -418,15 +609,16 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
418
609
  marketing?: string | import("mongoose").Types.ObjectId | undefined;
419
610
  isBuy1Get1?: boolean | undefined;
420
611
  valueType?: ValueType | null | undefined;
421
- }>, "many">>>;
422
- maxDiscountPerOrder: z.ZodDefault<z.ZodNumber>;
423
- isMaxDiscountPerOrderEnabled: z.ZodDefault<z.ZodBoolean>;
424
- spendLimit: z.ZodDefault<z.ZodNumber>;
425
- isSpendLimitEnabled: z.ZodDefault<z.ZodBoolean>;
426
- isOnlyForSubscriber: z.ZodDefault<z.ZodBoolean>;
427
- shop: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
428
- isAppliedByCompany: z.ZodBoolean;
429
- duration: z.ZodObject<{
612
+ }>, "many">>>>;
613
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
614
+ maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
615
+ isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
616
+ spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
617
+ isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
618
+ isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
619
+ shop: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
620
+ isAppliedByCompany: z.ZodOptional<z.ZodBoolean>;
621
+ duration: z.ZodOptional<z.ZodObject<{
430
622
  start: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
431
623
  end: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>;
432
624
  }, "strip", z.ZodTypeAny, {
@@ -435,122 +627,61 @@ declare const DiscountMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
435
627
  }, {
436
628
  start: string | Date;
437
629
  end?: string | Date | undefined;
438
- }>;
439
- status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
440
- pausedAt: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>;
441
- }, "strict", z.ZodTypeAny, {
442
- isAppliedByCompany: boolean;
443
- shop: import("mongoose").Types.ObjectId;
444
- status: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus;
445
- marketingType: MarketingType.DISCOUNT;
446
- duration: {
447
- start: Date;
448
- end?: Date | undefined;
449
- };
450
- pausedAt: Date | null;
451
- products: {
630
+ }>>;
631
+ status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
632
+ pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
633
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
634
+ _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
635
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
636
+ marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.DISCOUNT>>;
637
+ categoryValueType: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>>;
638
+ categoryValue: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
639
+ categories: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
640
+ isEntireMenu: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
641
+ valueType: z.ZodOptional<z.ZodOptional<z.ZodNativeEnum<typeof ValueType>>>;
642
+ value: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
643
+ products: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
644
+ product: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
645
+ marketing: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
646
+ isBuy1Get1: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
647
+ valueType: z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof ValueType>>>>;
648
+ value: z.ZodOptional<z.ZodNumber>;
649
+ }, "strip", z.ZodTypeAny, {
452
650
  product: import("mongoose").Types.ObjectId;
453
651
  value?: number | undefined;
454
652
  marketing?: import("mongoose").Types.ObjectId | undefined;
455
653
  isBuy1Get1?: boolean | undefined;
456
654
  valueType?: ValueType | null | undefined;
457
- }[];
458
- categories: import("mongoose").Types.ObjectId[];
459
- isEntireMenu: boolean;
460
- spendLimit: number;
461
- isSpendLimitEnabled: boolean;
462
- isOnlyForSubscriber: boolean;
463
- maxDiscountPerOrder: number;
464
- isMaxDiscountPerOrderEnabled: boolean;
465
- value?: number | undefined;
466
- valueType?: ValueType | undefined;
467
- categoryValueType?: ValueType | undefined;
468
- categoryValue?: number | undefined;
469
- }, {
470
- isAppliedByCompany: boolean;
471
- shop: string | import("mongoose").Types.ObjectId;
472
- marketingType: MarketingType.DISCOUNT;
473
- duration: {
474
- start: string | Date;
475
- end?: string | Date | undefined;
476
- };
477
- value?: number | undefined;
478
- status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
479
- pausedAt?: string | Date | null | undefined;
480
- valueType?: ValueType | undefined;
481
- products?: {
655
+ }, {
482
656
  product: string | import("mongoose").Types.ObjectId;
483
657
  value?: number | undefined;
484
658
  marketing?: string | import("mongoose").Types.ObjectId | undefined;
485
659
  isBuy1Get1?: boolean | undefined;
486
660
  valueType?: ValueType | null | undefined;
487
- }[] | undefined;
488
- categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
489
- isEntireMenu?: boolean | undefined;
490
- spendLimit?: number | undefined;
491
- isSpendLimitEnabled?: boolean | undefined;
492
- isOnlyForSubscriber?: boolean | undefined;
493
- categoryValueType?: ValueType | undefined;
494
- categoryValue?: number | undefined;
495
- maxDiscountPerOrder?: number | undefined;
496
- isMaxDiscountPerOrderEnabled?: boolean | undefined;
497
- }>, {
498
- isAppliedByCompany: boolean;
499
- shop: import("mongoose").Types.ObjectId;
500
- status: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus;
501
- marketingType: MarketingType.DISCOUNT;
502
- duration: {
661
+ }>, "many">>>>;
662
+ excludeProducts: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>, "many">>>>;
663
+ maxDiscountPerOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
664
+ isMaxDiscountPerOrderEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
665
+ spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
666
+ isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
667
+ isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
668
+ shop: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
669
+ isAppliedByCompany: z.ZodOptional<z.ZodBoolean>;
670
+ duration: z.ZodOptional<z.ZodObject<{
671
+ start: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
672
+ end: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>;
673
+ }, "strip", z.ZodTypeAny, {
503
674
  start: Date;
504
675
  end?: Date | undefined;
505
- };
506
- pausedAt: Date | null;
507
- products: {
508
- product: import("mongoose").Types.ObjectId;
509
- value?: number | undefined;
510
- marketing?: import("mongoose").Types.ObjectId | undefined;
511
- isBuy1Get1?: boolean | undefined;
512
- valueType?: ValueType | null | undefined;
513
- }[];
514
- categories: import("mongoose").Types.ObjectId[];
515
- isEntireMenu: boolean;
516
- spendLimit: number;
517
- isSpendLimitEnabled: boolean;
518
- isOnlyForSubscriber: boolean;
519
- maxDiscountPerOrder: number;
520
- isMaxDiscountPerOrderEnabled: boolean;
521
- value?: number | undefined;
522
- valueType?: ValueType | undefined;
523
- categoryValueType?: ValueType | undefined;
524
- categoryValue?: number | undefined;
525
- }, {
526
- isAppliedByCompany: boolean;
527
- shop: string | import("mongoose").Types.ObjectId;
528
- marketingType: MarketingType.DISCOUNT;
529
- duration: {
676
+ }, {
530
677
  start: string | Date;
531
678
  end?: string | Date | undefined;
532
- };
533
- value?: number | undefined;
534
- status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
535
- pausedAt?: string | Date | null | undefined;
536
- valueType?: ValueType | undefined;
537
- products?: {
538
- product: string | import("mongoose").Types.ObjectId;
539
- value?: number | undefined;
540
- marketing?: string | import("mongoose").Types.ObjectId | undefined;
541
- isBuy1Get1?: boolean | undefined;
542
- valueType?: ValueType | null | undefined;
543
- }[] | undefined;
544
- categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
545
- isEntireMenu?: boolean | undefined;
546
- spendLimit?: number | undefined;
547
- isSpendLimitEnabled?: boolean | undefined;
548
- isOnlyForSubscriber?: boolean | undefined;
549
- categoryValueType?: ValueType | undefined;
550
- categoryValue?: number | undefined;
551
- maxDiscountPerOrder?: number | undefined;
552
- isMaxDiscountPerOrderEnabled?: boolean | undefined;
553
- }>;
679
+ }>>;
680
+ status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
681
+ pausedAt: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
682
+ admin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
683
+ _id: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
684
+ }, z.ZodTypeAny, "passthrough">>;
554
685
  export { DiscountMarketingValidationSchemaRefined as DiscountMarketingValidationSchema, DiscountMarketingSchema, DiscountMarketingIdSchema as DiscountMarketingIdValidationSchema, UpdateDiscountMarketingSchema, };
555
686
  export type CreateDiscountMarketingDTO = DTO<typeof DiscountMarketingValidationSchema>;
556
687
  export type DiscountMarketingDTO = DTO<typeof DiscountMarketingSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"discount-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/discount-marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAkC7E,QAAA,MACa,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAC/B,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAC3B,yBAAyB,mNACrB,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACQ,CAAC;AAErD,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoC7C,CAAC;AAKF,OAAO,EACN,wCAAwC,IAAI,iCAAiC,EAC7E,uBAAuB,EACvB,yBAAyB,IAAI,mCAAmC,EAChE,6BAA6B,GAC7B,CAAC;AAKF,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,iCAAiC,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
1
+ {"version":3,"file":"discount-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/discount-marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAqC7E,QAAA,MACa,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAC/B,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAC3B,yBAAyB,iNAEgB,CAAC;AAErD,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyC7C,CAAC;AAEF,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAYlC,CAAC;AAKF,OAAO,EACN,wCAAwC,IAAI,iCAAiC,EAC7E,uBAAuB,EACvB,yBAAyB,IAAI,mCAAmC,EAChE,6BAA6B,GAC7B,CAAC;AAKF,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,iCAAiC,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -16,6 +16,9 @@ const baseFields = {
16
16
  valueType: global_validation_1.ZodValidation.enumType(enum_1.ValueType, 'Value type').optional(),
17
17
  value: global_validation_1.ZodValidation.number('Value').optional(),
18
18
  products: global_validation_1.ZodValidation.array(zod_1.z.object(product_marketing_validation_1.baseFields), 'Products').optional().default([]),
19
+ excludeProducts: global_validation_1.ZodValidation.array(global_validation_1.ZodValidation.objectId('Exclude Product'), 'Exclude Products')
20
+ .optional()
21
+ .default([]),
19
22
  maxDiscountPerOrder: global_validation_1.ZodValidation.number('Max discount per order').default(0),
20
23
  isMaxDiscountPerOrderEnabled: global_validation_1.ZodValidation.boolean('Is max discount per order enabled').default(false),
21
24
  spendLimit: global_validation_1.ZodValidation.number('Spend limit').default(0),
@@ -23,10 +26,9 @@ const baseFields = {
23
26
  isOnlyForSubscriber: global_validation_1.ZodValidation.boolean('IsOnlyForSubscriber').default(false),
24
27
  };
25
28
  const schemaBuilder = (0, global_validation_1.createSchemaBuilder)(baseFields);
26
- const { BaseSchema: DiscountMarketingValidationSchema, EntitySchema: DiscountMarketingSchema, IdSchema: DiscountMarketingIdSchema, UpdateSchema: UpdateDiscountMarketingSchema, } = schemaBuilder.getAllSchemas({ createdAt: true });
29
+ const { BaseSchema: DiscountMarketingValidationSchema, EntitySchema: DiscountMarketingSchema, IdSchema: DiscountMarketingIdSchema, UpdateSchema: UpdateDiscountMarketingSchemaWithoutRefinement, } = schemaBuilder.getAllSchemas({ createdAt: true });
27
30
  exports.DiscountMarketingSchema = DiscountMarketingSchema;
28
31
  exports.DiscountMarketingIdValidationSchema = DiscountMarketingIdSchema;
29
- exports.UpdateDiscountMarketingSchema = UpdateDiscountMarketingSchema;
30
32
  const DiscountMarketingValidationSchemaRefined = DiscountMarketingValidationSchema.superRefine((data, ctx) => {
31
33
  if (data.maxDiscountPerOrder && data.spendLimit) {
32
34
  if (data.maxDiscountPerOrder > data.spendLimit) {
@@ -51,7 +53,9 @@ const DiscountMarketingValidationSchemaRefined = DiscountMarketingValidationSche
51
53
  path: ['products', 'value', 'valueType', 'isEntireMenu'],
52
54
  });
53
55
  }
54
- if (data.products.length < 1 && data.categories.length < 1 && !(data.value && data.valueType && data.isEntireMenu)) {
56
+ if (data.products.length < 1 &&
57
+ data.categories.length < 1 &&
58
+ !(data.value && data.valueType && data.isEntireMenu)) {
55
59
  ctx.addIssue({
56
60
  code: zod_1.z.ZodIssueCode.custom,
57
61
  message: 'Please provide discount information for individual products or categories or the entire menu',
@@ -60,4 +64,16 @@ const DiscountMarketingValidationSchemaRefined = DiscountMarketingValidationSche
60
64
  }
61
65
  });
62
66
  exports.DiscountMarketingValidationSchema = DiscountMarketingValidationSchemaRefined;
67
+ const UpdateDiscountMarketingSchema = UpdateDiscountMarketingSchemaWithoutRefinement.superRefine((data, ctx) => {
68
+ if (data.maxDiscountPerOrder && data.spendLimit) {
69
+ if (data.maxDiscountPerOrder > data.spendLimit) {
70
+ ctx.addIssue({
71
+ code: zod_1.z.ZodIssueCode.custom,
72
+ message: 'Spend limit cannot be less than max discount per order',
73
+ path: ['maxDiscountPerOrder', 'spendLimit'],
74
+ });
75
+ }
76
+ }
77
+ });
78
+ exports.UpdateDiscountMarketingSchema = UpdateDiscountMarketingSchema;
63
79
  //# sourceMappingURL=discount-marketing.validation.js.map