"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerSchema = exports.loginSchema = exports.insertUserSchema = void 0;
const usedSchemas_1 = require("@repo/db/usedSchemas");
const zod_1 = require("zod");
exports.insertUserSchema = usedSchemas_1.UserUncheckedCreateInputObjectSchema.pick({
    username: true,
    password: true,
});
exports.loginSchema = exports.insertUserSchema.extend({
    rememberMe: zod_1.z.boolean().optional(),
});
exports.registerSchema = exports.insertUserSchema
    .extend({
    confirmPassword: zod_1.z.string().min(6, {
        message: "Password must be at least 6 characters long",
    }),
    agreeTerms: zod_1.z.literal(true, {
        errorMap: () => ({
            message: "You must agree to the terms and conditions",
        }),
    }),
})
    .refine((data) => data.password === data.confirmPassword, {
    message: "Passwords don't match",
    path: ["confirmPassword"],
});
