本卡屬 FR-196(母卡 CM-3875(已建)),卡 P-3,第二期批 5。只改 jedi-python-package。依賴:P-2。
通知中心套件第三棒:第一期的 notify() 只寫收件匣、Email 照舊由各處自己寄;本卡讓中心真正決定「這個人這個事件要不要寄 Email、現在寄還是排進每日摘要、在勿擾時段要延後到幾點」。外送紀錄存哪裡交給產品(第八張接口),套件不認識主系統那張表。摘要寄送器也在這裡:到時間把同一個人同一批的通知合成一封。
extend(套件):notify() 第一期只寫 inbox+立即交 delivery;本卡在中間加「外送決策」:每位收件人每個管道查設定→必收強制→digest/quiet 算 scheduled_at→寫 IOutboundStore port(新第八張 port:enqueue(inbox_id, channel, address, scheduled_at, digest_batch)/claim_due(now)/mark(id, result, error));立即的當場交 delivery 並 mark
repo:~/Projects/Jedicogy/module/jedi-python-package
改既有:jedi-notification-center/jedi_notification_center/app/service/notify_service.py
改既有:jedi-notification-center/jedi_notification_center/domain/ports.py(加 IOutboundStore)
改既有:jedi-notification-center/jedi_notification_center/plugin/contract.py(adapters 加 outbound_store)
新開:jedi-notification-center/jedi_notification_center/app/service/outbound_policy.py(digest/quiet 算時間,純函式)
新開:jedi-notification-center/jedi_notification_center/app/service/digest_sender.py(claim_due → 同 digest_batch 合成一封 → delivery → mark;供宿主排程呼叫)
新開:jedi-notification-center/tests/test_outbound_policy.py(daily 09:00、weekly 週一、quiet 22:00~08:00 跨午夜、必收事件 email 關不掉)
domain/ports.py 加 IOutboundStore:enqueue(inbox_id, channel, address, scheduled_at, digest_batch) -> id、claim_due(now, limit) -> [row]、mark(id, result, error=None);adapters 加 outbound_store。app/service/outbound_policy.py 純函式:schedule_for(profile, now, tz) -> (scheduled_at, digest_batch|None)——immediate 且不在 quiet → now/None;daily → 下一個 digest_hour,batch={user_id}:{date};weekly → 下一個 digest_weekday;quiet 內的 immediate → quiet_to;必收事件照樣走此規則(必收只管「不能關」不管「立刻」)。notify_service:每位收件人每個 True 的管道→算 schedule→enqueue;scheduled_at<=now 的當場 delivery.send_* 後 mark(sent|failed)。app/service/digest_sender.py:run(now):claim_due → 依 digest_batch 分組 → 同組合成一封(ITemplateRenderer.render_digest(items, locale),新增這個 port 方法)→ send → 逐筆 mark;無 batch 的單筆照寄。IClock.tz。套件 tests 綠(含:設定 email=False 的事件不進 outbound;必收仍進;daily 的 scheduled_at 是下一個 09:00;quiet 內的 email 推到 quiet_to;同人同批 digest_batch 相同);digest_sender.run(now) 對假 store 合成一封含兩筆標題
~/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.sql