app.purchase_orders
TableRow level security on
Purchase orders of a project. The creator cannot approve (sod_po_creator), approval runs spend authority, and a closed production refuses new ones (invariant 10). Totals are derived (app.purchase_order_totals).
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.projects on insert; never accepted from the caller and never changed.References app.organizations.id |
| project_id | uuid | No | Project buying.References app.projects.id |
| po_number | bigint | No | Number from the project's display key sequence, issued on insert. |
| vendor_id | uuid | No | Vendor supplying; never a Blocked or Canceled vendor.References app.vendors.id |
| rfq_response_id | uuid | Yes | Awarded RFQ response the order comes from, when there is one.References app.rfq_responses.id |
| currency_code | character(3) | No | ISO 4217 currency of the order.References private.currencies.currency_code |
| po_state | app.po_state | No | Purchase order state. Changes only through the purchase order 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 |
| delivery_due_on | date | Yes | Date the order is due to be delivered. |
| payment_terms_days | integer | Yes | Days after invoice the order is payable (Net 30 is 30). |
| tax_minor | bigint | Yes | Tax on the order in minor units of currency_code; NULL when not stated (never coerced to 0). |
| shipping_minor | bigint | Yes | Shipping charged on the order in minor units of currency_code; NULL when not stated. |