"""
Servicio del dashboard — STUB.
Implementa las métricas de tu proyecto aquí.
"""

from sqlalchemy.orm import Session

from .dto import DashboardStats, KPIMetric, OperationsOverview, InventoryMetrics


class DashboardService:
    """Stub — reemplaza con las consultas de tu proyecto."""

    def __init__(self, db: Session, tenant_id: int, company_id: int):
        self.db = db
        self.tenant_id = tenant_id
        self.company_id = company_id

    def get_stats(self) -> DashboardStats:
        empty_kpi = KPIMetric(label="", value=0, trend="stable")
        return DashboardStats(
            company_id=self.company_id,
            generated_at="",
            total_invoices=empty_kpi,
            total_pedimentos=empty_kpi,
            total_clients=empty_kpi,
            total_providers=empty_kpi,
            active_items=empty_kpi,
            pending_approvals=empty_kpi,
            invoices_by_month=[],
            operations_by_type=[],
            top_clients=[],
            top_providers=[],
            recent_activity=[],
        )

    def get_operations_overview(self) -> OperationsOverview:
        return OperationsOverview(total_operations=0, by_type={}, by_status={})

    def get_inventory_metrics(self) -> InventoryMetrics:
        return InventoryMetrics(
            total_items=0, items_in_stock=0, items_low_stock=0, by_category={}
        )
