- Remove unused IntegrationCommands folders

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

View File

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

View File

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

View File

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

View File

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

View File

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