# app/src/integrations/exchange/mock_data.py

from __future__ import annotations

from datetime import datetime, timezone
from decimal import Decimal

from src.integrations.exchange.models import BalanceSummary, ExchangeHealth
from src.market_data.acquisition.models.quote import Quote


def mock_exchange_health() -> ExchangeHealth:
    return ExchangeHealth(
        ok=True,
        mode="mock",
        message="Биржа работает в mock mode. Реальный API пока не подключен.",
    )


def mock_quote(symbol: str) -> Quote:
    normalized_symbol = symbol.upper().strip()
    fake_prices = {
        "BTCUSDT": Decimal("68425.10"),
        "ETHUSDT": Decimal("3521.44"),
        "BNBUSDT": Decimal("612.33"),
    }
    price = fake_prices.get(normalized_symbol, Decimal("100.00"))

    return Quote(
        symbol=normalized_symbol,
        last_price=price,
        bid_price=price,
        ask_price=price,
        exchange_timestamp=None,
        received_at=datetime.now(timezone.utc),
        source="mock",
    )


def mock_balance_summary() -> list[BalanceSummary]:
    return [
        BalanceSummary(currency="USDT", available=1500.00, locked=0.0, source="mock"),
        BalanceSummary(currency="BTC", available=0.025, locked=0.0, source="mock"),
    ]
