Owneat Technical Guide main Help

Class Customer

Namespace: Ordering.Domain.Aggregates.Customer
Assembly: Ordering.Domain.dll

[Table("Customers")] public sealed class Customer : Entity, IAuditable

Inheritance

object ← Entity ← Customer

Implements

IAuditable

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

Customer\(\)

public Customer()

Properties

HasToPay

public bool HasToPay { get; init; }

Property Value

bool

Identifier

[MaxLength(50)] public string Identifier { get; set; }

Property Value

string

IsFinished

public bool IsFinished { get; set; }

Property Value

bool

IsPaymentFirst

public bool IsPaymentFirst { get; init; }

Property Value

bool

OneSignalId

public Guid? OneSignalId { get; init; }

Property Value

Guid?

Orders

public IEnumerable<Order> Orders { get; }

Property Value

IEnumerable < Order \>

RestaurantId

public Guid RestaurantId { get; init; }

Property Value

Guid

TableId

[ForeignKey("TableId")] public Guid TableId { get; set; }

Property Value

Guid

Methods

AcknowledgeCategory\(string\)

Method that marks all the order line items of the customer as acknowledged by the category.

public void AcknowledgeCategory(string categoryName)

Parameters

categoryName string

AcknowledgeServingPeriod\(ServingPeriod\)

Method that marks all the order line items of the customer as acknowledged by the serving period.

public void AcknowledgeServingPeriod(ServingPeriod servingPeriod)

Parameters

servingPeriod ServingPeriod

AlreadyPlacedAnOrder\(\)

public bool AlreadyPlacedAnOrder()

Returns

bool

AreAllOrdersFinished\(\)

Gets a customer out of the system.

public bool AreAllOrdersFinished()

Returns

bool

Create\(string, Guid, Guid, bool, bool, Guid?\)

Method that create a Ordering.Domain.Aggregates.Customer.Customer.

public static Customer Create(string identifier, Guid tableId, Guid restaurantId, bool isPaymentFirst, bool hasToPay, Guid? oneSignalId)

Parameters

identifier string

Ordering.Domain.Aggregates.Customer.Customer.Identifier of the Ordering.Domain.Aggregates.Customer.Customer

tableId Guid

Ordering.Domain.Aggregates.Customer.Customer.TableId of the Ordering.Domain.Aggregates.Customer.Customer

restaurantId Guid

Ordering.Domain.Aggregates.Customer.Customer.RestaurantId of the Ordering.Domain.Aggregates.Customer.Customer

isPaymentFirst bool

Boolean that says if the restaurant needs payment before serving.

hasToPay bool

Boolean that says if the customer has to pay.

oneSignalId Guid?

NotificationId from OneSignal.

Returns

Customer

The created Ordering.Domain.Aggregates.Customer.Customer.

DoesNotHaveToPay\(\)

Method that returns if the customer needs to pay for his orders.

public bool DoesNotHaveToPay()

Returns

bool

FinalizeTransferToTheTableWithId\(Guid\)

Method that move the Ordering.Domain.Aggregates.Customer.Customer to a new table.

public void FinalizeTransferToTheTableWithId(Guid newTableId)

Parameters

newTableId Guid

PlaceAnOrder\(List<OrderLineItem\>\)

Method that add an Ordering.Domain.Aggregates.OrderAggregate.Order to the Ordering.Domain.Aggregates.Customer.Customer.Orders list of the Ordering.Domain.Aggregates.Customer.Customer.

public Order PlaceAnOrder(List<OrderLineItem> lineItems)

Parameters

lineItems List < OrderLineItem \>

The ordered line items to compose the order.

Returns

Order

ProcessUnbilledProducts\(Guid\)

Do treatment due to payment on customer.

public void ProcessUnbilledProducts(Guid payingCustomerId)

Parameters

payingCustomerId Guid

Quit\(\)

Gets a customer out of the system.

public void Quit()

RemoveOrder\(Order\)

Method that remove an Ordering.Domain.Aggregates.OrderAggregate.Order from the Ordering.Domain.Aggregates.Customer.Customer.Orders list of the Ordering.Domain.Aggregates.Customer.Customer.

public void RemoveOrder(Order order)

Parameters

order Order

The Ordering.Domain.Aggregates.OrderAggregate.Order to remove.

RetrievePaidItems\(\)

Retrieve the items that has been paid by the customer.

public List<OrderLineItem> RetrievePaidItems()

Returns

List < OrderLineItem \>

SendCustomerCreationEvent\(\)

Method that send the customer created domain event.

public void SendCustomerCreationEvent()

ServeCategory\(string\)

Method that validate all the order line items of the customer by the category.

public void ServeCategory(string categoryName)

Parameters

categoryName string

ServeServingPeriod\(ServingPeriod\)

Method that validate all the order line items of the customer by the serving period.

public void ServeServingPeriod(ServingPeriod servingPeriod)

Parameters

servingPeriod ServingPeriod

UnlinkEveryPaidItemsFromTheCustomerWithId\(Guid\)

public void UnlinkEveryPaidItemsFromTheCustomerWithId(Guid customerToRemoveGuid)

Parameters

customerToRemoveGuid Guid

ValidatePaymentMadeByCustomerWithId\(Guid\)

Do treatment due to payment on customer.

public void ValidatePaymentMadeByCustomerWithId(Guid payingCustomerId)

Parameters

payingCustomerId Guid

Last modified: 21 May 2024