import 'package:krow_core/core.dart';
import '../arguments/rapid_order_arguments.dart';
import '../repositories/client_create_order_repository_interface.dart';

/// Use case for creating a rapid (urgent) staffing order.
///
/// This use case handles urgent, text-based staffing requests and
/// delegates the submission to the [ClientCreateOrderRepositoryInterface].
class CreateRapidOrderUseCase implements UseCase<RapidOrderArguments, void> {
  /// Creates a [CreateRapidOrderUseCase].
  ///
  /// Requires a [ClientCreateOrderRepositoryInterface] to interact with the data layer.
  const CreateRapidOrderUseCase(this._repository);
  final ClientCreateOrderRepositoryInterface _repository;

  @override
  Future<void> call(RapidOrderArguments input) {
    return _repository.createRapidOrder(input.description);
  }
}
