Cash Expenses
singularName: cash-expensepluralName: cash-expenses
Holds the cash expenses for every run which are paid at the runsite in Cash. Used to generate cash-flow statement per run
Schema
| Name | Type | Details |
|---|---|---|
| run | relation | manyToOne → Hareline |
| expense_type | enumeration | one of [Beer Provider Ice & Tipp, OnDown Beer, Free Text Item] |
| free_text_item_content | string | |
| amount_spent | decimal |
Lifecycles
beforeCreate (async)
Before creating a new cash expense entry, this method checks:
- For a Free text item you MUST enter item Content
- If the amount spent is greater than 0, it multiplies it by -1
- If the amount spent is 0 or not provided, throws an error
Throws an error if the checks fail.
Parameters:
event: - The event object containing the parameters for the new cash expense entry.
