From 1d00996b66fe30db755302b5dddb0f2cdd2ab691 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 20 Oct 2025 13:04:10 -0300 Subject: [PATCH 1/5] feat: Extend Swagger Coverage for controller `OAuth2SummitSelectedPresentationListApiController` --- ...tSelectedPresentationListApiController.php | 339 +++++++++++++++++- app/Swagger/SummitPresentationSchemas.php | 35 ++ 2 files changed, 373 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php index c03107e69..5ac712e60 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php @@ -15,6 +15,7 @@ use App\Models\Exceptions\AuthzException; use App\ModelSerializers\SerializerUtils; use App\Services\Model\ISummitSelectedPresentationListService; +use Illuminate\Http\Response; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Validator; use models\main\IMemberRepository; @@ -22,6 +23,7 @@ use models\summit\ISummitRepository; use models\summit\SummitSelectedPresentation; use ModelSerializers\SerializerRegistry; +use OpenApi\Attributes as OA; /** * Class OAuth2SummitSelectedPresentationListApiController @@ -73,6 +75,46 @@ public function __construct * @param $track_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Get( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/team", + summary: "Get team selection list for a track", + security: [["Bearer" => []]], + tags: ["summit-selected-presentation-lists"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The summit id" + ), + new OA\Parameter( + name: "selection_plan_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection plan id" + ), + new OA\Parameter( + name: "track_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The track id" + ) + ], + responses: [ + new OA\Response( + response: 200, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") + ), + 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: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function getTeamSelectionList($summit_id, $selection_plan_id, $track_id){ return $this->processRequest(function () use($summit_id, $selection_plan_id, $track_id){ @@ -101,6 +143,47 @@ public function getTeamSelectionList($summit_id, $selection_plan_id, $track_id){ * @param $track_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Post( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/team", + summary: "Create team selection list for a track", + security: [["Bearer" => []]], + tags: ["summit-selected-presentation-lists"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The summit id" + ), + new OA\Parameter( + name: "selection_plan_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection plan id" + ), + new OA\Parameter( + name: "track_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The track id" + ) + ], + responses: [ + new OA\Response( + response: 201, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + 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: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function createTeamSelectionList($summit_id, $selection_plan_id, $track_id){ return $this->processRequest(function () use($summit_id, $selection_plan_id, $track_id){ @@ -125,6 +208,53 @@ public function createTeamSelectionList($summit_id, $selection_plan_id, $track_i * @param $owner_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Get( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/owner/{owner_id}", + summary: "Get individual selection list for a specific owner", + security: [["Bearer" => []]], + tags: ["summit-selected-presentation-lists"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The summit id" + ), + new OA\Parameter( + name: "selection_plan_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection plan id" + ), + new OA\Parameter( + name: "track_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The track id" + ), + new OA\Parameter( + name: "owner_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The owner/member id" + ) + ], + responses: [ + new OA\Response( + response: 200, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") + ), + 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: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function getIndividualSelectionList($summit_id, $selection_plan_id, $track_id, $owner_id){ return $this->processRequest(function () use($summit_id, $selection_plan_id, $track_id, $owner_id){ @@ -149,6 +279,47 @@ public function getIndividualSelectionList($summit_id, $selection_plan_id, $trac * @param $owner_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Post( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/owner/me", + summary: "Create individual selection list for current user", + security: [["Bearer" => []]], + tags: ["summit-selected-presentation-lists"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The summit id" + ), + new OA\Parameter( + name: "selection_plan_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection plan id" + ), + new OA\Parameter( + name: "track_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The track id" + ) + ], + responses: [ + new OA\Response( + response: 201, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + 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: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function createIndividualSelectionList($summit_id, $selection_plan_id, $track_id){ return $this->processRequest(function () use($summit_id, $selection_plan_id, $track_id) { @@ -172,6 +343,62 @@ public function createIndividualSelectionList($summit_id, $selection_plan_id, $t * @param $list_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Put( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/{list_id}/reorder", + summary: "Reorder presentations in a selection list", + security: [["Bearer" => []]], + tags: ["summit-selected-presentation-lists"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The summit id" + ), + new OA\Parameter( + name: "selection_plan_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection plan id" + ), + new OA\Parameter( + name: "track_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The track id" + ), + new OA\Parameter( + name: "list_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection list id" + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "application/json", + schema: new OA\Schema(ref: "#/components/schemas/SummitSelectedPresentationListReorderRequest") + ) + ), + responses: [ + new OA\Response( + response: 200, + description: "OK", + content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + 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: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function reorderSelectionList($summit_id, $selection_plan_id, $track_id, $list_id){ return $this->processRequest(function () use($summit_id, $selection_plan_id, $track_id, $list_id) { @@ -219,6 +446,61 @@ public function reorderSelectionList($summit_id, $selection_plan_id, $track_id, * @param $presentation_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Post( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id}", + summary: "Assign a presentation to current user's individual selection list", + security: [["Bearer" => []]], + tags: ["summit-selected-presentation-lists"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The summit id" + ), + new OA\Parameter( + name: "selection_plan_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection plan id" + ), + new OA\Parameter( + name: "track_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The track id" + ), + new OA\Parameter( + name: "collection", + in: "path", + required: true, + schema: new OA\Schema(type: "string", enum: ["selected", "maybe"]), + description: "The collection type (selected or maybe)" + ), + new OA\Parameter( + name: "presentation_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The presentation id" + ) + ], + responses: [ + new OA\Response( + response: 201, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + 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: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function assignPresentationToMyIndividualList($summit_id, $selection_plan_id, $track_id, $collection, $presentation_id){ return $this->processRequest(function () use($summit_id, $selection_plan_id, $track_id, $collection,$presentation_id) { @@ -244,6 +526,61 @@ public function assignPresentationToMyIndividualList($summit_id, $selection_plan * @param $presentation_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Delete( + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id}", + summary: "Remove a presentation from current user's individual selection list", + security: [["Bearer" => []]], + tags: ["summit-selected-presentation-lists"], + parameters: [ + new OA\Parameter( + name: "id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The summit id" + ), + new OA\Parameter( + name: "selection_plan_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The selection plan id" + ), + new OA\Parameter( + name: "track_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The track id" + ), + new OA\Parameter( + name: "collection", + in: "path", + required: true, + schema: new OA\Schema(type: "string", enum: ["selected", "maybe"]), + description: "The collection type (selected or maybe)" + ), + new OA\Parameter( + name: "presentation_id", + in: "path", + required: true, + schema: new OA\Schema(type: "integer"), + description: "The presentation id" + ) + ], + responses: [ + new OA\Response( + response: 201, + description: "Created", + content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + 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: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function removePresentationFromMyIndividualList($summit_id, $selection_plan_id, $track_id, $collection, $presentation_id){ return $this->processRequest(function () use($summit_id, $selection_plan_id, $track_id, $collection,$presentation_id) { @@ -260,4 +597,4 @@ public function removePresentationFromMyIndividualList($summit_id, $selection_pl )); }); } -} \ No newline at end of file +} diff --git a/app/Swagger/SummitPresentationSchemas.php b/app/Swagger/SummitPresentationSchemas.php index 8f8a3cf2c..073c0290e 100644 --- a/app/Swagger/SummitPresentationSchemas.php +++ b/app/Swagger/SummitPresentationSchemas.php @@ -81,3 +81,38 @@ class PresentationTrackChairRatingTypeCreateRequestSchema {} class PresentationTrackChairRatingTypeUpdateRequestSchema {} // + + +#[OA\Schema( + schema: "SummitSelectedPresentationList", + properties: [ + new OA\Property(property: "id", type: "integer", example: 1), + new OA\Property(property: "created", type: "integer", description: "Unix timestamp", example: 1640995200), + new OA\Property(property: "last_edited", type: "integer", description: "Unix timestamp", example: 1640995200), + new OA\Property(property: "name", type: "string", example: "My Selection List"), + new OA\Property(property: "type", type: "string", enum: ["Individual", "Group"], example: "Individual"), + new OA\Property(property: "hash", type: "string", example: "abc123def456"), + new OA\Property(property: "selected_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of selected presentation IDs"), + new OA\Property(property: "interested_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of interested presentation IDs (only for Individual lists)", nullable: true), + ], + anyOf: [ + new OA\Property(property: "category_id", type: "integer", example: 5), + new OA\Property(property: "category", ref: "#/components/schemas/PresentationCategory"), + new OA\Property(property: "owner_id", type: "integer", example: 10), + new OA\Property(property: "owner", ref: "#/components/schemas/Member"), + new OA\Property(property: "selection_plan_id", type: "integer", example: 3), + new OA\Property(property: "selection_plan", ref: "#/components/schemas/SelectionPlan"), + ] +)] +class SummitSelectedPresentationList {} + +#[OA\Schema( + schema: "SummitSelectedPresentationListReorderRequest", + required: ["collection"], + properties: [ + new OA\Property(property: "hash", type: "string", nullable: true, example: "abc123def456"), + new OA\Property(property: "collection", type: "string", enum: ["selected", "maybe"], example: "selected"), + new OA\Property(property: "presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of presentation IDs in the desired order", nullable: true), + ] +)] +class SummitSelectedPresentationListReorderRequest {} From f66d7c54120504793d3ff32a783068c69caa2407 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 20 Oct 2025 14:14:44 -0300 Subject: [PATCH 2/5] fix: respect OpenAPI 3.0 - moves anyOf to not be in the required, and properties there should be in the main properties param. --- app/Swagger/SummitPresentationSchemas.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Swagger/SummitPresentationSchemas.php b/app/Swagger/SummitPresentationSchemas.php index 073c0290e..f53dafd3e 100644 --- a/app/Swagger/SummitPresentationSchemas.php +++ b/app/Swagger/SummitPresentationSchemas.php @@ -85,6 +85,7 @@ class PresentationTrackChairRatingTypeUpdateRequestSchema {} #[OA\Schema( schema: "SummitSelectedPresentationList", + required: ["id", "created", "last_edited", "name", "type", "hash", "selected_presentations", "interested_presentations"], properties: [ new OA\Property(property: "id", type: "integer", example: 1), new OA\Property(property: "created", type: "integer", description: "Unix timestamp", example: 1640995200), @@ -94,8 +95,6 @@ class PresentationTrackChairRatingTypeUpdateRequestSchema {} new OA\Property(property: "hash", type: "string", example: "abc123def456"), new OA\Property(property: "selected_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of selected presentation IDs"), new OA\Property(property: "interested_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of interested presentation IDs (only for Individual lists)", nullable: true), - ], - anyOf: [ new OA\Property(property: "category_id", type: "integer", example: 5), new OA\Property(property: "category", ref: "#/components/schemas/PresentationCategory"), new OA\Property(property: "owner_id", type: "integer", example: 10), From 4522a60be19775d3fd0c4e6f8f79b2fbc4a370ed Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 27 Nov 2025 15:37:03 +0000 Subject: [PATCH 3/5] chore: Add the correct security and x attributes and fix path with the correct routes --- ...tSelectedPresentationListApiController.php | 58 ++++++++++++------- .../SelectedPresentationListAuthSchema.php | 25 ++++++++ app/Swagger/SummitPresentationSchemas.php | 15 ++--- 3 files changed, 68 insertions(+), 30 deletions(-) create mode 100644 app/Swagger/Security/SelectedPresentationListAuthSchema.php diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php index 5ac712e60..6cc487f66 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php @@ -13,7 +13,9 @@ **/ use App\Models\Exceptions\AuthzException; +use App\Models\Foundation\Main\IGroup; use App\ModelSerializers\SerializerUtils; +use App\Security\SummitScopes; use App\Services\Model\ISummitSelectedPresentationListService; use Illuminate\Http\Response; use Illuminate\Support\Facades\Request; @@ -76,10 +78,12 @@ public function __construct * @return \Illuminate\Http\JsonResponse|mixed */ #[OA\Get( - path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/team", + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/team", + operationId: 'getTeamSelectionList', summary: "Get team selection list for a track", - security: [["Bearer" => []]], - tags: ["summit-selected-presentation-lists"], + security: [["selected_presentation_list_oauth2" => [SummitScopes::ReadSummitData]]], + x: ["authz_groups" => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ["Summit Selected Presentation Lists"], parameters: [ new OA\Parameter( name: "id", @@ -144,10 +148,12 @@ public function getTeamSelectionList($summit_id, $selection_plan_id, $track_id){ * @return \Illuminate\Http\JsonResponse|mixed */ #[OA\Post( - path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/team", + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/team", + operationId: 'createTeamSelectionList', summary: "Create team selection list for a track", - security: [["Bearer" => []]], - tags: ["summit-selected-presentation-lists"], + security: [["selected_presentation_list_oauth2" => [SummitScopes::WriteSummitData]]], + x: ["authz_groups" => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ["Summit Selected Presentation Lists"], parameters: [ new OA\Parameter( name: "id", @@ -209,10 +215,12 @@ public function createTeamSelectionList($summit_id, $selection_plan_id, $track_i * @return \Illuminate\Http\JsonResponse|mixed */ #[OA\Get( - path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/owner/{owner_id}", + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/individual/owner/{owner_id}", + operationId: 'getIndividualSelectionList', summary: "Get individual selection list for a specific owner", - security: [["Bearer" => []]], - tags: ["summit-selected-presentation-lists"], + security: [["selected_presentation_list_oauth2" => [SummitScopes::ReadSummitData]]], + x: ["authz_groups" => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ["Summit Selected Presentation Lists"], parameters: [ new OA\Parameter( name: "id", @@ -280,10 +288,12 @@ public function getIndividualSelectionList($summit_id, $selection_plan_id, $trac * @return \Illuminate\Http\JsonResponse|mixed */ #[OA\Post( - path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/owner/me", + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/individual/owner/me", + operationId: 'createIndividualSelectionList', summary: "Create individual selection list for current user", - security: [["Bearer" => []]], - tags: ["summit-selected-presentation-lists"], + security: [["selected_presentation_list_oauth2" => [SummitScopes::WriteSummitData]]], + x: ["authz_groups" => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ["Summit Selected Presentation Lists"], parameters: [ new OA\Parameter( name: "id", @@ -344,10 +354,12 @@ public function createIndividualSelectionList($summit_id, $selection_plan_id, $t * @return \Illuminate\Http\JsonResponse|mixed */ #[OA\Put( - path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/{list_id}/reorder", + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/{list_id}/reorder", + operationId: 'reorderSelectionList', summary: "Reorder presentations in a selection list", - security: [["Bearer" => []]], - tags: ["summit-selected-presentation-lists"], + security: [["selected_presentation_list_oauth2" => [SummitScopes::WriteSummitData]]], + x: ["authz_groups" => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ["Summit Selected Presentation Lists"], parameters: [ new OA\Parameter( name: "id", @@ -447,10 +459,12 @@ public function reorderSelectionList($summit_id, $selection_plan_id, $track_id, * @return \Illuminate\Http\JsonResponse|mixed */ #[OA\Post( - path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id}", + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id}", + operationId: 'assignPresentationToMyIndividualList', summary: "Assign a presentation to current user's individual selection list", - security: [["Bearer" => []]], - tags: ["summit-selected-presentation-lists"], + security: [["selected_presentation_list_oauth2" => [SummitScopes::WriteSummitData]]], + x: ["authz_groups" => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ["Summit Selected Presentation Lists"], parameters: [ new OA\Parameter( name: "id", @@ -527,10 +541,12 @@ public function assignPresentationToMyIndividualList($summit_id, $selection_plan * @return \Illuminate\Http\JsonResponse|mixed */ #[OA\Delete( - path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/track-chairs/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id}", + path: "/api/v1/summits/{id}/selection-plans/{selection_plan_id}/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id}", + operationId: 'removePresentationFromMyIndividualList', summary: "Remove a presentation from current user's individual selection list", - security: [["Bearer" => []]], - tags: ["summit-selected-presentation-lists"], + security: [["selected_presentation_list_oauth2" => [SummitScopes::WriteSummitData]]], + x: ["authz_groups" => [IGroup::SuperAdmins, IGroup::Administrators, IGroup::TrackChairs, IGroup::TrackChairsAdmins]], + tags: ["Summit Selected Presentation Lists"], parameters: [ new OA\Parameter( name: "id", diff --git a/app/Swagger/Security/SelectedPresentationListAuthSchema.php b/app/Swagger/Security/SelectedPresentationListAuthSchema.php new file mode 100644 index 000000000..3a8a3e8a8 --- /dev/null +++ b/app/Swagger/Security/SelectedPresentationListAuthSchema.php @@ -0,0 +1,25 @@ + 'Read Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], + ) +] +class SelectedPresentationListAuthSchema {} diff --git a/app/Swagger/SummitPresentationSchemas.php b/app/Swagger/SummitPresentationSchemas.php index f53dafd3e..42d830edd 100644 --- a/app/Swagger/SummitPresentationSchemas.php +++ b/app/Swagger/SummitPresentationSchemas.php @@ -85,7 +85,6 @@ class PresentationTrackChairRatingTypeUpdateRequestSchema {} #[OA\Schema( schema: "SummitSelectedPresentationList", - required: ["id", "created", "last_edited", "name", "type", "hash", "selected_presentations", "interested_presentations"], properties: [ new OA\Property(property: "id", type: "integer", example: 1), new OA\Property(property: "created", type: "integer", description: "Unix timestamp", example: 1640995200), @@ -93,14 +92,12 @@ class PresentationTrackChairRatingTypeUpdateRequestSchema {} new OA\Property(property: "name", type: "string", example: "My Selection List"), new OA\Property(property: "type", type: "string", enum: ["Individual", "Group"], example: "Individual"), new OA\Property(property: "hash", type: "string", example: "abc123def456"), - new OA\Property(property: "selected_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of selected presentation IDs"), - new OA\Property(property: "interested_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of interested presentation IDs (only for Individual lists)", nullable: true), - new OA\Property(property: "category_id", type: "integer", example: 5), - new OA\Property(property: "category", ref: "#/components/schemas/PresentationCategory"), - new OA\Property(property: "owner_id", type: "integer", example: 10), - new OA\Property(property: "owner", ref: "#/components/schemas/Member"), - new OA\Property(property: "selection_plan_id", type: "integer", example: 3), - new OA\Property(property: "selection_plan", ref: "#/components/schemas/SelectionPlan"), + new OA\Property(property: "selected_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of SummitSelectedPresentation IDs of collection \"selected\", full objects when ?expand=selected_presentations" ), + new OA\Property(property: "interested_presentations", type: "array", items: new OA\Items(type: "integer"), description: "Array of SummitSelectedPresentation IDs of collection \"maybe\", full objects when ?expand=interested_presentations", nullable: true), + new OA\Property(property: "category_id", type: "integer", example: 5, description: "PresentationCategory ID, full object when ?expand=category", nullable: true), + new OA\Property(property: "owner_id", type: "integer", example: 10, nullable: true, description: "Member ID not present when ?expand=owner"), + new OA\Property(property: "owner", ref: "#/components/schemas/Member", description: "Member full object when ?expand=owner)", nullable: true), + new OA\Property(property: "selection_plan_id", type: "integer", example: 3, description: "SelectionPlan ID, full object when ?expand=selection_plan)", nullable: true), ] )] class SummitSelectedPresentationList {} From cfce1d036d1e290e33fd7114b66d22d2c6c41b2b Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 5 Dec 2025 15:32:44 +0000 Subject: [PATCH 4/5] chore: include PR requested changes --- app/Swagger/Security/SelectedPresentationListAuthSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Swagger/Security/SelectedPresentationListAuthSchema.php b/app/Swagger/Security/SelectedPresentationListAuthSchema.php index 3a8a3e8a8..45d48a66f 100644 --- a/app/Swagger/Security/SelectedPresentationListAuthSchema.php +++ b/app/Swagger/Security/SelectedPresentationListAuthSchema.php @@ -1,6 +1,6 @@ Date: Wed, 10 Dec 2025 21:31:13 +0000 Subject: [PATCH 5/5] chore: Add PR's requested changes --- .../OAuth2SummitSelectedPresentationListApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php index 6cc487f66..c3f0ce28f 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSelectedPresentationListApiController.php @@ -587,7 +587,7 @@ public function assignPresentationToMyIndividualList($summit_id, $selection_plan responses: [ new OA\Response( response: 201, - description: "Created", + description: "Removed from List", content: new OA\JsonContent(ref: "#/components/schemas/SummitSelectedPresentationList") ), new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),