"""FastAPI dependency providers for repositories.

Wiring lives ONLY in the presentation layer — use cases and services
never know which concrete repository implementation they receive.
"""

# Import Depends from fastapi
from fastapi import Depends

# Import Session from sqlalchemy.orm
from sqlalchemy.orm import Session

# Import get_db from app.database
from app.database import get_db

# Import  from app.infrastructure.persistence.repositories.sa_technique_repository
from app.infrastructure.persistence.repositories.sa_technique_repository import (
    SATechniqueRepository,
)

# Import  from app.infrastructure.persistence.repositories.sa_test_repository
from app.infrastructure.persistence.repositories.sa_test_repository import (
    SATestRepository,
)


# Define function get_technique_repository
def get_technique_repository(
    # Entry: db
    db: Session = Depends(get_db),
) -> SATechniqueRepository:
    """Provide a TechniqueRepository backed by the current DB session."""
    # Return SATechniqueRepository(db)
    return SATechniqueRepository(db)


# Define function get_test_repository
def get_test_repository(
    # Entry: db
    db: Session = Depends(get_db),
) -> SATestRepository:
    """Provide a TestRepository backed by the current DB session."""
    # Return SATestRepository(db)
    return SATestRepository(db)
