import '../../local_peference/local_preference.dart';
import '../../network_api_service/api_service/api_service.dart';
import '../../network_api_service/api_urls/api_urls.dart';
import '../model/support_details_model.dart';

class SupportDetailsRepository {
  final ApiService _apiService = ApiService();

  Future<SupportDetailModel> fetchSupportDetails() async {
    try {
      final userId = await LocalPreference.getUserId();

      final response = await _apiService.get(
        '${ApiUrls.supportDetails}/$userId',
      );

      return SupportDetailModel.fromJson(response.data);
    } catch (e) {
      throw Exception('Failed to fetch support details: $e');
    }
  }
}