"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.notificationMarkAsReadSchema = exports.notificationFilterSchema = void 0;
const zod_1 = __importDefault(require("zod"));
const optionalString = zod_1.default.preprocess((value) => {
    if (typeof value === 'string' && value.trim() === '')
        return undefined;
    return value;
}, zod_1.default.string().trim().optional());
const optionalDate = zod_1.default.preprocess((value) => {
    if (value === null || value === undefined || value === '')
        return undefined;
    return value;
}, zod_1.default.coerce.date().optional());
exports.notificationFilterSchema = zod_1.default.object({
    start_date: optionalString,
    end_date: optionalString,
    page: zod_1.default.preprocess((value) => {
        if (value === undefined || value === null || value === '')
            return 1;
        const parsed = Number(value);
        return Number.isNaN(parsed) ? value : parsed;
    }, zod_1.default.number().int().min(1).default(1)),
    limit: zod_1.default.preprocess((value) => {
        if (value === undefined || value === null || value === '')
            return 10;
        const parsed = Number(value);
        return Number.isNaN(parsed) ? value : parsed;
    }, zod_1.default.number().int().min(1).max(100).default(10)),
});
exports.notificationMarkAsReadSchema = zod_1.default.object({
    notification_id: zod_1.default.string().uuid(),
    member_id: zod_1.default.string().uuid(),
});
//# sourceMappingURL=notifications.dto.js.map