From 929aeec641cab3cdc893c8cef7f70c283f41bd53 Mon Sep 17 00:00:00 2001 From: Horux Dev Date: Mon, 25 May 2026 21:49:01 +0000 Subject: [PATCH] feat(declaraciones): supervisor puede crear declaraciones y extras MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Backend: agrega 'supervisor' a ROLES_UPLOAD en documentos.controller.ts - Frontend: agrega 'supervisor' a ROLES_UPLOAD y ROLES_UPLOAD_EXTRA en documentos/page.tsx para habilitar botones de subir declaración, comprobante de pago, eliminar y subir PDFs extra --- apps/api/src/controllers/documentos.controller.ts | 2 +- apps/web/app/(dashboard)/documentos/page.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api/src/controllers/documentos.controller.ts b/apps/api/src/controllers/documentos.controller.ts index b06f0e6..be9259c 100644 --- a/apps/api/src/controllers/documentos.controller.ts +++ b/apps/api/src/controllers/documentos.controller.ts @@ -71,7 +71,7 @@ export async function consultarManual(req: Request, res: Response, next: NextFun // Declaraciones provisionales // ============================================================================ -const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar']; +const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor']; function canUpload(req: Request): boolean { return ROLES_UPLOAD.includes(req.user!.role); diff --git a/apps/web/app/(dashboard)/documentos/page.tsx b/apps/web/app/(dashboard)/documentos/page.tsx index aa60ae3..e89f548 100644 --- a/apps/web/app/(dashboard)/documentos/page.tsx +++ b/apps/web/app/(dashboard)/documentos/page.tsx @@ -76,7 +76,7 @@ function getPeriodLabel(periodicidad: string, mes: number): string { const options = getPeriodOptions(periodicidad as Periodicidad); return options.find(o => o.value === mes)?.label || MESES[mes - 1] || String(mes); } -const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar']; +const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor']; function EstatusBadge({ estatus }: { estatus: string }) { if (estatus === 'Positiva') return {estatus}; @@ -700,7 +700,7 @@ function ComprobantePagoDialog({ declaracion, onClose }: { declaracion: Declarac // Extras — PDFs libres (acuses, contratos, poderes, estados de cuenta, etc.) // ============================================================================ -const ROLES_UPLOAD_EXTRA = ['owner', 'cfo', 'contador', 'auxiliar']; +const ROLES_UPLOAD_EXTRA = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor']; function ExtrasTab() { const user = useAuthStore((s) => s.user);