fix: add missing errors utility and fix seed timestamp casting

- Add apps/api/src/utils/errors.ts with AppError class
- Fix seed.ts timestamp casting for calendario_fiscal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Consultoria AS
2026-01-22 03:30:49 +00:00
parent 0c4b1a43a9
commit f4b42aa8c2
4 changed files with 4255 additions and 1 deletions

View File

@@ -216,7 +216,7 @@ async function main() {
await prisma.$executeRawUnsafe(`
INSERT INTO "${schemaName}"."calendario_fiscal"
(titulo, descripcion, tipo, fecha_limite, recurrencia, completado)
VALUES ($1, $2, $3, $4, 'mensual', $5)
VALUES ($1, $2, $3, $4::timestamp, 'mensual', $5)
ON CONFLICT DO NOTHING
`, evento.titulo, `${evento.titulo} - ${mes}/${año}`, evento.tipo, fechaLimite.toISOString(), completado);
}

View File

@@ -0,0 +1,10 @@
export class AppError extends Error {
constructor(
public statusCode: number,
public message: string,
public isOperational = true
) {
super(message);
Object.setPrototypeOf(this, AppError.prototype);
}
}