https://developers-site.s3.eu-west-1.amazonaws.com/schema/_images/tenzo.png

Universal Schema Documentation

Tenzo takes a variety of data sources and then provides a unified schema - this allows you to run prebuilt analytics and reports across wide disparate datasources.

In addition to a set of models (or database tables) covering core concepts found in restaurant and retail - we also have a proprietary summary engine, that will output summarized data to ensure critical bits of data are available quickly.

Today - we cover the following categories of data:

You can see an example of our Sales Summaries

Common

Core Concepts

Throughout we refer to “temporal data” - meaning something that happened at a point in time (i.e. a sale, or a shift), and “categorical data” - meaning something that describes a fixed object (e.g., an employee, or menu item).

There are several common fields that most models have:

  • id - this is a unique ID in Tenzo’s database and is stored as a BigInt

  • local_id - this is the ID of the record in the remote system

  • date_added - this shows the datetime that the record was created

  • last_modified - this shows the datetime that the record was last modified

  • deleted_at - we soft delete data in our database, and this being set indicates that a row has been deleted

Business

class collector.models.Business

This model is not included in a Tenzo shard - but is the representation of a business, or Tenzo customer. Various models may refer to this, for example a collector.models.Location belongs to a Business

Business API Instance

class collector.models.BusinessAPIInstance

This model is not included in a Tenzo shard - but is the representation of an API connection. Many models have an ID that refers to this.

Location

class Location(*args, **kwargs)

This is the core representation of a physical Location within Tenzo

Locations that come from other datasources (e.g., a point of sale, or a labour management system) will have a foreign key to this object to unify locations that come from different systems

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • name (varchar(200)) – Name

  • address_1 (varchar(128)) – Address 1

  • address_2 (varchar(128)) – Address 2

  • city (varchar(64)) – City

  • state_county (varchar(64)) – State / county

  • zip_postal_code (varchar(8)) – Zip/post code

  • country (varchar(2)) – Country

  • council_id (integer to Council) – Deprecated

  • latitude (decimal) – Latitude

  • longitude (decimal) – Longitude

  • use_events_countries (varchar(200)) – Deprecated

  • calendar_id (integer to BusinessCalendar) – A link to a calendar of events associated with this Location (used in forecasting)

  • open_days (varchar(14)) – Comma-separated list: 0 is Monday; defaults to all days

  • open_times (text) – Deprecated

  • recommended_labour_settings (text) – A JSON field for labour planning: Defines min (minimum employees at any time while the store is open, int), open (number of employees required to open the store, int), close (number of employees required to close the store, int), per_unit_sales (the number of employees required for each £ or $ of sales in an hour, float), hours_to_open (the number of hours needed to open the store, float), hours_to_close (the number of hours needed to close the store, float), addition_threshold (the sales required to trigger a fixed minimum, float), addition_employees (the number of employees to add if the threshold is met, int), sales_labour_offset (eg. -1 to staff labour 1 hour before the expected sales occur, int).

  • phone (varchar(50)) – Phone

  • date_added (datetime) – Date added

  • business_id (integer to Business) – Business

  • proxy_location_id (bigint to Location) – Used to indicate a similar location for forecasting when there is no data

  • area_id (bigint to Area) – Area

  • change_point (date) – Deprecated

  • pytz_timezone (varchar(300)) – A timezone represented as string - matching the python library pytz

  • is_enabled (bool) – Determines whether the location is active and should be seen in Tenzo

  • staff_only (bool) – Only Tenzo staff will see this location within Tenzo

  • data_stream_is_live (bool) – Indicates whether we expect this location to have live sales (for quality checking)

  • day_part (text) – Deprecated: Day parts are set at the business level

  • categories (text) – Deprecated

  • day_cutoff (time) – Deprecated: end of day cutoff is defined at the business level

  • extra (text) – An optional field to store location specific attributes

  • last_modified (datetime) – Last modified

  • events (ManyToManyField) – Events that are directly assigned to this Location (used in forecasting)

  • event_calendars (ManyToManyField) – Event calendars

refresh_from_db(using=None, fields=None, from_queryset=None)

Reload field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

save(force_insert=False, force_update=False, using=None, update_fields=None)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

API Location

This is a model that provides a generic way to connect between a location in an API, and a collector.models.Location in Tenzo. This is just a more generic representation of something like a sales.models.POSLocation and will be used for future integrations.

class APILocation(id, deleted_at, business_api_instance, app_location, local_id, name, api_class, date_added, last_modified, to_delete)
Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • app_location_id (bigint to Location) – App location

  • local_id (varchar(300)) – Local id

  • name (varchar(300)) – Name

  • api_class (varchar(64)) – Visible name of the integration this location’s data comes from

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

  • to_delete (bool) – Whilst cleaning up related models, we use this to mark objects as ‘to delete’, before soft deleting using deleted_at once it is safe to do so.

Sales

Note

All sales tables are prefixed with “sales_”

https://developers-site.s3.eu-west-1.amazonaws.com/schema/_images/sales.png

Categorical

POSLocation

class POSLocation(*args, **kwargs)

This is the representation of a Location coming from a point of sale

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this location belongs to

  • app_location_id (bigint to Location) – This unifies this location with a core physical location in Tenzo

  • local_id (varchar(300)) – Local id

  • address (varchar(300)) – Address

  • name (varchar(300)) – Name

  • phone (varchar(10)) – Phone

  • website (varchar(300)) – Website

  • pytz_timezone (varchar(300)) – A timezone represented as string - matching the python library pytz

  • api_class (varchar(64)) – Visible name of the integration this location’s data comes from

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

  • to_delete (bool) – Whilst cleaning up related models, we use this to mark objects as ‘to delete’, before soft deleting using deleted_at once it is safe to do so.

POSMenuCategory

class POSMenuCategory(*args, **kwargs)

A POSMenuCategory is a way of organizing POSMenuItems within Tenzo

A Category can have a parent, and this hierarchy can potentially be infinite. However, within the core Tenzo app - we only make 2-3 levels of this hierarchy visible

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this POSMenuCategory belongs to

  • local_id (varchar(200)) – Local id

  • name (varchar(300)) – Name

  • original_name (varchar(300)) – Original name

  • parent_category_id (bigint to POSMenuCategory) – Parent category

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSMenuItem

class POSMenuItem(*args, **kwargs)

This represents an item on a menu e.g., Chicken Burger, Coke, or a TV

A POSMenuItem typically belongs to a category for reporting purposes.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this menu item belongs to

  • category_id (bigint to POSMenuCategory) – Category

  • local_id (varchar(200)) – Local id

  • name (varchar(300)) – Name

  • original_name (varchar(300)) – Original name

  • is_visible (bool) – Indicates whether this item is visible on the menu

  • extra (text) – An optional field to store integration specific attributes e.g., price

  • price (decimal) – The amount reported by the POS from their menu end point (normally before tax)

  • pos_code (varchar(300)) – Pos code

  • size (varchar(300)) – Size

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSOrderType

class POSOrderType(*args, **kwargs)

The representation of an Order Type for a transaction e.g., Eat-in vs. Delivery vs. Drive-through etc.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this Order Type belongs to

  • local_id (varchar(200)) – Local id

  • name (varchar(300)) – Name

  • original_name (varchar(300)) – Original name

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSRevenueCenter

