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:
@@ -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