Flows and Relationships
Here's how some of the resources are related to each other and how they are used by the system.
Physical Sales
- When a cashier logs in to a cash register, he or she does so an a physical device that is bound to a Till entity with a 1-to-1 relationship, authenticating as a User. Such events are always logged in the cash register's Electronic Journal.
- The cash register uses the associated Location to determine how the receipt should look like, what Button Map to display, what kitchen printers are available and if it should listen for incoming Take-Out Orders (see Orders).
- Products are then added to a Tab, either by the cashier pressing buttons on a Button Map or by scanning barcodes. When a product is added, additional information such as its VAT rate or if a kitchen ticket should be printed is fetched from the Product Group that the product belongs to. Also, the Product Modifiers resource is consulted to see if any extras should be added to the product, and discounts may be automatically applied based on the configured Promotions/Campaigns.
- The cashier may then optionally choose to park the Tab—that is, save it for later and start registering a
new sale. When a tab is parked, both an Order and a Tab are created. The order is used to bind the
parked tab to the cash register's location and specific Resources, like a dinner table. When the tab is resumed
and paid for, the order is marked as
fulfilledand the tab is removed. (The tab is also removed if the cashier chooses to cancel it, but in this case the order is marked ascancelledinstead offulfilled.) Records logging tab operations will also be added to the cash register's Electronic Journal. - When a sale is to be finished, payments are collected by the cashier based on the available Payment Methods, kitchen tickets are printed to kitchen printers, the Order and Tab are closed and a Receipt record—including information about which customer made the purchase if provided, in addition to the products sold and how they were paid for—is added to the Electronic Journal. Finally, the receipt is then printed on the receipt printer or delivered electronically.
Note that the cash registers may operate even when offline. If so, records to the journal will be buffered and uploaded once connectivity is restored.
Orders
The Order resource acts kind of like a calendar and is used to keep track of bookings, reservations, open tabs and incoming orders (like for take-out). An order belongs to a Location and references Customers, Resources and Users. It can hold one or more Payments to indicate that the order has already been paid for (fully or partially) and may be confined to a specific timespan. Any number of Tabs may be associated with an order.
How orders are used by cash registers when parking tabs is described in the previous section.
Bookings and Reservations
When used for bookings and reservations, the order should be created in a requested or booked state, probably also
referencing Resources/Users and the Customer that made the reservation, by the external booking system
when the customer makes a reservation. It is then transitioned to the active state by the cashier when the customer
arrives and a tab is opened. Finally, it is transitioned to the fulfilled state when the customer leaves.
Triggers on the Orders, Tabs and Electronic Journal resources may be used to notify the booking system when tabs are added, modified or closed, when the state of the order changes and to inspect the final receipt(s).
Take-Out Orders
Take-out orders are orders created by an external web site or app, and then prepared and made ready for pick-up or delivery by the restaurant (or other kind of business). Since the products are added by the external system, it's a bit more involved than the other use cases.
- First, a TakeOutConfig and at least one menu should be configured. These resources define what products are available for take-out ordering, how they should be presented in the external system and at what times they may be ordered.
- Second, the ordering system must synchronize the Location, its menu and all Products, Product Groups and Product Modifiers it references. Use Triggers to keep your system up to date and don't forget to synchronize newly referenced entities as well.
- Once the ordering system has all information it needs, it may begin adding orders of type
take-outand staterequested. You should include Products, discounts and optionally Payments, an end date (what time the order should be ready for pick-up), a Customer and a Resource (for order-at-table services). - The cash registers use Event Streams to listen for incoming orders, which is also reflected in the
activeproperty of the TakeOutStatus resource. Use this flag to indicate to the customer that orders will be accepted. - Once a new order is added, a cashier accepts it by changing its state to
booked, optionally also adding a start date as a reminder of when to start preparing the order. - The order's state changes to
activewhen the order is being prepared, optionally with an updated end date in case the business is too busy to prepare the order in time. This causes kitchen tickets to be printed and the requested items to be transferred to a fresh Tab. - When the order is ready, the cashier changes its state to
shipped, indicating that the order is ready for pick-up or delivery. - Finally, the order is marked as
fulfilledwhen the customer has picked up the order. If the order was pre-paid, the Payments are transferred to the final receipt, or else the order is paid for as usual by the customer.
As always, use Triggers to keep your system up to date regarding the state of the order and to inspect the final receipt, if required.