"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listModerationQueueSchema = exports.moderateCampaignSchema = exports.updateUserCampaignSchema = exports.createUserCampaignSchema = exports.campaignIdSchema = exports.listCampaignsSchema = exports.updateCampaignSchema = exports.createCampaignSchema = void 0;
const zod_1 = require("zod");
const client_1 = require("@prisma/client");
exports.createCampaignSchema = zod_1.z.object({
    title: zod_1.z.string().min(1, 'Title is required').max(200),
    description: zod_1.z.string().max(2000).optional(),
    emailSubject: zod_1.z.string().min(1, 'Email subject is required').max(200),
    emailBody: zod_1.z.string().min(1, 'Email body is required').max(10000),
    callToAction: zod_1.z.string().max(500).optional(),
    status: zod_1.z.nativeEnum(client_1.CampaignStatus).optional().default(client_1.CampaignStatus.DRAFT),
    targetGovernmentLevels: zod_1.z.array(zod_1.z.nativeEnum(client_1.GovernmentLevel)).optional().default([]),
    allowSmtpEmail: zod_1.z.boolean().optional().default(true),
    allowMailtoLink: zod_1.z.boolean().optional().default(true),
    collectUserInfo: zod_1.z.boolean().optional().default(true),
    showEmailCount: zod_1.z.boolean().optional().default(true),
    showCallCount: zod_1.z.boolean().optional().default(true),
    allowEmailEditing: zod_1.z.boolean().optional().default(false),
    allowCustomRecipients: zod_1.z.boolean().optional().default(false),
    showResponseWall: zod_1.z.boolean().optional().default(false),
    highlightCampaign: zod_1.z.boolean().optional().default(false),
    coverPhoto: zod_1.z.string().url().max(500).optional(),
    coverVideoId: zod_1.z.number().int().positive().nullable().optional(),
});
exports.updateCampaignSchema = zod_1.z.object({
    title: zod_1.z.string().min(1).max(200).optional(),
    description: zod_1.z.string().max(2000).nullable().optional(),
    emailSubject: zod_1.z.string().min(1).max(200).optional(),
    emailBody: zod_1.z.string().min(1).max(10000).optional(),
    callToAction: zod_1.z.string().max(500).nullable().optional(),
    status: zod_1.z.nativeEnum(client_1.CampaignStatus).optional(),
    targetGovernmentLevels: zod_1.z.array(zod_1.z.nativeEnum(client_1.GovernmentLevel)).optional(),
    allowSmtpEmail: zod_1.z.boolean().optional(),
    allowMailtoLink: zod_1.z.boolean().optional(),
    collectUserInfo: zod_1.z.boolean().optional(),
    showEmailCount: zod_1.z.boolean().optional(),
    showCallCount: zod_1.z.boolean().optional(),
    allowEmailEditing: zod_1.z.boolean().optional(),
    allowCustomRecipients: zod_1.z.boolean().optional(),
    showResponseWall: zod_1.z.boolean().optional(),
    highlightCampaign: zod_1.z.boolean().optional(),
    coverPhoto: zod_1.z.string().url().max(500).nullable().optional(),
    coverVideoId: zod_1.z.number().int().positive().nullable().optional(),
});
exports.listCampaignsSchema = zod_1.z.object({
    page: zod_1.z.coerce.number().int().positive().default(1),
    limit: zod_1.z.coerce.number().int().positive().max(100).default(20),
    search: zod_1.z.string().optional(),
    status: zod_1.z.nativeEnum(client_1.CampaignStatus).optional(),
});
exports.campaignIdSchema = zod_1.z.object({
    id: zod_1.z.string().min(1),
});
// User-submitted campaign (restricted fields)
exports.createUserCampaignSchema = zod_1.z.object({
    title: zod_1.z.string().min(3, 'Title must be at least 3 characters').max(200),
    description: zod_1.z.string().max(2000).optional(),
    emailSubject: zod_1.z.string().min(3, 'Email subject is required').max(200),
    emailBody: zod_1.z.string().min(10, 'Email body must be at least 10 characters').max(5000),
    callToAction: zod_1.z.string().max(500).optional(),
    targetGovernmentLevels: zod_1.z.array(zod_1.z.nativeEnum(client_1.GovernmentLevel)).min(1, 'Select at least one government level'),
});
// Update own user campaign (same restricted fields)
exports.updateUserCampaignSchema = exports.createUserCampaignSchema.partial();
// Admin moderation action
exports.moderateCampaignSchema = zod_1.z.object({
    action: zod_1.z.enum(['approve', 'reject', 'request_changes']),
    reason: zod_1.z.string().max(2000).optional(),
    notes: zod_1.z.string().max(2000).optional(),
});
// Moderation queue filters
exports.listModerationQueueSchema = zod_1.z.object({
    page: zod_1.z.coerce.number().int().positive().default(1),
    limit: zod_1.z.coerce.number().int().positive().max(100).default(20),
    search: zod_1.z.string().optional(),
    moderationStatus: zod_1.z.nativeEnum(client_1.CampaignModerationStatus).optional(),
});
//# sourceMappingURL=campaigns.schemas.js.map