fix: resolve circular import in module system

The circular import occurred because:
1. app.modules.base imported FrontendType from models.database.admin_menu_config
2. This triggered models/database/__init__.py which runs model discovery
3. Model discovery imported module definitions
4. Module definitions imported from app.modules.base (still initializing)

Solution: Move FrontendType and MANDATORY_MENU_ITEMS to a new
app/modules/enums.py file. The models file re-exports them for
backward compatibility with existing imports.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 21:21:07 +01:00
parent 66f9600286
commit 6d7accfa25
3 changed files with 52 additions and 27 deletions

View File

@@ -44,7 +44,7 @@ if TYPE_CHECKING:
from fastapi import APIRouter
from pydantic import BaseModel
from models.database.admin_menu_config import FrontendType
from app.modules.enums import FrontendType
@dataclass