Giao diện
identity / consent
Trang sinh tự động
Sinh từ ad83b0aea — chạy 820 migration lên PostgreSQL 17 rồi đọc pg_catalog. Mô tả bảng và cột lấy từ COMMENT ON. Không sửa tay: lần chạy docgen sau sẽ ghi đè.
2 bảng. Quay lại identity.
consent_purpose_versions
P1-14. Versioned consent purpose texts (Legal/PO config, none seeded: GAP-60). One PUBLISHED per purpose.
public.consent_purpose_versions · 7 cột · 5 check · 1 unique · 3 index · 1 policy · 5 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
purpose | text | NOT NULL | ||
version | integer | NOT NULL | ||
status | text | NOT NULL | ||
document_ref | text | NOT NULL | ||
published_at | timestamptz | |||
created_at | timestamptz | NOT NULL |
Khoá chính: id
Trỏ ra: không có
Được trỏ tới (1): consent_records
consent_records
P1-14. Append-only consent grant/withdraw history per account and purpose (NFR-PRI-002, NFR-CPL-004).
public.consent_records · 11 cột · 4 check · 1 unique · 3 index · 1 policy · 2 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
account_id | uuid | NOT NULL | FK → accounts | |
purpose | text | NOT NULL | ||
seq | integer | NOT NULL | ||
action | text | NOT NULL | ||
purpose_version_id | uuid | NOT NULL | FK → consent_purpose_versions | |
purpose_version | integer | NOT NULL | ||
app | app_code | NOT NULL | ||
request_id | text | NOT NULL | ||
correlation_id | correlation_ref | NOT NULL | ||
recorded_at | timestamptz | NOT NULL |
Khoá chính: id
Trỏ ra (2):
account_id→accounts·ON DELETE RESTRICTpurpose_version_id→consent_purpose_versions·ON DELETE RESTRICT
Được trỏ tới: không có