本卡屬 FR-167(母卡 CM-3241),卡 P3-2a,階段 P3 更新中心、批 2。只改 BE(主 repo,Repo 欄空著)。依賴:P3-1。
主系統裡新開一個「產品更新」模組的骨架:一張紀錄表、四層程式、兩支讀端點(狀態、歷史)。狀態端點會把主機寫的進度檔讀進來。模組登記與 DI 這張卡一次做完,後面三張 P3-2 卡只往裡面加方法。
DDD 四層+RLS 表+進度檔對應;後面三張卡都往這裡填
new(新模組)照 app/source_scan_vulndb 的 settings service 形狀;讀進度檔用唯讀掛載;登記型檔集中:config/app_modules.py 與 di_containers/ 這張卡一次登記完
repo:~/Projects/Billows/Audit-Manager/compliance-manager-be
改既有:config/app_modules.py
改既有:di_containers/__init__.py(或對應容器)
新開:scripts/sql/2026-xx-xx-fr167-product-update-jobs.sql
新開:domain/product_update/*
新開:infra/product_update/*
新開:app/product_update/service/product_update_app_service.py
新開:api/product_update/routes/product_update_route.py
新開:api/product_update/serializers/*
細節在 design.md §5 對應段(~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-167-2610-online-update-channel/design.md,開 design.html 看導覽);本段只列本卡要做到的點:
product_update_jobs(欄位照 design §5.5;RLS 四指令;GRANT cm_app)。app/source_scan_vulndb:domain/product_update/(entity、query entity、repo interface、domain service)、infra/product_update/(model、mapper、repo impl 繼承 BaseRepositoryImpl)、app/product_update/service/product_update_app_service.py(@transaction;status 讀進度檔 <GUIDANT_UPGRADE_DIR>/upgrade-progress.json,唯讀掛載路徑用 config 變數,先 grep config.py 有無同義變數)、api/product_update/routes/。config/app_modules.py 與 di_containers/ 本卡一次登記完,後面 P3-2b/c/d 與 P4-2 只往 service/route 加方法。GET /system/product-update/status、GET …/history(分頁,審計欄位回 *_name);能力點守門用 common.authz capability 軸;無能力點 403 要有測試。DEV 套 migration 後表在、RLS 四指令;GET /system/product-update/status 回目前版本、最近檢查、進度檔內容;GET .../history 分頁;無能力點 403;守衛測試綠
對照雛形:~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-167-2610-online-update-channel/prototype/index.html(上方「跟著走」)。