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

/// Use case for creating a one-time staffing order.
///
/// This use case encapsulates the logic for submitting a structured
/// staffing request and delegates the data operation to the
/// [ClientCreateOrderRepositoryInterface].
class CreateOneTimeOrderUseCase
    implements UseCase<OneTimeOrderArguments, void> {
  /// Creates a [CreateOneTimeOrderUseCase].
  ///
  /// Requires a [ClientCreateOrderRepositoryInterface] to interact with the data layer.
  const CreateOneTimeOrderUseCase(this._repository);
  final ClientCreateOrderRepositoryInterface _repository;

  @override
  Future<void> call(OneTimeOrderArguments input) {
    return _repository.createOneTimeOrder(input.order);
  }
}
