本卡屬 FR-196(母卡 CM-3875(已建)),卡 S-2,第二期批 5。只改 BE(主 repo,Repo 欄空著)。依賴:S-1。
第二期的資料準備:把 FR-137 那張「寄信紀錄表」加四欄,讓它同時當通知中心的外送佇列與投遞紀錄(不另開表,重複設計盤點裁的);加三個系統設定值(已讀保留天數、投遞紀錄保留天數、Agent 離線判定分鐘數)。擴欄全部可空、既有資料不動。🔴 本卡是第二期 manifest 的 owner。
extend 既有表(設計 §5.2 表 5-5):ALTER ADD COLUMN 四欄皆可 null、既有列不動;唯一索引 uq_task_alert_notifications_scan_recipient 保留;system_configs seed 照 FR-020 NOTIFY_CONFIG 的 group/key 形狀
repo:~/Projects/Billows/Audit-Manager/compliance-manager-be
改既有:scripts/sql/manifest.tsv(兩行)
新開:scripts/sql/2026-11-13-fr196-task-alert-outbound-columns.sql
新開:scripts/sql/2026-11-13-fr196-seed-notification-center-configs.sql
2026-11-13-fr196-task-alert-outbound-columns.sql:ALTER TABLE compliance.task_alert_notifications ADD COLUMN IF NOT EXISTS inbox_id bigint NULL, ADD COLUMN IF NOT EXISTS channel varchar(16) NOT NULL DEFAULT 'email', ADD COLUMN IF NOT EXISTS scheduled_at timestamptz NULL, ADD COLUMN IF NOT EXISTS digest_batch varchar(64) NULL;索引 (result, scheduled_at) 給 claim_due;result 若有 CHECK 約束就加 skipped;不加 FK(inbox 在 public、本表在 compliance,跨 schema 軟參照照 D17 律②)。2026-11-13-fr196-seed-notification-center-configs.sql:system_configs ROOT 租戶(tenant_id=1)group NOTIFICATION_CENTER 三筆 key/value:inbox_retention_days=90、delivery_retention_days=180、agent_offline_minutes=15,ON CONFLICT DO NOTHING;形狀照 FR-020 的 NOTIFY_CONFIG seed。active *;只套 DEV;回寫「出貨基線待重產」。DEV 套過後 \d compliance.task_alert_notifications 多四欄且皆 nullable;既有列數不變;select count(*) from system_configs where "group"='NOTIFICATION_CENTER'=3(ROOT 租戶);連跑兩次冪等;回寫「出貨基線待重產」
~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-196-2611-notification-center/design.md §3 決策定案、§5 詳細設計(§5.1 套件職責與 port、§5.2 資料表、§5.3 API、§5.5 前端)、§6 拆卡表本卡那列、§8 風險;討論稿(Artifact,連結在 README)只在想知道「為什麼這樣裁」時看~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-196-2611-notification-center/prototype/index.html(四個分頁:鈴鐺、通知中心、通知設定、系統橫幅;純畫面,只取結構與資訊順序;文案依 i18n 重寫)infra/task_alert/(entity/model/mapper/repo+domain/task_alert/service/task_alert_notification_domain_service.py claim/mark);排程先例 core/scheduler_update.py;SocketIO 登記 config/socketio_namespaces.py(檔頭紅線)與 handler 先例 jedi-survey app/handler/fill_survey_socketio_handler.py;橫幅先例 FE src/components/ai-quota/AiQuotaBanner.vue、掛點 src/layout/AppLayout.vue 124;iam 通知接口 common/iam_ports.py;十個寄信點行號在 design.md 表 4-1jedi-bulletin/jedi_bulletin/plugin/(contract/assembly/migrations)、jedi-notification/README.md;主系統接線 core/plugins/bulletin.py、core/plugins/_host.py::host_defaults、core/plugins/license.py::TenantAdminDirectory;寄信點 app/flow_engine/service/workflow_execution_service.py:1246、stage_entered_notify_service.py:117、app/task_alert/service/scan_alert_app_service.py:74;既有投遞紀錄表 infra/task_alert/model/task_alert_notification.py;鈴鐺 FE src/layout/AppTopbar.vue 484~540、TopbarStageQueue.vue;seed 先例 scripts/sql/2026-05-22-seed-oscal-ssp-roles.sql、2026-11-10-fr194-ui-routes-entry-gates.sqldocs/claude/domain-capabilities.md、FE docs/claude/frontend-overview.md §4。三擇一、預設不新增:reuse → extend → 確認沒有才新增。回寫列出本卡 reuse 了哪些、新增了哪些、為什麼不能 reuse。本案設計已做過重複盤點(橫幅、投遞紀錄、去重戳、個人資料頁),卡上「reuse/extend/new」是結論,照它做。