fix: 添加后台定时重试 + 管理员强制确认 + 审计日志 + mock守卫
This commit is contained in:
14
migrations/009_add_payment_audit_log.sql
Normal file
14
migrations/009_add_payment_audit_log.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- 支付操作审计日志表
|
||||
CREATE TABLE IF NOT EXISTS payment_audit_log (
|
||||
id SERIAL PRIMARY KEY,
|
||||
order_no VARCHAR(64) NOT NULL REFERENCES payment_orders(order_no),
|
||||
user_id INTEGER NOT NULL REFERENCES users(id),
|
||||
action VARCHAR(32) NOT NULL, -- paid, refunded, cancelled, admin_confirm, admin_revoke, expired
|
||||
operator_id INTEGER REFERENCES users(id), -- NULL 表示系统操作
|
||||
detail TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_payment_audit_log_order_no ON payment_audit_log(order_no);
|
||||
CREATE INDEX IF NOT EXISTS idx_payment_audit_log_user_id ON payment_audit_log(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_payment_audit_log_created_at ON payment_audit_log(created_at);
|
||||
Reference in New Issue
Block a user