from __future__ import annotations

import json

from sqlalchemy.orm import Session

from app.core.logging import get_logger
from app.services.employee_behavior_profile_service import EmployeeBehaviorProfileService

logger = get_logger("app.services.hermes_employee_profile_scanner")


class HermesEmployeeProfileScannerService:
    def __init__(self, db: Session) -> None:
        self.db = db

    def scan_employee_profiles(self, log_id: str | None = None) -> dict:
        logger.info("Starting Hermes employee behavior profile scan...")
        summary = EmployeeBehaviorProfileService(self.db).scan_profiles(log_id=log_id)
        logger.info(
            "Hermes employee profile scan completed: %s",
            json.dumps(summary, ensure_ascii=False),
        )
        return summary
