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
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.budget_lines on insert; never accepted from the caller and never changed.References app.organizations.id |
| budget_line_id | uuid | No | The one budget line the expense posts to. Never changes.References app.budget_lines.id |
| counterparty_id | uuid | Yes | Vendor paid, when there is one.References app.counterparties.id |
| submitter_person_id | uuid | Yes | Person who submitted the expense, set from the session; they cannot approve it.References app.people.id |
| description | text | No | What was bought. |
| incurred_on | date | No | Date the cost was incurred; its accounting period must accept postings when approved. |
| amount_minor | bigint | No | Amount in minor units of currency_code. An expense is a claim, so the amount is required. |
| currency_code | character(3) | No | ISO 4217 currency; equals the budget currency.References private.currencies.currency_code |
| expense_state | app.expense_state | No | Expense state. Changes only through the expense RPCs. |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |