File tree Expand file tree Collapse file tree
SagaManager/SagaManager/Services Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11
22
3+ using Ordering . API . Application . IntegrationCommands . Commands ;
4+
35namespace 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 ;
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments