diff --git a/README.md b/README.md
index a9b814148..06f80bc9f 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,8 @@
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**ALPHA state**)
-Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
It is cross-platform either in the server and client side, thanks to .NET Core services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps.
+Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
+DISCLAIMER: This reference application proposes a simplified microservice oriented architecture implementation (currently in ALPHA state) to introduce technologies like .NET Core with Docker containers and a comprehensive but easy to get started approach. However, this reference application it is not trying to solve all the complexities in a large and mission-critical distributed system.
+
+This reference application is cross-platform either in the server and client side, thanks to .NET Core services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps.
diff --git a/img/eShopOnContainers_Architecture_Diagram.png b/img/eShopOnContainers_Architecture_Diagram.png
index 8bd161f58..3e9b76d16 100644
Binary files a/img/eShopOnContainers_Architecture_Diagram.png and b/img/eShopOnContainers_Architecture_Diagram.png differ
diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs
index f699b369c..bdaff000e 100644
--- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs
@@ -14,7 +14,7 @@
:IAsyncRequest
{
//(CDLTLL) TO DO: This is wrong, we must NOT use a child-entity class (OrderItem) within a Command class!!
- //Need to create a different DTO class, like OrderLineDTO or similar...
+ //Need to create a different DTO class, like OrderLineData or similar within the CreateOrderCommand class...
private readonly List _orderItems;
public string City { get; set; }
diff --git a/src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs b/src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs
index c5f7955e6..e2049947c 100644
--- a/src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs
+++ b/src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs
@@ -3,6 +3,8 @@ using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Models
{
+ //TO DO: Confirm if this class is not needed, if not, remove it
+ //(CDLTLL)
public class NewOrderViewModel
{
public string ShippingCity { get; set; }
diff --git a/src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs b/src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs
index 8a2f42d52..1f088f648 100644
--- a/src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs
+++ b/src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs
@@ -1,5 +1,7 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Models
{
+ //TO DO: Confirm if this class is not needed, if not, remove it
+ //(CDLTLL)
public class OrderItemViewModel
{
public int ProductId { get; set; }
diff --git a/src/Services/Ordering/Ordering.API/Models/_REFACTORING TO DO - Remove ViewModel classes.txt b/src/Services/Ordering/Ordering.API/Models/_REFACTORING TO DO - Remove ViewModel classes.txt
new file mode 100644
index 000000000..a7ac46963
--- /dev/null
+++ b/src/Services/Ordering/Ordering.API/Models/_REFACTORING TO DO - Remove ViewModel classes.txt
@@ -0,0 +1,5 @@
+
+REFACTORING TO DO:
+ //TO DO: Confirm if these ViewModel classes are still needed, if not, remove it
+ //and remove the related Unit Tests
+ //(CDLTLL)
diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
index b86ff9e57..db86e5ba2 100644
--- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
+++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
@@ -52,11 +52,28 @@
ShippingAddress = address;
}
+ //TO DO:
+ // (CDLTLL) Bad implementation, needs to be changed.
+ // The AddOrderItem should have the needed data params
+ // instead of an already created OrderItem object.
+ // The Aggregate-Root is responsible for any Update/Creation of its child entities
+ // If we are providing an already created OrderItem, that was created from the outside
+ // and the AggregateRoot cannot control/validate any rule/invariants/consistency.
public void AddOrderItem(OrderItem item)
{
- // Note: Some logic could be added here (like grouping items in one single OrderItem)
- // Also validation logic could be added here (like ensuring adding almost one item)
+ //TO DO: Bad implementation, need to change.
+ // The code "new OrderItem(params);" should be done here
+ // Plus any validation/rule related
OrderItems.Add(item);
+
+ //(CDLTLL)
+ // TO DO: Some more logic needs to be added here,
+ // Like consolidating items that are the same product in one single OrderItem with several units
+ // Also validation logic could be added here (like ensuring it is adding at least one item unit)
+
+ //Or, If there are different amounts of discounts per added OrderItem
+ //but the product Id is the same to existing Order Items, you should
+ //apply the higher discount, or any other domain logic that makes sense.
}
}
}
diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs
index 53f31a16a..0e57ea701 100644
--- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs
+++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs
@@ -2,7 +2,11 @@
{
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
-
+ //TO DO:
+ //(CDLTLL) Wrong implementation. Need to put Setters as private
+ // and only be able to update the OrderItem through specific methods, if needed, so we can
+ // have validations/control/logic in those "update or set methods".
+ //We also need to have a constructor with the needed params, we must not use the "setters"..
public class OrderItem
:Entity
{