style: 以 pint 格式化 routes、Docs 與 BookingListTest
Run Tests / test (pull_request) Successful in 36s

純格式調整,不改變行為。這四個檔案在 master 上即未通過 pint,
因本次功能變更觸及而一併修正,以符合變更檔案需通過 pint 的審查要求。

- 已驗證 route:list 除角色 middleware 外無差異
- 已驗證 l5-swagger 產出的 JSON 在格式化前後完全相同

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 23:57:30 +08:00
parent 16ccb4c18c
commit 90fc8f2d49
4 changed files with 354 additions and 204 deletions
+154 -66
View File
@@ -42,10 +42,13 @@ class ProviderApiDoc
* operationId="getProviderVerification",
* tags={"教練驗證"},
* security={{"bearerAuth": {}}},
*
* @OA\Response(
* response=200,
* description="取得成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(
* property="data",
@@ -55,8 +58,10 @@ class ProviderApiDoc
* @OA\Property(
* property="certifications",
* type="array",
*
* @OA\Items(
* type="object",
*
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="url", type="string", example="http://localhost:8080/storage/providers/5/certifications/uuid.jpg")
* )
@@ -64,12 +69,11 @@ class ProviderApiDoc
* )
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function getProviderVerification()
{
}
public function getProviderVerification() {}
/**
* 上傳證照圖片
@@ -81,20 +85,27 @@ class ProviderApiDoc
* operationId="uploadCertification",
* tags={"教練驗證"},
* security={{"bearerAuth": {}}},
*
* @OA\RequestBody(
* required=true,
*
* @OA\MediaType(
* mediaType="multipart/form-data",
*
* @OA\Schema(
* required={"certification"},
*
* @OA\Property(property="certification", type="string", format="binary", description="證照圖片(jpg/png,最大 5MB)")
* )
* )
* ),
*
* @OA\Response(
* response=200,
* description="上傳成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(
* property="data",
@@ -104,13 +115,12 @@ class ProviderApiDoc
* )
* )
* ),
*
* @OA\Response(response=422, description="圖片驗證失敗", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=403, description="非 provider 角色", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function uploadCertification()
{
}
public function uploadCertification() {}
/**
* 刪除證照圖片
@@ -122,22 +132,25 @@ class ProviderApiDoc
* operationId="deleteCertification",
* tags={"教練驗證"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="證照 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="刪除成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="證照已刪除")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色、非本人證照或當前狀態不可刪除", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=404, description="證照不存在", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function deleteCertification()
{
}
public function deleteCertification() {}
/**
* 送出驗證申請
@@ -149,21 +162,23 @@ class ProviderApiDoc
* operationId="submitVerification",
* tags={"教練驗證"},
* security={{"bearerAuth": {}}},
*
* @OA\Response(
* response=200,
* description="送審成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="驗證申請已送出")
* )
* ),
*
* @OA\Response(response=422, description="尚未上傳證照或當前狀態不可送審", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=403, description="非 provider 角色", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function submitVerification()
{
}
public function submitVerification() {}
// -----------------------------------------------------------------------
// Provider Offers CRUD
@@ -179,23 +194,26 @@ class ProviderApiDoc
* operationId="listProviderOffers",
* tags={"教練課程"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="page", in="query", description="頁碼", @OA\Schema(type="integer", default=1)),
* @OA\Parameter(name="per_page", in="query", description="每頁筆數", @OA\Schema(type="integer", default=15)),
*
* @OA\Response(
* response=200,
* description="取得成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/DivingOffer")),
* @OA\Property(property="meta", ref="#/components/schemas/PaginationMeta")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function listProviderOffers()
{
}
public function listProviderOffers() {}
/**
* 建立課程
@@ -207,10 +225,13 @@ class ProviderApiDoc
* operationId="createProviderOffer",
* tags={"教練課程"},
* security={{"bearerAuth": {}}},
*
* @OA\RequestBody(
* required=true,
*
* @OA\JsonContent(
* required={"title","description","region","price","max_participants"},
*
* @OA\Property(property="title", type="string", example="基礎開放水域課程"),
* @OA\Property(property="description", type="string", example="適合初學者的 OWD 課程"),
* @OA\Property(property="region", type="string", example="墾丁"),
@@ -219,22 +240,24 @@ class ProviderApiDoc
* @OA\Property(property="tags", type="array", @OA\Items(type="string"), example={"初學","OWD"})
* )
* ),
*
* @OA\Response(
* response=201,
* description="課程建立成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="課程建立成功"),
* @OA\Property(property="data", ref="#/components/schemas/DivingOffer")
* )
* ),
*
* @OA\Response(response=422, description="驗證失敗", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=403, description="非 provider 角色", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function createProviderOffer()
{
}
public function createProviderOffer() {}
/**
* 取得單一課程(Provider 視角)
@@ -246,22 +269,25 @@ class ProviderApiDoc
* operationId="getProviderOffer",
* tags={"教練課程"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="課程 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="取得成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="data", ref="#/components/schemas/DivingOffer")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=404, description="課程不存在", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function getProviderOffer()
{
}
public function getProviderOffer() {}
/**
* 更新課程
@@ -272,10 +298,14 @@ class ProviderApiDoc
* operationId="updateProviderOffer",
* tags={"教練課程"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="課程 ID", @OA\Schema(type="integer")),
*
* @OA\RequestBody(
* required=true,
*
* @OA\JsonContent(
*
* @OA\Property(property="title", type="string", example="進階開放水域課程"),
* @OA\Property(property="description", type="string", example="AOWD 課程"),
* @OA\Property(property="region", type="string", example="小琉球"),
@@ -285,21 +315,23 @@ class ProviderApiDoc
* @OA\Property(property="is_active", type="boolean", example=true)
* )
* ),
*
* @OA\Response(
* response=200,
* description="更新成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="data", ref="#/components/schemas/DivingOffer")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=422, description="驗證失敗", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function updateProviderOffer()
{
}
public function updateProviderOffer() {}
/**
* 刪除課程
@@ -310,22 +342,25 @@ class ProviderApiDoc
* operationId="deleteProviderOffer",
* tags={"教練課程"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="課程 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="刪除成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="課程已刪除")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=404, description="課程不存在", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function deleteProviderOffer()
{
}
public function deleteProviderOffer() {}
// -----------------------------------------------------------------------
// Provider Offer Images
@@ -341,32 +376,39 @@ class ProviderApiDoc
* operationId="uploadOfferCover",
* tags={"教練圖片"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="課程 ID", @OA\Schema(type="integer")),
*
* @OA\RequestBody(
* required=true,
*
* @OA\MediaType(
* mediaType="multipart/form-data",
*
* @OA\Schema(
* required={"cover_image"},
*
* @OA\Property(property="cover_image", type="string", format="binary", description="封面圖片(jpg/png,最大 5MB)")
* )
* )
* ),
*
* @OA\Response(
* response=200,
* description="上傳成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="cover_image_url", type="string", example="https://example.com/covers/1.jpg")
* )
* ),
*
* @OA\Response(response=422, description="圖片驗證失敗", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=403, description="非 provider 角色或非本人課程", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function uploadOfferCover()
{
}
public function uploadOfferCover() {}
/**
* 刪除封面圖片
@@ -377,21 +419,24 @@ class ProviderApiDoc
* operationId="deleteOfferCover",
* tags={"教練圖片"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="課程 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="刪除成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="封面圖片已刪除")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function deleteOfferCover()
{
}
public function deleteOfferCover() {}
/**
* 上傳相簿圖片
@@ -403,37 +448,45 @@ class ProviderApiDoc
* operationId="uploadOfferImages",
* tags={"教練圖片"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="課程 ID", @OA\Schema(type="integer")),
*
* @OA\RequestBody(
* required=true,
*
* @OA\MediaType(
* mediaType="multipart/form-data",
*
* @OA\Schema(
* required={"images[]"},
*
* @OA\Property(
* property="images[]",
* type="array",
*
* @OA\Items(type="string", format="binary"),
* description="相簿圖片(每張最大 5MB)"
* )
* )
* )
* ),
*
* @OA\Response(
* response=200,
* description="上傳成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="images", type="array", @OA\Items(type="string"), example={"https://example.com/img/1.jpg"})
* )
* ),
*
* @OA\Response(response=422, description="圖片驗證失敗", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=403, description="非 provider 角色或非本人課程", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function uploadOfferImages()
{
}
public function uploadOfferImages() {}
/**
* 刪除相簿圖片
@@ -444,22 +497,25 @@ class ProviderApiDoc
* operationId="deleteOfferImage",
* tags={"教練圖片"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="圖片 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="刪除成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="圖片已刪除")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人圖片", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=404, description="圖片不存在", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function deleteOfferImage()
{
}
public function deleteOfferImage() {}
// -----------------------------------------------------------------------
// Provider Schedules
@@ -475,21 +531,24 @@ class ProviderApiDoc
* operationId="listProviderSchedules",
* tags={"教練時段"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="offer_id", in="query", required=false, description="課程 ID 篩選", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="取得成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/CourseSchedule"))
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function listProviderSchedules()
{
}
public function listProviderSchedules() {}
/**
* 建立時段
@@ -500,31 +559,36 @@ class ProviderApiDoc
* operationId="createProviderSchedule",
* tags={"教練時段"},
* security={{"bearerAuth": {}}},
*
* @OA\RequestBody(
* required=true,
*
* @OA\JsonContent(
* required={"offer_id","start_date","end_date","available_slots"},
*
* @OA\Property(property="offer_id", type="integer", example=1),
* @OA\Property(property="start_date", type="string", format="date", example="2025-07-01"),
* @OA\Property(property="end_date", type="string", format="date", example="2025-07-03"),
* @OA\Property(property="available_slots", type="integer", example=4)
* )
* ),
*
* @OA\Response(
* response=201,
* description="時段建立成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="data", ref="#/components/schemas/CourseSchedule")
* )
* ),
*
* @OA\Response(response=422, description="驗證失敗", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=403, description="非 provider 角色或非本人課程", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function createProviderSchedule()
{
}
public function createProviderSchedule() {}
/**
* 更新時段
@@ -535,31 +599,37 @@ class ProviderApiDoc
* operationId="updateProviderSchedule",
* tags={"教練時段"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="時段 ID", @OA\Schema(type="integer")),
*
* @OA\RequestBody(
* required=true,
*
* @OA\JsonContent(
*
* @OA\Property(property="start_date", type="string", format="date", example="2025-07-05"),
* @OA\Property(property="end_date", type="string", format="date", example="2025-07-07"),
* @OA\Property(property="available_slots", type="integer", example=6),
* @OA\Property(property="is_active", type="boolean", example=true)
* )
* ),
*
* @OA\Response(
* response=200,
* description="更新成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="data", ref="#/components/schemas/CourseSchedule")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人時段", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=404, description="時段不存在", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function updateProviderSchedule()
{
}
public function updateProviderSchedule() {}
/**
* 刪除時段
@@ -570,22 +640,25 @@ class ProviderApiDoc
* operationId="deleteProviderSchedule",
* tags={"教練時段"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="時段 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="刪除成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="時段已刪除")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人時段", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=404, description="時段不存在", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function deleteProviderSchedule()
{
}
public function deleteProviderSchedule() {}
// -----------------------------------------------------------------------
// Provider Bookings Management
@@ -601,23 +674,26 @@ class ProviderApiDoc
* operationId="listProviderBookings",
* tags={"教練預約"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="page", in="query", description="頁碼", @OA\Schema(type="integer", default=1)),
* @OA\Parameter(name="per_page", in="query", description="每頁筆數", @OA\Schema(type="integer", default=15)),
*
* @OA\Response(
* response=200,
* description="取得成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/Booking")),
* @OA\Property(property="meta", ref="#/components/schemas/PaginationMeta")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function listProviderBookings()
{
}
public function listProviderBookings() {}
/**
* 確認預約
@@ -628,23 +704,26 @@ class ProviderApiDoc
* operationId="confirmBooking",
* tags={"教練預約"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="預約 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="確認成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="預約已確認"),
* @OA\Property(property="data", ref="#/components/schemas/Booking")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程的預約", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=422, description="狀態不允許確認", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function confirmBooking()
{
}
public function confirmBooking() {}
/**
* 拒絕預約
@@ -655,23 +734,26 @@ class ProviderApiDoc
* operationId="rejectBooking",
* tags={"教練預約"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="預約 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="拒絕成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="預約已拒絕"),
* @OA\Property(property="data", ref="#/components/schemas/Booking")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程的預約", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=422, description="狀態不允許拒絕", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function rejectBooking()
{
}
public function rejectBooking() {}
/**
* 標記預約完成
@@ -682,23 +764,26 @@ class ProviderApiDoc
* operationId="completeBookingByProvider",
* tags={"教練預約"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="預約 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="標記成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="預約已完成"),
* @OA\Property(property="data", ref="#/components/schemas/Booking")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程的預約", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=422, description="狀態不允許完成", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function completeBookingByProvider()
{
}
public function completeBookingByProvider() {}
/**
* 取消預約(Provider)
@@ -709,21 +794,24 @@ class ProviderApiDoc
* operationId="cancelBookingByProvider",
* tags={"教練預約"},
* security={{"bearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="預約 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="取消成功",
*
* @OA\JsonContent(
*
* @OA\Property(property="status", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="預約已取消"),
* @OA\Property(property="data", ref="#/components/schemas/Booking")
* )
* ),
*
* @OA\Response(response=403, description="非 provider 角色或非本人課程的預約", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse")),
* @OA\Response(response=422, description="狀態不允許取消", @OA\JsonContent(ref="#/components/schemas/ApiErrorResponse"))
* )
*/
public function cancelBookingByProvider()
{
}
public function cancelBookingByProvider() {}
}