
from fastapi import FastAPI
from app.core.module_framework.registry import ModuleRegistry
import pkgutil
import importlib

def setup_module(app: FastAPI, registry: ModuleRegistry):
    from . import presentation
    for _, name, _ in pkgutil.iter_modules(presentation.__path__):
        mod = importlib.import_module(f"app.modules.inventory.presentation.{name}")
        if hasattr(mod, "router"):
            app.include_router(mod.router)
