Class Order
Namespace: Ordering.Domain.Aggregates.OrderAggregate
Assembly: Ordering.Domain.dll
Inheritance
object ← Entity ← Order
Implements
Inherited Members
Entity.Id, Entity.CreatedAt, Entity.UpdatedAt, Entity.DomainEvents, object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)
Constructors
Order\(\)
Properties
CustomerId
The Ordering.Domain.Aggregates.Customer that placed the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
IsTreatmentOver
Bool that says if the order is ended for the restaurant.
Property Value
LineItems
The list of products contained in the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
IEnumerable < OrderLineItem \>
NeedsToBePaid
Bool that says if an order needs to be paid.
Property Value
PaymentState
The current state of the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
RestaurantId
The Restaurant where is placed the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
State
The current state of the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
TableId
The Ordering.Domain.Aggregates.TableAggregate.Table where is placed the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
TotalPrice
The total price of all products included in the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
UnpaidTotalPrice
The total price of all products included in the Ordering.Domain.Aggregates.OrderAggregate.Order.
Property Value
Methods
AcknowledgeCategory\(string\)
Parameters
categoryName string
AcknowledgeServingPeriod\(ServingPeriod\)
Method that marks all the order line items of the order as acknowledged.
Parameters
servingPeriod ServingPeriod
AddNewLineItem\(OrderLineItem\)
Method that add a product to the Ordering.Domain.Aggregates.OrderAggregate.Order.LineItems list of the Ordering.Domain.Aggregates.OrderAggregate.Order.
Parameters
lineItem OrderLineItem
The product to add.
AddProducts\(IEnumerable<OrderLineItem\>\)
Method that add a product to the Ordering.Domain.Aggregates.OrderAggregate.Order.LineItems list of the Ordering.Domain.Aggregates.OrderAggregate.Order.
Parameters
products IEnumerable < OrderLineItem \>
The products to add.
CalculateIfPaymentIsNeededForOrder\(\)
Method that initialize state depending on pre-payment condition.
Cancel\(\)
Method that cancel an order.
CancelItemWithId\(Guid\)
Method that cancel an order item.
Parameters
itemToCancelGuid Guid
Returns
Result<Unit\>
CreateNew\(Guid, Guid, Guid, bool, bool, List<OrderLineItem\>\)
Method that create an Ordering.Domain.Aggregates.OrderAggregate.Order.
Parameters
customerId Guid
Ordering.Domain.Aggregates.Customer that placed the Ordering.Domain.Aggregates.OrderAggregate.Order.
tableId Guid
Table on which was placed the Ordering.Domain.Aggregates.OrderAggregate.Order.
restaurantId Guid
Restaurant on which was placed the Ordering.Domain.Aggregates.OrderAggregate.Order.
customerNeedsToPayFirst bool
Book that says if the customer needs to pay first.
customerHasToPay bool
Bool that says if the customer will have to pay (payment enabled or not).
items List < OrderLineItem \>
The ordered line items to compose the order.
Returns
Order
The created Ordering.Domain.Aggregates.OrderAggregate.Order.
Finish\(\)
Mark the order to finished state.
GetOrderProducts\(\)
Method that get all the Ordering.Domain.Aggregates.OrderAggregate.OrderLineItems of the Ordering.Domain.Aggregates.OrderAggregate.Order.
Returns
IEnumerable < OrderLineItem \>
GetPaidItems\(\)
Method that get all the Ordering.Domain.Aggregates.OrderAggregate.OrderLineItems of that had been paid.
Returns
IEnumerable < OrderLineItem \>
MarkAllItemsAsAcknowledged\(\)
Method that marks all the order line items of the order as acknowledged.
MarkAnItemAsAcknowledged\(Guid\)
Method that marks a unique order line item of the order as acknowledged.
Parameters
acknowledgedItemId Guid
OrderHasBeenCanceled\(\)
Method that says if an order is canceled.
Returns
RemoveLineItemFromBilling\(OrderLineItem, int\)
Method that remove the line item from the current billing.
Parameters
lineItem OrderLineItem
newQuantity int
RemoveProduct\(OrderLineItem\)
Method that remove a product from the Ordering.Domain.Aggregates.OrderAggregate.Order.LineItems list of the Ordering.Domain.Aggregates.OrderAggregate.Order.
Parameters
lineItem OrderLineItem
The product to remove.
Serve\(\)
Method that serve an order.
ServeAcknowledgedItemsByCategory\(string\)
Parameters
categoryName string
ServeAcknowledgedItemsByServingPeriod\(ServingPeriod\)
Method that validate all the order line items of the order by the serving period.
Parameters
servingPeriod ServingPeriod
ServeTheLineItemWithId\(Guid\)
Method that serve a single order line item of the order.
Parameters
servedItemId Guid
SwitchToTheTableWithId\(Guid, Guid\)
Parameters
movingCustomerId Guid
newTableId Guid
TogglePayingCustomerId\(Guid, Guid\)
Method that toggle an order line item paying customer id.
Parameters
orderLineItemId Guid
payingCustomerId Guid
Returns
Result< OrderLineItem \>
UnlinkEveryPaidItemsFromTheCustomerWithId\(Guid\)
Method that reset the paying customer of the order line items with the given id.
Parameters
customerToRemoveGuid Guid