class POSRevenueCenter(*args, **kwargs)

A Revenue Center is typically a sub-section of a Location. For example, a Location might have both a bar and a dining area.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this Revenue Center belongs to

  • local_id (varchar(200)) – Local id

  • name (varchar(300)) – Name

  • original_name (varchar(300)) – Original name

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSEmployee

class POSEmployee(*args, **kwargs)

This represents an employee within a restaurant or retail location

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this Employee belongs to

  • local_id (varchar(200)) – Local id

  • check_name (varchar(300)) – Check name

  • first_name (varchar(300)) – First name

  • last_name (varchar(300)) – Last name

  • login (varchar(300)) – Login

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSCustomer

class POSCustomer(*args, **kwargs)

This represents the end customer (where available) coming from a point of sale. i.e., the person buying the item. Typically this detail may come from a connected loyalty platform.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • poslocation_id (bigint to POSLocation) – The location this customer belongs to

  • local_id (varchar(200)) – Local id

  • address (varchar(300)) – Address

  • name (varchar(300)) – Name

  • phone (varchar(25)) – Phone

  • email (varchar(200)) – Email

  • signup_date (datetime) – Signup date

  • active (bool) – Whether or not this customer has an active account

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSTable

class POSTable(*args, **kwargs)

This represents a physical Table within a restaurant

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this Table belongs to

  • local_id (varchar(200)) – Local id

  • name (varchar(300)) – Name

  • seats (integer) – The number of seats the table has around it

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSTenderType

class POSTenderType(*args, **kwargs)

The representation of a “method of payment” e.g., Cash vs. Credit Card etc.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this Tender Type belongs to

  • local_id (varchar(200)) – Local id

  • name (varchar(300)) – Name

  • date_added (datetime) – Date added

  • is_cash (bool) – Is cash

  • last_modified (datetime) – Last modified

POSAccount

class POSAccount(*args, **kwargs)

This is a grouping of POSTickets i.e. potentially for one customer, or spanning multiple days

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this account belongs to

  • local_id (varchar(200)) – Local id

  • opened_at (datetime) – When the account was opened

  • closed_at (datetime) – When the account was closed

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

Temporal

POSTicket

class POSTicket(*args, **kwargs)

This is the core representation of a sales transaction within Tenzo.

A POSTicket is made up of POSTicketItems, POSTicketDiscounts, and POSTicketAdjustments (typically service charge)

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – The location this transaction happened in

  • local_id (varchar(200)) – Local id

  • name (varchar(2500)) – Name

  • order_type_id (bigint to POSOrderType) – Order type

  • date_of_business (date) – The business day the transaction happened on. This could be different to calendar day, for instance transactions at 1am may be applied to the previous day

  • opened_at (datetime) – When the transaction was opened

  • closed_at (datetime) – When the transaction was closed

  • printed_at (datetime) – When the transaction receipt was printed

  • delivered_at (datetime) – If available and applicable, when the transaction was delivered to the customer

  • ready_at (datetime) – If available and applicable, when the transaction was ready to go to the customer i.e. normally when it was ‘bumped’ from a KDS

  • gross_revenue_with_tax (decimal) – Deprecated and value not reliable; used to indicate the value before discounts

  • gross_revenue_no_tax (decimal) – Deprecated and value not reliable; used to indicate the value before discounts

  • paid_with_tax (decimal) – The amount paid for this transaction - includes tax, service charge, all items and is AFTER discounts

  • paid_no_tax (decimal) – The amount paid for this transaction, excluding tax, but including service charge, all items and is AFTER discounts

  • promos_with_tax_shield (decimal) – The value of all promos on the transaction including the impact of the tax shield

  • promos_no_tax_shield (decimal) – The value of all promos on the transaction without the impact of the tax shield

  • comps_with_tax_shield (decimal) – The value of all comps (typically staff meals) on the transaction including the impact of the tax shield

  • comps_no_tax_shield (decimal) – The value of all comps (typically staff meals) on the transaction without the impact of the tax shield

  • adjust_with_tax_shield (decimal) – The value of all adjustments including tax

  • adjust_no_tax_shield (decimal) – The value of all adjustments excluding tax

  • tips (decimal) – The value of tips on the transaction - can also be found on the POSPayment

  • revenue_center_id (bigint to POSRevenueCenter) – Revenue center

  • table_id (bigint to POSTable) – Table

  • employee_id (bigint to POSEmployee) – Employee

  • customer_id (bigint to POSCustomer) – Customer

  • account_id (bigint to POSAccount) – Account

  • open (bool) – Whether the transaction is still open or not

  • guest_count (integer) – The number of guests or covers on a transaction (if avaialable in POS)

  • ticket_number (varchar(300)) – Normally a number that represents a transation that may be communicated to a guest e.g, ‘Ticket 12’

  • was_abandoned (bool) – indicates whether a transaction was VOIDED or CANCELLED

  • extra (text) – An additional JSON field to store any integration specific information

  • is_excluded (bool) – Whether this ticket should be excluded from core reports and summaries

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

POSTicketItem

class POSTicketItem(*args, **kwargs)

Represents an individual item on a ticket e.g., Chicken Burger or a Coke

Ticket Items include the value of sub-resources - POSTicketItemDiscount, POSTicketItemModifier

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • posticket_id (bigint to POSTicket) – The ticket the item belongs to

  • local_id (varchar(400)) – Local id

  • comment (varchar(300)) – Deprecated

  • name (varchar(4800)) – Deprecated

  • unit_paid_no_tax (decimal) – The amount paid for ONE of the item without tax. This includes modifiers and is AFTER discounts.

  • unit_paid_with_tax (decimal) – The amount paid for ONE of the item with tax. This includes modifiers and is AFTER discounts.

  • unit_gross_no_tax (decimal) – Deprecated and set inconsistently; aimed to be the amount paid before discounts

  • unit_gross_with_tax (decimal) – Deprecated and set inconsistently; aimed to be the amount paid before discounts

  • quantity (decimal) – The number of the item sold

  • menuitem_id (bigint to POSMenuItem) – Menuitem

  • employee_id (bigint to POSEmployee) – Employee

  • created_at (datetime) – When the item was added to the ticket

  • was_abandoned (bool) – Indicates whether a transaction was VOIDED or CANCELLED

  • is_liability (bool) – Indicates whether an item was a liability

  • order_type_id (bigint to POSOrderType) – An optional order type for a specific item; in most situations in Tenzo this detail comes from the order type on the POSTicket

  • revenue_center_id (bigint to POSRevenueCenter) – An optional revenue center for a specific item; in most situations in Tenzo this detail comes from the order type on the POSTicket

  • extra (text) – An additional JSON field to store any integration specific information

  • is_excluded (bool) – Whether this ticket item should be excluded from core reports and summaries

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Override to use posticket relationship for location filtering

POSTicketItemDiscount

class POSTicketItemDiscount(*args, **kwargs)

