"""FastAPI dependency providers for repositories.

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

from fastapi import Depends
from sqlalchemy.orm import Session

from app.database import get_db
from app.infrastructure.persistence.repositories.sa_technique_repository import (
    SATechniqueRepository,
)
from app.infrastructure.persistence.repositories.sa_test_repository import (
    SATestRepository,
)


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


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