import 'package:fcs/data/provider/user_data_provider.dart';
import 'package:fcs/domain/entities/connectivity.dart';
import 'package:fcs/domain/entities/user.dart';
import 'package:flutter/material.dart';

import 'user_service.dart';

class UserServiceImp implements UserService {
  UserServiceImp({
    @required this.connectivity,
    @required this.userDataProvider,
  });

  final Connectivity connectivity;
  final UserDataProvider userDataProvider;

  @override
  Future<void> inviteUser(String userName, String phoneNumber) {
    return userDataProvider.inviteUser(userName, phoneNumber);
  }

  @override
  Future<void> deleteInvite(String phoneNumber) {
    return userDataProvider.deleteInvite(phoneNumber);
  }

  @override
  Future<void> acceptRequest(String userID) {
    return userDataProvider.acceptRequest(userID);
  }

  @override
  Future<User> findUser(String phoneNumber) {
    return userDataProvider.findUser(phoneNumber);
  }

  @override
  Future<List<User>> searchUser(String term) {
    return userDataProvider.searchUser(term);
  }

  @override
  Future<void> removeMsgToken(String token) {
    return userDataProvider.removeMsgToken(token);
  }

  @override
  Future<void> uploadMsgToken(String token) {
    return userDataProvider.uploadMsgToken(token);
  }

  @override
  Future<void> enableUser(String userID, bool enabled) {
    return userDataProvider.enableUser(userID, enabled);
  }
}
