Skip to content

app.approval_instances

TableRow level security on

A spend document going through its approval policy. Created only by app.request_approval, which reads the amount, currency and project from the document; decided step by step through app.decide_approval.

Primary key: id

Columns of app.approval_instances
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org, derived from app.approval_policies on insert; never accepted from the caller and never changed.References app.organizations.id
approval_policy_iduuidNoPolicy the document goes through.References app.approval_policies.id
document_typeapp.spend_document_typeNoSpend document type.
document_iduuidNoId of the document in subject_table.
subject_tabletextNoTable of the document: purchase_orders, po_change_orders, change_orders, invoices, requisitions, expenses or payroll_runs.
subject_referencetextYesThe document's own number or name when requested, for display.
project_iduuidYesProject of the document; NULL for org-level documents such as payroll runs.References app.projects.id
amount_minorbigintNoAmount submitted for approval, in minor units; the approval covers the document only while its amount stays at or below it.
currency_codecharacter(3)NoISO 4217 currency of the amount.References private.currencies.currency_code
requested_byuuidNoPerson who requested the approval; never an approver of it (sod_approval_requester).References app.people.id
approval_stateapp.approval_stateNoIn Review, Approved, Rejected or Canceled. Changes only through the approval RPCs.
current_stepsmallintNoStep order waiting for a decision while In Review; the last step decided afterwards.
decided_attimestamp with time zoneYesWhen the approval was approved, rejected or canceled; NULL while In Review.
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