fix(api): adiciona guard prisma CLS no DashboardService

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-28 00:45:04 +00:00
parent 36103eaa87
commit 93bf906eec

View File

@@ -10,6 +10,7 @@ export class DashboardService {
async repDashboard(userId: string): Promise<RepDashboard> {
const prisma = this.cls.get('prisma');
if (!prisma) throw new Error('prisma não disponível no CLS');
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1;
@@ -109,6 +110,7 @@ export class DashboardService {
async supervisorDashboard(): Promise<SupervisorDashboard> {
const prisma = this.cls.get('prisma');
if (!prisma) throw new Error('prisma não disponível no CLS');
const now = new Date();
// Fila de aprovações — mais antigos primeiro