Owneat Technical Guide main Help

Class Restaurant

Namespace: Restaurant.Domain.Aggregates.RestaurantAggregate
Assembly: Restaurant.Domain.dll

[Table("Restaurants")] public sealed class Restaurant : Entity, IAuditable, IAggregateRoot

Inheritance

object ← Entity ← Restaurant

Implements

IAuditable, IAggregateRoot

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

Restaurant\(\)

public Restaurant()

Properties

Address

Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.Address of the Restaurant.

[Required] public Address Address { get; set; }

Property Value

Address

Description

Description of the restaurant services.

[MaxLength(500)] public string Description { get; set; }

Property Value

string

DisplayImageUrl

URL of the restaurant's picture.

[MaxLength(500)] public string DisplayImageUrl { get; set; }

Property Value

string

IsChargesEnabled

Boolean that says if the restaurant activated the charges on the payment platform.

public bool IsChargesEnabled { get; set; }

Property Value

bool

IsInPrePaymentMode

Boolean that says if the restaurant activated the pre-payment on it's restaurant.

public bool IsInPrePaymentMode { get; set; }

Property Value

bool

IsOnPaymentPlatform

Boolean that says if the restaurant created his account on our current payment platform.

[NotMapped] public bool IsOnPaymentPlatform { get; }

Property Value

bool

IsPaymentModuleEnabled

Boolean that says if the restaurant activated the payment module.

public bool IsPaymentModuleEnabled { get; set; }

Property Value

bool

The Menu property represents the Menu of products offered by the Restaurant.

public IEnumerable<Menu> Menus { get; }

Property Value

IEnumerable < Menu \>

Name

The Name property represents the name of the Restaurant.

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

Property Value

string

OpeningHours

The OpeningHours property represents the opening hours of the Restaurant.

public IEnumerable<OpeningHours> OpeningHours { get; }

Property Value

IEnumerable < OpeningHours \>

PaymentPlatformId

Payment's platform identifier.

[MaxLength(200)] public string? PaymentPlatformId { get; set; }

Property Value

string?

RestaurantEvents

The RestaurantEvents property represents the events of the Restaurant.

public IEnumerable<RestaurantEvent> RestaurantEvents { get; }

Property Value

IEnumerable < RestaurantEvent \>

Methods

AddMenu\(Menu\)

Add a Restaurant.Domain.Aggregates.MenuAggregate.Menu to a Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

public void AddMenu(Menu menu)

Parameters

menu Menu

The Restaurant.Domain.Aggregates.MenuAggregate.Menu to add.

AddRestaurantEvent\(RestaurantEvent\)

Add a Restaurant.Domain.Aggregates.RestaurantAggregate.RestaurantEvent to a Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

public void AddRestaurantEvent(RestaurantEvent restaurantEvent)

Parameters

restaurantEvent RestaurantEvent

The Restaurant.Domain.Aggregates.RestaurantAggregate.RestaurantEvent to add.

CanRestaurantChargeClients\(bool\)

Update basic informations of the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

public void CanRestaurantChargeClients(bool isChargesEnabled)

Parameters

isChargesEnabled bool

Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.IsChargesEnabled of the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

Create\(string, string, string, Address, List<OpeningHours\>\)

public static Restaurant Create(string name, string description, string displayImageUrl, Address address, List<OpeningHours> openingHours)

Parameters

name string

description string

displayImageUrl string

address Address

openingHours List < OpeningHours \>

Returns

Restaurant

GetMenus\(Func<Menu, bool\>\)

Method that returns all the Restaurant.Domain.Aggregates.MenuAggregate.Menus requested by a certain predicate.

public IEnumerable<Menu> GetMenus(Func<Menu, bool> predicate)

Parameters

predicate Func < Menu, bool \>

System.Func%601 is a predicate.

Returns

IEnumerable < Menu \>

IsLinkedToBillingPlatform\(\)

Method that say is a Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant is currently linked to a billing service.

public bool IsLinkedToBillingPlatform()

Returns

bool

IsRestaurantOpen\(DateTimeOffset\)

Method that say is a Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant is currently opened.

public bool IsRestaurantOpen(DateTimeOffset serverDateTime)

Parameters

serverDateTime DateTimeOffset

The current server date when called.

Returns

bool

A boolean that indicates if the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant is open or closed at the moment.

RemoveMenu\(Menu\)

Remove a Restaurant.Domain.Aggregates.MenuAggregate.Menu from a Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

public void RemoveMenu(Menu menu)

Parameters

menu Menu

The Restaurant.Domain.Aggregates.MenuAggregate.Menu to remove.

RemoveRestaurantEvent\(RestaurantEvent\)

public void RemoveRestaurantEvent(RestaurantEvent restaurantEventToDelete)

Parameters

restaurantEventToDelete RestaurantEvent

SetPaymentPlatformId\(string\)

public void SetPaymentPlatformId(string paymentPlatformId)

Parameters

paymentPlatformId string

ToggleMenuState\(Menu\)

Toggle method that take the Restaurant.Domain.Aggregates.MenuAggregate.Menu state and change it to it's opposed state.

public void ToggleMenuState(Menu menu)

Parameters

menu Menu

The Restaurant.Domain.Aggregates.MenuAggregate.Menu to activate or deactivate.

TogglePaymentFlow\(\)

Toggle restaurant payment mode.

public void TogglePaymentFlow()

UpdateBasicInformation\(string, string, string, Address\)

Update basic informations of the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

public void UpdateBasicInformation(string name, string description, string displayImageUrl, Address address)

Parameters

name string

Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.Name of the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

description string

Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.Description of the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

displayImageUrl string

Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.DisplayImageUrl of the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

address Address

Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.Address of the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.

UpdateOpeningHours\(IEnumerable<OpeningHours\>\)

Update the Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.OpeningHours of a Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant

public void UpdateOpeningHours(IEnumerable<OpeningHours> openingHours)

Parameters

openingHours IEnumerable < OpeningHours \>

The Restaurant.Domain.Aggregates.RestaurantAggregate.Restaurant.OpeningHours to replace.

Last modified: 21 May 2024