first commit

This commit is contained in:
2026-04-30 18:22:10 +02:00
commit c3e98af5b6
36 changed files with 4779 additions and 0 deletions
@@ -0,0 +1,20 @@
import type { Request, Response } from "express";
import { ProjectRepository } from "../../db/repositories/project.repository.js";
import { createProjectSchema } from "../../shared/validation/consumer.schemas.js";
const projectRepository = new ProjectRepository();
export async function listProjects(_req: Request, res: Response) {
const result = await projectRepository.list();
res.json(result);
}
export async function createProject(req: Request, res: Response) {
const parsed = createProjectSchema.safeParse(req.body);
if (!parsed.success) {
return res.status(400).json({ error: parsed.error.flatten() });
}
const project = await projectRepository.create(parsed.data.name);
return res.status(201).json(project);
}