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

@@ -58,7 +58,7 @@ export async function listProjects(params: ListProjectsParams) {
responsible_user_name: p.users
? `${p.users.first_name} ${p.users.last_name}`.trim()
: null,
order_number: (p.orders as any)?.order_number || null,
order_number: p.orders?.order_number || null,
}));
return { data: enriched, total, page, limit };