fix: remove as-any casts, type Dashboard data properly

- Route handlers: add exhaustive return after error checks so TypeScript
  narrows the union and result properties are accessible without casts
- attendance.service: use Prisma.attendanceGetPayload for included relations
- projects.service: remove unnecessary cast on orders relation
- Dashboard.tsx: replace Record<string,any> with proper DashData interface

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-24 20:20:43 +01:00
parent 106606f3fa
commit 87dbde5c59
6 changed files with 74 additions and 17 deletions

View File

@@ -160,6 +160,7 @@ export default async function invoicesRoutes(
`Neplatný přechod stavu z "${result.currentStatus}" na "${result.newStatus}"`,
400,
);
return error(reply, "Neznámá chyba", 500);
}
await logAudit({
@@ -168,7 +169,7 @@ export default async function invoicesRoutes(
action: "update",
entityType: "invoice",
entityId: id,
description: `Upravena faktura ${(result as any).invoice_number}`,
description: `Upravena faktura ${result.invoice_number}`,
});
return success(reply, { id }, 200, "Faktura byla aktualizována");
},