"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateBannerSchema = exports.createBannerSchema = exports.bannerListQuerySchema = exports.bannerIdParamSchema = void 0;
const zod_1 = require("zod");
const positiveId = zod_1.z.coerce.number().int().positive();
const slug = zod_1.z
    .string()
    .trim()
    .toLowerCase()
    .min(1)
    .max(140)
    .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
exports.bannerIdParamSchema = zod_1.z.object({
    id: positiveId,
});
exports.bannerListQuerySchema = zod_1.z.object({
    q: zod_1.z.string().trim().max(100).optional(),
    page: zod_1.z.coerce.number().int().min(1).default(1),
    perPage: zod_1.z.coerce.number().int().min(1).max(100).default(20),
    includeInactive: zod_1.z.coerce.boolean().optional(),
});
exports.createBannerSchema = zod_1.z.object({
    title: zod_1.z.string().trim().min(2).max(255),
    subtitle: zod_1.z.string().trim().max(255).optional().default(""),
    imageUrl: zod_1.z.string().trim().min(1).max(512),
    linkUrl: zod_1.z.string().trim().max(512).optional().default(""),
    linkLabel: zod_1.z.string().trim().max(120).optional().default(""),
    isActive: zod_1.z.boolean().default(true),
    sortOrder: zod_1.z.coerce.number().int().min(0).default(0),
});
exports.updateBannerSchema = exports.createBannerSchema
    .partial()
    .refine((value) => Object.keys(value).length > 0, "At least one field is required");
//# sourceMappingURL=bannerValidators.js.map