Represents a discount applied to a POSTicketItem

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • posticketitem_id (bigint to POSTicketItem) – A link to the item the discount applies to

  • posdiscount_id (bigint to POSDiscount) – The type or name of this discount

  • type (varchar(30)) – This should be either ‘comp’ or ‘promo’ to indicate the type of the discount. Comps are typically free or staff meals.

  • local_id (varchar(400)) – Local id

  • comment (varchar(300)) – Deprecated

  • name (varchar(300)) – Deprecated

  • unit_value_with_tax_shield (decimal) – The value of the discount including the impact of tax. A POSITIVE amount indicates a REDUCTION in the amount the end customer would pay.

  • unit_value_no_tax_shield (decimal) – The value of the discount excluding the impact of tax. A POSITIVE amount indicates a REDUCTION in the amount the end customer would pay.

  • quantity (integer) – The number of times this discount is applied to the item

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Override to use posticketitem->posticket relationship for location filtering

POSTicketItemModifier

class POSTicketItemModifier(*args, **kwargs)

Represents a modifier on a ticket item. e.g., this might be something like “Extra Egg” or “Spicy”. Modifiers may or may not have a value

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • posticketitem_id (bigint to POSTicketItem) – The item that this modifier applies to

  • menuitem_id (bigint to POSMenuItem) – A modifier may optionally have a menu item. This can be used to categorize modifiers

  • local_id (varchar(400)) – Local id

  • comment (varchar(300)) – Deprecated

  • name (varchar(300)) – Deprecated; use menuitem instead to store this detail

  • price_per_unit_with_tax (decimal) – The value of ONE modifier with tax

  • price_per_unit_no_tax (decimal) – The value of ONE modifier with tax

  • quantity (integer) – The number of times this modifier is applied to the item

  • created_at (datetime) – The time when the modifier was added to the transaction

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Override to use posticketitem->posticket relationship for location filtering

POSTicketDiscount

class POSTicketDiscount(*args, **kwargs)

Resource for Discounts that have been applied to the entire Ticket (i.e. NOT a specific item)

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • posticket_id (bigint to POSTicket) – The ticket this discount is on

  • posdiscount_id (bigint to POSDiscount) – Type or name of discount

  • local_id (varchar(200)) – Local id

  • comment (varchar(300)) – Deprecated

  • name (varchar(300)) – Name

  • created_at (datetime) – This is the time the discount was added to the ticket

  • unit_value_with_tax_shield (decimal) – The value of the discount including the impact of tax. A POSITIVE amount indicates a REDUCTION in the amount the end customer would pay.

  • unit_value_no_tax_shield (decimal) – The value of the discount excluding the impact of tax. A POSITIVE amount indicates a REDUCTION in the amount the end customer would pay.

  • quantity (integer) – The number of times this discount has been applied

  • employee_id (bigint to POSEmployee) – The employee that added the discount

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Override to use posticket relationship for location filtering

POSTicketAdjustment

class POSTicketAdjustment(*args, **kwargs)

This handles arbitrary adjustments to the POSTicket: the most common case here is service charge

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • posticket_id (bigint to POSTicket) – The ticket with the adjustment

  • local_id (varchar(200)) – Local id

  • comment (varchar(300)) – Can include additional info on the adjustment e.g., the type of service charge

  • name (varchar(300)) – Name

  • type (integer) – Type 1 = Service Charge

  • employee_id (bigint to POSEmployee) – The employee who added the adjustment

  • created_at (datetime) – when the Adjsutment was added to the ticket

  • value_with_tax (decimal) – The amount of the adjustment including tax

  • value_no_tax (decimal) – The amount of the adjustment excluding tax

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Override to use posticket relationship for location filtering

POSPayment

class POSPayment(*args, **kwargs)

Representation of an actual payment within Tenzo e.g., cash or credit

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • posticket_id (bigint to POSTicket) – The Ticket the payment applies to

  • account_id (bigint to POSAccount) – Optional: the customer account the payment applies to

  • employee_id (bigint to POSEmployee) – The employee who processed the payment

  • local_id (varchar(200)) – Local id

  • comment (varchar(300)) – Deprecated

  • tender_type_id (bigint to POSTenderType) – The type of the payment e.g., cash vs credit

  • paid_with_tax (decimal) – The amount of the payment including tax

  • paid_no_tax (decimal) – The amount of the payment excluding tax (often this cannot be determined, so will be the same as the paid_with_tax)

  • payment_time (datetime) – The time the payment was made

  • tip (decimal) – Any tip included with this payment

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Override to use posticket relationship for location filtering

Sales Summaries

SummarySalesByDay

class SummarySalesByDay(*args, **kwargs)

SummarySalesByDay represents the aggregation of daily sales in a location, grouped by POSLocation and date_of_business.

The base Sales models are used to calculate, aggregating POSTickets, POSTicketItems, and POSTicketItemDiscounts.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – Poslocation

  • date_of_business (date) – Date of business

  • ticket_count (integer) – Ticket count

  • gross_revenue_with_tax (decimal) – Gross revenue with tax

  • gross_revenue_no_tax (decimal) – Gross revenue no tax

  • paid_with_tax (decimal) – Paid with tax

  • paid_no_tax (decimal) – Paid no tax

  • promos_with_tax_shield (decimal) – Promos with tax shield

  • promos_no_tax_shield (decimal) – Promos no tax shield

  • comps_with_tax_shield (decimal) – Comps with tax shield

  • comps_no_tax_shield (decimal) – Comps no tax shield

  • adjust_with_tax_shield (decimal) – Adjust with tax shield

  • adjust_no_tax_shield (decimal) – Adjust no tax shield

  • tips (decimal) – Tips

  • guest_ticket_count (integer) – Guest ticket count

  • guest_gross_revenue_with_tax (decimal) – Guest gross revenue with tax

  • guest_gross_revenue_no_tax (decimal) – Guest gross revenue no tax

  • guest_paid_with_tax (decimal) – Guest paid with tax

  • guest_paid_no_tax (decimal) – Guest paid no tax

  • guest_promos_with_tax_shield (decimal) – Guest promos with tax shield

  • guest_promos_no_tax_shield (decimal) – Guest promos no tax shield

  • guest_comps_with_tax_shield (decimal) – Guest comps with tax shield

  • guest_comps_no_tax_shield (decimal) – Guest comps no tax shield

  • guest_adjust_with_tax_shield (decimal) – Guest adjust with tax shield

  • guest_adjust_no_tax_shield (decimal) – Guest adjust no tax shield

  • guest_tips (decimal) – Guest tips

  • guest_count (integer) – Guest count

  • void_ticket_count (integer) – Void ticket count

  • void_gross_revenue_with_tax (decimal) – Void gross revenue with tax

  • void_gross_revenue_no_tax (decimal) – Void gross revenue no tax

  • void_paid_with_tax (decimal) – Void paid with tax

  • void_paid_no_tax (decimal) – Void paid no tax

  • void_promos_with_tax_shield (decimal) – Void promos with tax shield

  • void_promos_no_tax_shield (decimal) – Void promos no tax shield

  • void_comps_with_tax_shield (decimal) – Void comps with tax shield

  • void_comps_no_tax_shield (decimal) – Void comps no tax shield

  • void_adjust_with_tax_shield (decimal) – Void adjust with tax shield

  • void_adjust_no_tax_shield (decimal) – Void adjust no tax shield

  • void_tips (decimal) – Void tips

  • void_guest_count (integer) – Void guest count

  • last_modified (datetime) – Last modified

  • time_to_serve (decimal) – Time to serve

  • guest_time_to_serve (decimal) – Guest time to serve

  • void_time_to_serve (decimal) – Void time to serve

