feat(store): add Area admission and audit outbox [T-010]
Harness governance / validate (push) Has been cancelled
Harness governance / validate (pull_request) Has been cancelled

This commit is contained in:
QiuSW
2026-08-07 18:23:24 +08:00
parent 8abff0a566
commit 36786723e3
23 changed files with 1346 additions and 99 deletions
+30
View File
@@ -0,0 +1,30 @@
-- Contract-only reference for the Bell -> Sense Area admission projection.
-- The executable migration is deploy/postgres/005_area_policy.sql.
CREATE OR REPLACE VIEW bell.area_policy_v1 (
tenant_id,
site_id,
area_id,
capture_policy,
source_version,
source_updated_at
) AS
SELECT
area.tenant_id,
area.site_id,
area.id,
area.capture_policy,
area.version,
area.updated_at
FROM bell.areas AS area
JOIN bell.sites AS site
ON site.tenant_id = area.tenant_id AND site.id = area.site_id
WHERE area.deleted_at IS NULL AND site.deleted_at IS NULL;
COMMENT ON VIEW bell.area_policy_v1 IS
'v1 read-only Area capture-policy projection owned by Bell and consumed by Sense';
ALTER VIEW bell.area_policy_v1 OWNER TO bell_app;
REVOKE ALL PRIVILEGES ON TABLE bell.area_policy_v1 FROM PUBLIC;
REVOKE ALL PRIVILEGES ON TABLE bell.area_policy_v1 FROM sense_app;
GRANT SELECT ON TABLE bell.area_policy_v1 TO sense_app;