from __future__ import annotations

from fastapi import APIRouter

from app.modules.api.application.request_service import RequestService
from app.modules.api.application.session_service import SessionService
from app.modules.api.application.stream_service import StreamService
from app.modules.api.controllers.request_controller import RequestController
from app.modules.api.controllers.session_controller import SessionController
from app.modules.api.controllers.stream_controller import StreamController
from app.modules.api.public_router import build_public_router


class ApiModule:
    def __init__(
        self,
        sessions: SessionService,
        requests: RequestService,
        streams: StreamService,
    ) -> None:
        self._sessions = SessionController(sessions)
        self._requests = RequestController(requests)
        self._streams = StreamController(streams)

    def public_router(self) -> APIRouter:
        return build_public_router(
            sessions=self._sessions,
            requests=self._requests,
            streams=self._streams,
        )
