docs:補全所有 API 端點 Swagger 文件(73 個端點)
Tests / PHP 8.2 (pull_request) Failing after 2s
Tests / PHP 8.3 (pull_request) Failing after 2s
pull requests / uneditable (pull_request_target) Failing after 0s

- 修正 AuthApiDoc.php 路徑錯位(/register/member → /member/register 等)
  及 change-password 方法(Post→Put);補上 POST /logout、GET /user
- 新增 AuthSupplementDoc.php(Google OAuth 2 端點)
- 新增 PublicApiDoc.php(共用 Schema + 公開課程 4 端點)
- 新增 MemberApiDoc.php(預約、評價、通知共 13 端點)
- 新增 ProviderApiDoc.php(課程、圖片、時段、預約管理共 18 端點)
- 新增 AdminApiDoc.php(統計、會員/教練/課程管理共 16 端點)
- 更新 README.md
- 歸檔 swagger-api-docs-completion change,同步主規格

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 01:17:25 +08:00
parent e8cd82cdee
commit 4feeeff94a
22 changed files with 6492 additions and 66 deletions
+30
View File
@@ -0,0 +1,30 @@
## ADDED Requirements
### Requirement: 公開端點 Swagger 文件及共用 Schema
`app/Docs/PublicApiDoc.php` SHALL 文件化所有無需認證的公開端點,並定義全域共用 Schema。
#### Scenario: 共用 Schema 定義完整
- **WHEN** 執行 `php artisan l5-swagger:generate`
- **THEN** 以下 Schema 出現在產生的 JSON`DivingOffer``Review``CourseSchedule``PaginationMeta``ApiErrorResponse`
#### Scenario: GET /api/diving-offers 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** `GET /diving-offers` 端點顯示 query parameters`q``region``tag``per_page``page`)及包含分頁 meta 的 response schema
#### Scenario: GET /api/diving-offers/{id} 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** `GET /diving-offers/{id}` 端點顯示 path parameter `id` 及包含 `cover_image_url``images` 陣列的 response schema404 response 亦有定義
#### Scenario: GET /api/diving-offers/{id}/reviews 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** 端點顯示 `sort`helpful/rating/newest)、`page``per_page` 參數;response 包含 `summary`average、total、distribution)與分頁 `meta`
#### Scenario: GET /api/diving-offers/{id}/schedules 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** 端點顯示 response 包含 `CourseSchedule` 陣列(id、date、period、capacity、booked_count、status