feat: add SmokeEndpointsCommand for endpoint health checks and logging
- Introduced SmokeEndpointsCommand to send HTTP requests to all /api and /oauth endpoints on the live site, ensuring logs are generated in the app_log table. - Implemented non-destructive testing by using real IDs for GET requests and non-existent IDs for write operations. - Added functionality to authenticate as an admin using a fixed OTP for development. - Created tests for endpoint sweeps to verify that no 5xx errors occur during various conditions, including no-auth and wrong-role scenarios. - Established RouteManifest for public success paths that should return 200 without requiring fixtures.
This commit is contained in:
+3
-1
@@ -1,6 +1,8 @@
|
||||
# Doctor API
|
||||
|
||||
> **Prefix:** `/api/v1/doctor`, `/api/v1/doctors`, `/api/v1/clinic-pro/doctor-address*`
|
||||
>
|
||||
> Numeric path params on the address routes (`doctor-address/{id}`, `doctor-addresses/{doctorId}`) require `\d+`; a non-numeric value returns a clean `404` instead of a `500`.
|
||||
|
||||
---
|
||||
|
||||
@@ -329,7 +331,7 @@ Get all practice addresses for a doctor, including addresses of clinics the doct
|
||||
### Path Parameters
|
||||
| Param | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `doctorId` | integer | Doctor's numeric ID |
|
||||
| `doctorId` | integer | Doctor's numeric ID (route requires `\d+`; non-numeric → 404) |
|
||||
|
||||
### Response `200`
|
||||
```json
|
||||
|
||||
@@ -558,7 +558,7 @@ class DoctorController extends BaseController
|
||||
new OA\Response(response: 404, description: 'Address not found'),
|
||||
]
|
||||
)]
|
||||
#[Route('/api/v1/clinic-pro/doctor-address/{id}', methods: ['GET'])]
|
||||
#[Route('/api/v1/clinic-pro/doctor-address/{id}', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('IS_AUTHENTICATED_FULLY')]
|
||||
public function showAddress(int $id, #[CurrentUser] User $user): JsonResponse
|
||||
{
|
||||
@@ -609,7 +609,7 @@ class DoctorController extends BaseController
|
||||
new OA\Response(response: 404, description: 'Address not found'),
|
||||
]
|
||||
)]
|
||||
#[Route('/api/v1/clinic-pro/doctor-address/{id}', methods: ['PATCH'])]
|
||||
#[Route('/api/v1/clinic-pro/doctor-address/{id}', methods: ['PATCH'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('IS_AUTHENTICATED_FULLY')]
|
||||
public function updateAddress(int $id, Request $request, #[CurrentUser] User $user): JsonResponse
|
||||
{
|
||||
@@ -658,7 +658,7 @@ class DoctorController extends BaseController
|
||||
new OA\Response(response: 404, description: 'Address not found'),
|
||||
]
|
||||
)]
|
||||
#[Route('/api/v1/clinic-pro/doctor-address/{id}', methods: ['DELETE'])]
|
||||
#[Route('/api/v1/clinic-pro/doctor-address/{id}', methods: ['DELETE'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('IS_AUTHENTICATED_FULLY')]
|
||||
public function deleteAddress(int $id, #[CurrentUser] User $user): JsonResponse
|
||||
{
|
||||
@@ -699,7 +699,7 @@ class DoctorController extends BaseController
|
||||
new OA\Response(response: 404, description: 'Doctor not found'),
|
||||
]
|
||||
)]
|
||||
#[Route('/api/v1/clinic-pro/doctor-addresses/{doctorId}', methods: ['GET'])]
|
||||
#[Route('/api/v1/clinic-pro/doctor-addresses/{doctorId}', methods: ['GET'], requirements: ['doctorId' => '\d+'])]
|
||||
public function listAddresses(int $doctorId): JsonResponse
|
||||
{
|
||||
$doctor = $this->doctorRepo->find($doctorId);
|
||||
|
||||
Reference in New Issue
Block a user