Skip to content

Commit 2a7c1d7

Browse files
Minor refactoring
1 parent df50d6c commit 2a7c1d7

6 files changed

Lines changed: 14 additions & 15 deletions

File tree

src/Services/Ordering/Ordering.API/Application/Sagas/OrderProcessSaga.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@ public OrderProcessSaga(
2929
OrderingContext orderingContext)
3030
: base(orderingContext)
3131
{
32-
}
32+
}
3333

3434
/// <summary>
35-
/// Command handler which confirms that the grace period
36-
/// has been completed and order has not been cancelled.
37-
/// If so, the process continues for validation.
35+
/// Event handler which confirms that the grace period
36+
/// has been completed and order will not initially be cancelled.
37+
/// Therefore, the order process continues for validation.
3838
/// </summary>
3939
/// <param name="event">
40-
/// Integration command message which is sent by a saga
41-
/// scheduler which provides the sagas that its grace
42-
/// period has completed.
40+
/// Integration event message which is sent by a saga scheduler
41+
/// telling us that the saga's grace period has completed.
4342
/// </param>
4443
/// <returns></returns>
4544
public async Task Handle(GracePeriodConfirmedIntegrationEvent @event)

src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static async Task SeedAsync(IApplicationBuilder applicationBuilder)
3131

3232
if (!context.OrderStatus.Any())
3333
{
34-
context.OrderStatus.Add(OrderStatus.Submited);
34+
context.OrderStatus.Add(OrderStatus.Submitted);
3535
context.OrderStatus.Add(OrderStatus.AwaitingValidation);
3636
context.OrderStatus.Add(OrderStatus.StockConfirmed);
3737
context.OrderStatus.Add(OrderStatus.Paid);

src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public Order(string userId, Address address, int cardTypeId, string cardNumber,
4646
_orderItems = new List<OrderItem>();
4747
_buyerId = buyerId;
4848
_paymentMethodId = paymentMethodId;
49-
_orderStatusId = OrderStatus.Submited.Id;
49+
_orderStatusId = OrderStatus.Submitted.Id;
5050
_orderDate = DateTime.UtcNow;
5151
Address = address;
5252

@@ -97,7 +97,7 @@ public void SetBuyerId(int id)
9797
public void SetAwaitingValidationStatus()
9898
{
9999
if (_orderStatusId == OrderStatus.Cancelled.Id ||
100-
_orderStatusId != OrderStatus.Submited.Id)
100+
_orderStatusId != OrderStatus.Submitted.Id)
101101
{
102102
StatusChangeException(OrderStatus.AwaitingValidation);
103103
}

src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderStatus.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
public class OrderStatus
1111
: Enumeration
1212
{
13-
public static OrderStatus Submited = new OrderStatus(1, nameof(Submited).ToLowerInvariant());
13+
public static OrderStatus Submitted = new OrderStatus(1, nameof(Submitted).ToLowerInvariant());
1414
public static OrderStatus AwaitingValidation = new OrderStatus(2, nameof(AwaitingValidation).ToLowerInvariant());
1515
public static OrderStatus StockConfirmed = new OrderStatus(3, nameof(StockConfirmed).ToLowerInvariant());
1616
public static OrderStatus Paid = new OrderStatus(4, nameof(Paid).ToLowerInvariant());
@@ -27,7 +27,7 @@ public OrderStatus(int id, string name)
2727
}
2828

2929
public static IEnumerable<OrderStatus> List() =>
30-
new[] { Submited, AwaitingValidation, StockConfirmed, Paid, Shipped, Cancelled };
30+
new[] { Submitted, AwaitingValidation, StockConfirmed, Paid, Shipped, Cancelled };
3131

3232
public static OrderStatus FromName(string name)
3333
{

src/Web/WebMVC/Views/Order/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<a class="esh-orders-link" asp-controller="Order" asp-action="Detail" asp-route-orderId="@item.OrderNumber">Detail</a>
3232
</section>
3333
<section class="esh-orders-item col-xs-1">
34-
@if (item.Status.ToLower() == "submited")
34+
@if (item.Status.ToLower() == "submitted")
3535
{
3636
<a class="esh-orders-link" asp-controller="Order" asp-action="cancel" asp-route-orderId="@item.OrderNumber">Cancel</a>
3737
}

test/Services/FunctionalTests/Services/Ordering/OrderingScenarios.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ public class OrderingScenarios : OrderingScenariosBase
1818
{
1919
// Issue: Unable to communicate with test host process
2020
//[Fact]
21-
//public async Task Checkout_basket_and_check_order_status_submited()
21+
//public async Task Checkout_basket_and_check_order_status_submitted()
2222
//{
2323
// using (var orderServer = new OrderingScenariosBase().CreateServer())
2424
// using (var basketServer = new BasketScenariosBase().CreateServer())
2525
// {
2626
// // Expected data
2727
// var cityExpected = $"city-{Guid.NewGuid()}";
28-
// var orderStatusExpected = "submited";
28+
// var orderStatusExpected = "submitted";
2929

3030
// var basketClient = basketServer.CreateIdempotentClient();
3131
// var orderClient = orderServer.CreateIdempotentClient();

0 commit comments

Comments
 (0)