"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapNotification = exports.NotificationDeleteAllDto = exports.NotificationUpdateAllDto = exports.NotificationUpdateDto = exports.NotificationCreateDto = exports.NotificationSearchDto = exports.NotificationDto = exports.TemplateDto = exports.TemplateResponseDto = exports.TestEmailResponseDto = void 0;
const openapi = require("@nestjs/swagger");
const nestjs_zod_1 = require("nestjs-zod");
const enum_1 = require("../enum");
const validation_1 = require("../validation");
const zod_1 = __importDefault(require("zod"));
const TestEmailResponseSchema = zod_1.default
    .object({
    messageId: zod_1.default.string().describe('Email message ID'),
})
    .meta({ id: 'TestEmailResponseDto' });
const TemplateResponseSchema = zod_1.default
    .object({
    name: zod_1.default.string().describe('Template name'),
    html: zod_1.default.string().describe('Template HTML content'),
})
    .meta({ id: 'TemplateResponseDto' });
const TemplateSchema = zod_1.default
    .object({
    template: zod_1.default.string().describe('Template name'),
})
    .meta({ id: 'TemplateDto' });
const NotificationSchema = zod_1.default
    .object({
    id: zod_1.default.uuidv4().describe('Notification ID'),
    createdAt: validation_1.isoDatetimeToDate.describe('Creation date'),
    level: enum_1.NotificationLevelSchema,
    type: enum_1.NotificationTypeSchema,
    title: zod_1.default.string().describe('Notification title'),
    description: zod_1.default.string().optional().describe('Notification description'),
    data: zod_1.default.record(zod_1.default.string(), zod_1.default.unknown()).optional().describe('Additional notification data'),
    readAt: validation_1.isoDatetimeToDate.optional().describe('Date when notification was read'),
})
    .meta({ id: 'NotificationDto' });
const NotificationSearchSchema = zod_1.default
    .object({
    id: zod_1.default.uuidv4().optional().describe('Filter by notification ID'),
    level: enum_1.NotificationLevelSchema.optional(),
    type: enum_1.NotificationTypeSchema.optional(),
    unread: validation_1.stringToBool.optional().describe('Filter by unread status'),
})
    .meta({ id: 'NotificationSearchDto' });
const NotificationCreateSchema = zod_1.default
    .object({
    level: enum_1.NotificationLevelSchema.optional(),
    type: enum_1.NotificationTypeSchema.optional(),
    title: zod_1.default.string().describe('Notification title'),
    description: zod_1.default.string().nullish().describe('Notification description'),
    data: zod_1.default.record(zod_1.default.string(), zod_1.default.unknown()).optional().describe('Additional notification data'),
    readAt: validation_1.isoDatetimeToDate.nullish().describe('Date when notification was read'),
    userId: zod_1.default.uuidv4().describe('User ID to send notification to'),
})
    .meta({ id: 'NotificationCreateDto' });
const NotificationUpdateSchema = zod_1.default
    .object({
    readAt: validation_1.isoDatetimeToDate.nullish().describe('Date when notification was read'),
})
    .meta({ id: 'NotificationUpdateDto' });
const NotificationUpdateAllSchema = zod_1.default
    .object({
    ids: zod_1.default.array(zod_1.default.uuidv4()).min(1).describe('Notification IDs to update'),
    readAt: validation_1.isoDatetimeToDate.nullish().describe('Date when notifications were read'),
})
    .meta({ id: 'NotificationUpdateAllDto' });
const NotificationDeleteAllSchema = zod_1.default
    .object({
    ids: zod_1.default.array(zod_1.default.uuidv4()).min(1).describe('Notification IDs to delete'),
})
    .meta({ id: 'NotificationDeleteAllDto' });
class TestEmailResponseDto extends (0, nestjs_zod_1.createZodDto)(TestEmailResponseSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.TestEmailResponseDto = TestEmailResponseDto;
class TemplateResponseDto extends (0, nestjs_zod_1.createZodDto)(TemplateResponseSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.TemplateResponseDto = TemplateResponseDto;
class TemplateDto extends (0, nestjs_zod_1.createZodDto)(TemplateSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.TemplateDto = TemplateDto;
class NotificationDto extends (0, nestjs_zod_1.createZodDto)(NotificationSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.NotificationDto = NotificationDto;
class NotificationSearchDto extends (0, nestjs_zod_1.createZodDto)(NotificationSearchSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.NotificationSearchDto = NotificationSearchDto;
class NotificationCreateDto extends (0, nestjs_zod_1.createZodDto)(NotificationCreateSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.NotificationCreateDto = NotificationCreateDto;
class NotificationUpdateDto extends (0, nestjs_zod_1.createZodDto)(NotificationUpdateSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.NotificationUpdateDto = NotificationUpdateDto;
class NotificationUpdateAllDto extends (0, nestjs_zod_1.createZodDto)(NotificationUpdateAllSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.NotificationUpdateAllDto = NotificationUpdateAllDto;
class NotificationDeleteAllDto extends (0, nestjs_zod_1.createZodDto)(NotificationDeleteAllSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.NotificationDeleteAllDto = NotificationDeleteAllDto;
const mapNotification = (notification) => {
    return {
        id: notification.id,
        createdAt: notification.createdAt,
        level: notification.level,
        type: notification.type,
        title: notification.title,
        description: notification.description ?? undefined,
        data: notification.data ?? undefined,
        readAt: notification.readAt ?? undefined,
    };
};
exports.mapNotification = mapNotification;
//# sourceMappingURL=notification.dto.js.map