Minor refactoring
This commit is contained in:
parent
df50d6cc08
commit
2a7c1d740b
@ -29,17 +29,16 @@ namespace Ordering.API.Application.Sagas
|
||||
OrderingContext orderingContext)
|
||||
: base(orderingContext)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Command handler which confirms that the grace period
|
||||
/// has been completed and order has not been cancelled.
|
||||
/// If so, the process continues for validation.
|
||||
/// Event handler which confirms that the grace period
|
||||
/// has been completed and order will not initially be cancelled.
|
||||
/// Therefore, the order process continues for validation.
|
||||
/// </summary>
|
||||
/// <param name="event">
|
||||
/// Integration command message which is sent by a saga
|
||||
/// scheduler which provides the sagas that its grace
|
||||
/// period has completed.
|
||||
/// Integration event message which is sent by a saga scheduler
|
||||
/// telling us that the saga's grace period has completed.
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public async Task Handle(GracePeriodConfirmedIntegrationEvent @event)
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
if (!context.OrderStatus.Any())
|
||||
{
|
||||
context.OrderStatus.Add(OrderStatus.Submited);
|
||||
context.OrderStatus.Add(OrderStatus.Submitted);
|
||||
context.OrderStatus.Add(OrderStatus.AwaitingValidation);
|
||||
context.OrderStatus.Add(OrderStatus.StockConfirmed);
|
||||
context.OrderStatus.Add(OrderStatus.Paid);
|
||||
|
@ -46,7 +46,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
||||
_orderItems = new List<OrderItem>();
|
||||
_buyerId = buyerId;
|
||||
_paymentMethodId = paymentMethodId;
|
||||
_orderStatusId = OrderStatus.Submited.Id;
|
||||
_orderStatusId = OrderStatus.Submitted.Id;
|
||||
_orderDate = DateTime.UtcNow;
|
||||
Address = address;
|
||||
|
||||
@ -97,7 +97,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
||||
public void SetAwaitingValidationStatus()
|
||||
{
|
||||
if (_orderStatusId == OrderStatus.Cancelled.Id ||
|
||||
_orderStatusId != OrderStatus.Submited.Id)
|
||||
_orderStatusId != OrderStatus.Submitted.Id)
|
||||
{
|
||||
StatusChangeException(OrderStatus.AwaitingValidation);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
public class OrderStatus
|
||||
: Enumeration
|
||||
{
|
||||
public static OrderStatus Submited = new OrderStatus(1, nameof(Submited).ToLowerInvariant());
|
||||
public static OrderStatus Submitted = new OrderStatus(1, nameof(Submitted).ToLowerInvariant());
|
||||
public static OrderStatus AwaitingValidation = new OrderStatus(2, nameof(AwaitingValidation).ToLowerInvariant());
|
||||
public static OrderStatus StockConfirmed = new OrderStatus(3, nameof(StockConfirmed).ToLowerInvariant());
|
||||
public static OrderStatus Paid = new OrderStatus(4, nameof(Paid).ToLowerInvariant());
|
||||
@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
public static IEnumerable<OrderStatus> List() =>
|
||||
new[] { Submited, AwaitingValidation, StockConfirmed, Paid, Shipped, Cancelled };
|
||||
new[] { Submitted, AwaitingValidation, StockConfirmed, Paid, Shipped, Cancelled };
|
||||
|
||||
public static OrderStatus FromName(string name)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@
|
||||
<a class="esh-orders-link" asp-controller="Order" asp-action="Detail" asp-route-orderId="@item.OrderNumber">Detail</a>
|
||||
</section>
|
||||
<section class="esh-orders-item col-xs-1">
|
||||
@if (item.Status.ToLower() == "submited")
|
||||
@if (item.Status.ToLower() == "submitted")
|
||||
{
|
||||
<a class="esh-orders-link" asp-controller="Order" asp-action="cancel" asp-route-orderId="@item.OrderNumber">Cancel</a>
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ namespace FunctionalTests.Services.Ordering
|
||||
{
|
||||
// Issue: Unable to communicate with test host process
|
||||
//[Fact]
|
||||
//public async Task Checkout_basket_and_check_order_status_submited()
|
||||
//public async Task Checkout_basket_and_check_order_status_submitted()
|
||||
//{
|
||||
// using (var orderServer = new OrderingScenariosBase().CreateServer())
|
||||
// using (var basketServer = new BasketScenariosBase().CreateServer())
|
||||
// {
|
||||
// // Expected data
|
||||
// var cityExpected = $"city-{Guid.NewGuid()}";
|
||||
// var orderStatusExpected = "submited";
|
||||
// var orderStatusExpected = "submitted";
|
||||
|
||||
// var basketClient = basketServer.CreateIdempotentClient();
|
||||
// var orderClient = orderServer.CreateIdempotentClient();
|
||||
|
Loading…
x
Reference in New Issue
Block a user