refactor: replace SessionDep with explicit Annotated[Session, Depends(get_session)] across all routers

- Replace SessionDep type alias with explicit Annotated[Session, Depends(get_session)]
- Add missing imports for Session, Annotated, and Depends types
- Update all endpoint function signatures to use explicit dependency annotation
- Remove redundant `= Depends()` default values from session parameters
- Update docstrings and comments to reference new annotation pattern
- Apply changes consistently across all router
This commit is contained in:
oib
2026-03-07 15:45:11 +01:00
parent 93aae0edb3
commit 89e161c906
75 changed files with 371 additions and 372 deletions

View File

@@ -1,14 +1,15 @@
from sqlalchemy.orm import Session
from typing import Annotated
"""
Dependency injection module for AITBC Coordinator API
Provides unified dependency injection using storage.SessionDep.
Provides unified dependency injection using storage.Annotated[Session, Depends(get_session)].
"""
from typing import Callable
from fastapi import Depends, Header, HTTPException
from .config import settings
from .storage import SessionDep
def _validate_api_key(allowed_keys: list[str], api_key: str | None) -> str:
@@ -68,6 +69,6 @@ def require_admin_key() -> Callable[[str | None], str]:
# Legacy aliases for backward compatibility
def get_session():
"""Legacy alias - use SessionDep instead."""
"""Legacy alias - use Annotated[Session, Depends(get_session)] instead."""
from .storage import get_session
return get_session()