本卡屬 FR-196(母卡 FR-196 母案(同清單上一張)),卡 P-2,第一期批 2。只改 jedi-python-package。依賴:P-1。

這張卡做什麼(白話)

通知中心套件的第二棒:對外的八條 REST 端點(鈴鐺紅點數、收件匣列表、最近十筆、標已讀、封存、批次、讀設定、存設定)與 register() 掛 blueprint。端點形狀照 jedi-bulletin,守門(要登入、要能力點)由主系統透過 adapters 給,套件不自己判。重點規則:別人的通知 uid 回 404 不分「不存在」與「不是你的」;必收事件的站內與 Email 不給關(回 412)。

reuse/extend/new

extend(P-1 的套件):route 形狀照 jedi-bulletin api/(MethodResource+marshmallow、守門 decorator 由 adapters 給、回應走 response_builder);分頁照主系統 docs/claude/api-patterns.md(POST list 帶 page/page_size、EnvelopeSchema);settings GET 回 23 列=型錄 left join 個人設定

在哪裡

repo:~/Projects/Jedicogy/module/jedi-python-package
改既有:jedi-notification-center/jedi_notification_center/plugin/assembly.py(create_blueprint)
改既有:jedi-notification-center/jedi_notification_center/plugin/contract.py(CAPABILITIES 兩顆、mount_api)
改既有:jedi-notification-center/jedi_notification_center/__init__.py
新開:jedi-notification-center/jedi_notification_center/api/routes/inbox_routes.py
新開:jedi-notification-center/jedi_notification_center/api/routes/settings_routes.py
新開:jedi-notification-center/jedi_notification_center/api/serializers/
新開:jedi-notification-center/jedi_notification_center/app/service/inbox_service.py(list/recent/read/archive/batch;uid 不是本人的回 404 不分)
新開:jedi-notification-center/jedi_notification_center/app/service/settings_service.py(GET 合併預設;PUT 必收事件 inapp/email 與型錄不符回 412)
新開:jedi-notification-center/jedi_notification_center/common/error_code.py(NC_404001/NC_412001/NC_400001/NC_403001)
新開:jedi-notification-center/tests/test_api_*.py

怎麼做

驗收(首腦照這個驗)

套件 tests 綠(含:未帶 token 401 不是 500;別人的 uid 404;必收事件 PUT 關 email 回 412 NC_412001;batch read_all scope=category 只標該類);harness 起來 curl 八條都回信封形狀;notification.inbox.read 在 CAPABILITIES

必讀