base con autenticacion, registro, modulo encuestas

This commit is contained in:
2025-06-16 12:02:22 -04:00
commit 475e0754df
411 changed files with 26265 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { z } from 'zod';
// Definir esquema de validación con Zod para el formulario
export const createUser = z.object({
username: z.string().min(5, { message: "Debe de tener 5 o más caracteres" }),
password: z.string().min(8, { message: "Debe de tener 8 o más caracteres" }),
email: z.string().email({ message: "Correo no válido" }),
fullname: z.string(),
phone: z.string(),
state: z.number(),
municipality: z.number(),
parish: z.number(),
confirmPassword: z.string(),
})
.refine((data) => data.password === data.confirmPassword, {
message: 'La contraseña no coincide',
path: ['confirmPassword'],
})
export type createUserValue = z.infer<typeof createUser>;
export const user = z.object({
id: z.number().optional(),
username: z.string(),
email: z.string(),
fullname: z.string(),
phone: z.string().nullable(),
isActive: z.boolean(),
role: z.string()
});
export const UsersMutate = z.object({
message: z.string(),
data: user,
})