Cross-Repo Flows
這頁只描述跨 major system 的主流程。細節仍回到 source、tests 與 domain docs。
Twitch viewer watch flow
P0 complete| Boundary | Source |
|---|---|
| Extension heartbeat | apps/extension/src/hooks/useHeartbeat.ts |
| Extension API client | apps/extension/src/services/api.ts |
| Watch handler | services/api/internal/handlers/watch_handler.go |
| Watch service | services/api/internal/services/watch_service.go |
| Points service | services/api/internal/services/points_service.go |
| Schema | 003_watch_points.sql, 012_tachi_balances.sql |
Review focus:
- heartbeat debounce / cadence 是否避免 double credit。
- ledger insert 和 balance update 是否在同一個 consistency boundary。
- API 回傳型別是否仍符合 extension hook 的假設。
Coupon redemption flow
P0 complete| Boundary | Source |
|---|---|
| Extension coupon panel | CouponShopPanel.tsx |
| Extension redeem logic | redeemCouponForPanel.ts, couponRedeem.ts |
| Spend handler | spend_handler.go |
| Spend service | spend_service.go |
| tachiya client | tachiya_client.go |
| tachigo schema | 019_coupon_redemptions.sql |
| tachiya repo | https://github.com/nurockplayer/tachiya |
Review focus:
- spend / redemption update 要能處理 tachiya timeout、retry 與 partial failure。
- external redemption id 應避免重複建立 coupon 或重複扣點。
- tachiya 連結使用
master穩定路徑;未合併內容要用 commit permalink。
Streamer / agency management flow
P1 stubComing soon. 第一版先保留入口,後續補完整 dashboard → tachigo API → channel / agency state flow。
目前可先從這些檔案開始: