- Remove unused IntegrationCommands folders
- minor name changes
This commit is contained in:
parent
a2eb2a348d
commit
45fff656d0
@ -74,9 +74,4 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="IntegrationCommands\CommandHandlers\" />
|
||||
<Folder Include="IntegrationCommands\Commands\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -79,8 +79,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Application\IntegrationCommands\CommandHandlers\" />
|
||||
<Folder Include="Application\IntegrationCommands\Commands\" />
|
||||
<Folder Include="Infrastructure\IntegrationEventMigrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user