Convert backend to regular directory

This commit is contained in:
2026-06-04 20:16:41 +02:00
parent 9107c29304
commit be40cb4745
29 changed files with 4149 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
const { z } = require("zod");
const createEmployeeSchema = z.object({
firstname: z.string().min(2),
lastname: z.string().min(2),
email: z.string().email(),
password: z.string().min(8),
birthdate: z.string().optional(),
gender: z.string().optional(),
});
module.exports = {
createEmployeeSchema,
};

View File

@@ -0,0 +1,21 @@
const { z } = require("zod");
const registerSchema = z.object({
firstname: z.string().min(2, "Le prénom doit contenir au moins 2 caractères"),
lastname: z.string().min(2, "Le nom doit contenir au moins 2 caractères"),
email: z.string().email("Email invalide"),
password: z.string().min(8, "Le mot de passe doit contenir au moins 8 caractères"),
birthdate: z.string().optional(),
gender: z.string().optional(),
marketingOptIn: z.boolean().optional(),
});
const loginSchema = z.object({
email: z.string().email("Email invalide"),
password: z.string().min(1, "Mot de passe requis"),
});
module.exports = {
registerSchema,
loginSchema,
};

View File

@@ -0,0 +1,13 @@
const { z } = require("zod");
const participateSchema = z.object({
code: z
.string()
.min(10, "Le code doit contenir 10 caractères")
.max(10, "Le code doit contenir 10 caractères")
.toUpperCase(),
});
module.exports = {
participateSchema,
};