import 'package:farm_tpf/custom_model/account.dart';
import 'package:farm_tpf/custom_model/password.dart';
import 'package:farm_tpf/data/api/dio_provider.dart';
import 'package:farm_tpf/data/api/rest_client.dart';

class UserRepository {
  final dio = DioProvider.instance();

  Future<Account> getUser() {
    final client = RestClient(dio);
    return client.getMe();
  }

  Future<void> forgotPassword(String email) {
    final client = RestClient(dio);
    return client.forgotPassword(email);
  }

  Future<void> changePassword(Password password) {
    final client = RestClient(dio);
    return client.changePassword(password);
  }

  Future<Account> updateProfile(Account account) {
    final client = RestClient(dio);
    return client.updateProfile(account);
  }

  Future<void> updateFcmToken(String token) {
    final client = RestClient(dio);
    return client.updateFcmToken(token);
  }

  Future<void> deleteFcmToken(String token) {
    final client = RestClient(dio);
    return client.deleteFcmToken(token);
  }
}
