Skip to content

Commit 04b5577

Browse files
committed
Fix some errors
1 parent cde4c3a commit 04b5577

3 files changed

Lines changed: 10 additions & 17 deletions

File tree

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,9 @@ public async Task Handle(ConfirmGracePeriodCommandMsg command)
7878
CheckValidSagaId(orderSaga);
7979

8080
// TODO: This handler should change to Integration command handler type once command bus is implemented
81+
8182
// TODO: If order status is not cancelled, change state to awaitingValidation and
8283
// send ConfirmOrderStockCommandMsg to Inventory api
83-
if (orderSaga.OrderStatus == OrderStatus.Submitted)
84-
{
85-
86-
}
8784

8885
}
8986

src/Services/Ordering/Ordering.API/Startup.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22

3+
using Ordering.API.Application.IntegrationCommands.Commands;
4+
35
namespace Microsoft.eShopOnContainers.Services.Ordering.API
46
{
57
using AspNetCore.Http;
@@ -23,9 +25,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
2325
using Microsoft.Extensions.DependencyInjection;
2426
using Microsoft.Extensions.HealthChecks;
2527
using Microsoft.Extensions.Logging;
26-
using Ordering.API.Application.Commands;
27-
using Ordering.API.Application.IntegrationCommands.Commands;
28-
using Ordering.API.Application.IntegrationEvents.Events;
2928
using Ordering.Infrastructure;
3029
using RabbitMQ.Client;
3130
using System;

src/Services/SagaManager/SagaManager/Services/SagaManagerService.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,12 @@ private IEnumerable<int> GetFinishedGracePeriodOrders()
3434
IEnumerable<int> orderIds = new List<int>();
3535
using (var conn = new SqlConnection(_settings.ConnectionString))
3636
{
37-
if (conn != null)
38-
{
39-
conn.Open();
40-
orderIds = conn.Query<int>(
41-
@"SELECT Id FROM [Microsoft.eShopOnContainers.Services.OrderingDb].[ordering].[orders]
42-
WHERE DATEDIFF(hour, [OrderDate], GETDATE()) >= @GracePeriod
43-
AND [OrderStatusId] = 1",
44-
new { GracePeriod = _settings.GracePeriod });
45-
}
37+
conn.Open();
38+
orderIds = conn.Query<int>(
39+
@"SELECT Id FROM [Microsoft.eShopOnContainers.Services.OrderingDb].[ordering].[orders]
40+
WHERE DATEDIFF(hour, [OrderDate], GETDATE()) >= @GracePeriod
41+
AND [OrderStatusId] = 1",
42+
new { GracePeriod = _settings.GracePeriod });
4643
}
4744

4845
return orderIds;
@@ -52,7 +49,7 @@ private void Publish(int orderId)
5249
{
5350
var confirmGracePeriodEvent = new ConfirmGracePeriodIntegrationEvent(orderId);
5451

55-
// Publish through the Event Bus and mark the saved event as published
52+
// Publish through the Event Bus
5653
_confirmGracePeriodEvent.PublishThroughEventBus(confirmGracePeriodEvent);
5754
}
5855
}

0 commit comments

Comments
 (0)