QuoteRequests API
整理 quote_requests 與其直接改名路徑相關 API。
建議閱讀順序
| 目的 | 文件 |
|---|---|
看 quote_requests 已深入調查的流程 | details/quote_requests/README.md |
看已搬的 search_add 主流程 | index.md |
看已搬的 copy 主流程 | index.md |
看 security_hash 規則與流量結果 | details/quote_requests/security_hash.md |
| 看舊 Web 多步驟發案入口 | details/quote_requests/add.md |
Endpoint Inventory
| Endpoint | 方法 | 認證 | 來源 | 說明 | 新專案對應 | 狀態 | 備註 |
|---|---|---|---|---|---|---|---|
/quote_requests/add.json | 待確認 | 使用者 session | app/Plugin/Quotes/Controller/QuoteRequestsController.php:1220 | 新增 quote request | 未找到 | 未找到 | 舊 Web 多步驟發案流程,與 search_add 不同;調查見 details/quote_requests/add.md。 |
/quote_requests/json_response.json | 待確認 | 不適用 | app/Plugin/Quotes/Controller/QuoteRequestsController.php:3946 | raw JSON response | 不需搬移 | 不需搬移 | 舊碼是 private function json_response(),屬 controller helper,非獨立 API action。 |
/quote_requests/static_fields.json | 待確認 | 全域 API key | app/Plugin/Quotes/Controller/QuoteRequestsController.php:3431 | static fields | QuoteRequests::static_fields() | 同路徑已存在 | 固定回傳空 StaticFormField;規則見 details/quote_requests/static_fields.md。 |
/quote_requests/index.json | 待確認 | 使用者 session | app/Plugin/Quotes/Controller/QuoteRequestsController.php:744 | quote request 清單 | QuoteRequests::index() | 同路徑已存在 | 新專案 Endpoint/V1/QuoteRequests.php 有同名 action。 |
/quote_requests/change_status.json | 待確認 | 使用者 session | app/Plugin/Quotes/Controller/QuoteRequestsController.php:1687 | 改 quote request 狀態 | QuoteRequests::change_status() | 同路徑已存在 | 新專案 Endpoint/V1/QuoteRequests.php 有同名 action;raw params 解析狀態與 id。 |
/quote_requests/security_hash.json | 待確認 | 全域 API key | app/Plugin/Quotes/Controller/QuoteRequestsController.php:4713 | security hash | QuoteRequests::security_hash() | 同路徑已存在 | 低風險相容 API;規則見 details/quote_requests/security_hash.md。 |
/quote_requests/search_add.json | POST | 使用者 session + API key | app/Plugin/Quotes/Controller/QuoteRequestsController.php:1805 | 全域 API key 檢查例外;可 auto sign up | SearchAdd::index() | 已搬;由專門文件維護 | 已明確 routing 到 Endpoint/V1/SearchAdd.php,主流程與 legacy parity 文件見 index.md。判斷下一支 migration 時,不要因 access log 流量大就把它重新列為待搬候選。 |
/quote_requests/view.json | 待確認 | 使用者 session | app/Plugin/Quotes/Controller/QuoteRequestsController.php:3477 | quote request detail | QuoteRequests::view() | 同路徑已存在 | 新專案 Endpoint/V1/QuoteRequests.php 有同名 action;另有 /quote_request/{id}.json mapping。 |
/quote_requests/copy/{quote_request_id}.json | POST | 使用者 session + API key,也支援 hash flow | app/Plugin/Quotes/Controller/QuoteRequestsController.php:4112 | copy quote request | QuoteRequests::copy() | 已搬;由專門文件維護 | 新專案 Endpoint/V1/QuoteRequests.php::copy() 會轉交 Lib/QuoteRequestCopy/CopyRequestHandler.php;主要 caller 使用 path id,規則、baseline 與測試證據見 index.md。 |
/quote_requests/edit.json | 已完成 | 使用者 session | app/Plugin/Quotes/Controller/QuoteRequestsController.php:5828 | 修改 request 電話可聯絡時間 | QuoteRequests::edit() | 同路徑已存在 | controller-only;legacy / 新版都只更新 phone_available_time 與 is_show_phone_to_providers。已補 legacy queue guard 與 tests/QuoteRequestsEditTest.php;詳見 details/quote_requests/edit.md。 |
/quote_requests/leads.json | 待確認 | 使用者 session + API key | app/Plugin/Quotes/Controller/QuoteRequestsController.php:5932 | leads | QuoteRequests::leads() | 同路徑已存在 | 新專案 Endpoint/V1/QuoteRequests.php 有同名 action。 |
search_add Form Payload Compatibility
/quote_requests/search_add.json 明確 routing 到新專案 Endpoint/V1/SearchAdd.php,但 form response 的 legacy contract 仍以純值字串為主。
Legacy QuoteRequestsController::search_add() 只對 Form[...] 做 rawurldecode,實際寫入由 QuoteFormSubmission::submit() 處理;該 legacy writer 支援 checkbox 的 scalar list 語意,例如 ["A","B"] 轉成 "A,B",但沒有把 {"value":"A"} 或 [{"value":"A"}] 攤平成純值的規則。
因此 current FormSubmissionWriter 對 {value: ...} / [{value: ...}] 的處理是 migration compatibility guard,用來支援新版 client payload shape,不能誤解成 legacy 本來就有這個資料格式。travelpref 仍保留 JSON object 語意,不屬於這個攤平規則。