SPAY4 · CURRENT AUTHORITY

Target ER 審核

CURRENT

69 relations 的 identity、owner/snapshot、nullable、index intent 與 service guard 集中於此入口。

所有關係都是 logical relation;圖表不補畫候選 DDL 沒有的欄位。

用途與具體情境

69 relations 的 identity、owner/snapshot、nullable、index intent 與 service guard 集中於此入口。 例如:在安排建置或核對資料關係前,先確認這份摘要的適用範圍;來源不能代替產品驗收。

展開技術摘要與圖表

Schema 版本與適用範圍

52 foundation baseline - 1 #546 removal + 2 Overview + 1 Withdrawal + 2 Notification + 1 HOUSE balance + 1 BO alert + 1 Payment Account limit + 5 Supply Channel + 2 Supply Channel daily quota + 1 Supply Channel transaction + 1 Channel report + 1 Payment Account identity history = 69 current union。52-table foundation 詳細審核保留原版本;Overview checkpoint 是 54,Withdrawal 加 Notification exact 2 overlays 後是 57,再加 HOUSE balance exact 1 overlay 後是 58,再加 BO alert exact 1 overlay 後是 59,再加 Payment Account limit exact 1 overlay 後是 60,再加 Supply Channel exact 5 overlay 後是 65,再加 Supply Channel daily quota exact 2 overlay 後是 67,再加 Supply Channel transaction exact 1 overlay 後是 68,再加 Channel report exact 1 overlay 後是 69,#546 移除 foundation 的 Withdrawal recovery case 歷史表後是 68,再加 Payment Account identity history exact 1 overlay 後是當前 fresh DDL 69。資料表數不是功能完成證據。

來源:sql/V4/README.md/sql/V4/ddl.sql 的 exact foundation/Overview/Withdrawal/Notification inventories;foundation contract、Overview overlay 與驗收界線、Withdrawal operation authority。不授權 SQL,不修改 DDL/seed;existing target 不得重跑 fresh DDL、清庫或 backfill。

Target ER 四區總覽與關聯子圖;Withdrawal 僅含 Payment Account path,沒有 HOUSE path。
總覽後依序呈現四個區域子圖;所有連線均由 service guard 維護,非 database foreign key。

分區總覽+四張子圖

先讀跨區主鏈,再依序讀 Core、Supply、Cardholder/Payment Account/order routing、immutable fact/projection/reporting。每張 card 都是候選 DDL 已存在的 relation;連線的 cardinality 與類型只描述 service guard 維護的 logical relation。

69-relation catalog

下列 catalog 保留作 identity、nullable、owner/snapshot、index intent 與 service guard 的查閱入口;視覺圖不取代 current contract。

Core · 14

currencybankagentnotification_provider_sourcecredential_referencecredential_secretagent_banksystem_groupsystem_methodrolerole_methodusersystem_configagent_system_config

Domain · 55

external_api_replay_noncesuppliersupply_gatewaysupply_accountdomain_audit_logsupply_pt_policysupply_pt_revisionsupply_pt_revision_linesupply_gateway_direction_configsupply_gateway_agent_allocationsupply_eligible_factsupply_eligible_fact_correctionsupply_eligible_fact_projection_queuesupply_eligible_fact_projection_failure_attemptsupply_aggregate_projection_watermarksupply_financial_hourly_aggregatesupply_cardholdersupply_cardholder_sessionsupply_cardholder_device_tokensupply_cardholder_notificationpayment_account_applicationpayment_accountpayment_account_balance_loghouse_cardpayment_account_daily_countersupply_cardholder_daily_assignment_counteragent_api_order_claimsupply_deposit_ordersupply_withdrawal_ordersupply_order_assignment_attemptagent_callback_outboxpayment_account_reservationsupply_order_proofsupply_deposit_operationhouse_card_transactionhouse_card_daily_counterhouse_card_deposit_reservationpayment_account_identity_guardpayment_account_overview_commandsupply_withdrawal_operationsupply_notification_batchsupply_notification_batch_recipienthouse_card_balance_logbo_alertpayment_account_currency_limitsupply_channelsupplier_external_provider_secretsupply_channel_agent_allocationsupplier_credential_referencesupplier_credential_secretsupply_channel_daily_countersupply_channel_deposit_reservationsupply_channel_transactionagent_receiver_aliaspayment_account_identity_history

固定邊界

  • user 與 supply_account 各自直接保存 password、TOTP、challenge 與 session state;credential_reference/credential_secret 僅屬 Agent OGP/LINE integration。
  • HOUSE 僅在 Deposit、LINE inbound evidence、HOUSE Deposit quota/reservation 出現;Withdrawal 使用 Payment Account reservation、assignment attempt 與 operation;不設 recovery case relation(#546 已移除歷史 schema),不授予 recovery writer。
  • 所有 relation 維持 Greenfield/no database FK、server-derived owner scope、immutable fact/correction/projector 與 Agent API claim 的 current authority。

完整性 evidence

表格完整性審核逐列記錄 identity/unique grain、owner/snapshot、必要欄位群、index intent、流程使用點與 finding boundary。

圖表用來定位元件與資料責任,不表示完整需求已實作或驗證。

來源:concepts/target-er-model-review.md(SQL 初始化頁除外)。

圖片預覽