SummarySalesByOrderType

class SummarySalesByOrderType(*args, **kwargs)

SummarySalesByOrderType represents the aggregation of daily sales by order type in a location, grouped by POSLocation, date_of_business, and POSOrderType.

The base Sales models are used to calculate, aggregating POSTickets, POSTicketItems, and POSTicketItemDiscounts.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – Poslocation

  • date_of_business (date) – Date of business

  • ticket_count (integer) – Ticket count

  • gross_revenue_with_tax (decimal) – Gross revenue with tax

  • gross_revenue_no_tax (decimal) – Gross revenue no tax

  • paid_with_tax (decimal) – Paid with tax

  • paid_no_tax (decimal) – Paid no tax

  • promos_with_tax_shield (decimal) – Promos with tax shield

  • promos_no_tax_shield (decimal) – Promos no tax shield

  • comps_with_tax_shield (decimal) – Comps with tax shield

  • comps_no_tax_shield (decimal) – Comps no tax shield

  • adjust_with_tax_shield (decimal) – Adjust with tax shield

  • adjust_no_tax_shield (decimal) – Adjust no tax shield

  • tips (decimal) – Tips

  • guest_ticket_count (integer) – Guest ticket count

  • guest_gross_revenue_with_tax (decimal) – Guest gross revenue with tax

  • guest_gross_revenue_no_tax (decimal) – Guest gross revenue no tax

  • guest_paid_with_tax (decimal) – Guest paid with tax

  • guest_paid_no_tax (decimal) – Guest paid no tax

  • guest_promos_with_tax_shield (decimal) – Guest promos with tax shield

  • guest_promos_no_tax_shield (decimal) – Guest promos no tax shield

  • guest_comps_with_tax_shield (decimal) – Guest comps with tax shield

  • guest_comps_no_tax_shield (decimal) – Guest comps no tax shield

  • guest_adjust_with_tax_shield (decimal) – Guest adjust with tax shield

  • guest_adjust_no_tax_shield (decimal) – Guest adjust no tax shield

  • guest_tips (decimal) – Guest tips

  • guest_count (integer) – Guest count

  • void_ticket_count (integer) – Void ticket count

  • void_gross_revenue_with_tax (decimal) – Void gross revenue with tax

  • void_gross_revenue_no_tax (decimal) – Void gross revenue no tax

  • void_paid_with_tax (decimal) – Void paid with tax

  • void_paid_no_tax (decimal) – Void paid no tax

  • void_promos_with_tax_shield (decimal) – Void promos with tax shield

  • void_promos_no_tax_shield (decimal) – Void promos no tax shield

  • void_comps_with_tax_shield (decimal) – Void comps with tax shield

  • void_comps_no_tax_shield (decimal) – Void comps no tax shield

  • void_adjust_with_tax_shield (decimal) – Void adjust with tax shield

  • void_adjust_no_tax_shield (decimal) – Void adjust no tax shield

  • void_tips (decimal) – Void tips

  • void_guest_count (integer) – Void guest count

  • last_modified (datetime) – Last modified

  • time_to_serve (decimal) – Time to serve

  • guest_time_to_serve (decimal) – Guest time to serve

  • void_time_to_serve (decimal) – Void time to serve

  • order_type_id (bigint to POSOrderType) – Order type

SummarySalesByRevenueCenter

class SummarySalesByRevenueCenter(*args, **kwargs)

SummarySalesByRevenueCenter represents the aggregation of daily sales by revenue center in a location, grouped by POSLocation, date_of_business, and POSRevenueCenter.

The base Sales models are used to calculate, aggregating POSTickets, POSTicketItems, and POSTicketItemDiscounts.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – Poslocation

  • date_of_business (date) – Date of business

  • ticket_count (integer) – Ticket count

  • gross_revenue_with_tax (decimal) – Gross revenue with tax

  • gross_revenue_no_tax (decimal) – Gross revenue no tax

  • paid_with_tax (decimal) – Paid with tax

  • paid_no_tax (decimal) – Paid no tax

  • promos_with_tax_shield (decimal) – Promos with tax shield

  • promos_no_tax_shield (decimal) – Promos no tax shield

  • comps_with_tax_shield (decimal) – Comps with tax shield

  • comps_no_tax_shield (decimal) – Comps no tax shield

  • adjust_with_tax_shield (decimal) – Adjust with tax shield

  • adjust_no_tax_shield (decimal) – Adjust no tax shield

  • tips (decimal) – Tips

  • guest_ticket_count (integer) – Guest ticket count

  • guest_gross_revenue_with_tax (decimal) – Guest gross revenue with tax

  • guest_gross_revenue_no_tax (decimal) – Guest gross revenue no tax

  • guest_paid_with_tax (decimal) – Guest paid with tax

  • guest_paid_no_tax (decimal) – Guest paid no tax

  • guest_promos_with_tax_shield (decimal) – Guest promos with tax shield

  • guest_promos_no_tax_shield (decimal) – Guest promos no tax shield

  • guest_comps_with_tax_shield (decimal) – Guest comps with tax shield

  • guest_comps_no_tax_shield (decimal) – Guest comps no tax shield

  • guest_adjust_with_tax_shield (decimal) – Guest adjust with tax shield

  • guest_adjust_no_tax_shield (decimal) – Guest adjust no tax shield

  • guest_tips (decimal) – Guest tips

  • guest_count (integer) – Guest count

  • void_ticket_count (integer) – Void ticket count

  • void_gross_revenue_with_tax (decimal) – Void gross revenue with tax

  • void_gross_revenue_no_tax (decimal) – Void gross revenue no tax

  • void_paid_with_tax (decimal) – Void paid with tax

  • void_paid_no_tax (decimal) – Void paid no tax

  • void_promos_with_tax_shield (decimal) – Void promos with tax shield

  • void_promos_no_tax_shield (decimal) – Void promos no tax shield

  • void_comps_with_tax_shield (decimal) – Void comps with tax shield

  • void_comps_no_tax_shield (decimal) – Void comps no tax shield

  • void_adjust_with_tax_shield (decimal) – Void adjust with tax shield

  • void_adjust_no_tax_shield (decimal) – Void adjust no tax shield

  • void_tips (decimal) – Void tips

  • void_guest_count (integer) – Void guest count

  • last_modified (datetime) – Last modified

  • time_to_serve (decimal) – Time to serve

  • guest_time_to_serve (decimal) – Guest time to serve

  • void_time_to_serve (decimal) – Void time to serve

  • revenue_center_id (bigint to POSRevenueCenter) – Revenue center

SummarySalesByProductItem

class SummarySalesByProductItem(*args, **kwargs)

SummarySalesByProductItem represents the aggregation of daily sales by product item (menu item) in a location, grouped by POSLocation, date_of_business, and POSMenuItem.

