app.journal_entries
TableRow level security on
Journal entries. Prepared, then posted by someone other than the preparer (Section 8.2); posting into a Closed, Audited or Archived period is refused (invariant 13). Entries generated by approved documents are prepared by the platform.
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.accounting_periods on insert; never accepted from the caller and never changed.References app.organizations.id |
| accounting_period_id | uuid | No | Period the entry posts to; its dates cover entry_date.References app.accounting_periods.id |
| project_id | uuid | Yes | Project the entry belongs to, when it does.References app.projects.id |
| entry_date | date | No | Date the cost or revenue is recognized. |
| memo | text | No | What the entry records. |
| journal_state | app.journal_state | No | Proposed, Posted or Canceled. Changes only through app.post_journal_entry and app.cancel_journal_entry. |
| prepared_by | uuid | Yes | Person who prepared the entry, set from the session; NULL when the platform generated it from an approved document.References app.people.id |
| posted_by | uuid | Yes | Person who posted the entry; never the preparer.References app.people.id |
| posted_at | timestamp with time zone | Yes | When the entry was posted. |
| source_table | text | Yes | Table of the document that generated the entry, such as expenses. |
| source_id | uuid | Yes | Id of the document that generated the entry. |
| 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 |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |