Owneat Technical Guide main Help

Class Table

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

[Table("Tables")] public sealed class Table : Entity, IAggregateRoot, IAuditable, IConcurrent

Inheritance

object ← Entity ← Table

Implements

IAggregateRoot, IAuditable, IConcurrent

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

Table\(\)

public Table()

Table\(Guid, int, int, long\)

public Table(Guid restaurantId, int tableNumber, int seatsCount, long color)

Parameters

restaurantId Guid

tableNumber int

seatsCount int

color long

Properties

Color

The color of the Ordering.Domain.Aggregates.TableAggregate.Table

public long Color { get; set; }

Property Value

long

CurrentCustomers

List of Ordering.Domain.Aggregates.OrderAggregate.Order currently running on a Ordering.Domain.Aggregates.TableAggregate.Table.

public IEnumerable<Customer> CurrentCustomers { get; }

Property Value

IEnumerable < Customer \>

CurrentlySittingCustomersCount

The current number of customers sitting on the Ordering.Domain.Aggregates.TableAggregate.Table.

[NotMapped] public int CurrentlySittingCustomersCount { get; }

Property Value

int

IsCustomersLimitReached

Bool that says if the customers cap is reached on this table.

[NotMapped] public bool IsCustomersLimitReached { get; }

Property Value

bool

IsManualRelease

Bool that says if a waiter needs to do the customers sitting on a the table.

public bool IsManualRelease { get; set; }

Property Value

bool

IsOutOfService

Boot that says if the table is out of service.

[NotMapped] public bool IsOutOfService { get; }

Property Value

bool

IsReleasable

Boot that says if the table is releasable.

[NotMapped] public bool IsReleasable { get; }

Property Value

bool

NumberOfCustomersWhoPlacedAnOrder

The current number of customers who placed an order on the Ordering.Domain.Aggregates.TableAggregate.Table.

[NotMapped] public int NumberOfCustomersWhoPlacedAnOrder { get; }

Property Value

int

OutstandingBalance

The outstanding balance of the Ordering.Domain.Aggregates.TableAggregate.Table.

public double OutstandingBalance { get; }

Property Value

double

RestaurantId

Id of the restaurant where the Ordering.Domain.Aggregates.TableAggregate.Table is located.

public Guid RestaurantId { get; init; }

Property Value

Guid

RowVersion

Versioning field for database concurrency.

public Guid RowVersion { get; set; }

Property Value

Guid

SeatsCount

Number of seats that can be placed on a Ordering.Domain.Aggregates.TableAggregate.Table.

public int SeatsCount { get; set; }

Property Value

int

SittingCustomersLimit

Int that specify the maximum customers linked to the table.

public int? SittingCustomersLimit { get; set; }

Property Value

int?

SortingIndex

Position of the Ordering.Domain.Aggregates.TableAggregate.Table on the owner view.

public int SortingIndex { get; set; }

Property Value

int

State

The current state of the Ordering.Domain.Aggregates.TableAggregate.Table.

public TableState State { get; set; }

Property Value

TableState

TableNumber

Number of the Ordering.Domain.Aggregates.TableAggregate.Table.

public int TableNumber { get; set; }

Property Value

int

TotalPrice

The total price of all Ordering.Domain.Aggregates.OrderAggregate.Order included in the Ordering.Domain.Aggregates.TableAggregate.Table.

[NotMapped] public double TotalPrice { get; }

Property Value

double

WaiterCalledIndicator

Bool that says if a waiter is called on the table.

public WaiterCalledIndicatorStates WaiterCalledIndicator { get; set; }

Property Value

WaiterCalledIndicatorStates

Methods

AlreadyWaitingForServer\(\)

Method that toggle the Ordering.Domain.Aggregates.TableAggregate.Table.WaiterCalledIndicator indicator.

public bool AlreadyWaitingForServer()

Returns

bool

AssignPayingCustomerToFinanciallyUnresolvedItems\(Guid\)

Method that assign customer to the unassigned and unpaid line items.

public void AssignPayingCustomerToFinanciallyUnresolvedItems(Guid payingCustomerId)

Parameters

payingCustomerId Guid

BehaveOnSitting\(\)

Method that reset sitting customer limit if table is in manual release.

public void BehaveOnSitting()

CanWaitingStateMutate\(WaiterCalledIndicatorStates\)

Method that says if the waiterCall indicator will change after the operation.

public bool CanWaitingStateMutate(WaiterCalledIndicatorStates newWaiterCalledIndicator)

Parameters

newWaiterCalledIndicator WaiterCalledIndicatorStates

Returns

bool

ChangeWaiterCalledIndicator\(WaiterCalledIndicatorStates\)

Method that toggle the Ordering.Domain.Aggregates.TableAggregate.Table.WaiterCalledIndicator indicator.

public void ChangeWaiterCalledIndicator(WaiterCalledIndicatorStates newValue)

Parameters

newValue WaiterCalledIndicatorStates

ClearForNewCustomerWithALimit\(int\)

Method that toggle the releasing mode.

public void ClearForNewCustomerWithALimit(int sittingCustomersLimit)

Parameters

sittingCustomersLimit int

ClearTableForNewCustomers\(\)

Method that release a table for next customers when Ordering.Domain.Aggregates.TableAggregate.Table.IsNowFullyPaid.

public void ClearTableForNewCustomers()

Create\(Guid, int, int, long\)

Method that create a Ordering.Domain.Aggregates.TableAggregate.Table.

public static Table Create(Guid restaurantId, int tableNumber, int seatsNumber, long color)

Parameters

restaurantId Guid

Id of the restaurant where the Ordering.Domain.Aggregates.TableAggregate.Table is located.

tableNumber int

Number of the Ordering.Domain.Aggregates.TableAggregate.Table.

seatsNumber int

Number of seats that can be placed on a Ordering.Domain.Aggregates.TableAggregate.Table.

color long

The color of the Ordering.Domain.Aggregates.TableAggregate.Table

Returns

Table

DecreaseOutstandingBalance\(double, string\)

Method that decrease the Ordering.Domain.Aggregates.TableAggregate.Table.OutstandingBalance of the Ordering.Domain.Aggregates.TableAggregate.Table.

public void DecreaseOutstandingBalance(double valueToSubtract, string customerIdentifier)

Parameters

valueToSubtract double

customerIdentifier string

EnactCustomerDepartureToAnotherTable\(Guid, string\)

Method that notify customers and staff that a customer quit the table.

public void EnactCustomerDepartureToAnotherTable(Guid customerToRemoveGuid, string customerToRemoveIdentifier)

Parameters

customerToRemoveGuid Guid

customerToRemoveIdentifier string

FullyAcknowledgeCategory\(string\)

Method that acknowledge a category.

public void FullyAcknowledgeCategory(string categoryName)

Parameters

categoryName string

FullyAcknowledgeServingPeriod\(ServingPeriod\)

Method that acknowledge a period of time.

public void FullyAcknowledgeServingPeriod(ServingPeriod periodToServe)

Parameters

periodToServe ServingPeriod

IncreaseOutstandingBalance\(double, string, Guid\)

Method that increase the Ordering.Domain.Aggregates.TableAggregate.Table.OutstandingBalance of the Ordering.Domain.Aggregates.TableAggregate.Table. It also checks if a table need to be passed from available to busy when an order is placed.

public void IncreaseOutstandingBalance(double valueToAdd, string customerIdentifier, Guid customerId)

Parameters

valueToAdd double

customerIdentifier string

customerId Guid

IsNowFullyPaid\(\)

Bool that returns if table is paid.

public bool IsNowFullyPaid()

Returns

bool

ReceiveACustomerFromAnotherTable\(Customer\)

Method that notify customers and staff that a customer joined the table.

