"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CuentaDto = exports.accountSchema = void 0;
const tag_dto_1 = require("../../tag/dto/tag.dto");
const tag_group_dto_1 = require("../../tag-group/dto/tag-group.dto");
const translate_1 = require("../../i18n/translate");
const zod_nestjs_1 = require("@anatine/zod-nestjs");
const zod_1 = require("zod");
const prisma_schema_1 = require("../../../types/prisma-schema/index.js");
exports.accountSchema = zod_1.z.object({
    id: zod_1.z
        .string({
        required_error: (0, translate_1.translate)('model.account.id.required'),
    })
        .uuid({
        message: (0, translate_1.translate)('model.account.id.uuid'),
    }),
    username: zod_1.z.string({
        required_error: (0, translate_1.translate)('model.account.username.required'),
    }),
    password: zod_1.z
        .string({
        required_error: (0, translate_1.translate)('model.account.password.required'),
    })
        .min(6, (0, translate_1.translate)('model.account.password.min')),
    role: zod_1.z.nativeEnum(prisma_schema_1.Role, {
        required_error: (0, translate_1.translate)('model.account.role.required'),
        message: (0, translate_1.translate)('model.account.role.invalid'),
    }),
    created_at: zod_1.z.string().datetime(),
    updated_at: zod_1.z.string().datetime(),
    globalFilter: zod_1.z.object({
        tags: tag_dto_1.tagSchema
            .pick({
            id: true,
            name: true,
        })
            .merge(zod_1.z.object({
            group: tag_group_dto_1.tagGroupSchema.pick({
                id: true,
                color: true,
                isExclusive: true,
            }),
        })),
        active: zod_1.z.boolean(),
    }),
    isGlobalFilterActive: zod_1.z.boolean().default(false),
    fcmToken: zod_1.z.array(zod_1.z.string()).default([]),
});
class CuentaDto extends (0, zod_nestjs_1.createZodDto)(exports.accountSchema) {
}
exports.CuentaDto = CuentaDto;
//# sourceMappingURL=account.dto.js.map