# retoor <retoor@molodetz.nl>

from __future__ import annotations

from typing import Optional

from devplacepy.schemas.base import _Out


class GatewayUsageOut(_Out):
    window_hours: int = 48
    generated_at: Optional[str] = None
    requests: int = 0
    volume: dict = {}
    tokens: dict = {}
    latency: dict = {}
    errors: dict = {}
    cost: dict = {}
    behavior: dict = {}
    hourly: list = []
    notes: dict = {}
    admin_section: Optional[str] = None


class UserAiUsageOut(_Out):
    owner_id: str = ""
    window_hours: int = 24
    generated_at: Optional[str] = None
    requests: int = 0
    success: int = 0
    failed: int = 0
    success_pct: float = 0.0
    error_pct: float = 0.0
    tokens: dict = {}
    cost: dict = {}
    latency: dict = {}
    first_used: Optional[str] = None
    last_used: Optional[str] = None
    by_model: list = []
    by_backend: list = []
    hourly: list = []
    notes: dict = {}
