@lyxa.ai/marketing 1.0.27 → 1.0.29
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 +2 -2
- package/dist/lib/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/coupon.service.js +36 -32
- package/dist/lib/modules/coupon/services/coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/custom-coupon.service.js +6 -0
- package/dist/lib/modules/coupon/services/custom-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/global-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/global-coupon.service.js +6 -0
- package/dist/lib/modules/coupon/services/global-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/helper.service.d.ts +12 -0
- package/dist/lib/modules/coupon/services/helper.service.d.ts.map +1 -0
- package/dist/lib/modules/coupon/services/helper.service.js +147 -0
- package/dist/lib/modules/coupon/services/helper.service.js.map +1 -0
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.js +6 -0
- package/dist/lib/modules/coupon/services/individual-store-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/individual-user-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/individual-user-coupon.service.js +7 -1
- package/dist/lib/modules/coupon/services/individual-user-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.d.ts +6 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js +102 -6
- package/dist/lib/modules/coupon/services/patterns/repository/CouponRepository.js.map +1 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.d.ts +0 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.js +14 -14
- package/dist/lib/modules/coupon/services/referral-code-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.d.ts +2 -1
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.js +22 -20
- package/dist/lib/modules/coupon/services/referral-reward-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.js +8 -1
- package/dist/lib/modules/coupon/services/shops-categories-coupon.service.js.map +1 -1
- package/dist/lib/modules/coupon/validations/coupon.validation.js +3 -6
- package/dist/lib/modules/coupon/validations/coupon.validation.js.map +1 -1
- package/dist/lib/modules/deal-setting/routers/deal-setting.router.d.ts.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts +2 -0
- package/dist/lib/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js +32 -8
- package/dist/lib/modules/deal-setting/services/deal-setting.service.js.map +1 -1
- package/dist/lib/modules/featured-setting/routers/featured-setting.router.d.ts.map +1 -1
- package/dist/lib/modules/featured-setting/services/featured-setting.service.d.ts +2 -0
- package/dist/lib/modules/featured-setting/services/featured-setting.service.d.ts.map +1 -1
- package/dist/lib/modules/featured-setting/services/featured-setting.service.js +54 -8
- package/dist/lib/modules/featured-setting/services/featured-setting.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 +48 -20
- 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 +47 -19
- 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 +12 -2
- 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/featured-marketing.validation.js +12 -13
- package/dist/lib/modules/marketing/validations/featured-marketing.validation.js.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 +36 -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 +77 -2
- package/dist/lib/modules/marketing/validations/punch-marketing.validation.js.map +1 -1
- package/dist/lib/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.js +12 -9
- package/dist/lib/modules/punch-marketing-history/services/punch-marketing-history.service.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 +2 -2
- package/dist/types/modules/coupon/services/coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/custom-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/global-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/helper.service.d.ts +12 -0
- package/dist/types/modules/coupon/services/helper.service.d.ts.map +1 -0
- package/dist/types/modules/coupon/services/individual-store-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/individual-user-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponRepository.d.ts +6 -1
- package/dist/types/modules/coupon/services/patterns/repository/CouponRepository.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/referral-code-coupon.service.d.ts +0 -1
- package/dist/types/modules/coupon/services/referral-code-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/referral-reward-coupon.service.d.ts +2 -1
- package/dist/types/modules/coupon/services/referral-reward-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/coupon/services/shops-categories-coupon.service.d.ts.map +1 -1
- package/dist/types/modules/deal-setting/routers/deal-setting.router.d.ts.map +1 -1
- package/dist/types/modules/deal-setting/services/deal-setting.service.d.ts +2 -0
- package/dist/types/modules/deal-setting/services/deal-setting.service.d.ts.map +1 -1
- package/dist/types/modules/featured-setting/routers/featured-setting.router.d.ts.map +1 -1
- package/dist/types/modules/featured-setting/services/featured-setting.service.d.ts +2 -0
- package/dist/types/modules/featured-setting/services/featured-setting.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/dist/types/modules/punch-marketing-history/routers/punch-marketing-history.router.d.ts.map +1 -1
- package/dist/types/modules/punch-marketing-history/services/punch-marketing-history.service.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discount-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/discount-marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,4DAA6E;AAC7E,iEAA6D;AAC7D,iFAA0F;AAK1F,MAAM,UAAU,GAAG;IAClB,GAAG,0CAAmB;IACtB,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAa,CAAC,QAAQ,CAAC;IAChD,iBAAiB,EAAE,iCAAa,CAAC,QAAQ,CAAC,gBAAS,EAAE,qBAAqB,CAAC,CAAC,QAAQ,EAAE;IACtF,aAAa,EAAE,iCAAa,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IAChE,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,SAAS,EAAE,iCAAa,CAAC,QAAQ,CAAC,gBAAS,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE;IACrE,KAAK,EAAE,iCAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,iCAAa,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,yCAA0B,CAAC,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACtG,mBAAmB,EAAE,iCAAa,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,4BAA4B,EAAE,iCAAa,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACvG,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,
|
|
1
|
+
{"version":3,"file":"discount-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/discount-marketing.validation.ts"],"names":[],"mappings":"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","sourcesContent":["import { z } from 'zod';\nimport {\n\tZodValidation,\n\tcreateSchemaBuilder,\n\tDTO,\n} from '@lyxa.ai/core/dist/utilities/validation/global-validation';\nimport { MarketingType, ValueType } from '@lyxa.ai/core/dist/utilities/enum';\nimport { baseMarketingFields } from './marketing.validation';\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.DISCOUNT),\n\tcategoryValueType: ZodValidation.enumType(ValueType, 'Category value type').optional(),\n\tcategoryValue: ZodValidation.number('Category value').optional(),\n\tcategories: ZodValidation.array(ZodValidation.objectId('Category'), 'Categories').optional().default([]),\n\tisEntireMenu: ZodValidation.boolean('IsEntireMenu').default(false),\n\tvalueType: ZodValidation.enumType(ValueType, 'Value type').optional(),\n\tvalue: ZodValidation.number('Value').optional(),\n\tproducts: ZodValidation.array(z.object(baseProductMarketingFields), 'Products').optional().default([]),\n\texcludeProducts: ZodValidation.array(ZodValidation.objectId('Exclude Product'), 'Exclude Products')\n\t\t.optional()\n\t\t.default([]),\n\tmaxDiscountPerOrder: ZodValidation.number('Max discount per order').default(0),\n\tisMaxDiscountPerOrderEnabled: ZodValidation.boolean('Is max discount per order enabled').default(false),\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: DiscountMarketingValidationSchema,\n\tEntitySchema: DiscountMarketingSchema,\n\tIdSchema: DiscountMarketingIdSchema,\n\tUpdateSchema: UpdateDiscountMarketingSchemaWithoutRefinement,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nconst DiscountMarketingValidationSchemaRefined = DiscountMarketingValidationSchema.superRefine(\n\t(data, ctx) => {\n\t\tif (data.maxDiscountPerOrder && data.spendLimit) {\n\t\t\tif (data.maxDiscountPerOrder > data.spendLimit) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: 'Spend limit cannot be less than max discount per order',\n\t\t\t\t\tpath: ['maxDiscountPerOrder', 'spendLimit'],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (data.categories.length > 0 && (!data.categoryValue || !data.categoryValueType)) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide discount information for categories',\n\t\t\t\tpath: ['categories', 'categoryValue', 'categoryValueType'],\n\t\t\t});\n\t\t}\n\n\t\tif (data.products.length > 0 && (data.value || data.valueType || data.isEntireMenu)) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Please provide discount information for either individual products or the entire menu',\n\t\t\t\tpath: ['products', 'value', 'valueType', 'isEntireMenu'],\n\t\t\t});\n\t\t}\n\n\t\tif (\n\t\t\tdata.products.length < 1 &&\n\t\t\tdata.categories.length < 1 &&\n\t\t\t!(data.value && data.valueType && data.isEntireMenu)\n\t\t) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage:\n\t\t\t\t\t'Please provide discount information for individual products or categories or the entire menu',\n\t\t\t\tpath: ['products', 'value', 'valueType', 'isEntireMenu', 'categories'],\n\t\t\t});\n\t\t}\n\t}\n);\n\nconst UpdateDiscountMarketingSchema = UpdateDiscountMarketingSchemaWithoutRefinement.superRefine(\n\t(data, ctx) => {\n\t\tif (data.maxDiscountPerOrder && data.spendLimit) {\n\t\t\tif (data.maxDiscountPerOrder > data.spendLimit) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: 'Spend limit cannot be less than max discount per order',\n\t\t\t\t\tpath: ['maxDiscountPerOrder', 'spendLimit'],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n);\n\n/**\n * Export schemas\n */\nexport {\n\tDiscountMarketingValidationSchemaRefined as DiscountMarketingValidationSchema,\n\tDiscountMarketingSchema,\n\tDiscountMarketingIdSchema as DiscountMarketingIdValidationSchema,\n\tUpdateDiscountMarketingSchema,\n};\n\n/**\n * Export DTO types\n */\nexport type CreateDiscountMarketingDTO = DTO<typeof DiscountMarketingValidationSchema>;\nexport type DiscountMarketingDTO = DTO<typeof DiscountMarketingSchema>;\nexport type UpdateDiscountMarketingDTO = DTO<typeof UpdateDiscountMarketingSchema>;\n"]}
|
|
@@ -18,6 +18,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
18
18
|
}>;
|
|
19
19
|
status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
|
|
20
20
|
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>>>>;
|
|
21
|
+
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>]>>>;
|
|
21
22
|
}, "strict", z.ZodTypeAny, {
|
|
22
23
|
isAppliedByCompany: boolean;
|
|
23
24
|
shop: import("mongoose").Types.ObjectId;
|
|
@@ -29,6 +30,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
29
30
|
};
|
|
30
31
|
pausedAt: Date | null;
|
|
31
32
|
amount: number;
|
|
33
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
32
34
|
}, {
|
|
33
35
|
isAppliedByCompany: boolean;
|
|
34
36
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -40,6 +42,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
40
42
|
amount: number;
|
|
41
43
|
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
42
44
|
pausedAt?: string | Date | null | undefined;
|
|
45
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
43
46
|
}>, FeaturedMarketingSchema: z.ZodObject<{
|
|
44
47
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FEATURED>>;
|
|
45
48
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
@@ -57,6 +60,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
57
60
|
}>>;
|
|
58
61
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
59
62
|
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>>>>>;
|
|
63
|
+
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>]>>>>;
|
|
60
64
|
_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>]>>;
|
|
61
65
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
62
66
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FEATURED>>;
|
|
@@ -75,6 +79,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
75
79
|
}>>;
|
|
76
80
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
77
81
|
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>>>>>;
|
|
82
|
+
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>]>>>>;
|
|
78
83
|
_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>]>>;
|
|
79
84
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
80
85
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FEATURED>>;
|
|
@@ -93,6 +98,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
93
98
|
}>>;
|
|
94
99
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
95
100
|
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>>>>>;
|
|
101
|
+
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>]>>>>;
|
|
96
102
|
_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>]>>;
|
|
97
103
|
}, z.ZodTypeAny, "passthrough">>, FeaturedMarketingIdSchema: 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>]>, UpdateFeaturedMarketingSchema: z.ZodObject<{
|
|
98
104
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
@@ -117,6 +123,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
117
123
|
}>>;
|
|
118
124
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
119
125
|
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>>>>>;
|
|
126
|
+
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>]>>>>;
|
|
120
127
|
_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>]>>;
|
|
121
128
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
122
129
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FEATURED>>;
|
|
@@ -135,6 +142,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
135
142
|
}>>;
|
|
136
143
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
137
144
|
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>>>>>;
|
|
145
|
+
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>]>>>>;
|
|
138
146
|
_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>]>>;
|
|
139
147
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
140
148
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FEATURED>>;
|
|
@@ -153,6 +161,7 @@ declare const FeaturedMarketingValidationSchema: z.ZodObject<{
|
|
|
153
161
|
}>>;
|
|
154
162
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
155
163
|
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>>>>>;
|
|
164
|
+
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>]>>>>;
|
|
156
165
|
_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>]>>;
|
|
157
166
|
}, z.ZodTypeAny, "passthrough">>;
|
|
158
167
|
declare const FeaturedMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject<{
|
|
@@ -172,6 +181,7 @@ declare const FeaturedMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
172
181
|
}>;
|
|
173
182
|
status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
|
|
174
183
|
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>>>>;
|
|
184
|
+
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>]>>>;
|
|
175
185
|
}, "strict", z.ZodTypeAny, {
|
|
176
186
|
isAppliedByCompany: boolean;
|
|
177
187
|
shop: import("mongoose").Types.ObjectId;
|
|
@@ -183,6 +193,7 @@ declare const FeaturedMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
183
193
|
};
|
|
184
194
|
pausedAt: Date | null;
|
|
185
195
|
amount: number;
|
|
196
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
186
197
|
}, {
|
|
187
198
|
isAppliedByCompany: boolean;
|
|
188
199
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -194,6 +205,7 @@ declare const FeaturedMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
194
205
|
amount: number;
|
|
195
206
|
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
196
207
|
pausedAt?: string | Date | null | undefined;
|
|
208
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
197
209
|
}>, {
|
|
198
210
|
isAppliedByCompany: boolean;
|
|
199
211
|
shop: import("mongoose").Types.ObjectId;
|
|
@@ -205,6 +217,7 @@ declare const FeaturedMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
205
217
|
};
|
|
206
218
|
pausedAt: Date | null;
|
|
207
219
|
amount: number;
|
|
220
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
208
221
|
}, {
|
|
209
222
|
isAppliedByCompany: boolean;
|
|
210
223
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -216,6 +229,7 @@ declare const FeaturedMarketingValidationSchemaRefined: z.ZodEffects<z.ZodObject
|
|
|
216
229
|
amount: number;
|
|
217
230
|
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
218
231
|
pausedAt?: string | Date | null | undefined;
|
|
232
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
219
233
|
}>;
|
|
220
234
|
export { FeaturedMarketingValidationSchemaRefined as FeaturedMarketingValidationSchema, FeaturedMarketingSchema, FeaturedMarketingIdSchema as FeaturedMarketingIdValidationSchema, UpdateFeaturedMarketingSchema, };
|
|
221
235
|
export type CreateFeaturedMarketingDTO = DTO<typeof FeaturedMarketingValidationSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featured-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/featured-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,MAAM,mCAAmC,CAAC;AAsBlE,QAAA,MACa,iCAAiC
|
|
1
|
+
{"version":3,"file":"featured-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/featured-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,MAAM,mCAAmC,CAAC;AAsBlE,QAAA,MACa,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAC/B,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAC3B,yBAAyB,mNACrB,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCACQ,CAAC;AAErD,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuB7C,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,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.UpdateFeaturedMarketingSchema = exports.FeaturedMarketingIdValidationSchema = exports.FeaturedMarketingSchema = exports.FeaturedMarketingValidationSchema = void 0;
|
|
7
4
|
const zod_1 = require("zod");
|
|
8
5
|
const global_validation_1 = require("@lyxa.ai/core/dist/utilities/validation/global-validation");
|
|
9
6
|
const marketing_validation_1 = require("./marketing.validation");
|
|
10
7
|
const enum_1 = require("@lyxa.ai/core/dist/utilities/enum");
|
|
11
|
-
const dayjs_1 =
|
|
8
|
+
const dayjs_1 = require("@lyxa.ai/core/dist/utilities/dayjs");
|
|
12
9
|
const baseFields = {
|
|
13
10
|
...marketing_validation_1.baseMarketingFields,
|
|
14
11
|
marketingType: zod_1.z.literal(enum_1.MarketingType.FEATURED),
|
|
@@ -27,15 +24,17 @@ const FeaturedMarketingValidationSchemaRefined = FeaturedMarketingValidationSche
|
|
|
27
24
|
path: ['isAppliedByCompany'],
|
|
28
25
|
});
|
|
29
26
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
if (data.duration) {
|
|
28
|
+
const startDate = (0, dayjs_1.dayjs)(data.duration.start);
|
|
29
|
+
const endDate = (0, dayjs_1.dayjs)(data.duration.end);
|
|
30
|
+
const diff = endDate.diff(startDate, 'day');
|
|
31
|
+
if (diff < 3 || diff > 28) {
|
|
32
|
+
ctx.addIssue({
|
|
33
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
34
|
+
message: 'Duration should be between 3 and 28 days',
|
|
35
|
+
path: ['duration'],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
exports.FeaturedMarketingValidationSchema = FeaturedMarketingValidationSchemaRefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featured-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/featured-marketing.validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"featured-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/featured-marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,iEAA6D;AAC7D,4DAAkE;AAClE,8DAA2D;AAK3D,MAAM,UAAU,GAAG;IAClB,GAAG,0CAAmB;IACtB,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAa,CAAC,QAAQ,CAAC;IAChD,MAAM,EAAE,iCAAa,CAAC,MAAM,CAAC,QAAQ,CAAC;CACtC,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;AAgCpD,0DAAuB;AACM,wEAAmC;AAChE,sEAA6B;AAhC9B,MAAM,wCAAwC,GAAG,iCAAiC,CAAC,WAAW,CAC7F,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACb,IAAI,IAAI,CAAC,kBAAkB,IAAI,KAAK,EAAE,CAAC;QACtC,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,iDAAiD;YAC1D,IAAI,EAAE,CAAC,oBAAoB,CAAC;SAC5B,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,MAAM,SAAS,GAAG,IAAA,aAAK,EAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAA,aAAK,EAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;YAC3B,GAAG,CAAC,QAAQ,CAAC;gBACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;gBAC3B,OAAO,EAAE,0CAA0C;gBACnD,IAAI,EAAE,CAAC,UAAU,CAAC;aAClB,CAAC,CAAC;QACJ,CAAC;IACF,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 } from '@lyxa.ai/core/dist/utilities/enum';\nimport { dayjs } from '@lyxa.ai/core/dist/utilities/dayjs';\n\n/**\n * Define the base parent schema fields\n */\nconst baseFields = {\n\t...baseMarketingFields,\n\tmarketingType: z.literal(MarketingType.FEATURED),\n\tamount: ZodValidation.number('Amount'),\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: FeaturedMarketingValidationSchema,\n\tEntitySchema: FeaturedMarketingSchema,\n\tIdSchema: FeaturedMarketingIdSchema,\n\tUpdateSchema: UpdateFeaturedMarketingSchema,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nconst FeaturedMarketingValidationSchemaRefined = FeaturedMarketingValidationSchema.superRefine(\n\t(data, ctx) => {\n\t\tif (data.isAppliedByCompany == false) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Featured marketing can only be created by admin',\n\t\t\t\tpath: ['isAppliedByCompany'],\n\t\t\t});\n\t\t}\n\n\t\tif (data.duration) {\n\t\t\tconst startDate = dayjs(data.duration.start);\n\t\t\tconst endDate = dayjs(data.duration.end);\n\t\t\tconst diff = endDate.diff(startDate, 'day');\n\t\t\tif (diff < 3 || diff > 28) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: 'Duration should be between 3 and 28 days',\n\t\t\t\t\tpath: ['duration'],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n);\n\n/**\n * Export schemas\n */\nexport {\n\tFeaturedMarketingValidationSchemaRefined as FeaturedMarketingValidationSchema,\n\tFeaturedMarketingSchema,\n\tFeaturedMarketingIdSchema as FeaturedMarketingIdValidationSchema,\n\tUpdateFeaturedMarketingSchema,\n};\n\n/**\n * Export DTO types\n */\nexport type CreateFeaturedMarketingDTO = DTO<typeof FeaturedMarketingValidationSchema>;\nexport type FeaturedMarketingDTO = DTO<typeof FeaturedMarketingSchema>;\nexport type UpdateFeaturedMarketingDTO = DTO<typeof UpdateFeaturedMarketingSchema>;\n"]}
|
|
@@ -1,7 +1,68 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { DTO } from '@lyxa.ai/core/dist/utilities/validation/global-validation';
|
|
3
3
|
import { MarketingType } from '@lyxa.ai/core/dist/utilities/enum';
|
|
4
|
-
declare const
|
|
4
|
+
declare const FreeDeliveryMarketingSchema: z.ZodObject<{
|
|
5
|
+
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
6
|
+
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
7
|
+
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
8
|
+
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>]>>;
|
|
9
|
+
isAppliedByCompany: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
duration: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
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>;
|
|
12
|
+
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>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
start: Date;
|
|
15
|
+
end?: Date | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
start: string | Date;
|
|
18
|
+
end?: string | Date | undefined;
|
|
19
|
+
}>>;
|
|
20
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
21
|
+
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>>>>>;
|
|
22
|
+
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>]>>>>;
|
|
23
|
+
_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>]>>;
|
|
24
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
25
|
+
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
26
|
+
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
27
|
+
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
28
|
+
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>]>>;
|
|
29
|
+
isAppliedByCompany: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
duration: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
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>;
|
|
32
|
+
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>>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
start: Date;
|
|
35
|
+
end?: Date | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
start: string | Date;
|
|
38
|
+
end?: string | Date | undefined;
|
|
39
|
+
}>>;
|
|
40
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
41
|
+
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>>>>>;
|
|
42
|
+
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>]>>>>;
|
|
43
|
+
_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>]>>;
|
|
44
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
45
|
+
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
46
|
+
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
47
|
+
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
48
|
+
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>]>>;
|
|
49
|
+
isAppliedByCompany: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
duration: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
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>;
|
|
52
|
+
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>>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
start: Date;
|
|
55
|
+
end?: Date | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
start: string | Date;
|
|
58
|
+
end?: string | Date | undefined;
|
|
59
|
+
}>>;
|
|
60
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
61
|
+
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>>>>>;
|
|
62
|
+
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>]>>>>;
|
|
63
|
+
_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>]>>;
|
|
64
|
+
}, z.ZodTypeAny, "passthrough">>, FreeDeliveryMarketingIdSchema: 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>]>;
|
|
65
|
+
declare const FreeDeliveryMarketingValidationSchema: z.ZodEffects<z.ZodObject<{
|
|
5
66
|
marketingType: z.ZodLiteral<MarketingType.FREE_DELIVERY>;
|
|
6
67
|
spendLimit: z.ZodDefault<z.ZodNumber>;
|
|
7
68
|
isSpendLimitEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -19,6 +80,7 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
19
80
|
}>;
|
|
20
81
|
status: z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>;
|
|
21
82
|
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>>>>;
|
|
83
|
+
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>]>>>;
|
|
22
84
|
}, "strict", z.ZodTypeAny, {
|
|
23
85
|
isAppliedByCompany: boolean;
|
|
24
86
|
shop: import("mongoose").Types.ObjectId;
|
|
@@ -31,6 +93,7 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
31
93
|
pausedAt: Date | null;
|
|
32
94
|
spendLimit: number;
|
|
33
95
|
isSpendLimitEnabled: boolean;
|
|
96
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
34
97
|
}, {
|
|
35
98
|
isAppliedByCompany: boolean;
|
|
36
99
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -41,28 +104,47 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
41
104
|
};
|
|
42
105
|
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
43
106
|
pausedAt?: string | Date | null | undefined;
|
|
107
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
44
108
|
spendLimit?: number | undefined;
|
|
45
109
|
isSpendLimitEnabled?: boolean | undefined;
|
|
46
|
-
}>,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
duration: z.ZodOptional<z.ZodObject<{
|
|
53
|
-
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>;
|
|
54
|
-
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>>;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
}>, {
|
|
111
|
+
isAppliedByCompany: boolean;
|
|
112
|
+
shop: import("mongoose").Types.ObjectId;
|
|
113
|
+
status: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus;
|
|
114
|
+
marketingType: MarketingType.FREE_DELIVERY;
|
|
115
|
+
duration: {
|
|
56
116
|
start: Date;
|
|
57
117
|
end?: Date | undefined;
|
|
58
|
-
}
|
|
118
|
+
};
|
|
119
|
+
pausedAt: Date | null;
|
|
120
|
+
spendLimit: number;
|
|
121
|
+
isSpendLimitEnabled: boolean;
|
|
122
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
123
|
+
}, {
|
|
124
|
+
isAppliedByCompany: boolean;
|
|
125
|
+
shop: string | import("mongoose").Types.ObjectId;
|
|
126
|
+
marketingType: MarketingType.FREE_DELIVERY;
|
|
127
|
+
duration: {
|
|
59
128
|
start: string | Date;
|
|
60
129
|
end?: string | Date | undefined;
|
|
61
|
-
}
|
|
62
|
-
status
|
|
63
|
-
pausedAt
|
|
64
|
-
|
|
65
|
-
|
|
130
|
+
};
|
|
131
|
+
status?: import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus | undefined;
|
|
132
|
+
pausedAt?: string | Date | null | undefined;
|
|
133
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
134
|
+
spendLimit?: number | undefined;
|
|
135
|
+
isSpendLimitEnabled?: boolean | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
declare const UpdateFreeDeliveryMarketingSchema: z.ZodEffects<z.ZodObject<{
|
|
138
|
+
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
139
|
+
}, "strict", z.ZodTypeAny, {
|
|
140
|
+
[x: string]: any;
|
|
141
|
+
}, {
|
|
142
|
+
[x: string]: any;
|
|
143
|
+
}>, {
|
|
144
|
+
[x: string]: any;
|
|
145
|
+
}, {
|
|
146
|
+
[x: string]: any;
|
|
147
|
+
}> | z.ZodEffects<z.ZodObject<{
|
|
66
148
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
67
149
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
68
150
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -80,8 +162,9 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
80
162
|
}>>;
|
|
81
163
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
82
164
|
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>>>>>;
|
|
165
|
+
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>]>>>>;
|
|
83
166
|
_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>]>>;
|
|
84
|
-
}, z.ZodTypeAny,
|
|
167
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
85
168
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
86
169
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
87
170
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -99,14 +182,9 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
99
182
|
}>>;
|
|
100
183
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
101
184
|
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>>>>>;
|
|
185
|
+
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>]>>>>;
|
|
102
186
|
_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>]>>;
|
|
103
|
-
}, z.ZodTypeAny, "passthrough"
|
|
104
|
-
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
105
|
-
}, "strict", z.ZodTypeAny, {
|
|
106
|
-
[x: string]: any;
|
|
107
|
-
}, {
|
|
108
|
-
[x: string]: any;
|
|
109
|
-
}> | z.ZodObject<{
|
|
187
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
110
188
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
111
189
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
112
190
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -124,8 +202,9 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
124
202
|
}>>;
|
|
125
203
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
126
204
|
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>>>>>;
|
|
205
|
+
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>]>>>>;
|
|
127
206
|
_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>]>>;
|
|
128
|
-
},
|
|
207
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
129
208
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
130
209
|
spendLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
131
210
|
isSpendLimitEnabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -143,6 +222,7 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
143
222
|
}>>;
|
|
144
223
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
145
224
|
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>>>>>;
|
|
225
|
+
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>]>>>>;
|
|
146
226
|
_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>]>>;
|
|
147
227
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
148
228
|
marketingType: z.ZodOptional<z.ZodLiteral<MarketingType.FREE_DELIVERY>>;
|
|
@@ -162,6 +242,7 @@ declare const FreeDeliveryMarketingValidationSchema: z.ZodObject<{
|
|
|
162
242
|
}>>;
|
|
163
243
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof import("@lyxa.ai/core/dist/utilities/enum").MarketingStatus>>>;
|
|
164
244
|
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>>>>>;
|
|
245
|
+
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>]>>>>;
|
|
165
246
|
_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>]>>;
|
|
166
247
|
}, z.ZodTypeAny, "passthrough">>;
|
|
167
248
|
export { FreeDeliveryMarketingValidationSchema, FreeDeliveryMarketingSchema, FreeDeliveryMarketingIdSchema as FreeDeliveryMarketingIdValidationSchema, UpdateFreeDeliveryMarketingSchema, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"free-delivery-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/free-delivery-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,MAAM,mCAAmC,CAAC;AAsBlE,QAAA,
|
|
1
|
+
{"version":3,"file":"free-delivery-marketing.validation.d.ts","sourceRoot":"/","sources":["modules/marketing/validations/free-delivery-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,MAAM,mCAAmC,CAAC;AAsBlE,QAAA,MAEe,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAC/B,6BAA6B,iNAEY,CAAC;AAErD,QAAA,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBxC,CAAC;AAEJ,QAAA,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAmBtC,CAAC;AAKF,OAAO,EACN,qCAAqC,EACrC,2BAA2B,EAC3B,6BAA6B,IAAI,uCAAuC,EACxE,iCAAiC,GACjC,CAAC;AAKF,MAAM,MAAM,8BAA8B,GAAG,GAAG,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAC/F,MAAM,MAAM,wBAAwB,GAAG,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,8BAA8B,GAAG,GAAG,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
|
|
@@ -12,9 +12,43 @@ const baseFields = {
|
|
|
12
12
|
isSpendLimitEnabled: global_validation_1.ZodValidation.boolean('Is spend limit enabled').default(false),
|
|
13
13
|
};
|
|
14
14
|
const schemaBuilder = (0, global_validation_1.createSchemaBuilder)(baseFields);
|
|
15
|
-
const { BaseSchema:
|
|
16
|
-
exports.FreeDeliveryMarketingValidationSchema = FreeDeliveryMarketingValidationSchema;
|
|
15
|
+
const { BaseSchema: FreeDeliveryMarketingValidationSchemaWithoutRefinement, EntitySchema: FreeDeliveryMarketingSchema, IdSchema: FreeDeliveryMarketingIdSchema, UpdateSchema: UpdateFreeDeliveryMarketingSchemaWithoutRefinement, } = schemaBuilder.getAllSchemas({ createdAt: true });
|
|
17
16
|
exports.FreeDeliveryMarketingSchema = FreeDeliveryMarketingSchema;
|
|
18
17
|
exports.FreeDeliveryMarketingIdValidationSchema = FreeDeliveryMarketingIdSchema;
|
|
18
|
+
const FreeDeliveryMarketingValidationSchema = FreeDeliveryMarketingValidationSchemaWithoutRefinement.superRefine((data, ctx) => {
|
|
19
|
+
if (data.isSpendLimitEnabled && (!data.spendLimit || data.spendLimit <= 0)) {
|
|
20
|
+
ctx.addIssue({
|
|
21
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
22
|
+
message: 'Spend limit must be greater than 0 when enabled',
|
|
23
|
+
path: ['spendLimit', 'isSpendLimitEnabled'],
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (!data.duration.end) {
|
|
27
|
+
ctx.addIssue({
|
|
28
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
29
|
+
message: 'End date is required',
|
|
30
|
+
path: ['duration', 'end'],
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
exports.FreeDeliveryMarketingValidationSchema = FreeDeliveryMarketingValidationSchema;
|
|
35
|
+
const UpdateFreeDeliveryMarketingSchema = UpdateFreeDeliveryMarketingSchemaWithoutRefinement.superRefine((data, ctx) => {
|
|
36
|
+
if (data.isSpendLimitEnabled && (!data.spendLimit || data.spendLimit <= 0)) {
|
|
37
|
+
ctx.addIssue({
|
|
38
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
39
|
+
message: 'Spend limit must be greater than 0 when enabled',
|
|
40
|
+
path: ['spendLimit', 'isSpendLimitEnabled'],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (data.duration) {
|
|
44
|
+
if (!data.duration.end) {
|
|
45
|
+
ctx.addIssue({
|
|
46
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
47
|
+
message: 'End date is required',
|
|
48
|
+
path: ['duration', 'end'],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
19
53
|
exports.UpdateFreeDeliveryMarketingSchema = UpdateFreeDeliveryMarketingSchema;
|
|
20
54
|
//# sourceMappingURL=free-delivery-marketing.validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"free-delivery-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/free-delivery-marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,iEAA6D;AAC7D,4DAAkE;AAKlE,MAAM,UAAU,GAAG;IAClB,GAAG,0CAAmB;IACtB,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAa,CAAC,aAAa,CAAC;IACrD,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;CACnF,CAAC;AAOF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AAKtD,MAAM,EACL,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"free-delivery-marketing.validation.js","sourceRoot":"/","sources":["modules/marketing/validations/free-delivery-marketing.validation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iGAImE;AACnE,iEAA6D;AAC7D,4DAAkE;AAKlE,MAAM,UAAU,GAAG;IAClB,GAAG,0CAAmB;IACtB,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAa,CAAC,aAAa,CAAC;IACrD,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;CACnF,CAAC;AAOF,MAAM,aAAa,GAAG,IAAA,uCAAmB,EAAC,UAAU,CAAC,CAAC;AAKtD,MAAM,EACL,UAAU,EAAE,sDAAsD,EAClE,YAAY,EAAE,2BAA2B,EACzC,QAAQ,EAAE,6BAA6B,EACvC,YAAY,EAAE,kDAAkD,GAChE,GAAG,aAAa,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AA8CpD,kEAA2B;AACM,gFAAuC;AA7CzE,MAAM,qCAAqC,GAC1C,sDAAsD,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAChF,IAAI,IAAI,CAAC,mBAAmB,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,EAAE,CAAC;QAC5E,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,iDAAiD;YAC1D,IAAI,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;SAC3C,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACxB,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,sBAAsB;YAC/B,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC;SACzB,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC,CAAC;AA2BH,sFAAqC;AAzBtC,MAAM,iCAAiC,GAAG,kDAAkD,CAAC,WAAW,CACvG,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACb,IAAI,IAAI,CAAC,mBAAmB,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,EAAE,CAAC;QAC5E,GAAG,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,iDAAiD;YAC1D,IAAI,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;SAC3C,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YACxB,GAAG,CAAC,QAAQ,CAAC;gBACZ,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;gBAC3B,OAAO,EAAE,sBAAsB;gBAC/B,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC;aACzB,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;AACF,CAAC,CACD,CAAC;AASD,8EAAiC","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 } from '@lyxa.ai/core/dist/utilities/enum';\n\n/**\n * Define the base parent schema fields\n */\nconst baseFields = {\n\t...baseMarketingFields,\n\tmarketingType: z.literal(MarketingType.FREE_DELIVERY),\n\tspendLimit: ZodValidation.number('Spend limit').default(0),\n\tisSpendLimitEnabled: ZodValidation.boolean('Is spend limit enabled').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: FreeDeliveryMarketingValidationSchemaWithoutRefinement,\n\tEntitySchema: FreeDeliveryMarketingSchema,\n\tIdSchema: FreeDeliveryMarketingIdSchema,\n\tUpdateSchema: UpdateFreeDeliveryMarketingSchemaWithoutRefinement,\n} = schemaBuilder.getAllSchemas({ createdAt: true });\n\nconst FreeDeliveryMarketingValidationSchema =\n\tFreeDeliveryMarketingValidationSchemaWithoutRefinement.superRefine((data, ctx) => {\n\t\tif (data.isSpendLimitEnabled && (!data.spendLimit || data.spendLimit <= 0)) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Spend limit must be greater than 0 when enabled',\n\t\t\t\tpath: ['spendLimit', 'isSpendLimitEnabled'],\n\t\t\t});\n\t\t}\n\t\tif (!data.duration.end) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'End date is required',\n\t\t\t\tpath: ['duration', 'end'],\n\t\t\t});\n\t\t}\n\t});\n\nconst UpdateFreeDeliveryMarketingSchema = UpdateFreeDeliveryMarketingSchemaWithoutRefinement.superRefine(\n\t(data, ctx) => {\n\t\tif (data.isSpendLimitEnabled && (!data.spendLimit || data.spendLimit <= 0)) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'Spend limit must be greater than 0 when enabled',\n\t\t\t\tpath: ['spendLimit', 'isSpendLimitEnabled'],\n\t\t\t});\n\t\t}\n\t\tif (data.duration) {\n\t\t\tif (!data.duration.end) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\t\tmessage: 'End date is required',\n\t\t\t\t\tpath: ['duration', 'end'],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n);\n\n/**\n * Export schemas\n */\nexport {\n\tFreeDeliveryMarketingValidationSchema,\n\tFreeDeliveryMarketingSchema,\n\tFreeDeliveryMarketingIdSchema as FreeDeliveryMarketingIdValidationSchema,\n\tUpdateFreeDeliveryMarketingSchema,\n};\n\n/**\n * Export DTO types\n */\nexport type CreateFreeDeliveryMarketingDTO = DTO<typeof FreeDeliveryMarketingValidationSchema>;\nexport type FreeDeliveryMarketingDTO = DTO<typeof FreeDeliveryMarketingSchema>;\nexport type UpdateFreeDeliveryMarketingDTO = DTO<typeof UpdateFreeDeliveryMarketingSchema>;\n"]}
|
|
@@ -17,6 +17,7 @@ export declare const baseMarketingFields: {
|
|
|
17
17
|
}>;
|
|
18
18
|
status: z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>;
|
|
19
19
|
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>>>>;
|
|
20
|
+
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>]>>>;
|
|
20
21
|
};
|
|
21
22
|
declare const MarketingValidationSchema: z.ZodObject<{
|
|
22
23
|
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>]>;
|
|
@@ -34,6 +35,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
34
35
|
}>;
|
|
35
36
|
status: z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>;
|
|
36
37
|
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>>>>;
|
|
38
|
+
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>]>>>;
|
|
37
39
|
}, "strict", z.ZodTypeAny, {
|
|
38
40
|
isAppliedByCompany: boolean;
|
|
39
41
|
shop: import("mongoose").Types.ObjectId;
|
|
@@ -44,6 +46,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
44
46
|
end?: Date | undefined;
|
|
45
47
|
};
|
|
46
48
|
pausedAt: Date | null;
|
|
49
|
+
admin?: import("mongoose").Types.ObjectId | null | undefined;
|
|
47
50
|
}, {
|
|
48
51
|
isAppliedByCompany: boolean;
|
|
49
52
|
shop: string | import("mongoose").Types.ObjectId;
|
|
@@ -54,6 +57,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
54
57
|
};
|
|
55
58
|
status?: MarketingStatus | undefined;
|
|
56
59
|
pausedAt?: string | Date | null | undefined;
|
|
60
|
+
admin?: string | import("mongoose").Types.ObjectId | null | undefined;
|
|
57
61
|
}>, MarketingSchema: z.ZodObject<{
|
|
58
62
|
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>]>>;
|
|
59
63
|
marketingType: z.ZodOptional<z.ZodNativeEnum<typeof MarketingType>>;
|
|
@@ -70,6 +74,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
70
74
|
}>>;
|
|
71
75
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>>;
|
|
72
76
|
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>>>>>;
|
|
77
|
+
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>]>>>>;
|
|
73
78
|
_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>]>>;
|
|
74
79
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
75
80
|
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>]>>;
|
|
@@ -87,6 +92,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
87
92
|
}>>;
|
|
88
93
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>>;
|
|
89
94
|
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>>>>>;
|
|
95
|
+
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>]>>>>;
|
|
90
96
|
_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>]>>;
|
|
91
97
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
92
98
|
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>]>>;
|
|
@@ -104,6 +110,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
104
110
|
}>>;
|
|
105
111
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>>;
|
|
106
112
|
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>>>>>;
|
|
113
|
+
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>]>>>>;
|
|
107
114
|
_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>]>>;
|
|
108
115
|
}, z.ZodTypeAny, "passthrough">>, MarketingIdSchema: 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>]>, UpdateMarketingSchema: z.ZodObject<{
|
|
109
116
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
@@ -127,6 +134,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
127
134
|
}>>;
|
|
128
135
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>>;
|
|
129
136
|
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>>>>>;
|
|
137
|
+
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>]>>>>;
|
|
130
138
|
_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>]>>;
|
|
131
139
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
132
140
|
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>]>>;
|
|
@@ -144,6 +152,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
144
152
|
}>>;
|
|
145
153
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>>;
|
|
146
154
|
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>>>>>;
|
|
155
|
+
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>]>>>>;
|
|
147
156
|
_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>]>>;
|
|
148
157
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
149
158
|
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>]>>;
|
|
@@ -161,6 +170,7 @@ declare const MarketingValidationSchema: z.ZodObject<{
|
|
|
161
170
|
}>>;
|
|
162
171
|
status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<typeof MarketingStatus>>>;
|
|
163
172
|
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>>>>>;
|
|
173
|
+
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>]>>>>;
|
|
164
174
|
_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>]>>;
|
|
165
175
|
}, z.ZodTypeAny, "passthrough">>;
|
|
166
176
|
export { MarketingValidationSchema, MarketingSchema, MarketingIdSchema as MarketingIdValidationSchema, UpdateMarketingSchema, };
|