feat(Q): 下游缺口回補——日報表清潔費分項、admin 訂單詳情帶 stops、司機電話寫入路徑 - #43
Merged
Conversation
盤點三端程式碼(不只看勾選)發現後端有三個洞:兩個讓 admin/App 顯示不出已完成的 能力,一個讓已拍板的功能**實質從未生效**。 **Q1 日報表補清潔費分項**(DailyDriverStats) 月報表 F6 與司機收入 F7 早就有 total_cleaning_fee_cents,日報表 F5 漏了。 少了它,「營業額 − 手續費」會莫名對不上 driver_net_cents——差額正是清潔費, 而 admin 只呈現不算錢,看到的就是一組兜不攏的數字。 反向確認:拿掉 SQL 那行,TestCleaningFeeReports/日報表分項與等式 FAIL(得到 0,預期 3700)。 **Q2 admin 訂單詳情帶 stops**(RideDetail + SetRideStops 注入) 多停靠點行程在後台只看得到由停靠點推導出的單一上車/下車點,中間的乘客完全消失, 客服無法回答「這趟載了誰、停了哪幾站、哪站被跳過」。 形狀共用 service.StopViews(=司機/乘客端同一份 stopView)——三端說法不一致就沒得對帳。 停靠點讀取失敗**不擋整個詳情頁**;單點訂單不帶 stops 鍵(不是空陣列)。 反向確認:拿掉接線後 TestAdminRideDetail_帶停靠點 FAIL(回應只有 ride/track/events) ——比照 N4 踩過的「SetStops 沒在 main.go 呼叫」漏接線坑。 **Q3 司機電話寫入路徑**(PUT /api/driver/profile) O7 拍板「電話明碼、乘客可直接撥打」,但 drivers.phone **從來沒有任何寫入路徑**—— 註冊不收、車輛設定也不收,只能手動改 DB。結果乘客端的 tel: 撥號按鈕實質永遠不出現: 一個看起來三端都做完的功能,一次都沒運作過。 新增 DriverRegistry.SetPhone + DriverRepository.UpdatePhone,寬鬆驗證(去分隔符後 8–15 位數字、可帶 +;不綁「09 開頭」,車隊可能有市話或境外號碼)。 **刻意與 PUT /driver/vehicle 分開**:電話不是車輛屬性,改電話若重置 O5 審核, 司機為了更新一個號碼就會被鎖出派單池——有測試釘住這條。 讀取端 GET /driver/vehicle 順帶回 phone(唯讀便利欄位,App 設定頁一次讀完省一支往返)。 驗收:gofmt 乾淨、go build/vet 綠;CI 的無 Docker 測試集全過; 新增測試 TestDriverProfile_*(授權邊界/參數驗證/改電話不重置審核,走真 DB)、 TestAdminRideDetail_帶停靠點/_未注入停靠點repo仍可用、TestNormalizePhone、 TestCleaningFeeReports/日報表分項與等式。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
thothawei
added a commit
that referenced
this pull request
Jul 27, 2026
- docs/TODO.md 的 S 段補 admin 可見性(SummaryByDrivers 批次彙總、 /admin/drivers 帶 rating_avg/rating_count、/admin/rides/:id 帶 rating), 含 docker compose 實打數字。 - README 端點表補 /api/customer/rides/estimate、/api/customer/rides/:id/rating、 /api/admin/drivers/:id/vehicle-review,並標明 admin 兩支端點多帶的欄位。 - **修正 README「規劃中(尚未實作)」的過期資訊**:N/O/P 與寵物車清潔費、 司機聯絡方式早已實作並合併(PR #35–#43),該段卻仍寫「都還沒實作」。 改寫成實際剩下的項目,逐條寫明是量體、產品決策還是外部資源卡住。 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
盤點三端程式碼(不只看文件勾選)發現後端有三個洞:兩個讓 admin/App 顯示不出已完成的能力,一個讓已拍板的功能實質從未生效。
配套 PR:admin thothawei/fleet-frontEnd#21、App thothawei/fleet-app#41。兩者對缺欄位都會安全降級,合併順序不敏感,但這支先合下游才看得到東西。
Q1 日報表補清潔費分項(
DailyDriverStats)月報表 F6 與司機收入 F7 早就有
total_cleaning_fee_cents,日報表 F5 漏了。少了它,「營業額 − 手續費」會莫名對不上driver_net_cents——差額正是清潔費,而 admin 只呈現不算錢,看到的就是一組兜不攏的數字。反向確認:拿掉 SQL 那行,
TestCleaningFeeReports/日報表分項與等式FAIL(得到 0,預期 3700)。Q2 admin 訂單詳情帶 stops(
RideDetail+SetRideStops注入)多停靠點行程(N)在後台只看得到由停靠點推導出的單一上車/下車點,中間的乘客完全消失,客服無法回答「這趟載了誰、停了哪幾站、哪站被跳過」。
service.StopViews(=司機/乘客端同一份stopView)——三端說法不一致就沒得對帳。stops鍵(不是空陣列),前端據此決定要不要顯示該區塊。反向確認:拿掉
main.go的SetRideStops接線後TestAdminRideDetail_帶停靠點FAIL(回應只有ride/track_geojson/events)——比照 N4 踩過的「dispatchService.SetStops沒在 main.go 呼叫」漏接線坑。Q3 司機電話寫入路徑(
PUT /api/driver/profile)O7 拍板「電話明碼、乘客可直接撥打」,但
drivers.phone從來沒有任何寫入路徑——註冊不收、車輛設定也不收,只能手動改 DB。結果乘客端的tel:撥號按鈕實質永遠不出現:一個看起來三端都做完的功能,一次都沒運作過。DriverRegistry.SetPhone+DriverRepository.UpdatePhone;寬鬆驗證(去分隔符後 8–15 位數字、可帶+)。不綁「09 開頭」——車隊可能有市話或境外號碼,硬綁會誤擋真號碼,而打不通的號碼本來就只能靠乘客回報。PUT /driver/vehicle分開:電話不是車輛屬性,改電話若重置 O5 審核,司機為了更新一個號碼就會被鎖出派單池。TestDriverProfile_改電話不重置車輛審核釘住這條。GET /driver/vehicle順帶回phone(唯讀便利欄位,App 設定頁一次讀完省一支往返)。驗收
gofmt -l乾淨、go build ./...、go vet ./...綠。TestDriverProfile_*、TestAdminRideDetail_帶停靠點/_未注入停靠點repo仍可用、TestNormalizePhone、TestCleaningFeeReports/日報表分項與等式(後三者走 testcontainers 真 Postgres,本機實跑通過)。🤖 Generated with Claude Code