Fix some errors

This commit is contained in:
Christian Arenas 2017-05-08 11:32:57 +02:00
parent 6f7605776d
commit f5ab8333ce
3 changed files with 10 additions and 17 deletions

View File

@ -78,12 +78,9 @@ namespace Ordering.API.Application.Sagas
CheckValidSagaId(orderSaga); CheckValidSagaId(orderSaga);
// TODO: This handler should change to Integration command handler type once command bus is implemented // 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 // TODO: If order status is not cancelled, change state to awaitingValidation and
// send ConfirmOrderStockCommandMsg to Inventory api // send ConfirmOrderStockCommandMsg to Inventory api
if (orderSaga.OrderStatus == OrderStatus.Submitted)
{
}
} }

View File

@ -1,5 +1,7 @@
 
using Ordering.API.Application.IntegrationCommands.Commands;
namespace Microsoft.eShopOnContainers.Services.Ordering.API namespace Microsoft.eShopOnContainers.Services.Ordering.API
{ {
using AspNetCore.Http; using AspNetCore.Http;
@ -23,9 +25,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.HealthChecks; using Microsoft.Extensions.HealthChecks;
using Microsoft.Extensions.Logging; 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 Ordering.Infrastructure;
using RabbitMQ.Client; using RabbitMQ.Client;
using System; using System;

View File

@ -34,15 +34,12 @@
IEnumerable<int> orderIds = new List<int>(); IEnumerable<int> orderIds = new List<int>();
using (var conn = new SqlConnection(_settings.ConnectionString)) using (var conn = new SqlConnection(_settings.ConnectionString))
{ {
if (conn != null) conn.Open();
{ orderIds = conn.Query<int>(
conn.Open(); @"SELECT Id FROM [Microsoft.eShopOnContainers.Services.OrderingDb].[ordering].[orders]
orderIds = conn.Query<int>( WHERE DATEDIFF(hour, [OrderDate], GETDATE()) >= @GracePeriod
@"SELECT Id FROM [Microsoft.eShopOnContainers.Services.OrderingDb].[ordering].[orders] AND [OrderStatusId] = 1",
WHERE DATEDIFF(hour, [OrderDate], GETDATE()) >= @GracePeriod new { GracePeriod = _settings.GracePeriod });
AND [OrderStatusId] = 1",
new { GracePeriod = _settings.GracePeriod });
}
} }
return orderIds; return orderIds;
@ -52,7 +49,7 @@
{ {
var confirmGracePeriodEvent = new ConfirmGracePeriodIntegrationEvent(orderId); 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); _confirmGracePeriodEvent.PublishThroughEventBus(confirmGracePeriodEvent);
} }
} }