import '../../core/network/api_client.dart';
import 'tier.dart';

/// واکشی انواع میز برای صفحه‌ی لیست میزها.
class GameRepository {
  final ApiClient _api;
  GameRepository(this._api);

  Future<List<TableTier>> getTiers() async {
    final res = await _api.dio.get('/shop');
    final cat = Map<String, dynamic>.from(res.data['catalog'] as Map);
    final list = (cat['table_tiers'] as List?) ?? [];
    return list
        .map((e) => TableTier.fromJson(Map<String, dynamic>.from(e as Map)))
        .toList();
  }
}
