import 'package:krow_core/core.dart';

import '../repositories/profile_repository.dart';

/// Use case for signing out the current user.
///
/// This use case delegates the sign-out logic to the [ProfileRepositoryInterface].
///
/// Following Clean Architecture principles, this use case:
/// - Encapsulates the sign-out business rule
/// - Depends only on the repository interface
/// - Keeps the domain layer independent of external frameworks
class SignOutUseCase implements NoInputUseCase<void> {
  final ProfileRepositoryInterface _repository;

  /// Creates a [SignOutUseCase].
  ///
  /// Requires a [ProfileRepositoryInterface] to perform the sign-out operation.
  const SignOutUseCase(this._repository);

  @override
  Future<void> call() {
    return _repository.signOut();
  }
}
