aboutsummaryrefslogtreecommitdiff
path: root/api/src/modules/auth/auth.schema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/modules/auth/auth.schema.ts')
-rw-r--r--api/src/modules/auth/auth.schema.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/api/src/modules/auth/auth.schema.ts b/api/src/modules/auth/auth.schema.ts
new file mode 100644
index 0000000..550c670
--- /dev/null
+++ b/api/src/modules/auth/auth.schema.ts
@@ -0,0 +1,16 @@
+import { z } from 'zod';
+
+export const registerSchema = z.object({
+ name: z.string().min(2, 'Nome deve ter pelo menos 2 caracteres'),
+ email: z.string().email('Email inválido'),
+ password: z.string().min(6, 'Senha deve ter pelo menos 6 caracteres'),
+ gross_salary: z.coerce.number().min(0).optional(),
+});
+
+export const loginSchema = z.object({
+ email: z.string().email('Email inválido'),
+ password: z.string().min(6, 'Senha inválida'),
+});
+
+export type RegisterData = z.infer<typeof registerSchema>;
+export type LoginData = z.infer<typeof loginSchema>;