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

import 'auth_service.dart';

class AuthServiceImp implements AuthService {
  AuthServiceImp({
    @required this.authFb,
    @required this.connectivity,
  });

  final Connectivity connectivity;
  final AuthFb authFb;

  @override
  Future<AuthResult> sendSmsCodeToPhoneNumber(String phoneNumber) {
    return authFb.sendSmsCodeToPhoneNumber(phoneNumber);
  }

  @override
  Future<AuthResult> signInWithSmsCode(String smsCode) {
    return authFb.signInWithPhoneNumber(smsCode);
  }

  @override
  Future<void> signout() {
    return authFb.signout();
  }

  @override
  Stream<User> getUserStream() {
    return authFb.user();
  }

  @override
  Stream<Setting> getSetting() {
    return authFb.settings();
  }

  @override
  Future<void> signup(String userName) {
    return authFb.signup(userName);
  }

  @override
  Future<void> joinInvite(String userName) {
    return authFb.joinInvite(userName);
  }

  @override
  Future<bool> hasInvite() {
    return authFb.hasInvite();
  }

  @override
  Future<void> updateProfileName(String newUserName) {
    return authFb.updateProfileName(newUserName);
  }

  @override
  Future<void> updatePreferredCurrency(String currency) {
    return authFb.updatePreferredCurrency(currency);
  }
}
