Skip to content

feat(H): GET /customer/rides 乘客歷史行程列表(留言板入口補遺後端) - #39

Merged
thothawei merged 1 commit into
mainfrom
claude/dispatch-customer-ride-history
Jul 19, 2026
Merged

thothawei merged 1 commit into
mainfrom
claude/dispatch-customer-ride-history

Conversation

@thothawei

Copy link
Copy Markdown
Owner

乘客端原本沒有「我的行程」列表,聊天入口只綁在進行中行程/協尋單。加此端點讓乘客能列出過去行程、對有司機的行程事後聯絡(開對話)——對應 App 端「留言板入口補遺」。

改動

  • repo.ListRecentByCustomer:LEFT JOIN drivers 取 driver_name(無司機為 null,前端據此決定是否顯示「聯絡司機」);id DESC;limit 預設 20、硬上限 MaxListRows;只回本人(呼叫端已由 CustomerAuth 綁 customerID)
  • CustomerRideRow:id/status/上下車地址/時間/車資/driver_id/driver_name
  • service.RideQueryService.ListRecentByCustomer 委派 repo
  • handler.HistoryByCustomer;route GET /customer/rides(與既有 /active、/:id 共存,gin 靜態優先,無衝突)

驗收

  • go build/go vet 通過
  • repo 整合測試綠:只回本人、新到舊、有司機帶名/車資、無司機不帶、limit
  • runtime:docker 啟動無路由衝突、造單 → GET /customer/rides 回傳正確欄位

🤖 Generated with Claude Code

乘客端原本沒有「我的行程」列表,chat 入口只綁在進行中行程/協尋單。
加此端點讓乘客能列出過去行程、對有司機的行程事後聯絡(開對話)。

- repo ListRecentByCustomer:LEFT JOIN drivers 取 driver_name(無司機為
  null,前端據此決定是否顯示「聯絡司機」);id DESC;limit 預設 20、
  硬上限 MaxListRows;只回本人(呼叫端已由 CustomerAuth 綁 customerID)
- CustomerRideRow:id/status/上下車地址/時間/車資/driver_id/driver_name
- service RideQueryService.ListRecentByCustomer 委派 repo
- handler HistoryByCustomer;route GET /customer/rides(與既有
  /active、/:id 共存,gin 靜態優先,無衝突——runtime 啟動已驗)
- 整合測試:只回本人、新到舊、有司機帶名/車資、無司機不帶、limit

go build/vet 通過;repo 整合測試綠;runtime 造單→GET 回傳正確。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thothawei
thothawei merged commit 69cbb38 into main Jul 19, 2026
1 check passed
@thothawei
thothawei deleted the claude/dispatch-customer-ride-history branch July 19, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant