app.expenses
TablaSeguridad a nivel de fila activa
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.
Clave primaria: id
| Columna | Tipo | Admite nulos | Descripción |
|---|---|---|---|
| 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.Hace referencia a app.organizations.id |
| budget_line_id | uuid | No | The one budget line the expense posts to. Never changes.Hace referencia a app.budget_lines.id |
| counterparty_id | uuid | Sí | Vendor paid, when there is one.Hace referencia a app.counterparties.id |
| submitter_person_id | uuid | Sí | Person who submitted the expense, set from the session; they cannot approve it.Hace referencia a 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.Hace referencia a private.currencies.currency_code |
| expense_state | app.expense_state | No | Expense state. Changes only through the expense RPCs. |
| deleted_at | timestamp with time zone | Sí | 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 | Sí | Person who inserted the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Sí | Person who last changed the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |