feat: historial muestra todos los turnos del auto con estado, km y comentario
Deploy / deploy (push) Successful in 3m52s

Reemplaza HistorialServicio por Turno en ambas APIs y frontends (cliente y admin).
Muestra: servicio, fecha, horario, estado (badge), km al ingreso, observaciones del jefe.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Beldor
2026-06-22 23:19:53 -03:00
parent 112f4a07bb
commit 4a6023f9f3
4 changed files with 95 additions and 161 deletions
+4 -4
View File
@@ -10,13 +10,13 @@ export async function GET(req: NextRequest) {
const autoId = searchParams.get("autoId");
if (!autoId) return NextResponse.json({ error: "autoId requerido" }, { status: 400 });
const historial = await prisma.historialServicio.findMany({
const turnos = await prisma.turno.findMany({
where: { autoId },
include: { admin: { select: { nombre: true } }, tipoServicio: { select: { nombre: true } } },
orderBy: { fechaRealizado: "desc" },
include: { tipoServicio: { select: { nombre: true } } },
orderBy: { fechaInicio: "desc" },
});
return NextResponse.json(historial);
return NextResponse.json(turnos);
}
export async function POST(req: NextRequest) {