import 'package:tm_app/data/services/api/profile_api.dart';
import 'package:tm_app/data/services/model/company_profile_response/company_profile_response.dart';
import 'package:tm_app/data/services/model/profile_response/profile_response.dart';

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

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

  final NetworkManager _networkManager;

  Future<Result<ProfileResponse>> getProfile() async {
    final result = await _networkManager.makeRequest(
      ProfileApi.profile,
      method: 'GET',
      (json) => ProfileResponse.fromJson(json),
    );
    return result;
  }

  Future<Result<CompanyProfileResponse>> getCompanyProfile() async {
    final result = await _networkManager.makeRequest(
      ProfileApi.companyProfile,
      method: 'GET',
      (json) => CompanyProfileResponse.fromJson(json),
    );
    return result;
  }
}
