import 'package:krow_data_connect/krow_data_connect.dart' as dc;

import '../../domain/repositories/settings_repository_interface.dart';

/// Implementation of [SettingsRepositoryInterface].
///
/// This implementation delegates authentication operations to [DataConnectService].
class SettingsRepositoryImpl implements SettingsRepositoryInterface {
  /// Creates a [SettingsRepositoryImpl] with the required [_service].
  const SettingsRepositoryImpl({required dc.DataConnectService service}) : _service = service;

  /// The Data Connect service.
  final dc.DataConnectService _service;

  @override
  Future<void> signOut() async {
    return _service.run(() async {
      await _service.auth.signOut();
    });
  }
}
