@lyxa.ai/marketing 1.0.26 → 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.
- package/dist/lib/index.d.ts +11 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts +7 -0
- package/dist/lib/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/lib/modules/coupon/routers/coupon.router.js +6 -0
- package/dist/lib/modules/coupon/routers/coupon.router.js.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.d.ts +1 -0
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +22 -0
- package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts +4 -4
- package/dist/lib/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/lib/modules/marketing/routers/marketing.router.js +0 -2
- package/dist/lib/modules/marketing/routers/marketing.router.js.map +1 -1
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js +38 -18
- package/dist/lib/modules/marketing/services/buy1-get1-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/discount-marketing.service.js +37 -17
- package/dist/lib/modules/marketing/services/discount-marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/lib/modules/marketing/services/marketing.service.js +4 -1
- package/dist/lib/modules/marketing/services/marketing.service.js.map +1 -1
- package/dist/lib/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts +2 -0
- package/dist/lib/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/transformers/discount-marketing.transformer.d.ts +2 -0
- package/dist/lib/modules/marketing/transformers/discount-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/transformers/featured-marketing.transformer.d.ts +1 -0
- package/dist/lib/modules/marketing/transformers/featured-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts +1 -0
- package/dist/lib/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/transformers/punch-marketing.transformer.d.ts +1 -0
- package/dist/lib/modules/marketing/transformers/punch-marketing.transformer.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +28 -0
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.js +1 -0
- package/dist/lib/modules/marketing/validations/buy1-get1-marketing.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts +254 -123
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.js +19 -3
- package/dist/lib/modules/marketing/validations/discount-marketing.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/featured-marketing.validation.d.ts +14 -0
- package/dist/lib/modules/marketing/validations/featured-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.d.ts +107 -26
- package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.js +34 -2
- package/dist/lib/modules/marketing/validations/free-delivery-marketing.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts +10 -0
- package/dist/lib/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/marketing.validation.js +1 -0
- package/dist/lib/modules/marketing/validations/marketing.validation.js.map +1 -1
- package/dist/lib/modules/marketing/validations/punch-marketing.validation.d.ts +127 -30
- package/dist/lib/modules/marketing/validations/punch-marketing.validation.d.ts.map +1 -1
- package/dist/lib/modules/marketing/validations/punch-marketing.validation.js +80 -2
- package/dist/lib/modules/marketing/validations/punch-marketing.validation.js.map +1 -1
- package/dist/types/index.d.ts +11 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/coupon/routers/coupon.router.d.ts +7 -0
- package/dist/types/modules/coupon/routers/coupon.router.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/coupon.service.d.ts +1 -0
- package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/routers/marketing.router.d.ts +4 -4
- package/dist/types/modules/marketing/routers/marketing.router.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/buy1-get1-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/discount-marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/services/marketing.service.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts +2 -0
- package/dist/types/modules/marketing/transformers/buy1-get1-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/discount-marketing.transformer.d.ts +2 -0
- package/dist/types/modules/marketing/transformers/discount-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/featured-marketing.transformer.d.ts +1 -0
- package/dist/types/modules/marketing/transformers/featured-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts +1 -0
- package/dist/types/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/transformers/punch-marketing.transformer.d.ts +1 -0
- package/dist/types/modules/marketing/transformers/punch-marketing.transformer.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts +28 -0
- package/dist/types/modules/marketing/validations/buy1-get1-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts +254 -123
- package/dist/types/modules/marketing/validations/discount-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/featured-marketing.validation.d.ts +14 -0
- package/dist/types/modules/marketing/validations/featured-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/free-delivery-marketing.validation.d.ts +107 -26
- package/dist/types/modules/marketing/validations/free-delivery-marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts +10 -0
- package/dist/types/modules/marketing/validations/marketing.validation.d.ts.map +1 -1
- package/dist/types/modules/marketing/validations/punch-marketing.validation.d.ts +127 -30
- package/dist/types/modules/marketing/validations/punch-marketing.validation.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/lib/modules/marketing/transformers/free-delivery-marketing.transformer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"free-delivery-marketing.transformer.d.ts","sourceRoot":"/","sources":["modules/marketing/transformers/free-delivery-marketing.transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,IAAI,KAAK,EAAE,MAAM,mFAAmF,CAAC;AAMnI,eAAO,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"free-delivery-marketing.transformer.d.ts","sourceRoot":"/","sources":["modules/marketing/transformers/free-delivery-marketing.transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,IAAI,KAAK,EAAE,MAAM,mFAAmF,CAAC;AAMnI,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;4CAAwC,CAAC"}
|
|
@@ -21,6 +21,7 @@ export declare const punchMarketingTransformer: import("@lyxa.ai/core/dist/utili
|
|
|
21
21
|
}>>;
|
|
22
22
|
status: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
23
23
|
pausedAt: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, Date, string>, import("zod").ZodDate]>, Date, string | Date>, Date, string | Date>>>>>;
|
|
24
|
+
admin: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>>>;
|
|
24
25
|
_id: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
25
26
|
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
26
27
|
//# sourceMappingURL=punch-marketing.transformer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"punch-marketing.transformer.d.ts","sourceRoot":"/","sources":["modules/marketing/transformers/punch-marketing.transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,KAAK,EAAE,MAAM,2EAA2E,CAAC;AAMpH,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"punch-marketing.transformer.d.ts","sourceRoot":"/","sources":["modules/marketing/transformers/punch-marketing.transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,KAAK,EAAE,MAAM,2EAA2E,CAAC;AAMpH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;4CAAwC,CAAC"}
|
|
@@ -24,6 +24,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
24
24
|
isBuy1Get1?: boolean | undefined;
|
|
25
25
|
valueType?: ValueType | null | undefined;
|
|
26
26
|
}>, "many">>>;
|
|
27
|
+
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">>>;
|
|
27
28
|
spendLimit: z.ZodDefault<z.ZodNumber>;
|
|
28
29
|
isSpendLimitEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
29
30
|
isOnlyForSubscriber: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -41,6 +42,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
41
42
|
}>;
|
|
42
43
|
status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
|
|
43
44
|
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>>>>;
|
|
45
|
+
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>]>>>;
|
|
44
46
|
}, "strict", z.ZodTypeAny, {
|
|
45
47
|
isAppliedByCompany: boolean;
|
|
46
48
|
shop: import("mongoose").Types.ObjectId;
|
|
@@ -60,9 +62,11 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
60
62
|
}[];
|
|
61
63
|
categories: import("mongoose").Types.ObjectId[];
|
|
62
64
|
isEntireMenu: boolean;
|
|
65
|
+
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
63
66
|
spendLimit: number;
|
|
64
67
|
isSpendLimitEnabled: boolean;
|
|
65
68
|
isOnlyForSubscriber: boolean;
|
|
69
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
66
70
|
}, {
|
|
67
71
|
isAppliedByCompany: boolean;
|
|
68
72
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -73,6 +77,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
73
77
|
};
|
|
74
78
|
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
75
79
|
pausedAt?: string | Date | null | undefined;
|
|
80
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
76
81
|
products?: {
|
|
77
82
|
product: string | import("mongoose").Types.ObjectId;
|
|
78
83
|
value?: number | undefined;
|
|
@@ -82,6 +87,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
82
87
|
}[] | undefined;
|
|
83
88
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
84
89
|
isEntireMenu?: boolean | undefined;
|
|
90
|
+
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
85
91
|
spendLimit?: number | undefined;
|
|
86
92
|
isSpendLimitEnabled?: boolean | undefined;
|
|
87
93
|
isOnlyForSubscriber?: boolean | undefined;
|
|
@@ -108,6 +114,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
108
114
|
isBuy1Get1?: boolean | undefined;
|
|
109
115
|
valueType?: ValueType | null | undefined;
|
|
110
116
|
}>, "many">>>>;
|
|
117
|
+
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">>>>;
|
|
111
118
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
112
119
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
113
120
|
isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -125,6 +132,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
125
132
|
}>>;
|
|
126
133
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
127
134
|
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>>>>>;
|
|
135
|
+
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>]>>>>;
|
|
128
136
|
_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>]>>;
|
|
129
137
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
130
138
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.BUY1GET1>>;
|
|
@@ -149,6 +157,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
149
157
|
isBuy1Get1?: boolean | undefined;
|
|
150
158
|
valueType?: ValueType | null | undefined;
|
|
151
159
|
}>, "many">>>>;
|
|
160
|
+
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">>>>;
|
|
152
161
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
153
162
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
154
163
|
isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -166,6 +175,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
166
175
|
}>>;
|
|
167
176
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
168
177
|
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>>>>>;
|
|
178
|
+
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>]>>>>;
|
|
169
179
|
_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>]>>;
|
|
170
180
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
171
181
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.BUY1GET1>>;
|
|
@@ -190,6 +200,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
190
200
|
isBuy1Get1?: boolean | undefined;
|
|
191
201
|
valueType?: ValueType | null | undefined;
|
|
192
202
|
}>, "many">>>>;
|
|
203
|
+
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">>>>;
|
|
193
204
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
194
205
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
195
206
|
isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -207,6 +218,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
207
218
|
}>>;
|
|
208
219
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
209
220
|
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>>>>>;
|
|
221
|
+
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>]>>>>;
|
|
210
222
|
_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>]>>;
|
|
211
223
|
}, z.ZodTypeAny, "passthrough">>, Buy1Get1MarketingIdSchema: 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>]>, UpdateBuy1Get1MarketingSchema: z.ZodObject<{
|
|
212
224
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
@@ -237,6 +249,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
237
249
|
isBuy1Get1?: boolean | undefined;
|
|
238
250
|
valueType?: ValueType | null | undefined;
|
|
239
251
|
}>, "many">>>>;
|
|
252
|
+
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">>>>;
|
|
240
253
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
241
254
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
242
255
|
isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -254,6 +267,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
254
267
|
}>>;
|
|
255
268
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
256
269
|
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>>>>>;
|
|
270
|
+
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>]>>>>;
|
|
257
271
|
_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>]>>;
|
|
258
272
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
259
273
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.BUY1GET1>>;
|
|
@@ -278,6 +292,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
278
292
|
isBuy1Get1?: boolean | undefined;
|
|
279
293
|
valueType?: ValueType | null | undefined;
|
|
280
294
|
}>, "many">>>>;
|
|
295
|
+
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">>>>;
|
|
281
296
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
282
297
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
283
298
|
isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -295,6 +310,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
295
310
|
}>>;
|
|
296
311
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
297
312
|
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>>>>>;
|
|
313
|
+
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>]>>>>;
|
|
298
314
|
_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>]>>;
|
|
299
315
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
300
316
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.BUY1GET1>>;
|
|
@@ -319,6 +335,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
319
335
|
isBuy1Get1?: boolean | undefined;
|
|
320
336
|
valueType?: ValueType | null | undefined;
|
|
321
337
|
}>, "many">>>>;
|
|
338
|
+
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">>>>;
|
|
322
339
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
323
340
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
324
341
|
isOnlyForSubscriber: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -336,6 +353,7 @@ declare const Buy1Get1MarketingValidationSchema: z.ZodObject<{
|
|
|
336
353
|
}>>;
|
|
337
354
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
338
355
|
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>>>>>;
|
|
356
|
+
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>]>>>>;
|
|
339
357
|
_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>]>>;
|
|
340
358
|
}, z.ZodTypeAny, "passthrough">>;
|
|
341
359
|
declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject<{
|
|
@@ -361,6 +379,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
361
379
|
isBuy1Get1?: boolean | undefined;
|
|
362
380
|
valueType?: ValueType | null | undefined;
|
|
363
381
|
}>, "many">>>;
|
|
382
|
+
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">>>;
|
|
364
383
|
spendLimit: z.ZodDefault<z.ZodNumber>;
|
|
365
384
|
isSpendLimitEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
366
385
|
isOnlyForSubscriber: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -378,6 +397,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
378
397
|
}>;
|
|
379
398
|
status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
|
|
380
399
|
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>>>>;
|
|
400
|
+
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>]>>>;
|
|
381
401
|
}, "strict", z.ZodTypeAny, {
|
|
382
402
|
isAppliedByCompany: boolean;
|
|
383
403
|
shop: import("mongoose").Types.ObjectId;
|
|
@@ -397,9 +417,11 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
397
417
|
}[];
|
|
398
418
|
categories: import("mongoose").Types.ObjectId[];
|
|
399
419
|
isEntireMenu: boolean;
|
|
420
|
+
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
400
421
|
spendLimit: number;
|
|
401
422
|
isSpendLimitEnabled: boolean;
|
|
402
423
|
isOnlyForSubscriber: boolean;
|
|
424
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
403
425
|
}, {
|
|
404
426
|
isAppliedByCompany: boolean;
|
|
405
427
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -410,6 +432,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
410
432
|
};
|
|
411
433
|
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
412
434
|
pausedAt?: string | Date | null | undefined;
|
|
435
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
413
436
|
products?: {
|
|
414
437
|
product: string | import("mongoose").Types.ObjectId;
|
|
415
438
|
value?: number | undefined;
|
|
@@ -419,6 +442,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
419
442
|
}[] | undefined;
|
|
420
443
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
421
444
|
isEntireMenu?: boolean | undefined;
|
|
445
|
+
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
422
446
|
spendLimit?: number | undefined;
|
|
423
447
|
isSpendLimitEnabled?: boolean | undefined;
|
|
424
448
|
isOnlyForSubscriber?: boolean | undefined;
|
|
@@ -441,9 +465,11 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
441
465
|
}[];
|
|
442
466
|
categories: import("mongoose").Types.ObjectId[];
|
|
443
467
|
isEntireMenu: boolean;
|
|
468
|
+
excludeProducts: import("mongoose").Types.ObjectId[];
|
|
444
469
|
spendLimit: number;
|
|
445
470
|
isSpendLimitEnabled: boolean;
|
|
446
471
|
isOnlyForSubscriber: boolean;
|
|
472
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
447
473
|
}, {
|
|
448
474
|
isAppliedByCompany: boolean;
|
|
449
475
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -454,6 +480,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
454
480
|
};
|
|
455
481
|
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
456
482
|
pausedAt?: string | Date | null | undefined;
|
|
483
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
457
484
|
products?: {
|
|
458
485
|
product: string | import("mongoose").Types.ObjectId;
|
|
459
486
|
value?: number | undefined;
|
|
@@ -463,6 +490,7 @@ declare const Buy1Get1MarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
463
490
|
}[] | undefined;
|
|
464
491
|
categories?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
465
492
|
isEntireMenu?: boolean | undefined;
|
|
493
|
+
excludeProducts?: (string | import("mongoose").Types.ObjectId)[] | undefined;
|
|
466
494
|
spendLimit?: number | undefined;
|
|
467
495
|
isSpendLimitEnabled?: boolean | undefined;
|
|
468
496
|
isOnlyForSubscriber?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buy1-get1-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/buy1-get1-marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"buy1-get1-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/buy1-get1-marketing.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGN,GAAG,EACH,MAAM,2DAA2D,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AA4B7E,QAAA,MACa,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAC/B,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAC3B,yBAAyB,mNACrB,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACQ,CAAC;AAErD,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B7C,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"}
|
|
@@ -12,6 +12,7 @@ const baseFields = {
|
|
|
12
12
|
categories: global_validation_1.ZodValidation.array(global_validation_1.ZodValidation.objectId('Category'), 'Categories').optional().default([]),
|
|
13
13
|
isEntireMenu: global_validation_1.ZodValidation.boolean('IsEntireMenu').default(false),
|
|
14
14
|
products: global_validation_1.ZodValidation.array(zod_1.z.object(product_marketing_validation_1.baseFields), "Products").optional().default([]),
|
|
15
|
+
excludeProducts: global_validation_1.ZodValidation.array(global_validation_1.ZodValidation.objectId('Exclude Product'), 'Exclude Products').optional().default([]),
|
|
15
16
|
spendLimit: global_validation_1.ZodValidation.number('Spend limit').default(0),
|
|
16
17
|
isSpendLimitEnabled: global_validation_1.ZodValidation.boolean('Is spend limit enabled').default(false),
|
|
17
18
|
isOnlyForSubscriber: global_validation_1.ZodValidation.boolean('IsOnlyForSubscriber').default(false),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buy1-get1-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/buy1-get1-marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,iEAA6D;AAC7D,4DAA6E;AAC7E,iFAA0F;AAK1F,MAAM,UAAU,GAAG;IAClB,GAAG,0CAAmB;IACtB,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAa,CAAC,QAAQ,CAAC;IAChD,UAAU,EAAE,iCAAa,CAAC,KAAK,CAAC,iCAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACxG,YAAY,EAAE,iCAAa,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAClE,QAAQ,EAAE,iCAAa,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,yCAA0B,CAAC,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACtG,UAAU,EAAE,iCAAa,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,mBAAmB,EAAE,iCAAa,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACnF,mBAAmB,EAAE,iCAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;CAChF,CAAC;AAOF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AAKtD,MAAM,EACL,UAAU,EAAE,iCAAiC,EAC7C,YAAY,EAAE,uBAAuB,EACrC,QAAQ,EAAE,yBAAyB,EACnC,YAAY,EAAE,6BAA6B,GAC3C,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAoCpD,0DAAuB;AACM,wEAAmC;AAChE,sEAA6B;AApC9B,MAAM,wCAAwC,GAAG,iCAAiC,CAAC,WAAW,CAC7F,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAEb,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACrD,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,iDAAiD;YAC1D,IAAI,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;SACpC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACnD,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,+CAA+C;YACxD,IAAI,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC;SAClC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClF,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,6DAA6D;YACtE,IAAI,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC;SAChD,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CACD,CAAC;AAM2C,qFAAiC","sourcesContent":["import { z } from 'zod';\nimport {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { baseMarketingFields } from './marketing.validation';\nimport { MarketingType, ValueType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { baseFields as baseProductMarketingFields } from './product-marketing.validation';\n\n/**\n * Define the base parent schema fields\n */\nconst baseFields = {\n\t...baseMarketingFields,\n\tmarketingType: z.literal(MarketingType.BUY1GET1),\n\tcategories: ZodValidation.array(ZodValidation.objectId('Category'), 'Categories').optional().default([]),\n\tisEntireMenu: ZodValidation.boolean('IsEntireMenu').default(false),\n\tproducts: ZodValidation.array(z.object(baseProductMarketingFields), \"Products\").optional().default([]),\n\tspendLimit: ZodValidation.number('Spend limit').default(0),\n\tisSpendLimitEnabled: ZodValidation.boolean('Is spend limit enabled').default(false),\n\tisOnlyForSubscriber: ZodValidation.boolean('IsOnlyForSubscriber').default(false),\n};\n\n/**\n * Create schema builder for Parent entity\n * - Includes timestamps\n * - Excludes 'createdAt' from update operations\n */\nconst schemaBuilder = createSchemaBuilder(baseFields);\n\n/**\n * Get all schemas for the Parent entity\n */\nconst {\n\tBaseSchema: Buy1Get1MarketingValidationSchema,\n\tEntitySchema: Buy1Get1MarketingSchema,\n\tIdSchema: Buy1Get1MarketingIdSchema,\n\tUpdateSchema: UpdateBuy1Get1MarketingSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nconst Buy1Get1MarketingValidationSchemaRefined = Buy1Get1MarketingValidationSchema.superRefine(\n\t(data, ctx) => {\n\n\t\tif (data.categories.length > 0 && data.isEntireMenu) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide either categories or entire menu',\n\t\t\t\tpath: ['categories', 'isEntireMenu'],\n\t\t\t});\n\t\t}\n\n\t\tif (data.products.length > 0 && data.isEntireMenu) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide either products or entire menu',\n\t\t\t\tpath: ['products', 'isEntireMenu'],\n\t\t\t});\n\t\t}\n\n\t\tif (data.categories.length < 1 && data.products.length < 1 && !data.isEntireMenu) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide either categories or products or entire menu',\n\t\t\t\tpath: ['categories', 'products', 'isEntireMenu'],\n\t\t\t});\n\t\t}\n\t}\n);\n\n/**\n * Export schemas\n */\nexport {\n\tBuy1Get1MarketingValidationSchemaRefined as Buy1Get1MarketingValidationSchema,\n\tBuy1Get1MarketingSchema,\n\tBuy1Get1MarketingIdSchema as Buy1Get1MarketingIdValidationSchema,\n\tUpdateBuy1Get1MarketingSchema,\n};\n\n/**\n * Export DTO types\n */\nexport type CreateBuy1Get1MarketingDTO = DTO<typeof Buy1Get1MarketingValidationSchema>;\nexport type Buy1Get1MarketingDTO = DTO<typeof Buy1Get1MarketingSchema>;\nexport type UpdateBuy1Get1MarketingDTO = DTO<typeof UpdateBuy1Get1MarketingSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"buy1-get1-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/buy1-get1-marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,iEAA6D;AAC7D,4DAA6E;AAC7E,iFAA0F;AAK1F,MAAM,UAAU,GAAG;IAClB,GAAG,0CAAmB;IACtB,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAa,CAAC,QAAQ,CAAC;IAChD,UAAU,EAAE,iCAAa,CAAC,KAAK,CAAC,iCAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACxG,YAAY,EAAE,iCAAa,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAClE,QAAQ,EAAE,iCAAa,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,yCAA0B,CAAC,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACtG,eAAe,EAAE,iCAAa,CAAC,KAAK,CAAC,iCAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC1H,UAAU,EAAE,iCAAa,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,mBAAmB,EAAE,iCAAa,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACnF,mBAAmB,EAAE,iCAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;CAChF,CAAC;AAOF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AAKtD,MAAM,EACL,UAAU,EAAE,iCAAiC,EAC7C,YAAY,EAAE,uBAAuB,EACrC,QAAQ,EAAE,yBAAyB,EACnC,YAAY,EAAE,6BAA6B,GAC3C,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAoCpD,0DAAuB;AACM,wEAAmC;AAChE,sEAA6B;AApC9B,MAAM,wCAAwC,GAAG,iCAAiC,CAAC,WAAW,CAC7F,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAEb,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACrD,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,iDAAiD;YAC1D,IAAI,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;SACpC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACnD,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,+CAA+C;YACxD,IAAI,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC;SAClC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClF,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,6DAA6D;YACtE,IAAI,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC;SAChD,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CACD,CAAC;AAM2C,qFAAiC","sourcesContent":["import { z } from 'zod';\nimport {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { baseMarketingFields } from './marketing.validation';\nimport { MarketingType, ValueType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { baseFields as baseProductMarketingFields } from './product-marketing.validation';\n\n/**\n * Define the base parent schema fields\n */\nconst baseFields = {\n\t...baseMarketingFields,\n\tmarketingType: z.literal(MarketingType.BUY1GET1),\n\tcategories: ZodValidation.array(ZodValidation.objectId('Category'), 'Categories').optional().default([]),\n\tisEntireMenu: ZodValidation.boolean('IsEntireMenu').default(false),\n\tproducts: ZodValidation.array(z.object(baseProductMarketingFields), \"Products\").optional().default([]),\n\texcludeProducts: ZodValidation.array(ZodValidation.objectId('Exclude Product'), 'Exclude Products').optional().default([]),\n\tspendLimit: ZodValidation.number('Spend limit').default(0),\n\tisSpendLimitEnabled: ZodValidation.boolean('Is spend limit enabled').default(false),\n\tisOnlyForSubscriber: ZodValidation.boolean('IsOnlyForSubscriber').default(false),\n};\n\n/**\n * Create schema builder for Parent entity\n * - Includes timestamps\n * - Excludes 'createdAt' from update operations\n */\nconst schemaBuilder = createSchemaBuilder(baseFields);\n\n/**\n * Get all schemas for the Parent entity\n */\nconst {\n\tBaseSchema: Buy1Get1MarketingValidationSchema,\n\tEntitySchema: Buy1Get1MarketingSchema,\n\tIdSchema: Buy1Get1MarketingIdSchema,\n\tUpdateSchema: UpdateBuy1Get1MarketingSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nconst Buy1Get1MarketingValidationSchemaRefined = Buy1Get1MarketingValidationSchema.superRefine(\n\t(data, ctx) => {\n\n\t\tif (data.categories.length > 0 && data.isEntireMenu) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide either categories or entire menu',\n\t\t\t\tpath: ['categories', 'isEntireMenu'],\n\t\t\t});\n\t\t}\n\n\t\tif (data.products.length > 0 && data.isEntireMenu) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide either products or entire menu',\n\t\t\t\tpath: ['products', 'isEntireMenu'],\n\t\t\t});\n\t\t}\n\n\t\tif (data.categories.length < 1 && data.products.length < 1 && !data.isEntireMenu) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide either categories or products or entire menu',\n\t\t\t\tpath: ['categories', 'products', 'isEntireMenu'],\n\t\t\t});\n\t\t}\n\t}\n);\n\n/**\n * Export schemas\n */\nexport {\n\tBuy1Get1MarketingValidationSchemaRefined as Buy1Get1MarketingValidationSchema,\n\tBuy1Get1MarketingSchema,\n\tBuy1Get1MarketingIdSchema as Buy1Get1MarketingIdValidationSchema,\n\tUpdateBuy1Get1MarketingSchema,\n};\n\n/**\n * Export DTO types\n */\nexport type CreateBuy1Get1MarketingDTO = DTO<typeof Buy1Get1MarketingValidationSchema>;\nexport type Buy1Get1MarketingDTO = DTO<typeof Buy1Get1MarketingSchema>;\nexport type UpdateBuy1Get1MarketingDTO = DTO<typeof UpdateBuy1Get1MarketingSchema>;\n"]}
|