"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.noticiaDeleteSchema = exports.noticiaChangeFileSchema = exports.noticiaEditSchema = exports.extendNoticiaCreateSchema = exports.noticiaCreateSchema = void 0;
const zod_1 = require("zod");
const zod_to_openapi_1 = require("@asteasolutions/zod-to-openapi");
const validation_1 = require("../../util/validation");
(0, zod_to_openapi_1.extendZodWithOpenApi)(zod_1.z);
exports.noticiaCreateSchema = zod_1.z.object({
    titulo: zod_1.z.string().trim().min(1, 'O campo titulo é obrigatório'),
    fonte: zod_1.z.string().trim().optional(),
    conteudo: zod_1.z.string().trim().optional(),
    destaque: zod_1.z.string().trim().optional(),
    subTitulo: zod_1.z.string().trim().optional(),
    status: zod_1.z.string().trim().optional(),
    seccao: zod_1.z.string().trim().optional(),
    categoria: zod_1.z.string().trim().optional(),
    link: zod_1.z.string().trim().optional(),
    userId: (0, validation_1.requiredString)('userId'),
});
exports.extendNoticiaCreateSchema = exports.noticiaCreateSchema.extend({
    imagem: (0, validation_1.fileSchema)('imagem')
});
exports.noticiaEditSchema = zod_1.z.object({
    titulo: zod_1.z.string().trim().optional(),
    fonte: zod_1.z.string().trim().optional(),
    conteudo: zod_1.z.string().trim().optional(),
    regiao: zod_1.z.string().trim().optional(),
    destaque: zod_1.z.string().trim().optional(),
    subTitulo: zod_1.z.string().trim().optional(),
    link: zod_1.z.string().trim().optional(),
    status: zod_1.z.string().trim().optional(),
    seccao: zod_1.z.string().trim().optional(),
    noticiaId: zod_1.z.string().trim().min(1, 'O campo noticiaId é obrigatório'),
    userId: zod_1.z.string().trim().optional(),
});
exports.noticiaChangeFileSchema = zod_1.z.object({
    noticiaId: (0, validation_1.requiredNumber)('noticiaId'),
    userId: (0, validation_1.requiredString)('userId'),
});
exports.noticiaDeleteSchema = zod_1.z.object({
    id: (0, validation_1.requiredNumber)('id'),
    userId: (0, validation_1.requiredNumber)('userId'),
});