The base Sales models are used to calculate, aggregating POSTickets, POSTicketItems, and POSTicketItemDiscounts.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – Poslocation

  • date_of_business (date) – Date of business

  • menuitem_id (bigint to POSMenuItem) – Menuitem

  • type (integer) – Type

  • ticket_count (integer) – Total number of tickets (on this dob-loc. Includes tickets without TicketItems)

  • quantity_count (decimal) – Sum of the quantity field on POSTicketItem for this MenuItem

  • total_paid_no_tax (decimal) – Total paid no tax

  • total_paid_with_tax (decimal) – Total paid with tax

  • promos_no_tax_shield (decimal) – Promos no tax shield

  • promos_with_tax_shield (decimal) – Promos with tax shield

  • comps_no_tax_shield (decimal) – Comps no tax shield

  • comps_with_tax_shield (decimal) – Comps with tax shield

  • adjust_no_tax_shield (decimal) – Adjust no tax shield

  • adjust_with_tax_shield (decimal) – Adjust with tax shield

  • last_modified (datetime) – Last modified

  • total_gross_no_tax (decimal) – deprecated

  • total_gross_with_tax (decimal) – deprecated

SummarySalesByTimeOfDay

class SummarySalesByTimeOfDay(*args, **kwargs)

SummarySalesByTimeOfDay represents the aggregation of sales by fifteen minute periods in a day for a location. For a particular date_of_business and POSLocation, Time of Day summaries would be represented by 96 fifteen minute periods, starting with 00:00 - 00:14, then 00:15-00:29 and so on.

The base Sales models are used to calculate, aggregating POSTickets, POSTicketItems, and POSTicketItemDiscounts.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – Poslocation

  • date_of_business (date) – Date of business

  • ticket_count (integer) – Ticket count

  • gross_revenue_with_tax (decimal) – Gross revenue with tax

  • gross_revenue_no_tax (decimal) – Gross revenue no tax

  • paid_with_tax (decimal) – Paid with tax

  • paid_no_tax (decimal) – Paid no tax

  • promos_with_tax_shield (decimal) – Promos with tax shield

  • promos_no_tax_shield (decimal) – Promos no tax shield

  • comps_with_tax_shield (decimal) – Comps with tax shield

  • comps_no_tax_shield (decimal) – Comps no tax shield

  • adjust_with_tax_shield (decimal) – Adjust with tax shield

  • adjust_no_tax_shield (decimal) – Adjust no tax shield

  • tips (decimal) – Tips

  • guest_ticket_count (integer) – Guest ticket count

  • guest_gross_revenue_with_tax (decimal) – Guest gross revenue with tax

  • guest_gross_revenue_no_tax (decimal) – Guest gross revenue no tax

  • guest_paid_with_tax (decimal) – Guest paid with tax

  • guest_paid_no_tax (decimal) – Guest paid no tax

  • guest_promos_with_tax_shield (decimal) – Guest promos with tax shield

  • guest_promos_no_tax_shield (decimal) – Guest promos no tax shield

  • guest_comps_with_tax_shield (decimal) – Guest comps with tax shield

  • guest_comps_no_tax_shield (decimal) – Guest comps no tax shield

  • guest_adjust_with_tax_shield (decimal) – Guest adjust with tax shield

  • guest_adjust_no_tax_shield (decimal) – Guest adjust no tax shield

  • guest_tips (decimal) – Guest tips

  • guest_count (integer) – Guest count

  • void_ticket_count (integer) – Void ticket count

  • void_gross_revenue_with_tax (decimal) – Void gross revenue with tax

  • void_gross_revenue_no_tax (decimal) – Void gross revenue no tax

  • void_paid_with_tax (decimal) – Void paid with tax

  • void_paid_no_tax (decimal) – Void paid no tax

  • void_promos_with_tax_shield (decimal) – Void promos with tax shield

  • void_promos_no_tax_shield (decimal) – Void promos no tax shield

  • void_comps_with_tax_shield (decimal) – Void comps with tax shield

  • void_comps_no_tax_shield (decimal) – Void comps no tax shield

  • void_adjust_with_tax_shield (decimal) – Void adjust with tax shield

  • void_adjust_no_tax_shield (decimal) – Void adjust no tax shield

  • void_tips (decimal) – Void tips

  • void_guest_count (integer) – Void guest count

  • last_modified (datetime) – Last modified

  • time_to_serve (decimal) – Time to serve

  • guest_time_to_serve (decimal) – Guest time to serve

  • void_time_to_serve (decimal) – Void time to serve

  • fifteen_minute_period (integer) – Fifteen minute period of the day, with 0 representing 00:00 to 00:14, and 1 representing 00:15 to 00:29

  • open_tickets (integer) – Open tickets

SummarySalesByTimeOfDayByProductItem

class SummarySalesByTimeOfDayByProductItem(*args, **kwargs)

SummarySalesByTimeOfDayByProductItem represents the aggregation of sales by product item (menu item) and fifteen minute period in a day for a location. For a particular date_of_business, POSMenuItem and POSLocation, Time of Day summaries would be represented by 96 fifteen minute periods, starting with 00:00 - 00:14, then 00:15-00:29 and so on.

The base Sales models are used to calculate, aggregating POSTickets, POSTicketItems, and POSTicketItemDiscounts.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • poslocation_id (bigint to POSLocation) – Poslocation

  • date_of_business (date) – Date of business

  • menuitem_id (bigint to POSMenuItem) – Menuitem

  • type (integer) – Type

  • ticket_count (integer) – Total number of tickets (on this dob-loc. Includes tickets without TicketItems)

  • quantity_count (decimal) – Sum of the quantity field on POSTicketItem for this MenuItem

  • total_paid_no_tax (decimal) – Total paid no tax

  • total_paid_with_tax (decimal) – Total paid with tax

  • promos_no_tax_shield (decimal) – Promos no tax shield

  • promos_with_tax_shield (decimal) – Promos with tax shield

  • comps_no_tax_shield (decimal) – Comps no tax shield

  • comps_with_tax_shield (decimal) – Comps with tax shield

  • adjust_no_tax_shield (decimal) – Adjust no tax shield

  • adjust_with_tax_shield (decimal) – Adjust with tax shield

  • last_modified (datetime) – Last modified

  • total_gross_no_tax (decimal) – deprecated

  • total_gross_with_tax (decimal) – deprecated

  • fifteen_minute_period (integer) – Fifteen minute period

Labor

Note

All labor tables are prefixed with “labor_”

https://developers-site.s3.eu-west-1.amazonaws.com/schema/_images/labor.png

Categorical

RotaLocation

class RotaLocation(*args, **kwargs)

The representation of a Location coming from a labor / staff scheduler

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • app_location_id (bigint to Location) – Unifies this Rota Location with a core physical location in Tenzo

  • local_id (varchar(200)) – Local id

  • name (varchar(200)) – Name

  • api_class (varchar(64)) – Visible name of the integration this location’s data comes from

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • to_delete (bool) – To delete

RotaHousePart

class RotaHousePart(*args, **kwargs)

RotaHousePart is a way of organizing RotaEmployees within Tenzo.

The default hierarchy is RotaLocation > RotaHousePart > RotaRole > RotaEmployee, but this can be modified depending on the integration.

