本卡屬 FR-196(母卡 CM-3875(已建)),卡 M-7,第三期批 9。只改 BE(主 repo,Repo 欄空著)。依賴:P-4、P-5、S-3、M-4。

這張卡做什麼(白話)

主系統第三期接線:登記 SocketIO 頻道、推送實作換成真的、「排定維護」兩條端點(管理員建一筆並通知全員;橫幅讀目前有效的那筆)。🔴 SocketIO 處理類要晚於 DI 接線才建構,紅線在 config/socketio_namespaces.py 檔頭。

reuse/extend/new

extend:config/socketio_namespaces.py 加一列(字串 import);_notification_center_ports.py 的 RealtimeNotifier 換實作;新 route 照 api/notify_config/routes/notify_config_route.py 形狀;守門用 common.authz capability 軸;maintenance 寫表後 notify(system.maintenance_scheduled, Role('tenant_all'))

在哪裡

repo:~/Projects/Billows/Audit-Manager/compliance-manager-be
改既有:config/socketio_namespaces.py
改既有:core/plugins/_notification_center_ports.py
改既有:core/plugins/notification_center.py
改既有:config/app_modules.py(新 blueprint 登記)
新開:api/notification_center/__init__.py
新開:api/notification_center/routes/maintenance_route.py
新開:api/notification_center/serializers/maintenance.py
新開:app/notification_center/service/maintenance_app_service.py
新開:test/test_notification_center_maintenance.py(無能力點 403;建一筆後 current 回它;過期不回)

怎麼做

驗收(首腦照這個驗)

RUN_MODE=socketio python main.py 起得來且 scripts/build/socketio_probe.py 改連新 namespace 通;兩個瀏覽器:A 指派給 B,B 三秒內紅點變(不重整);POST /maintenance 無能力點 403、有則 200 且全租戶 inbox 各一列;GET /maintenance/current 回該筆;三條測試綠

必讀

紀律