import 'package:tm_app/core/utils/result.dart';
import 'package:tm_app/data/services/api/tender_detail_api.dart';
import 'package:tm_app/data/services/model/tender_detail_response/tender_detail_response_model.dart';

import '../../core/network/network_manager.dart';

class TenderDetailService {
  TenderDetailService({required NetworkManager networkManager})
    : _networkManager = networkManager;

  final NetworkManager _networkManager;

  Future<Result<TenderDetailResponseModel>> getTenderDetails({
    required String tenderId,
  }) async {
    final result = await _networkManager.makeRequest(
      TenderDetailApi.getTenderDetails(tenderId: tenderId),
      method: 'GET',
      (json) => TenderDetailResponseModel.fromJson(json),
    );
    return result;
  }
}
