fix: personalización logo/color por contribuyente en vez de tenant

- Agrega getCustomizationContribuyente, uploadLogoContribuyente,
  updateColorContribuyente en contribuyente-facturapi.service.ts
- Agrega controllers per-contribuyente en facturacion.controller.ts
- Agrega rutas GET/POST/PUT /contribuyentes/:id/facturapi/customization|logo|color
- Modifica CustomizationSection para recibir contribuyenteId, usar endpoints
  per-contribuyente, y corrige useState mal aplicado a useEffect
- Backend y frontend buildeados y deployados
This commit is contained in:
Horux Dev
2026-05-22 18:20:09 +00:00
parent 46846200da
commit 5ba31b7291
5 changed files with 138 additions and 16 deletions

View File

@@ -3,6 +3,7 @@ import { authenticate, authorize } from '../middlewares/auth.middleware.js';
import { tenantMiddleware } from '../middlewares/tenant.middleware.js';
import * as ctrl from '../controllers/contribuyente.controller.js';
import * as configCtrl from '../controllers/contribuyente-config.controller.js';
import * as facturacionCtrl from '../controllers/facturacion.controller.js';
import * as obligacionesCtrl from '../controllers/obligaciones.controller.js';
const router: IRouter = Router();
@@ -32,6 +33,11 @@ router.post('/:id/facturapi/org', authorize('owner', 'cfo'), configCtrl.createOr
router.get('/:id/facturapi/status', configCtrl.orgStatus);
router.post('/:id/facturapi/csd', authorize('owner', 'cfo'), configCtrl.uploadCsd);
// Personalización per contribuyente
router.get('/:id/facturapi/customization', facturacionCtrl.getCustomizationContribuyenteCtrl);
router.post('/:id/facturapi/logo', authorize('owner', 'cfo'), facturacionCtrl.uploadLogoContribuyenteCtrl);
router.put('/:id/facturapi/color', authorize('owner', 'cfo'), facturacionCtrl.updateColorContribuyenteCtrl);
// Obligaciones fiscales per contribuyente
router.get('/:id/obligaciones/periodo', obligacionesCtrl.getObligacionesPorPeriodo);
router.get('/:id/obligaciones', obligacionesCtrl.getObligaciones);