"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tierDiscountQuerySchema = exports.createCampaignSchema = exports.createFlashDealSchema = exports.createBundleSchema = void 0;
const zod_1 = require("zod");
exports.createBundleSchema = zod_1.z.object({
    title: zod_1.z.string().min(2, 'Bundle title is required'),
    description: zod_1.z.string().optional(),
    coverImage: zod_1.z.string().url().optional(),
    originalPrice: zod_1.z.number().positive(),
    bundlePrice: zod_1.z.number().positive(),
    discountPercentage: zod_1.z.number().min(0).max(100).optional(),
    badgeText: zod_1.z.string().optional(),
    isCombo: zod_1.z.boolean().optional(),
    items: zod_1.z.array(zod_1.z.object({
        bookId: zod_1.z.string().min(1),
        quantity: zod_1.z.number().int().positive().default(1),
        sortOrder: zod_1.z.number().int().optional(),
    })).min(2, 'A bundle or combo must contain at least 2 books'),
});
exports.createFlashDealSchema = zod_1.z.object({
    bookId: zod_1.z.string().min(1, 'Book ID is required'),
    dealPrice: zod_1.z.number().positive(),
    originalPrice: zod_1.z.number().positive(),
    discountPercentage: zod_1.z.number().min(1).max(99),
    stockLimit: zod_1.z.number().int().positive().default(50),
    badgeText: zod_1.z.string().optional(),
    startsAt: zod_1.z.string().datetime().optional(),
    endsAt: zod_1.z.string().datetime(),
});
exports.createCampaignSchema = zod_1.z.object({
    title: zod_1.z.string().min(2, 'Campaign title is required'),
    description: zod_1.z.string().optional(),
    bannerUrl: zod_1.z.string().url().optional(),
    themeColor: zod_1.z.string().optional(),
    couponCode: zod_1.z.string().optional(),
    discountPercent: zod_1.z.number().min(1).max(100).optional(),
    targetCategory: zod_1.z.string().optional(),
    startsAt: zod_1.z.string().datetime().optional(),
    endsAt: zod_1.z.string().datetime(),
});
exports.tierDiscountQuerySchema = zod_1.z.object({
    quantity: zod_1.z.coerce.number().int().positive().default(1),
    subtotal: zod_1.z.coerce.number().positive().default(0),
});
//# sourceMappingURL=smart-sales.validator.js.map