Supplier PO Approval Tracker
An internal tool that replaces email-and-spreadsheet purchase-order approvals with a clear, auditable workflow: create POs, route them for approval, and notify approvers by email — with a status dashboard for the ops team.
Goals
- Give every PO a clear, auditable approval trail.
- Cut approval turnaround time with email notifications.
- Show PO status at a glance for the ops team.
Features
- PO creation — Create a purchase order with supplier, lines and totals.
- Approval workflow — Submit for approval; approve/reject with a note.
- Email notifications — Notify approvers when action is needed.
- Status dashboard — List and filter POs by status.
Data model
PurchaseOrder
A purchase order routed through the approval workflow.
| Field | Type | Nullable | Notes |
|---|
| id | uuid | no | |
| company_id | uuid | no | Multi-tenancy scope. |
| supplier | text | no | |
| status | enum(draft|pending|approved|rejected) | no | |
| total | decimal(12,2) | no | |
| note | text | yes | |
| created_at | timestamptz | no | |
Relations:
- has many PurchaseOrderLine
- belongs to User (submitter)
Indexes:
PurchaseOrderLine
A single line item on a purchase order.
| Field | Type | Nullable | Notes |
|---|
| id | uuid | no | |
| purchase_order_id | uuid | no | |
| description | text | no | |
| quantity | integer | no | |
| unit_price | decimal(12,2) | no | |
Relations:
Indexes:
Pages
/purchase-orders
List and filter purchase orders by status.
Components:
- StatusFilter
- PurchaseOrderTable
States: empty, loading
/purchase-orders/new
Create a new purchase order with line items.
Components:
- PurchaseOrderForm
- LineItemEditor
/purchase-orders/[id]
View a PO and approve/reject it.
Components:
- PurchaseOrderDetail
- ApprovalActions
Milestones
- Foundation — Stand up the app, DB and auth.
- PO & approval — Core PO lifecycle and approvals.
- Notifications & dashboard — Email + status visibility.
Tasks
Foundation
- Scaffold Next.js app with Ensign defaults (Urgent · S)
- Wire Postgres + Drizzle (Urgent · S)
- Integrate ensign-sso auth (company_id scoping) (High · M)
PO & approval
- Model PurchaseOrder + line items (Urgent · M)
- Build PO create/edit form (High · M)
- Implement submit / approve / reject with notes (High · M)
Notifications & dashboard
- Send approval-needed emails (Medium · S)
- Build status dashboard with filters (Medium · M)
Non-functional requirements
- Security — All access gated by ensign-sso; every query scoped by company_id.
- Auditability — Approval events are append-only and never mutated.
- Performance — PO list paginated; p95 under 300ms at 10k POs.
Risks
- Email delivery failures leave approvers unaware of pending POs. — Show a pending-approvals badge in-app so email is not the only channel.
- Approval trail could be edited after the fact, undermining auditability. — Append-only approval events; never mutate past decisions.
Open questions
- Should approval thresholds vary by PO total?
- Who can create POs — any user, or a specific role?
Out of scope
- Xero/Sage accounting integration
- Multi-step approval chains
- Supplier self-service portal