"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.customerUpdateProfileSchema = exports.logoutSchema = exports.changePasswordSchema = exports.refreshTokenSchema = exports.staffVerifyOtpSchema = exports.staffRequestOtpSchema = exports.staffLoginSchema = exports.staffRegisterSchema = exports.customerVerifyOtpSchema = exports.customerRequestOtpSchema = void 0;
const zod_1 = require("zod");
const email = zod_1.z.string().trim().toLowerCase().email().max(255);
const otpCode = zod_1.z
    .string()
    .trim()
    .regex(/^\d{6}$/, "OTP must be a 6 digit code");
const password = zod_1.z
    .string()
    .min(8, "Password must be at least 8 characters")
    .max(72, "Password must be 72 characters or fewer")
    .regex(/[A-Z]/, "Password must include at least one uppercase letter")
    .regex(/[a-z]/, "Password must include at least one lowercase letter")
    .regex(/[0-9]/, "Password must include at least one number");
exports.customerRequestOtpSchema = zod_1.z.object({
    email,
});
exports.customerVerifyOtpSchema = zod_1.z.object({
    email,
    code: otpCode,
    name: zod_1.z.string().trim().min(1).max(255).optional(),
    phoneNumber: zod_1.z.string().trim().min(7).max(30).optional(),
});
exports.staffRegisterSchema = zod_1.z.object({
    name: zod_1.z.string().trim().min(2).max(255),
    email,
    password,
    role: zod_1.z.enum(["seller", "admin"]).default("seller"),
});
exports.staffLoginSchema = zod_1.z.object({
    email,
    password: zod_1.z.string().min(1).max(72),
});
exports.staffRequestOtpSchema = zod_1.z.object({
    email,
});
exports.staffVerifyOtpSchema = zod_1.z.object({
    email,
    code: otpCode,
});
exports.refreshTokenSchema = zod_1.z.object({
    refreshToken: zod_1.z.string().trim().min(64).max(256),
});
exports.changePasswordSchema = zod_1.z.object({
    currentPassword: zod_1.z.string().min(1, "Current password is required").max(72),
    newPassword: password,
});
exports.logoutSchema = zod_1.z.object({
    refreshToken: zod_1.z.string().trim().min(64).max(256),
});
exports.customerUpdateProfileSchema = zod_1.z.object({
    name: zod_1.z.string().trim().min(1).max(255).optional(),
    phoneNumber: zod_1.z.string().trim().min(7).max(30).optional(),
});
//# sourceMappingURL=authValidators.js.map