import 'package:afterwork/domain/entities/user.dart';
import 'package:afterwork/domain/repositories/user_repository.dart';
import 'package:afterwork/data/datasources/user_remote_data_source.dart';
import 'package:afterwork/data/models/user_model.dart';

class UserRepositoryImpl implements UserRepository {
  final UserRemoteDataSource remoteDataSource;

  UserRepositoryImpl({required this.remoteDataSource});

  @override
  Future<User> getUser(String id) async {
    UserModel userModel = await remoteDataSource.getUser(id);
    return userModel;  // Retourne un UserModel qui est un sous-type de User
  }

  Future<User> authenticateUser(String email, String password) async {
    UserModel userModel = await remoteDataSource.authenticateUser(email, password);
    return userModel;  // Retourne un UserModel qui est un sous-type de User
  }
}
