import 'package:krow_domain/krow_domain.dart';

// TODO: Implement AuthRepositoryInterface once defined in a feature package.
class AuthRepositoryMock {
  Stream<User?> get currentUser => Stream.value(
    const User(id: 'mock_user_1', email: 'test@krow.com', role: 'staff'),
  );

  Future<String?> signInWithPhone(String phoneNumber) async {
    await Future.delayed(const Duration(milliseconds: 500));
    return 'mock_verification_id';
  }

  Future<User?> verifyOtp(String verificationId, String smsCode) async {
    await Future.delayed(const Duration(milliseconds: 500));
    return const User(id: 'mock_user_1', email: 'test@krow.com', role: 'staff');
  }

  Future<void> signOut() async {
    await Future.delayed(const Duration(milliseconds: 200));
  }

  /// Signs in a user with email and password (Mock).
  Future<User> signInWithEmail(String email, String password) async {
    await Future.delayed(const Duration(milliseconds: 500));
    return User(id: 'mock_client_1', email: email, role: 'client_admin');
  }

  /// Registers a new user with email and password (Mock).
  Future<User> signUpWithEmail(
    String email,
    String password,
    String companyName,
  ) async {
    await Future.delayed(const Duration(milliseconds: 500));
    return User(id: 'mock_client_new', email: email, role: 'client_admin');
  }

  /// Authenticates using a social provider (Mock).
  Future<User> signInWithSocial(String provider) async {
    await Future.delayed(const Duration(milliseconds: 500));
    return const User(
      id: 'mock_social_user',
      email: 'social@example.com',
      role: 'client_admin',
    );
  }
}
