Browse Source

Fix some errors

pull/223/head
Christian Arenas 7 years ago
parent
commit
f5ab8333ce
3 changed files with 10 additions and 17 deletions
  1. +1
    -4
      src/Services/Ordering/Ordering.API/Application/Sagas/OrderProcessSaga.cs
  2. +2
    -3
      src/Services/Ordering/Ordering.API/Startup.cs
  3. +7
    -10
      src/Services/SagaManager/SagaManager/Services/SagaManagerService.cs

+ 1
- 4
src/Services/Ordering/Ordering.API/Application/Sagas/OrderProcessSaga.cs View File

@ -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)
{
}
}


+ 2
- 3
src/Services/Ordering/Ordering.API/Startup.cs View File

@ -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;


+ 7
- 10
src/Services/SagaManager/SagaManager/Services/SagaManagerService.cs View File

@ -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…
Cancel
Save