public void ReceiveACustomerFromAnotherTable(Customer joiningCustomer)

Parameters

joiningCustomer Customer

RedeemAnExpenseReportForCustomerWithId\(Guid, string, int\)

public void RedeemAnExpenseReportForCustomerWithId(Guid customerGuid, string customerEmail, int guestsCount)

Parameters

customerGuid Guid

customerEmail string

guestsCount int

ResetSittingCustomerLimit\(\)

Method that sets the limit to 0.

public void ResetSittingCustomerLimit()

RetrieveCustomers\(List<Guid\>\)

Method that selects sitting customers on the table by their IDs.

public List<Customer> RetrieveCustomers(List<Guid> customerIds)

Parameters

customerIds List < Guid \>

Returns

List < Customer \>

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

Method that add an Ordering.Domain.Aggregates.Customer to the Ordering.Domain.Aggregates.TableAggregate.Table.CurrentCustomers list of the Ordering.Domain.Aggregates.TableAggregate.Table.

public Result<Customer> SeatACustomer(string customerIdentifier, bool isPaymentFirst, bool hasToPay, Guid? oneSignalId)

Parameters

customerIdentifier string

The Ordering.Domain.Aggregates.Customer to add.

isPaymentFirst bool

Do the customer have to pay before lunch.

hasToPay bool

Do the customer has to pay (is payment enabled).

oneSignalId Guid?

Returns

Result< Customer \>

SendOrderLineItemsTogglingEvent\(IEnumerable<OrderLineItem\>, Guid?\)

Send toggle on remaining selectable products event.

public void SendOrderLineItemsTogglingEvent(IEnumerable<OrderLineItem> orderLineItems, Guid? payingCustomerId)

Parameters

orderLineItems IEnumerable < OrderLineItem \>

All affected orderLineItems.

payingCustomerId Guid?

The paying customer id, which want to select the remaining products.

ServeAFullCategory\(string\)

Method that serve a category.

public void ServeAFullCategory(string categoryName)

Parameters

categoryName string

ServeAFullServingPeriod\(ServingPeriod\)

Method that serve a period of time.

public void ServeAFullServingPeriod(ServingPeriod periodToServe)

Parameters

periodToServe ServingPeriod

SetAvailable\(\)

Method that sets the table state to available.

public void SetAvailable()

SetBusy\(\)

Method that sets the table state to busy.

public void SetBusy()

SetOutOfService\(\)

Method that sets the table state to available.

public void SetOutOfService()

ToggleReleasingMode\(\)

Method that toggle the releasing mode.

public void ToggleReleasingMode()

ToggleUnresolvedItemsOfACustomer\(Guid, Guid\)

public void ToggleUnresolvedItemsOfACustomer(Guid nonPayingCustomerId, Guid payingCustomerId)

Parameters

nonPayingCustomerId Guid

payingCustomerId Guid

UpdateSortingIndex\(int\)

Update the position of the Ordering.Domain.Aggregates.TableAggregate.Table in its restaurant.

public void UpdateSortingIndex(int newSortingIndex)

Parameters

newSortingIndex int

New position.

UpdateTableAttributes\(int, int, long\)

Method that update table attributes.

public void UpdateTableAttributes(int tableNumber, int seatsCount, long color)

Parameters

tableNumber int

Number of the Ordering.Domain.Aggregates.TableAggregate.Table.

seatsCount int

Number of seats that can be placed on a Ordering.Domain.Aggregates.TableAggregate.Table.

color long

The Ordering.Domain.Aggregates.TableAggregate.Table.Color of the Ordering.Domain.Aggregates.TableAggregate.Table

ValidateCustomersItemsPayment\(Guid, double\)

Set the paid items to the paid status.

public void ValidateCustomersItemsPayment(Guid payingCustomerId, double paymentAmount)

Parameters

payingCustomerId Guid

paymentAmount double

Last modified: 21 May 2024