From ec36eefeb8f18f494c78a12b8b92b1bb48e47f33 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Mon, 15 Jun 2026 14:54:10 +0330 Subject: [PATCH] feat: add OpenAPI tags to various controllers for improved API documentation --- src/Appointment/Controller/AppointmentSettingsController.php | 2 ++ src/Appointment/Controller/MyAppointmentsController.php | 2 ++ src/Auth/Controller/NotificationMobileController.php | 2 ++ src/Auth/Controller/PreRegistrationController.php | 2 ++ src/Category/Controller/CategoryController.php | 2 ++ src/ClinicInvitation/Controller/ClinicInvitationController.php | 2 ++ src/ClinicService/Controller/ClinicServiceController.php | 2 ++ src/Config/Controller/SiteConfigController.php | 2 ++ src/Dashboard/Controller/DashboardController.php | 2 ++ src/DoctorService/Controller/DoctorServiceController.php | 2 ++ src/Insurance/Controller/InsuranceController.php | 2 ++ src/Location/Controller/LocationController.php | 2 ++ src/Patient/Controller/PatientController.php | 2 ++ src/Secretary/Controller/SecretaryController.php | 2 ++ src/Sms/Controller/SmsWalletController.php | 2 ++ src/Specialty/Controller/SpecialtyController.php | 2 ++ src/Staff/Controller/StaffController.php | 2 ++ src/Subscription/Controller/SubscriptionController.php | 2 ++ src/Tag/Controller/TagController.php | 2 ++ src/UserProfile/Controller/UserProfileController.php | 2 ++ 20 files changed, 40 insertions(+) diff --git a/src/Appointment/Controller/AppointmentSettingsController.php b/src/Appointment/Controller/AppointmentSettingsController.php index c1698724..716ab461 100644 --- a/src/Appointment/Controller/AppointmentSettingsController.php +++ b/src/Appointment/Controller/AppointmentSettingsController.php @@ -21,7 +21,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Appointment Settings')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class AppointmentSettingsController extends BaseController { diff --git a/src/Appointment/Controller/MyAppointmentsController.php b/src/Appointment/Controller/MyAppointmentsController.php index c0f40e1e..6b53a161 100644 --- a/src/Appointment/Controller/MyAppointmentsController.php +++ b/src/Appointment/Controller/MyAppointmentsController.php @@ -16,7 +16,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'My Appointments')] class MyAppointmentsController extends BaseController { public function __construct( diff --git a/src/Auth/Controller/NotificationMobileController.php b/src/Auth/Controller/NotificationMobileController.php index aae43bd4..8702274f 100644 --- a/src/Auth/Controller/NotificationMobileController.php +++ b/src/Auth/Controller/NotificationMobileController.php @@ -15,7 +15,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Auth')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class NotificationMobileController extends BaseController { diff --git a/src/Auth/Controller/PreRegistrationController.php b/src/Auth/Controller/PreRegistrationController.php index d05f426c..3ade6733 100644 --- a/src/Auth/Controller/PreRegistrationController.php +++ b/src/Auth/Controller/PreRegistrationController.php @@ -20,7 +20,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Auth')] class PreRegistrationController extends BaseController { public function __construct( diff --git a/src/Category/Controller/CategoryController.php b/src/Category/Controller/CategoryController.php index d9565032..a3529da2 100644 --- a/src/Category/Controller/CategoryController.php +++ b/src/Category/Controller/CategoryController.php @@ -5,6 +5,7 @@ namespace App\Category\Controller; use App\Shared\Controller\BaseController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Attribute\Route; +use OpenApi\Attributes as OA; /** * Legacy stub — all endpoints migrated to domain-specific controllers: @@ -14,6 +15,7 @@ use Symfony\Component\Routing\Attribute\Route; * Insurances → App\Insurance\Controller\InsuranceController * Tags → App\Tag\Controller\TagController */ +#[OA\Tag(name: 'Categories')] class CategoryController extends BaseController { #[Route('/api/v1/categorys/{bundle}', methods: ['GET'])] diff --git a/src/ClinicInvitation/Controller/ClinicInvitationController.php b/src/ClinicInvitation/Controller/ClinicInvitationController.php index ed02cc31..2a7093f0 100644 --- a/src/ClinicInvitation/Controller/ClinicInvitationController.php +++ b/src/ClinicInvitation/Controller/ClinicInvitationController.php @@ -15,7 +15,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Clinic Invitations')] class ClinicInvitationController extends BaseController { public function __construct( diff --git a/src/ClinicService/Controller/ClinicServiceController.php b/src/ClinicService/Controller/ClinicServiceController.php index d0a7436c..3cc86106 100644 --- a/src/ClinicService/Controller/ClinicServiceController.php +++ b/src/ClinicService/Controller/ClinicServiceController.php @@ -19,7 +19,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Clinic Services')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class ClinicServiceController extends BaseController { diff --git a/src/Config/Controller/SiteConfigController.php b/src/Config/Controller/SiteConfigController.php index c064e7dc..ed6b8633 100644 --- a/src/Config/Controller/SiteConfigController.php +++ b/src/Config/Controller/SiteConfigController.php @@ -9,7 +9,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Config')] #[IsGranted('ROLE_ADMIN')] class SiteConfigController extends BaseController { diff --git a/src/Dashboard/Controller/DashboardController.php b/src/Dashboard/Controller/DashboardController.php index e4690752..38201c94 100644 --- a/src/Dashboard/Controller/DashboardController.php +++ b/src/Dashboard/Controller/DashboardController.php @@ -19,7 +19,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Dashboard')] class DashboardController extends BaseController { public function __construct( diff --git a/src/DoctorService/Controller/DoctorServiceController.php b/src/DoctorService/Controller/DoctorServiceController.php index 5fce71c4..108d368d 100644 --- a/src/DoctorService/Controller/DoctorServiceController.php +++ b/src/DoctorService/Controller/DoctorServiceController.php @@ -11,7 +11,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Doctor Services')] class DoctorServiceController extends BaseController { public function __construct( diff --git a/src/Insurance/Controller/InsuranceController.php b/src/Insurance/Controller/InsuranceController.php index 8310ba95..6ba47919 100644 --- a/src/Insurance/Controller/InsuranceController.php +++ b/src/Insurance/Controller/InsuranceController.php @@ -18,7 +18,9 @@ use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Uid\Uuid; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Insurance')] class InsuranceController extends BaseController { public function __construct( diff --git a/src/Location/Controller/LocationController.php b/src/Location/Controller/LocationController.php index a8769c81..c3f4565e 100644 --- a/src/Location/Controller/LocationController.php +++ b/src/Location/Controller/LocationController.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Location')] class LocationController extends BaseController { public function __construct( diff --git a/src/Patient/Controller/PatientController.php b/src/Patient/Controller/PatientController.php index d7ddc250..9343aa39 100644 --- a/src/Patient/Controller/PatientController.php +++ b/src/Patient/Controller/PatientController.php @@ -21,7 +21,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Patients')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class PatientController extends BaseController { diff --git a/src/Secretary/Controller/SecretaryController.php b/src/Secretary/Controller/SecretaryController.php index 271aef73..1835c085 100644 --- a/src/Secretary/Controller/SecretaryController.php +++ b/src/Secretary/Controller/SecretaryController.php @@ -17,7 +17,9 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Secretaries')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class SecretaryController extends BaseController { diff --git a/src/Sms/Controller/SmsWalletController.php b/src/Sms/Controller/SmsWalletController.php index bddd02fb..178beaad 100644 --- a/src/Sms/Controller/SmsWalletController.php +++ b/src/Sms/Controller/SmsWalletController.php @@ -23,7 +23,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'SMS')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class SmsWalletController extends BaseController { diff --git a/src/Specialty/Controller/SpecialtyController.php b/src/Specialty/Controller/SpecialtyController.php index 961be3bb..da8f4c4e 100644 --- a/src/Specialty/Controller/SpecialtyController.php +++ b/src/Specialty/Controller/SpecialtyController.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Specialties')] class SpecialtyController extends BaseController { public function __construct( diff --git a/src/Staff/Controller/StaffController.php b/src/Staff/Controller/StaffController.php index 0c220ac7..58768540 100644 --- a/src/Staff/Controller/StaffController.php +++ b/src/Staff/Controller/StaffController.php @@ -14,7 +14,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Staff')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class StaffController extends BaseController { diff --git a/src/Subscription/Controller/SubscriptionController.php b/src/Subscription/Controller/SubscriptionController.php index cd542ec7..cdb8f16d 100644 --- a/src/Subscription/Controller/SubscriptionController.php +++ b/src/Subscription/Controller/SubscriptionController.php @@ -21,7 +21,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Subscription')] class SubscriptionController extends BaseController { public function __construct( diff --git a/src/Tag/Controller/TagController.php b/src/Tag/Controller/TagController.php index 2987e484..09393f54 100644 --- a/src/Tag/Controller/TagController.php +++ b/src/Tag/Controller/TagController.php @@ -10,7 +10,9 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'Tags')] class TagController extends BaseController { public function __construct( diff --git a/src/UserProfile/Controller/UserProfileController.php b/src/UserProfile/Controller/UserProfileController.php index cbfc9b66..24c74c43 100644 --- a/src/UserProfile/Controller/UserProfileController.php +++ b/src/UserProfile/Controller/UserProfileController.php @@ -12,7 +12,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\CurrentUser; use Symfony\Component\Security\Http\Attribute\IsGranted; +use OpenApi\Attributes as OA; +#[OA\Tag(name: 'User Profile')] #[IsGranted('IS_AUTHENTICATED_FULLY')] class UserProfileController extends BaseController {