feat(market-intel): 新增既有資料橋接預覽
All checks were successful
CD Pipeline / deploy (push) Successful in 1m2s

This commit is contained in:
OoO
2026-05-18 14:19:43 +08:00
parent c021945047
commit bb6a862dbe
9 changed files with 762 additions and 4 deletions

View File

@@ -151,6 +151,7 @@ EwoooC 目前已有 MOMO EDM / 節慶活動資料、`promo_products`、PChome
- 2026-05-12 追加 read-only DB schema probe`/api/market_intel/schema_db_probe` 預設只回 planned不連 DB人工 smoke 才能以明確參數查正式 DB catalog。探針不得使用 `DatabaseManager()`,避免觸發 metadata `create_all()`;不得建立 ORM session、不得寫入、不得 commit。
- 2026-05-12 追加 platform seed DB diff probe`/api/market_intel/platform_seed_db_diff` 預設只回 planned不連 DB人工 smoke 才能以明確參數只讀查詢 `market_platforms`,比對 adapter seed 是否 missing / differs / matches。探針不得使用 `DatabaseManager()`、不得建立 ORM session、不得寫入、不得 commit。
- 2026-05-13 追加 platform seed CLI writer`scripts/market_intel_seed_writer.py` 可在 CLI 明確帶入 `--execute``--apply-real-write` 與確認 token 時,以 SQLAlchemy Core 短 transaction upsert `market_platforms`API 仍不得替使用者執行 DB 寫入,不建立 ORM session、不連外、不掛 scheduler。
- 2026-05-18 追加 legacy source bridge preview`/api/market_intel/legacy_source_bridge` 預設 `execute=false` 只回 planned不連 DB人工 smoke 才能以 `execute=true` 只讀盤點 `promo_products``competitor_prices``competitor_price_history`,產生舊資料導入 `market_*` 的 mapping、dedupe 與 blocked operation preview。此橋接不得寫入 DB、不得建立 ORM session、不得把 PChome 比價快取冒充為活動頁商品、不得掛 scheduler。
### Phase 4Coupang / Shopee Adapter