From 689096f4c83c19abd72267c61335db6d254247a3 Mon Sep 17 00:00:00 2001 From: Christian Arenas Date: Thu, 18 May 2017 12:03:17 +0200 Subject: [PATCH] - Remove unused IntegrationCommands folders - minor name changes --- src/Services/Catalog/Catalog.API/Catalog.API.csproj | 5 ----- .../OrderStockRejectedIntegrationEventHandler.cs | 4 ++-- .../Ordering.API/Application/Sagas/OrderSaga.cs | 4 +--- src/Services/Ordering/Ordering.API/Ordering.API.csproj | 2 -- .../AggregatesModel/OrderAggregate/Order.cs | 10 +++++----- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 2f0a0d20a..3c2686278 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -74,9 +74,4 @@ - - - - - diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs index 124bb8a11..c70eba187 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs @@ -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(); } diff --git a/src/Services/Ordering/Ordering.API/Application/Sagas/OrderSaga.cs b/src/Services/Ordering/Ordering.API/Application/Sagas/OrderSaga.cs index b1041971a..a570d7eca 100644 --- a/src/Services/Ordering/Ordering.API/Application/Sagas/OrderSaga.cs +++ b/src/Services/Ordering/Ordering.API/Application/Sagas/OrderSaga.cs @@ -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 SaveChangesAsync() diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index e0970db38..63f98fc9a 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -79,8 +79,6 @@ - - diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs index 1f3a0dbbf..a7389a227 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs @@ -156,7 +156,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O _description = $"The order was cancelled."; } - public void SetCancelledStatusWhenStockIsRejected(IEnumerable orderStockNotConfirmedItems) + public void SetCancelledStatusWhenStockIsRejected(IEnumerable 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,