Skip to content

Sales Items

singularName: sales-itempluralName: sales-items

Table to store all sales items available for purchase. A number of category fiels are required to combine all in one table. The items are effective dated

Schema

NameTypeDetails
item_typeenumerationone of [Drinks, Subscriptions, Other]
item_namestring
item_priceinteger
start_datedate
end_datedate
onsite_salesrelationoneToMany → Onsite Sales
item_subtypeenumerationone of [Beer, Non-Beer]

Lifecycles

beforeUpdate (async)

This lifecycle method is triggered before updating a sales item entry. It checks for any changes in the entry's fields and ensures that updates to certain fields like 'item_price', 'item_type', and 'item_subtype' are not allowed. If these fields are attempted to be updated, an error is thrown indicating that these fields cannot be modified and a new item should be created instead.

Parameters:

  • event: - The event object containing parameters and state from the update process.

Released under the MIT License.