- Remove unused IntegrationCommands folders

- minor name changes
This commit is contained in:
Christian Arenas 2017-05-18 12:03:17 +02:00
parent a2eb2a348d
commit 45fff656d0
5 changed files with 8 additions and 17 deletions

View File

@ -74,9 +74,4 @@
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="IntegrationCommands\CommandHandlers\" />
<Folder Include="IntegrationCommands\Commands\" />
</ItemGroup>
</Project>

View File

@ -19,11 +19,11 @@
{
var orderToUpdate = await _orderRepository.GetAsync(@event.OrderId);
var orderStockNotConfirmedItems = @event.OrderStockItems
var orderStockRejectedItems = @event.OrderStockItems
.FindAll(c => !c.HasStock)
.Select(c => c.ProductId);
orderToUpdate.SetCancelledStatusWhenStockIsRejected(orderStockNotConfirmedItems);
orderToUpdate.SetCancelledStatusWhenStockIsRejected(orderStockRejectedItems);
await _orderRepository.UnitOfWork.SaveEntitiesAsync();
}

View File

@ -17,13 +17,11 @@ namespace Ordering.API.Application.Sagas
public override Order FindSagaById(int id)
{
var order = _orderingContext.Orders
return _orderingContext.Orders
.Include(c => c.OrderStatus)
.Include(c => c.OrderItems)
.Include(c => c.Address)
.Single(c => c.Id == id);
return order;
}
public override async Task<bool> SaveChangesAsync()

View File

@ -79,8 +79,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Application\IntegrationCommands\CommandHandlers\" />
<Folder Include="Application\IntegrationCommands\Commands\" />
<Folder Include="Infrastructure\IntegrationEventMigrations\" />
</ItemGroup>

View File

@ -156,7 +156,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
_description = $"The order was cancelled.";
}
public void SetCancelledStatusWhenStockIsRejected(IEnumerable<int> orderStockNotConfirmedItems)
public void SetCancelledStatusWhenStockIsRejected(IEnumerable<int> orderStockRejectedItems)
{
if (_orderStatusId != OrderStatus.AwaitingValidation.Id)
{
@ -165,12 +165,12 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
_orderStatusId = OrderStatus.Cancelled.Id;
var itemsStockNotConfirmedProductNames = OrderItems
.Where(c => orderStockNotConfirmedItems.Contains(c.ProductId))
var itemsStockRejectedProductNames = OrderItems
.Where(c => orderStockRejectedItems.Contains(c.ProductId))
.Select(c => c.GetOrderItemProductName());
var itemsStockNotConfirmedDescription = string.Join(", ", itemsStockNotConfirmedProductNames);
_description = $"The product items don't have stock: ({itemsStockNotConfirmedDescription}).";
var itemsStockRejectedDescription = string.Join(", ", itemsStockRejectedProductNames);
_description = $"The product items don't have stock: ({itemsStockRejectedDescription}).";
}
private void AddOrderStartedDomainEvent(string userId, int cardTypeId, string cardNumber,