Skip to content

Commit 689096f

Browse files
committed
- Remove unused IntegrationCommands folders
- minor name changes
1 parent f79e21f commit 689096f

5 files changed

Lines changed: 8 additions & 17 deletions

File tree

src/Services/Catalog/Catalog.API/Catalog.API.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,4 @@
7474
</None>
7575
</ItemGroup>
7676

77-
<ItemGroup>
78-
<Folder Include="IntegrationCommands\CommandHandlers\" />
79-
<Folder Include="IntegrationCommands\Commands\" />
80-
</ItemGroup>
81-
8277
</Project>

src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public async Task Handle(OrderStockRejectedIntegrationEvent @event)
1919
{
2020
var orderToUpdate = await _orderRepository.GetAsync(@event.OrderId);
2121

22-
var orderStockNotConfirmedItems = @event.OrderStockItems
22+
var orderStockRejectedItems = @event.OrderStockItems
2323
.FindAll(c => !c.HasStock)
2424
.Select(c => c.ProductId);
2525

26-
orderToUpdate.SetCancelledStatusWhenStockIsRejected(orderStockNotConfirmedItems);
26+
orderToUpdate.SetCancelledStatusWhenStockIsRejected(orderStockRejectedItems);
2727

2828
await _orderRepository.UnitOfWork.SaveEntitiesAsync();
2929
}

src/Services/Ordering/Ordering.API/Application/Sagas/OrderSaga.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ public OrderSaga(OrderingContext orderingContext) : base(orderingContext)
1717

1818
public override Order FindSagaById(int id)
1919
{
20-
var order = _orderingContext.Orders
20+
return _orderingContext.Orders
2121
.Include(c => c.OrderStatus)
2222
.Include(c => c.OrderItems)
2323
.Include(c => c.Address)
2424
.Single(c => c.Id == id);
25-
26-
return order;
2725
}
2826

2927
public override async Task<bool> SaveChangesAsync()

src/Services/Ordering/Ordering.API/Ordering.API.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@
7979
</ItemGroup>
8080

8181
<ItemGroup>
82-
<Folder Include="Application\IntegrationCommands\CommandHandlers\" />
83-
<Folder Include="Application\IntegrationCommands\Commands\" />
8482
<Folder Include="Infrastructure\IntegrationEventMigrations\" />
8583
</ItemGroup>
8684

src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void SetCancelledStatus()
156156
_description = $"The order was cancelled.";
157157
}
158158

159-
public void SetCancelledStatusWhenStockIsRejected(IEnumerable<int> orderStockNotConfirmedItems)
159+
public void SetCancelledStatusWhenStockIsRejected(IEnumerable<int> orderStockRejectedItems)
160160
{
161161
if (_orderStatusId != OrderStatus.AwaitingValidation.Id)
162162
{
@@ -165,12 +165,12 @@ public void SetCancelledStatusWhenStockIsRejected(IEnumerable<int> orderStockNot
165165

166166
_orderStatusId = OrderStatus.Cancelled.Id;
167167

168-
var itemsStockNotConfirmedProductNames = OrderItems
169-
.Where(c => orderStockNotConfirmedItems.Contains(c.ProductId))
168+
var itemsStockRejectedProductNames = OrderItems
169+
.Where(c => orderStockRejectedItems.Contains(c.ProductId))
170170
.Select(c => c.GetOrderItemProductName());
171171

172-
var itemsStockNotConfirmedDescription = string.Join(", ", itemsStockNotConfirmedProductNames);
173-
_description = $"The product items don't have stock: ({itemsStockNotConfirmedDescription}).";
172+
var itemsStockRejectedDescription = string.Join(", ", itemsStockRejectedProductNames);
173+
_description = $"The product items don't have stock: ({itemsStockRejectedDescription}).";
174174
}
175175

176176
private void AddOrderStartedDomainEvent(string userId, int cardTypeId, string cardNumber,

0 commit comments

Comments
 (0)