Usually, a RotaHousePart can be considered as a grouping of RotaRoles

Some common examples are: Front of House, Back of House

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • local_id (varchar(200)) – Local id

  • name (varchar(200)) – Name of the house part

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

RotaRole

class RotaRole(*args, **kwargs)

RotaRole is a way of organizing RotaEmployees within Tenzo.

The default hierarchy is RotaLocation > RotaHousePart > RotaRole > RotaEmployee, but this can be modified depending on the integration.

Some common examples are: Waiter, Chef, Manager

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • local_id (varchar(200)) – Local id

  • name (varchar(200)) – Name of the Role

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

RotaEmployee

class RotaEmployee(*args, **kwargs)

RotaEmployee represents an employee, coming from a labor / staff scheduler

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • local_id (varchar(200)) – Local id

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • rotarole_id (bigint to RotaRole) – Rotarole

  • pay_rate_type (integer) – Relates to pay_rate, and is the default pay rate type for the employee (can be overriden on the shift). This can be either 0: Hourly or 1: Salaried.

  • pay_rate (decimal) – The default rate of pay for the employee (can be overriden on the shift). If pay_rate_type is hourly, then pay_rate is the hourly rate. If pay_rate_type is Salaried, then pay_rate is the annual rate.

  • full_name (varchar(200)) – Usually a combination of first_name and last_name, however in some cases full_name can be an abbreviation or nickname

  • first_name (varchar(200)) – First name

  • last_name (varchar(200)) – Last name

  • hire_date (date) – Hire date

  • termination_date (date) – Termination date

  • extra (text) – Extra

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

Temporal

RotaShift

class RotaShift(*args, **kwargs)

RotaShift is the core representation of a shift within Tenzo.

Each shift is tied to a RotaEmployee and RotaLocation, and optionally a RotaRole and RotaHousePart. Shifts can be worked or unworked (paid or unpaid absences), and can be for hourly or salaried staff.

A RotaShift stores the number of minutes and the costs for the shift.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • rotaemployee_id (bigint to RotaEmployee) – Rotaemployee

  • rotarole_id (bigint to RotaRole) – Rotarole

  • rotahousepart_id (bigint to RotaHousePart) – Rotahousepart

  • date_of_business (date) – Date the shift will or did take place

  • local_id (varchar(200)) – Local id

  • work_type (integer) – Used to identify absences. Choices are 0: worked, 1: Paid time off, or 2: Unpaid time off

  • work_type_detail (varchar(255)) – Free-text detail on the work type from the source system, e.g. the absence/leave name such as ‘PTO’, ‘Sick Pay’ or ‘Maternity’.

  • pay_rate_type (integer) – Relates to pay_rate, and is the pay rate type for the employee. This can be either 0: Hourly or 1: Salaried.

  • pay_rate (decimal) – Rate of pay for the shift. Hourly rate for hourly shifts, Annual rate for Salaried shifts.

  • base_cost (decimal) – Base Cost of the shift (without any overheads).

  • penalty_cost (decimal) – An overhead. Any penalty costs associated with the shift (usually relating to labor laws).

  • holiday_accrual_cost (decimal) – An overhead. Value of any holiday accrued

  • overtime_cost (decimal) – An overhead. Value of any overtime cost

  • other_overhead_cost (decimal) – An overhead. Value of any ‘other’ overheads, e.g. tax

  • employer_taxes (decimal) – An overhead. Value of any employer taxes

  • pension (decimal) – An overhead. Value of any pension

  • start_time (datetime) – Start time of the shift

  • end_time (datetime) – End time of the shift

  • num_mins (integer) – Number of minutes in the shift, deducting unpaid break minutes. num_mins = (end_time - start_time) - num_mins_break_unpaid

  • num_mins_break_unpaid (integer) – Minutes of unpaid break in the shift

  • num_mins_break_paid (integer) – Minutes of paid break in the shift

  • num_mins_overtime (integer) – Minutes of overtime in the shift

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • extra (text) – Extra

  • is_excluded (bool) – Whether this shift should be excluded from core reports and summaries

  • approved (bool) – Whether the shift has been approved in the source system

RotaShiftPlanned

class RotaShiftPlanned(*args, **kwargs)

RotaShiftPlanned represents an upcoming planned shift (though we keep historical records to allow comparison between planned and actual shift costs).

It is almost identical to RotaShift, expect for having an extra field “plan_date”. This keeps a record of the planned shift and how it changes over time, allowing you to see how shift and planning costs change in the lead up to shifts being worked.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • rotaemployee_id (bigint to RotaEmployee) – Rotaemployee

  • rotarole_id (bigint to RotaRole) – Rotarole

  • rotahousepart_id (bigint to RotaHousePart) – Rotahousepart

  • date_of_business (date) – Date the shift will or did take place

  • local_id (varchar(200)) – Local id

  • work_type (integer) – Used to identify absences. Choices are 0: worked, 1: Paid time off, or 2: Unpaid time off

  • work_type_detail (varchar(255)) – Free-text detail on the work type from the source system, e.g. the absence/leave name such as ‘PTO’, ‘Sick Pay’ or ‘Maternity’.

  • pay_rate_type (integer) – Relates to pay_rate, and is the pay rate type for the employee. This can be either 0: Hourly or 1: Salaried.

  • pay_rate (decimal) – Rate of pay for the shift. Hourly rate for hourly shifts, Annual rate for Salaried shifts.

  • base_cost (decimal) – Base Cost of the shift (without any overheads).

  • penalty_cost (decimal) – An overhead. Any penalty costs associated with the shift (usually relating to labor laws).

  • holiday_accrual_cost (decimal) – An overhead. Value of any holiday accrued

  • overtime_cost (decimal) – An overhead. Value of any overtime cost

  • other_overhead_cost (decimal) – An overhead. Value of any ‘other’ overheads, e.g. tax

  • employer_taxes (decimal) – An overhead. Value of any employer taxes

  • pension (decimal) – An overhead. Value of any pension

  • start_time (datetime) – Start time of the shift

  • end_time (datetime) – End time of the shift

  • num_mins (integer) – Number of minutes in the shift, deducting unpaid break minutes. num_mins = (end_time - start_time) - num_mins_break_unpaid

  • num_mins_break_unpaid (integer) – Minutes of unpaid break in the shift

  • num_mins_break_paid (integer) – Minutes of paid break in the shift

  • num_mins_overtime (integer) – Minutes of overtime in the shift

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • extra (text) – Extra

  • plan_date (date) – An extra dimension for planned shifts. Stores the date when the planned shift was retrieved, so you can see how scheduling costs are altered before the shift happens.

  • is_excluded (bool) – Whether this planned shift should be excluded from core reports and summaries

  • approved (bool) – Whether the planned shift has been published in the source system

static get_latest_plan_date_shifts(queryset) → list

Get the most recent shifts by plan_date grouped by location, role, housepart, employee and date_of_business

Labor Summaries

SummaryLaborByDay

class SummaryLaborByDay(*args, **kwargs)

SummaryLaborByDay represents the aggregation of daily shifts in a location, grouped by RotaLocation and date_of_business.

