feat(auth): supervisor puede configurar FIEL, CSD y Obligaciones
- Backend: agrega 'supervisor' a authorize() de rutas: - POST/DELETE /contribuyentes/:id/fiel - POST /contribuyentes/:id/facturapi/csd - POST/DELETE /contribuyentes/:id/obligaciones/* - Frontend: muestra tarjeta 'Obligaciones Fiscales' en /configuracion para rol supervisor
This commit is contained in:
@@ -25,14 +25,14 @@ router.delete('/:id', authorize('owner'), ctrl.deactivate);
|
||||
router.post('/:id/cliente-acceso', authorize('owner', 'supervisor'), ctrl.addClienteAcceso);
|
||||
|
||||
// FIEL per contribuyente
|
||||
router.post('/:id/fiel', authorize('owner', 'cfo'), configCtrl.uploadFiel);
|
||||
router.post('/:id/fiel', authorize('owner', 'cfo', 'supervisor'), configCtrl.uploadFiel);
|
||||
router.get('/:id/fiel/status', configCtrl.fielStatus);
|
||||
router.delete('/:id/fiel', authorize('owner', 'cfo'), configCtrl.deleteFiel);
|
||||
router.delete('/:id/fiel', authorize('owner', 'cfo', 'supervisor'), configCtrl.deleteFiel);
|
||||
|
||||
// Facturapi per contribuyente
|
||||
router.post('/:id/facturapi/org', authorize('owner', 'cfo'), configCtrl.createOrg);
|
||||
router.get('/:id/facturapi/status', configCtrl.orgStatus);
|
||||
router.post('/:id/facturapi/csd', authorize('owner', 'cfo'), configCtrl.uploadCsd);
|
||||
router.post('/:id/facturapi/csd', authorize('owner', 'cfo', 'supervisor'), configCtrl.uploadCsd);
|
||||
|
||||
// Personalización per contribuyente
|
||||
router.get('/:id/facturapi/customization', facturacionCtrl.getCustomizationContribuyenteCtrl);
|
||||
@@ -42,10 +42,10 @@ router.put('/:id/facturapi/color', authorize('owner', 'cfo'), facturacionCtrl.up
|
||||
// Obligaciones fiscales per contribuyente
|
||||
router.get('/:id/obligaciones/periodo', obligacionesCtrl.getObligacionesPorPeriodo);
|
||||
router.get('/:id/obligaciones', obligacionesCtrl.getObligaciones);
|
||||
router.post('/:id/obligaciones/init', authorize('owner', 'cfo'), obligacionesCtrl.initRecomendaciones);
|
||||
router.post('/:id/obligaciones', authorize('owner', 'cfo'), obligacionesCtrl.addObligacion);
|
||||
router.delete('/:id/obligaciones/:obligacionId', authorize('owner', 'cfo'), obligacionesCtrl.removeObligacion);
|
||||
router.post('/:id/obligaciones/:obligacionId/restore', authorize('owner', 'cfo'), obligacionesCtrl.restoreObligacion);
|
||||
router.post('/:id/obligaciones/init', authorize('owner', 'cfo', 'supervisor'), obligacionesCtrl.initRecomendaciones);
|
||||
router.post('/:id/obligaciones', authorize('owner', 'cfo', 'supervisor'), obligacionesCtrl.addObligacion);
|
||||
router.delete('/:id/obligaciones/:obligacionId', authorize('owner', 'cfo', 'supervisor'), obligacionesCtrl.removeObligacion);
|
||||
router.post('/:id/obligaciones/:obligacionId/restore', authorize('owner', 'cfo', 'supervisor'), obligacionesCtrl.restoreObligacion);
|
||||
router.post('/:id/obligaciones/:obligacionId/complete', authorize('owner', 'cfo', 'contador', 'auxiliar'), obligacionesCtrl.completeObligacion);
|
||||
router.post('/:id/obligaciones/:obligacionId/uncomplete', authorize('owner', 'cfo', 'contador', 'auxiliar'), obligacionesCtrl.uncompleteObligacion);
|
||||
router.post('/:id/obligaciones/:obligacionId/complete-periodo', authorize('owner', 'cfo', 'contador', 'auxiliar'), obligacionesCtrl.completePeriodo);
|
||||
|
||||
@@ -477,7 +477,7 @@ export default function ConfiguracionPage() {
|
||||
</Link>
|
||||
|
||||
{/* Obligaciones Fiscales */}
|
||||
{(user?.role === 'owner' || user?.role === 'cfo') && (
|
||||
{(user?.role === 'owner' || user?.role === 'cfo' || user?.role === 'supervisor') && (
|
||||
<Link href="/configuracion/obligaciones">
|
||||
<Card className="hover:border-primary/50 transition-colors cursor-pointer">
|
||||
<CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user