public async Task <IOperationResult> HandleAsync(IApplySaleStrategy command, ICorrelationContext correlationContext)
        {
            var saleStrategy = await _repository.GetSaleStrategy(command.SaleStrategyId);

            if (saleStrategy is null)
            {
                return(new OperationResult("sale_strategy_not_found", $"Could not find sale strategy with ID '{command.SaleStrategyId}'"));
            }

            var applicationSuccessful = await saleStrategy.ApplyAsync(_accountingService, command.UserId, command.Cost);

            if (applicationSuccessful)
            {
                return(OperationResult.Ok());
            }
            else
            {
                return(new OperationResult("sale_strategy_application_failed", $"The '{saleStrategy.DisplayName}' rejected the sale attempt."));
            }
        }
 public async Task <SaleStrategyDto> HandleAsync(GetSaleStrategy query)
 {
     return(_mapper.MapToWithNullPropagation <SaleStrategyDto>(await _repository.GetSaleStrategy(query.Id)));
 }