- Add /cfdi/emisores and /cfdi/receptores API endpoints - Search by RFC or nombre with ILIKE - Show suggestions dropdown while typing (min 2 chars) - Click suggestion to select and populate filter input - Show loading state while searching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
22 lines
829 B
TypeScript
22 lines
829 B
TypeScript
import { Router, type IRouter } from 'express';
|
|
import { authenticate } from '../middlewares/auth.middleware.js';
|
|
import { tenantMiddleware } from '../middlewares/tenant.middleware.js';
|
|
import * as cfdiController from '../controllers/cfdi.controller.js';
|
|
|
|
const router: IRouter = Router();
|
|
|
|
router.use(authenticate);
|
|
router.use(tenantMiddleware);
|
|
|
|
router.get('/', cfdiController.getCfdis);
|
|
router.get('/resumen', cfdiController.getResumen);
|
|
router.get('/emisores', cfdiController.getEmisores);
|
|
router.get('/receptores', cfdiController.getReceptores);
|
|
router.get('/:id', cfdiController.getCfdiById);
|
|
router.get('/:id/xml', cfdiController.getXml);
|
|
router.post('/', cfdiController.createCfdi);
|
|
router.post('/bulk', cfdiController.createManyCfdis);
|
|
router.delete('/:id', cfdiController.deleteCfdi);
|
|
|
|
export { router as cfdiRoutes };
|