Fix some errors
This commit is contained in:
parent
6f7605776d
commit
f5ab8333ce
@ -78,12 +78,9 @@ namespace Ordering.API.Application.Sagas
|
||||
CheckValidSagaId(orderSaga);
|
||||
|
||||
// TODO: This handler should change to Integration command handler type once command bus is implemented
|
||||
|
||||
// TODO: If order status is not cancelled, change state to awaitingValidation and
|
||||
// send ConfirmOrderStockCommandMsg to Inventory api
|
||||
if (orderSaga.OrderStatus == OrderStatus.Submitted)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
|
||||
|
||||
using Ordering.API.Application.IntegrationCommands.Commands;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.API
|
||||
{
|
||||
using AspNetCore.Http;
|
||||
@ -23,9 +25,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.HealthChecks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ordering.API.Application.Commands;
|
||||
using Ordering.API.Application.IntegrationCommands.Commands;
|
||||
using Ordering.API.Application.IntegrationEvents.Events;
|
||||
using Ordering.Infrastructure;
|
||||
using RabbitMQ.Client;
|
||||
using System;
|
||||
|
@ -34,15 +34,12 @@
|
||||
IEnumerable<int> orderIds = new List<int>();
|
||||
using (var conn = new SqlConnection(_settings.ConnectionString))
|
||||
{
|
||||
if (conn != null)
|
||||
{
|
||||
conn.Open();
|
||||
orderIds = conn.Query<int>(
|
||||
@"SELECT Id FROM [Microsoft.eShopOnContainers.Services.OrderingDb].[ordering].[orders]
|
||||
WHERE DATEDIFF(hour, [OrderDate], GETDATE()) >= @GracePeriod
|
||||
AND [OrderStatusId] = 1",
|
||||
new { GracePeriod = _settings.GracePeriod });
|
||||
}
|
||||
conn.Open();
|
||||
orderIds = conn.Query<int>(
|
||||
@"SELECT Id FROM [Microsoft.eShopOnContainers.Services.OrderingDb].[ordering].[orders]
|
||||
WHERE DATEDIFF(hour, [OrderDate], GETDATE()) >= @GracePeriod
|
||||
AND [OrderStatusId] = 1",
|
||||
new { GracePeriod = _settings.GracePeriod });
|
||||
}
|
||||
|
||||
return orderIds;
|
||||
@ -52,7 +49,7 @@
|
||||
{
|
||||
var confirmGracePeriodEvent = new ConfirmGracePeriodIntegrationEvent(orderId);
|
||||
|
||||
// Publish through the Event Bus and mark the saved event as published
|
||||
// Publish through the Event Bus
|
||||
_confirmGracePeriodEvent.PublishThroughEventBus(confirmGracePeriodEvent);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user