import '../../../../../api/demo/data/demo_ticker.dart';
import '../../../../../api/demo/demo_mode.dart';
import '../../../../../api/marianumconnect/queries/get_ticker/get_ticker.dart';
import '../../../../../api/marianumconnect/queries/get_ticker/get_ticker_response.dart';
import '../../../../../api/marianumconnect/queries/get_ticker_nav/get_ticker_nav.dart';
import '../../../../../api/marianumconnect/queries/get_ticker_nav/get_ticker_nav_response.dart';
import '../../../infrastructure/repository/repository.dart';
import '../bloc/ticker_state.dart';

class TickerRepository extends Repository<TickerState> {
  Future<TickerResponse> getTicker() {
    if (DemoMode.active) return Future.value(DemoTicker.ticker());
    return GetTicker().run();
  }

  Future<TickerNavResponse> getNav() {
    if (DemoMode.active) return Future.value(DemoTicker.nav());
    return GetTickerNav().run();
  }
}
