# #region PreviewSessionManager [C:3] [TYPE Class] [SEMANTICS preview, session]
# @defgroup Translate Module group.
# @BRIEF Manage preview session querying.
# @RELATION DEPENDS_ON -> [preview_session_ops]
# @RATIONALE Session get extracted to preview_session_ops module for INV_7 compliance.

from typing import Any

from sqlalchemy.orm import Session

from ...core.logger import belief_scope
from .preview_session_ops import get_preview_session as _get_preview_session


class PreviewSessionManager:
    """Manage preview session lifecycle: query."""

    def __init__(self, db: Session):
        self.db = db

    # region get_preview_session [TYPE Function]
    # @PURPOSE: Get the latest preview session for a job with its records.
    def get_preview_session(self, job_id: str) -> dict[str, Any]:
        with belief_scope("PreviewSessionManager.get_preview_session"):
            return _get_preview_session(self.db, job_id)
    # endregion get_preview_session

# #endregion PreviewSessionManager
