Giao diện
payment / voucher
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 payment.
vouchers
P3-09. Manual RECEIPT/PAYMENT/REVERSAL vouchers (maker/checker, G-FIN). APPROVED/CANCELLED are immutable; the approval snapshot (payload hash, policy version, roles) is frozen at submit. No number (GAP-99), no balance.
public.vouchers · 29 cột · 12 check · 1 unique · 6 index · 1 policy · 4 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
kind | text | NOT NULL | ||
status | text | NOT NULL | ||
fund_code | text | NOT NULL | ||
amount_vnd | bigint | NOT NULL | ||
currency | text | NOT NULL | ||
reason | text | NOT NULL | ||
order_id | uuid | FK → orders | ||
transaction_id | uuid | FK → provider_transactions | ||
original_voucher_id | uuid | FK → vouchers | ||
evidence_media_ids | uuid[] | NOT NULL | ||
created_by | uuid | NOT NULL | FK → accounts | |
created_at | timestamptz | NOT NULL | ||
updated_by | uuid | NOT NULL | FK → accounts | |
updated_at | timestamptz | NOT NULL | ||
submitted_by | uuid | FK → accounts | ||
submitted_at | timestamptz | |||
payload_hash | bytea | |||
policy_version_id | uuid | FK → finance_policy_versions | ||
policy_version_no | integer | |||
maker_roles | text[] | |||
checker_roles | text[] | |||
approved_by | uuid | FK → accounts | ||
approved_at | timestamptz | |||
cashbook_entry_id | uuid | FK → cashbook_entries | ||
cancelled_by | uuid | FK → accounts | ||
cancelled_at | timestamptz | |||
version | integer | NOT NULL | ||
correlation_id | correlation_ref | NOT NULL |
Khoá chính: id
Trỏ ra (10):
approved_by→accounts·ON DELETE RESTRICTcancelled_by→accounts·ON DELETE RESTRICTcreated_by→accounts·ON DELETE RESTRICTcashbook_entry_id→cashbook_entries·ON DELETE RESTRICT DEFERRABLEorder_id→orders·ON DELETE RESTRICToriginal_voucher_id→vouchers·ON DELETE RESTRICTpolicy_version_id→finance_policy_versions·ON DELETE RESTRICTsubmitted_by→accounts·ON DELETE RESTRICTtransaction_id→provider_transactions·ON DELETE RESTRICTupdated_by→accounts·ON DELETE RESTRICT
Được trỏ tới (2): voucher_rejections, vouchers
voucher_rejections
FU-713. Append-only: a checker sent a SUBMITTED voucher back to its maker, with the reason. Never changed or deleted.
public.voucher_rejections · 7 cột · 1 check · 1 unique · 3 index · 1 policy · 2 trigger · RLS bật
| Cột | Kiểu | Khoá | Mô tả | |
|---|---|---|---|---|
id | uuid | NOT NULL | PK | |
voucher_id | uuid | NOT NULL | FK → vouchers | |
at_version | integer | NOT NULL | ||
rejected_by | uuid | NOT NULL | FK → accounts | |
rejected_at | timestamptz | NOT NULL | ||
reason | text | NOT NULL | ||
correlation_id | correlation_ref | NOT NULL |
Khoá chính: id
Trỏ ra (2):
rejected_by→accounts·ON DELETE RESTRICTvoucher_id→vouchers·ON DELETE RESTRICT
Được trỏ tới: không có