It is calculated using the base Labor models, aggregating RotaShifts

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins (integer) – Num mins

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

SummaryLaborByRole

class SummaryLaborByRole(*args, **kwargs)

SummaryLaborByRole represents the aggregation of daily shifts in a location, grouped by RotaRole, RotaLocation, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShifts

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins (integer) – Num mins

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

  • rotarole_id (bigint to RotaRole) – Rotarole

SummaryLaborByHousePart

class SummaryLaborByHousePart(*args, **kwargs)

SummaryLaborByHousePart represents the aggregation of daily shifts in a location, grouped by RotaHousePart, RotaLocation, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShifts

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins (integer) – Num mins

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

  • rotahousepart_id (bigint to RotaHousePart) – Rotahousepart

SummaryLaborByTimeOfDay

class SummaryLaborByTimeOfDay(*args, **kwargs)

SummaryLaborByTimeOfDay represents the aggregation of shifts in a location, grouped by RotaLocation, a fifteen_minute_period representing time of day, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShifts

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

  • fifteen_minute_period (integer) – An integer representing a fifteen-minute time period of the day, where 0 corresponds to 00:00, and 1 corresponds to 00:15, and so on

  • num_mins (decimal) – Num mins

SummaryLaborPlannedByDay

class SummaryLaborPlannedByDay(*args, **kwargs)

SummaryLaborPlannedByDay represents the aggregation of daily planned shifts in a location, grouped by RotaLocation, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShiftPlanned

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins (integer) – Num mins

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

SummaryLaborPlannedByRole

class SummaryLaborPlannedByRole(*args, **kwargs)

SummaryLaborPlannedByRole represents the aggregation of daily planned shifts in a location, grouped by RotaRole, RotaLocation, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShiftPlanned

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins (integer) – Num mins

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

  • rotarole_id (bigint to RotaRole) – Rotarole

SummaryLaborPlannedByHousePart

class SummaryLaborPlannedByHousePart(*args, **kwargs)

SummaryLaborPlannedByHousePart represents the aggregation of daily planned shifts in a location, grouped by RotaHousePart, RotaLocation, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShiftPlanned

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins (integer) – Num mins

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

  • rotahousepart_id (bigint to RotaHousePart) – Rotahousepart

SummaryLaborPlannedByTimeOfDay

class SummaryLaborPlannedByTimeOfDay(*args, **kwargs)

SummaryLaborPlannedByTimeOfDay represents the aggregation of planned shifts in a location, grouped by RotaLocation, a fifteen_minute_period representing time of day, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShiftPlanned

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

  • fifteen_minute_period (integer) – An integer representing a fifteen-minute time period of the day, where 0 corresponds to 00:00, and 1 corresponds to 00:15, and so on

  • num_mins (decimal) – Num mins

SummaryLaborPlannedByPlanDateByDay

class SummaryLaborPlannedByPlanDateByDay(*args, **kwargs)

SummaryLaborPlannedByPlanDateByDay represents the aggregation of daily planned shifts in a location, grouped by plan_day, RotaLocation, and date_of_business.

It is calculated using the base Labor models, aggregating RotaShiftPlanned.

This allows viewing how planned shifts change over time.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • rotalocation_id (bigint to RotaLocation) – Rotalocation

  • date_of_business (date) – Date of business

  • last_modified (datetime) – Last modified

  • work_type (integer) – Work type

  • pay_rate_type (integer) – Pay rate type

  • base_cost (decimal) – Base cost

  • penalty_cost (decimal) – Penalty cost

  • holiday_accrual_cost (decimal) – Holiday accrual cost

  • overtime_cost (decimal) – Overtime cost

  • other_overhead_cost (decimal) – Other overhead cost

  • employer_taxes (decimal) – Employer taxes

  • pension (decimal) – Pension

  • num_mins (integer) – Num mins

  • num_mins_break_unpaid (integer) – Num mins break unpaid

  • num_mins_break_paid (integer) – Num mins break paid

  • num_mins_overtime (integer) – Num mins overtime

  • plan_date (date) – Plan date

Inventory

Note

All inventory tables are prefixed with “inventory_”

https://developers-site.s3.eu-west-1.amazonaws.com/schema/_images/inventory.png

Categorical

INVLocation

class INVLocation(*args, **kwargs)

INVLocation is a representation of a Location for an inventory item or menu item.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this location belongs to

  • local_id (varchar(200)) – Local id

  • app_location_id (bigint to Location) – This unifies this location with a core physical location in Tenzo

  • name (varchar(200)) – Name

  • api_class (varchar(64)) – Visible name of the integration this location’s data comes from

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • to_delete (bool) – To delete

INVItem

class INVItem(*args, **kwargs)

INVItem is a representation of an item within the inventory.

A INVItem typically belongs to a category, which should be an instance of INVCategory. A INVItem typically represents an ingredient/stock item rather than a product or recipe of the business.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this item belongs to

  • invlocation_id (bigint to INVLocation) – Invlocation

  • local_id (varchar(200)) – Local id

  • name (varchar(200)) – Name

  • category_id (bigint to INVCategory) – The INVCategory to which this item belongs

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

INVCategory

class INVCategory(*args, **kwargs)

INVCategory is a representation of a category for inventory items, used to organise INVItem within Tenzo.

A Category can have a parent category, which is used to organise items into subcategories. The model supports hierarchies of an arbitrary depth. Only categories and immediate subcategories are available on webapp.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this category belongs to

  • invlocation_id (bigint to INVLocation) – Invlocation

  • local_id (varchar(200)) – Local id

  • name (varchar(200)) – Name

  • parent_category_id (bigint to INVCategory) – The parent INVCategory which the given category is a subcategory of

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

INVVendor

class INVVendor(*args, **kwargs)

INVVendor is a representation of a business supplier, from which stock is purchased.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this vendor belongs to

  • invlocation_id (bigint to INVLocation) – Invlocation

  • local_id (varchar(200)) – Local id

  • name (varchar(200)) – Name

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

Temporal

INVPurchase

class INVPurchase(*args, **kwargs)

INVPurchase represents the purchase of an item.

The associated date may represent the point of order, receipt, or payment, and should align with the convention used by the inventory platform.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this location belongs to

  • local_id (varchar(200)) – Local id

  • invlocation_id (bigint to INVLocation) – The INVLocation where the purchase was received

  • item_id (bigint to INVItem) – The INVItem received

  • date_of_business (date) – Date of business

  • vendor_id (bigint to INVVendor) – The INVVendor purchased from.

  • order_date (datetime) – Order date

  • delivery_date (datetime) – Delivery date

  • quantity (decimal) – The quantity of items purchased, expressed in units of pack size (e.g., 2 packs of 500g)

  • cost_no_tax (decimal) – The total cost of the items received excluding tax

  • cost_with_tax (decimal) – The total cost of the items received including tax

  • base_unit (varchar(100)) – Unit of measurement of the item quantity (e.g. ‘Kg’, ‘Piece’, ‘L’)

  • is_excluded (bool) – Whether this purchase should be excluded from core reports and summaries

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • extra (text) – Extra

classmethod get_location_filter_field() → str

Override to use invlocation instead of poslocation for inventory models

