"""Router agregador del módulo Facturación (Diagrama 4). Prefijo ``/fin``."""

from fastapi import APIRouter, Depends

from api.v1.modules.core.permissions.dependencies import PermissionChecker

from . import permissions  # noqa: F401  (side-effect: registra permisos)
from .catalogs.routes import router as catalogs_router
from .concepts.routes import router as concepts_router
from .invoices.routes import router as invoices_router
from .issuer.routes import router as issuer_router
from .stamping.routes import router as stamping_router

# Enforcement por área/carril (R-T-07): se exige fin.access para el módulo.
router = APIRouter(dependencies=[Depends(PermissionChecker(["fin.access"]))])
router.include_router(catalogs_router)
router.include_router(concepts_router)
router.include_router(issuer_router)
router.include_router(invoices_router)
router.include_router(stamping_router)
