Skip to content

app.expenses

TableRow level security on

Expenses. One expense posts to exactly one budget line (invariant 12): a single required budget line that never changes. Approval posts it to the ledger.

Primary key: id

Columns of app.expenses
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org, derived from app.budget_lines on insert; never accepted from the caller and never changed.References app.organizations.id
budget_line_iduuidNoThe one budget line the expense posts to. Never changes.References app.budget_lines.id
counterparty_iduuidYesVendor paid, when there is one.References app.counterparties.id
submitter_person_iduuidYesPerson who submitted the expense, set from the session; they cannot approve it.References app.people.id
descriptiontextNoWhat was bought.
incurred_ondateNoDate the cost was incurred; its accounting period must accept postings when approved.
amount_minorbigintNoAmount in minor units of currency_code. An expense is a claim, so the amount is required.
currency_codecharacter(3)NoISO 4217 currency; equals the budget currency.References private.currencies.currency_code
expense_stateapp.expense_stateNoExpense state. Changes only through the expense RPCs.
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id