From d5406a14a9219ea317b48311e652cedcb3eb6f24 Mon Sep 17 00:00:00 2001 From: Jose Andres Tejerina Date: Tue, 18 Nov 2025 16:04:54 -0300 Subject: [PATCH 1/5] feat: Add openapi documentation for OAuth2SummitNotificationsApiController --- ...OAuth2SummitNotificationsApiController.php | 451 +++++++++++++++++- app/Swagger/ChatTeamsSchemas.php | 18 +- app/Swagger/SummitPushNotificationSchemas.php | 110 +++++ .../SummitNotificationsAuthShemas.php | 28 ++ 4 files changed, 605 insertions(+), 2 deletions(-) create mode 100644 app/Swagger/SummitPushNotificationSchemas.php create mode 100644 app/Swagger/security/SummitNotificationsAuthShemas.php diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php index 207c0abc0..72868aa0d 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php @@ -13,6 +13,8 @@ **/ use App\Http\Utils\BooleanCellFormatter; use App\Http\Utils\EpochCellFormatter; +use App\Models\Foundation\Main\IGroup; +use App\Security\SummitScopes; use App\Services\Model\ISummitPushNotificationService; use models\exceptions\EntityNotFoundException; use models\exceptions\ValidationException; @@ -28,6 +30,9 @@ use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Request; use Exception; +use OpenApi\Attributes as OA; +use Symfony\Component\HttpFoundation\Response; + /** * Class OAuth2SummitNotificationsApiController * @package App\Http\Controllers @@ -81,6 +86,88 @@ public function __construct * @param $summit_id * @return mixed */ + #[OA\Get( + path: '/api/v1/summits/{id}/notifications', + operationId: 'getNotifications', + description: "required-groups " . IGroup::SummitAdministrators . ", " . IGroup::SuperAdmins . ", " . IGroup::Administrators, + summary: 'Get all push notifications for a summit', + tags: ['Summit Notifications'], + x: [ + 'required-groups' => [ + IGroup::SummitAdministrators, + IGroup::SuperAdmins, + IGroup::Administrators + ] + ], + security: [['summit_notifications_oauth2' => [ + SummitScopes::ReadAllSummitData, + SummitScopes::ReadNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token (alternative to Authorization: Bearer)', + schema: new OA\Schema(type: 'string', example: 'eyJhbGciOi...'), + ), + new OA\Parameter( + name: 'id', + description: 'Summit ID', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'page', + description: 'Page number', + in: 'query', + schema: new OA\Schema(type: 'integer', default: 1) + ), + new OA\Parameter( + name: 'per_page', + description: 'Items per page', + in: 'query', + schema: new OA\Schema(type: 'integer', default: 10) + ), + new OA\Parameter( + name: 'expand', + description: 'Expand relations (event,group,recipients)', + in: 'query', + schema: new OA\Schema(type: 'string') + ), + new OA\Parameter( + name: 'filter[]', + in: 'query', + required: false, + description: 'Filter expressions', + style: 'form', + explode: true, + schema: new OA\Schema( + type: 'array', + items: new OA\Items(type: 'string') + ) + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + description: 'Order by field(s)', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'List of notifications', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedNotificationsResponse') + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), + ] + )] public function getAll($summit_id) { $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->getResourceServerContext())->find($summit_id); @@ -142,8 +229,82 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit /** * @param $summit_id - * @return \Illuminate\Http\JsonResponse|mixed + * @return mixed */ + #[OA\Get( + path: '/api/v1/summits/{id}/notifications/sent', + operationId: 'getApprovedNotifications', + summary: 'Get all approved push notifications sent to current user', + tags: ['Summit Notifications'], + security: [['summit_notifications_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token (alternative to Authorization: Bearer)', + schema: new OA\Schema(type: 'string', example: 'eyJhbGciOi...'), + ), + new OA\Parameter( + name: 'id', + description: 'Summit ID', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'page', + description: 'Page number', + in: 'query', + schema: new OA\Schema(type: 'integer', default: 1) + ), + new OA\Parameter( + name: 'per_page', + description: 'Items per page', + in: 'query', + schema: new OA\Schema(type: 'integer', default: 10) + ), + new OA\Parameter( + name: 'expand', + description: 'Expand relations (event,group,recipients)', + in: 'query', + schema: new OA\Schema(type: 'string') + ), + new OA\Parameter( + name: 'filter[]', + in: 'query', + required: false, + description: 'Filter expressions', + style: 'form', + explode: true, + schema: new OA\Schema( + type: 'array', + items: new OA\Items(type: 'string') + ) + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + description: 'Order by field(s)', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'List of approved notifications', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedNotificationsResponse') + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), + ] + )] public function getAllApprovedByUser($summit_id){ $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -204,6 +365,69 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($curren * @param $summit_id * @return mixed */ + #[OA\Get( + path: '/api/v1/summits/{id}/notifications/csv', + operationId: 'getNotificationsCSV', + description: "required-groups " . IGroup::SummitAdministrators . ", " . IGroup::SuperAdmins . ", " . IGroup::Administrators, + summary: 'Export all push notifications as CSV', + tags: ['Summit Notifications'], + x: [ + 'required-groups' => [ + IGroup::SummitAdministrators, + IGroup::SuperAdmins, + IGroup::Administrators + ] + ], + security: [['summit_notifications_oauth2' => [ + SummitScopes::ReadAllSummitData, + SummitScopes::ReadNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token (alternative to Authorization: Bearer)', + schema: new OA\Schema(type: 'string', example: 'eyJhbGciOi...'), + ), + new OA\Parameter( + name: 'id', + description: 'Summit ID', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'filter[]', + in: 'query', + required: false, + description: 'Filter expressions', + style: 'form', + explode: true, + schema: new OA\Schema( + type: 'array', + items: new OA\Items(type: 'string') + ) + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + description: 'Order by field(s)', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'CSV file with notifications' + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), + ] + )] public function getAllCSV($summit_id) { @@ -279,6 +503,64 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit * @param $notification_id * @return mixed */ + #[OA\Get( + path: '/api/v1/summits/{id}/notifications/{notification_id}', + operationId: 'getNotificationById', + description: "required-groups " . IGroup::SummitAdministrators . ", " . IGroup::SuperAdmins . ", " . IGroup::Administrators, + summary: 'Get specific push notification', + tags: ['Summit Notifications'], + x: [ + 'required-groups' => [ + IGroup::SummitAdministrators, + IGroup::SuperAdmins, + IGroup::Administrators + ] + ], + security: [['summit_notifications_oauth2' => [ + SummitScopes::ReadAllSummitData, + SummitScopes::ReadNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token (alternative to Authorization: Bearer)', + schema: new OA\Schema(type: 'string', example: 'eyJhbGciOi...'), + ), + new OA\Parameter( + name: 'id', + description: 'Summit ID', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'notification_id', + description: 'Notification ID', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'expand', + description: 'Expand relations', + in: 'query', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'Notification details', + content: new OA\JsonContent(ref: '#/components/schemas/SummitPushNotificationResponse') + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit or notification not found'), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), + ] + )] public function getById($summit_id, $notification_id){ try { $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -305,6 +587,47 @@ public function getById($summit_id, $notification_id){ * @param $notification_id * @return mixed */ + #[OA\Delete( + path: '/api/v1/summits/{id}/notifications/{notification_id}', + operationId: 'deleteNotification', + description: 'Delete a notification from a summit. required-groups: SuperAdmins, Administrators, SummitAdministrators', + tags: ['Summit Notifications'], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + security: [['summit_notifications_oauth2' => [ + SummitScopes::WriteSummitData, + SummitScopes::WriteNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'notification_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response(response: 204, description: 'Notification deleted successfully'), + new OA\Response(response: 400, description: 'Invalid input'), + new OA\Response(response: 401, description: 'Unauthorized'), + new OA\Response(response: 403, description: 'Forbidden'), + new OA\Response(response: 404, description: 'Summit or notification not found'), + new OA\Response(response: 412, description: 'Validation failed'), + new OA\Response(response: 500, description: 'Server error'), + ], + )] public function deleteNotification($summit_id, $notification_id){ try { $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -328,6 +651,47 @@ public function deleteNotification($summit_id, $notification_id){ * @param $notification_id * @return mixed */ + #[OA\Put( + path: '/api/v1/summits/{id}/notifications/{notification_id}/approve', + operationId: 'approveNotification', + description: 'Approve a notification for sending. required-groups: SuperAdmins, Administrators, SummitAdministrators', + tags: ['Summit Notifications'], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + security: [['summit_notifications_oauth2' => [ + SummitScopes::WriteSummitData, + SummitScopes::WriteNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'notification_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response(response: 200, description: 'Notification approved successfully'), + new OA\Response(response: 400, description: 'Invalid input'), + new OA\Response(response: 401, description: 'Unauthorized'), + new OA\Response(response: 403, description: 'Forbidden'), + new OA\Response(response: 404, description: 'Summit or notification not found'), + new OA\Response(response: 412, description: 'Validation failed'), + new OA\Response(response: 500, description: 'Server error'), + ], + )] public function approveNotification($summit_id, $notification_id){ try { $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -352,6 +716,47 @@ public function approveNotification($summit_id, $notification_id){ * @param $notification_id * @return mixed */ + #[OA\Delete( + path: '/api/v1/summits/{id}/notifications/{notification_id}/approve', + operationId: 'unApproveNotification', + description: 'Revoke approval for a notification. required-groups: SuperAdmins, Administrators, SummitAdministrators', + tags: ['Summit Notifications'], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + security: [['summit_notifications_oauth2' => [ + SummitScopes::WriteSummitData, + SummitScopes::WriteNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'notification_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response(response: 200, description: 'Notification approval revoked successfully'), + new OA\Response(response: 400, description: 'Invalid input'), + new OA\Response(response: 401, description: 'Unauthorized'), + new OA\Response(response: 403, description: 'Forbidden'), + new OA\Response(response: 404, description: 'Summit or notification not found'), + new OA\Response(response: 412, description: 'Validation failed'), + new OA\Response(response: 500, description: 'Server error'), + ], + )] public function unApproveNotification($summit_id, $notification_id){ try { $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -375,6 +780,50 @@ public function unApproveNotification($summit_id, $notification_id){ * @param $summit_id * @return mixed */ + #[OA\Post( + path: '/api/v1/summits/{id}/notifications', + operationId: 'addNotification', + description: 'Create a new push notification for a summit. required-groups: SuperAdmins, Administrators, SummitAdministrators', + tags: ['Summit Notifications'], + x: ['required-groups' => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::SummitAdministrators]], + security: [['summit_notifications_oauth2' => [ + SummitScopes::WriteSummitData, + SummitScopes::WriteNotifications, + ]]], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'access_token', + in: 'query', + required: false, + description: 'OAuth2 access token', + schema: new OA\Schema(type: 'string') + ), + ], + requestBody: new OA\RequestBody( + required: true, + description: 'Notification data', + content: new OA\JsonContent(ref: '#/components/schemas/SummitPushNotificationRequest') + ), + responses: [ + new OA\Response( + response: 201, + description: 'Notification created successfully', + content: new OA\JsonContent(ref: '#/components/schemas/SummitPushNotificationResponse') + ), + new OA\Response(response: 400, description: 'Invalid input'), + new OA\Response(response: 401, description: 'Unauthorized'), + new OA\Response(response: 403, description: 'Forbidden'), + new OA\Response(response: 404, description: 'Summit not found'), + new OA\Response(response: 412, description: 'Validation failed'), + new OA\Response(response: 500, description: 'Server error'), + ], + )] public function addPushNotification($summit_id){ try { diff --git a/app/Swagger/ChatTeamsSchemas.php b/app/Swagger/ChatTeamsSchemas.php index 6b3e2f895..509382f7c 100644 --- a/app/Swagger/ChatTeamsSchemas.php +++ b/app/Swagger/ChatTeamsSchemas.php @@ -4,4 +4,20 @@ use OpenApi\Attributes as OA; -// +class ChatTeamSchema +{ + #[OA\Schema( + schema: 'ChatTeam', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', description: 'Chat Team ID'), + new OA\Property(property: 'name', type: 'string', description: 'Team/Group name'), + new OA\Property(property: 'description', type: 'string', description: 'Team/Group description', nullable: true), + new OA\Property(property: 'created', type: 'integer', format: 'epoch', description: 'Creation timestamp'), + new OA\Property(property: 'last_edited', type: 'integer', format: 'epoch', description: 'Last edit timestamp'), + new OA\Property(property: 'is_private', type: 'boolean', description: 'Is team private'), + new OA\Property(property: 'members_count', type: 'integer', description: 'Number of members'), + ] + )] + public function __construct() {} +} diff --git a/app/Swagger/SummitPushNotificationSchemas.php b/app/Swagger/SummitPushNotificationSchemas.php new file mode 100644 index 000000000..823c4a4a0 --- /dev/null +++ b/app/Swagger/SummitPushNotificationSchemas.php @@ -0,0 +1,110 @@ + 'Read Summit Notifications', + SummitScopes::WriteNotifications => 'Write Summit Notifications', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::ReadSummitData => 'Read Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], + ) +] +class SummitNotificationsAuthSchema{} From b09a263a9b215b61458a1d20ef6b989e2ebd334d Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 5 Dec 2025 15:40:06 +0000 Subject: [PATCH 2/5] chore: include PR requested changes --- ...itBookableRoomsAttributeTypeAuthSchema.php | 24 +++++++++++++++++++ .../SummitNotificationsAuthSchema.php} | 2 +- .../SummitSubmittersOAuthSchema.php | 0 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app/Swagger/Security/SummitBookableRoomsAttributeTypeAuthSchema.php rename app/Swagger/{security/SummitNotificationsAuthShemas.php => Security/SummitNotificationsAuthSchema.php} (96%) rename app/Swagger/{security => Security}/SummitSubmittersOAuthSchema.php (100%) diff --git a/app/Swagger/Security/SummitBookableRoomsAttributeTypeAuthSchema.php b/app/Swagger/Security/SummitBookableRoomsAttributeTypeAuthSchema.php new file mode 100644 index 000000000..18238d0da --- /dev/null +++ b/app/Swagger/Security/SummitBookableRoomsAttributeTypeAuthSchema.php @@ -0,0 +1,24 @@ + 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], + ) +] +class SummitBookableRoomsAttributeTypeAuthSchema{} diff --git a/app/Swagger/security/SummitNotificationsAuthShemas.php b/app/Swagger/Security/SummitNotificationsAuthSchema.php similarity index 96% rename from app/Swagger/security/SummitNotificationsAuthShemas.php rename to app/Swagger/Security/SummitNotificationsAuthSchema.php index 978af14eb..9bc730df8 100644 --- a/app/Swagger/security/SummitNotificationsAuthShemas.php +++ b/app/Swagger/Security/SummitNotificationsAuthSchema.php @@ -1,6 +1,6 @@ Date: Wed, 10 Dec 2025 21:41:14 +0000 Subject: [PATCH 3/5] chore: Add missing doc on public endpoint --- ...OAuth2SummitNotificationsApiController.php | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php index 72868aa0d..37466bff3 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php @@ -305,6 +305,69 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), ] )] + #[OA\Get( + path: '/api/public/v1/summits/{id}/notifications/sent', + operationId: 'getApprovedNotifications', + summary: 'Get all approved push notifications sent to current user', + tags: ['Summit Notifications (Public)'], + parameters: [ + new OA\Parameter( + name: 'id', + description: 'Summit ID', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer') + ), + new OA\Parameter( + name: 'page', + description: 'Page number', + in: 'query', + schema: new OA\Schema(type: 'integer', default: 1) + ), + new OA\Parameter( + name: 'per_page', + description: 'Items per page', + in: 'query', + schema: new OA\Schema(type: 'integer', default: 10) + ), + new OA\Parameter( + name: 'expand', + description: 'Expand relations (event,group,recipients)', + in: 'query', + schema: new OA\Schema(type: 'string') + ), + new OA\Parameter( + name: 'filter[]', + in: 'query', + required: false, + description: 'Filter expressions', + style: 'form', + explode: true, + schema: new OA\Schema( + type: 'array', + items: new OA\Items(type: 'string') + ) + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + description: 'Order by field(s)', + schema: new OA\Schema(type: 'string') + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'List of approved notifications', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedNotificationsResponse') + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), + ] + )] public function getAllApprovedByUser($summit_id){ $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -864,4 +927,4 @@ public function addPushNotification($summit_id){ return $this->error500($ex); } } -} \ No newline at end of file +} From d7ba204a8ca3472297223eb04e00f08fc34130cd Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Wed, 10 Dec 2025 21:43:42 +0000 Subject: [PATCH 4/5] chore: include PR requested changes --- .../Summit/OAuth2SummitNotificationsApiController.php | 10 +++++----- app/Swagger/SummitPushNotificationSchemas.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php index 37466bff3..49827ccab 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php @@ -164,7 +164,7 @@ public function __construct ), new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Not Found'), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), ] )] @@ -301,7 +301,7 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit ), new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Not Found'), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), ] )] @@ -364,7 +364,7 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit ), new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Not Found'), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), ] )] @@ -487,7 +487,7 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($curren ), new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'), new OA\Response(response: Response::HTTP_FORBIDDEN, description: 'Forbidden'), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Not Found'), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'Server Error'), ] )] @@ -882,7 +882,7 @@ public function unApproveNotification($summit_id, $notification_id){ new OA\Response(response: 400, description: 'Invalid input'), new OA\Response(response: 401, description: 'Unauthorized'), new OA\Response(response: 403, description: 'Forbidden'), - new OA\Response(response: 404, description: 'Summit not found'), + new OA\Response(response: 404, description: 'Not Found'), new OA\Response(response: 412, description: 'Validation failed'), new OA\Response(response: 500, description: 'Server error'), ], diff --git a/app/Swagger/SummitPushNotificationSchemas.php b/app/Swagger/SummitPushNotificationSchemas.php index 823c4a4a0..2181f60cf 100644 --- a/app/Swagger/SummitPushNotificationSchemas.php +++ b/app/Swagger/SummitPushNotificationSchemas.php @@ -1,6 +1,6 @@ Date: Wed, 10 Dec 2025 21:48:01 +0000 Subject: [PATCH 5/5] chore: remove repeated security schema and minor issue with operationId --- ...OAuth2SummitNotificationsApiController.php | 2 +- ...mmitBookableRoomsAttributeTypeSecurity.php | 25 ------------------- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 app/Swagger/Security/SummitBookableRoomsAttributeTypeSecurity.php diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php index 49827ccab..67c663afa 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitNotificationsApiController.php @@ -307,7 +307,7 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit )] #[OA\Get( path: '/api/public/v1/summits/{id}/notifications/sent', - operationId: 'getApprovedNotifications', + operationId: 'getApprovedNotificationsPublic', summary: 'Get all approved push notifications sent to current user', tags: ['Summit Notifications (Public)'], parameters: [ diff --git a/app/Swagger/Security/SummitBookableRoomsAttributeTypeSecurity.php b/app/Swagger/Security/SummitBookableRoomsAttributeTypeSecurity.php deleted file mode 100644 index 8b3ad5e8c..000000000 --- a/app/Swagger/Security/SummitBookableRoomsAttributeTypeSecurity.php +++ /dev/null @@ -1,25 +0,0 @@ - 'Read Summit Data', - SummitScopes::ReadAllSummitData => 'Read All Summit Data', - SummitScopes::WriteSummitData => 'Write Summit Data', - ], - ), - ], - ) -] -class SummitBookableRoomsAttributeTypeAuthSchema{}