INVUsage

class INVUsage(*args, **kwargs)

INVUsage represents the usage of an item at a specific location on a specific date.

A INVUsage type is specified by the `usage_type` field:

1 - Theoretical (As determined from the quantity and expected contents of menu-items/recipes sold) 2 - Recorded Wastage (Recorded wastage of items not used in menu-items/recipes sold - i.e., expired items) 3 - Actual (As determined from the change in item quantity in the inventory between stock counts)

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this location belongs to

  • local_id (varchar(200)) – Local id

  • invlocation_id (bigint to INVLocation) – The INVLocation where the usage occurred

  • item_id (bigint to INVItem) – The INVItem that was used.

  • date_of_business (date) – Date of business

  • usage_type (integer) – The type of item usage, can be either 1 (Theoretical), 2 (Recorded Wastage) or 3 (Actual).

  • quantity (decimal) – The quantity of items used, expressed in units of pack size (e.g., 2 packs of 500g)

  • cost_no_tax (decimal) – The total cost of the items used excluding tax

  • cost_with_tax (decimal) – The total cost of the items used including tax

  • is_excluded (bool) – Whether this usage should be excluded from core reports and summaries

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • extra (text) – Extra

classmethod get_location_filter_field() → str

Override to use invlocation instead of poslocation for inventory models

INVTransfer

class INVTransfer(*args, **kwargs)

INVTransfer represents the transfer of an item from one location to another.

A INVTransfer type is specified by the `transfer_type` field:

1 - Transfer in to the location specified by `invlocation_id`. 2 - Transfer out of the location specified by `invlocation_id`.

This classification is relative to the location specified by the `invlocation_id` field.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this location belongs to

  • local_id (varchar(200)) – Local id

  • invlocation_id (bigint to INVLocation) – The INVLocation where the stock change is being accounted

  • item_id (bigint to INVItem) – The INVItem transferred

  • date_of_business (date) – Date of business

  • transferring_location_id (bigint to INVLocation) – The INVLocation where the item is being transferred to (if a transfer out) or being transferred from (if a transfer in)

  • transfer_type (integer) – The type of transfer. This can be either 1 (Transfer in) or 2 (Transfer out)

  • quantity (decimal) – The quantity of items transferred, expressed in units of pack size (e.g., 2 packs of 500g)

  • cost_no_tax (decimal) – The total cost of the items transferred excluding tax.

  • cost_with_tax (decimal) – The total cost of the items transferred including tax (positive for both transfers in and out).

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • extra (text) – Extra

INVMenuItemCost

class INVMenuItemCost(*args, **kwargs)

INVMenuItemCost represents the cost of an item on the menu.

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – This indicates the business and API this location belongs to

  • local_id (varchar(400)) – Local id

  • invlocation_id (bigint to INVLocation) – The INVLocation where the menu item exists

  • date_of_business (date) – Date of business

  • menuitem_id (bigint to INVMenuItem) – The INVMenuItem of the menu item

  • cost (decimal) – Total cost of the menu item

  • is_excluded (bool) – Whether this menu item cost should be excluded from core reports and summaries

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • extra (text) – Extra

classmethod get_location_filter_field() → str

Override to use invlocation instead of poslocation for inventory models

Social

Categorical

SocialLocation

class SocialLocation(id, deleted_at, business_api_instance, api, api_credentials, business, location, local_id, identifier, search_query, ignored, version, last_modified, date_added, to_delete)
Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • api_id (integer to API) – Api

  • api_credentials_id (integer to APICredentials) – Api credentials

  • business_id (integer to Business) – Business

  • location_id (bigint to Location) – Location

  • local_id (varchar(300)) – Local id

  • identifier (varchar(300)) – Identifier

  • search_query (varchar(300)) – Search query

  • ignored (bool) – Ignored

  • version (integer) – Version

  • last_modified (datetime) – Last modified

  • date_added (datetime) – Date added

  • to_delete (bool) – To delete

Temporal

SocialReview

class SocialReview(id, deleted_at, sociallocation, instance_type, rating, local_id, source_id, language, author_name, author_url, linker_url, content_type, comment, text, has_replied, ignored, extra, is_excluded, date_added, review_datetime, review_created, last_modified)
Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • sociallocation_id (bigint to SocialLocation) – Sociallocation

  • instance_type (integer) – Instance type

  • rating (decimal) – Rating

  • local_id (varchar(200)) – Local id

  • source_id (varchar(200)) – Source id

  • language (varchar(10)) – Language

  • author_name (varchar(200)) – Author name

  • author_url (varchar(200)) – Author url

  • linker_url (varchar(200)) – Linker url

  • content_type (varchar(200)) – Content type

  • comment (varchar(1000)) – Comment

  • text (text) – Text

  • has_replied (bool) – Has replied

  • ignored (bool) – Ignored

  • extra (text) – Extra

  • is_excluded (bool) – Whether this review should be excluded from core reports and summaries

  • date_added (datetime) – Date added

  • review_datetime (datetime) – Review datetime

  • review_created (datetime) – Review created

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Return the field path for location filtering

SocialSubRating

class SocialSubRating(id, deleted_at, local_id, social_review, rating, rating_type, text, extra, date_added, last_modified)
Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • local_id (varchar(200)) – Local id

  • social_review_id (bigint to SocialReview) – Social review

  • rating (decimal) – Rating

  • rating_type (text) – Rating type

  • text (text) – Text

  • extra (text) – Extra

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

Reservations

Categorical

ResCustomer

class ResCustomer(*args, **kwargs)

This represents the end customer who will be coming into the location

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • business_api_instance_id (bigint to BusinessAPIInstance) – Business api instance

  • local_id (varchar(200)) – Local id

  • name (varchar(300)) – Name

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

Temporal

Reservation

class Reservation(*args, **kwargs)

This represents an individual reservation at a specific time for a certain number of people

Parameters:
  • id (integer) – Id

  • deleted_at (datetime) – Deleted at

  • apilocation_id (bigint to APILocation) – Apilocation

  • customer_id (bigint to ResCustomer) – Customer

  • revenue_center_id (bigint to ResRevenueCenter) – Revenue center

  • source_id (bigint to ResSource) – Source

  • local_id (varchar(300)) – Local id

  • date_of_business (date) – Date of business

  • reservation_datetime (datetime) – Reservation datetime

  • reservation_created (datetime) – Reservation created

  • reservation_last_updated (datetime) – Reservation last updated

  • num_guests (integer) – Num guests

  • reservation_paid_with_tax (decimal) – The total value of this reservation with tax

  • reservation_paid_no_tax (decimal) – The total value of this reservation without tax

  • reservation_prepayment_with_tax (decimal) – The amount paid ahead for this reservation with tax

  • reservation_prepayment_no_tax (decimal) – The amount paid ahead for this reservation without tax

  • status (integer) – Status

  • tags (text) – Can store any additional info about the reservation e.g., special requests etc.

  • extra (text) – Extra

  • is_excluded (bool) – Whether this reservation should be excluded from core reports and summaries

  • date_added (datetime) – Date added

  • last_modified (datetime) – Last modified

classmethod get_location_filter_field() → str

Return the field path for location filtering