Expose a permission-filtered approvals inbox and readable order summaries

This commit is contained in:
2026-11-17 22:38:14 +01:00
parent 18b31df91b
commit bc8100602b
6 changed files with 288 additions and 13 deletions
+7
View File
@@ -0,0 +1,7 @@
-- Count and page pending requests by customer without walking decided requests.
CREATE INDEX approval_requests_pending_inbox ON approval_requests
(tenant_id, created_at DESC, operation_id DESC) INCLUDE (plan_id)
WHERE approval_state = 'pending_approval';
CREATE INDEX approval_requests_timeline ON approval_requests
(tenant_id, created_at DESC, operation_id DESC) INCLUDE (plan_id, approval_state);