B001:評價、評價標籤與回覆

最後更新:2026-08-10
環境:Staging
狀態:進行中;quote_feedback_tags/index 已完成 2 / 3,其餘待整組 QA

導覽:PHP 8 API 搬移批次總表批次測試索引

下一步:先補 quote_feedback_tags/index response header 的 x-php-env: php82-staging-*,再執行 quote_feedbacks/sent,最後執行 comment save / delete。

本批範圍

API首選測試方式30 天狀態QA 文件工程 detail
GET /quote_feedback_tags/index.jsonWeb + curlPHP 8 程式存在,Production 仍走 Legacy測試步驟Legacy parity
GET /quote_feedbacks/sent/sort:{sort}.jsonWeb + curlPHP 8 程式存在,Production 仍走 Legacy測試步驟Legacy parity
POST /quote_feedback_comments/save/{feedback_id}.jsonWeb create + curl updatePHP 8 程式存在,Production 仍走 Legacy測試步驟Legacy parity
GET/POST /quote_feedback_comments/delete/id:{comment_id}.jsoncurlPHP 8 程式存在,Production 仍走 Legacy測試步驟Legacy parity

測試身份與前置資料

  • Consumer:8616,詳見 帳號文件
  • Provider:8617,詳見 帳號文件
  • 需要一筆 Consumer/Provider 雙方可操作、已有案件評價的 Staging feedback。
  • save/delete 只使用本次建立的臨時 comment,不修改既有 comment。
  • 若上述帳號沒有合適 feedback,先建立專用測試資料;不可直接拿其他使用者資料測試。
export STAGING_API_KEY='<Staging 可用 API key>'
export CONSUMER_SESSION_TOKEN='<8616 登入 request 的 session token>'
export PROVIDER_SESSION_TOKEN='<8617 登入 request 的 session token>'
export FEEDBACK_ID='<8616 與 8617 可操作的案件 feedback id>'
export COMMENT_ID='<本次 save 新增的臨時 comment id>'

核心測試

1. Consumer 評價標籤

Web:進入 Consumer 商品訂單評價頁,點「評價」或「編輯評價」。DevTools Network 應出現 GET /quote_feedback_tags/index.json

curl -i \
  -H 'Accept-Language: zh-TW' \
  -H "X-PRO360-Rest-Api-Key: ${STAGING_API_KEY}" \
  'https://api-staging.pro360.com.tw/quote_feedback_tags/index.json'

預期:HTTP 200、JSON、error 為 number 0data 為包含 key 15 的 object,header 有 x-php-env: php82-staging-*

詳細:quote_feedback_tags/index

2. Consumer 已送出的評價

Web:以 Consumer 模式開啟 https://staging.pro360.com.tw/dashboard/settings/reviews,切換時間/分數排序並觀察 Network。

curl -i \
  -H "X-PRO360-Rest-Api-Key: ${STAGING_API_KEY}" \
  -H "X-PRO360-User-Session-Token: ${CONSUMER_SESSION_TOKEN}" \
  'https://api-staging.pro360.com.tw/quote_feedbacks/sent/sort:time.json'

預期:HTTP 200、raw JSON array、header 有 x-php-env: php82-staging-*;畫面可以顯示評價,切換排序後順序相符。

詳細:quote_feedbacks/sent

3. Provider 回覆評價

Web:以 Provider 登入,進入 https://staging.pro360.com.tw/dashboard/works/{bid_id},在評價卡片點「回覆評價」,送出唯一文字 php82-b001-review-reply

Network 應出現 POST /quote_feedback_comments/save/{feedback_id}.json,response 預期:

{"error":0,"status":"Success"}

DB 必須新增一筆本次 comment,comment_user_id 是 Provider,is_customer="0"。以唯一文字查出 COMMENT_ID

詳細:quote_feedback_comments/save

4. 清除臨時回覆

curl -i -X POST \
  -H "X-PRO360-Rest-Api-Key: ${STAGING_API_KEY}" \
  -H "X-PRO360-User-Session-Token: ${PROVIDER_SESSION_TOKEN}" \
  "https://api-staging.pro360.com.tw/quote_feedback_comments/delete/id:${COMMENT_ID}.json"

預期:HTTP 200、header 有 x-php-env: php82-staging-*,body:

{"error":0,"message":"success"}

DB 中該臨時 comment 必須已 hard delete。

詳細:quote_feedback_comments/delete

測試結果

日期測試人Case 1Case 2Case 3Case 4證據/備註
待測待填待測待測待測待測

切流條件

  • 四個核心案例全部通過。
  • PHP 8 response、型別、DB write、hard delete 與 Legacy 一致。
  • Staging header 確認命中 php82-staging-*
  • Production ALB path rule 與 rollback target 已確認。
  • 切流後先跑 tags/sent read-only smoke;save/delete 只在核准的測試資料上執行。

任何一項未完成都不可標「可切流」。