From 0352cfe3904ab531dbef1105fa84b716cc168ad1 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 20 Oct 2025 13:04:10 -0300 Subject: [PATCH 1/6] feat: Extend Swagger Coverage for controller `OAuth2SummitSelectedPresentationListApiController` --- ...tSelectedPresentationListApiController.php | 339 +++++++++++++++++- app/Swagger/SummitPresentationSchemas.php | 208 ++++++++++- 2 files changed, 545 insertions(+), 2 deletions(-) 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 c365566ea..4f9d5a66b 100644 --- a/app/Swagger/SummitPresentationSchemas.php +++ b/app/Swagger/SummitPresentationSchemas.php @@ -147,6 +147,76 @@ class PresentationTrackChairScoreTypeUpdateRequest {} // End Track Chair Score Types +#[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 {} + + +#[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 {} + + // Summit Speaker Assistance Schemas #[OA\Schema( @@ -280,4 +350,140 @@ class PresentationActionTypeCreateRequestSchema )] class PresentationActionTypeUpdateRequestSchema { -} \ No newline at end of file +} + + +// Summit Speaker Assistance Schemas + +#[OA\Schema( + schema: "PresentationSpeakerSummitAssistanceConfirmationRequest", + type: "object", + 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: "on_site_phone", type: "string", nullable: true), + new OA\Property(property: "registered", type: "boolean"), + new OA\Property(property: "is_confirmed", type: "boolean"), + new OA\Property(property: "checked_in", type: "boolean"), + new OA\Property(property: "summit_id", type: "integer"), + new OA\Property(property: "speaker_email", type: "string"), + new OA\Property(property: "speaker_full_name", type: "string"), + new OA\Property(property: "speaker_id", type: "integer", description: "PresentationSpeaker Id, full object available in 'speaker' expand (speaker field)"), + new OA\Property(property: "confirmation_date", type: "integer", nullable: true), + ] +)] +class PresentationSpeakerSummitAssistanceConfirmationRequest +{ +} + +#[OA\Schema( + schema: "PaginatedPresentationSpeakerSummitAssistanceConfirmationRequestsResponse", + allOf: [ + new OA\Schema(ref: "#/components/schemas/PaginateDataSchemaResponse"), + new OA\Schema( + properties: [ + new OA\Property( + property: "data", + type: "array", + items: new OA\Items(ref: "#/components/schemas/PresentationSpeakerSummitAssistanceConfirmationRequest") + ) + ] + ) + ] +)] +class PaginatedPresentationSpeakerSummitAssistanceConfirmationRequestsResponse +{ +} + +#[OA\Schema( + schema: "PresentationSpeakerSummitAssistanceConfirmationRequestCreateRequest", + type: "object", + required: ["speaker_id"], + properties: [ + new OA\Property(property: "speaker_id", type: "integer"), + new OA\Property(property: "on_site_phone", type: "string", maxLength: 50), + new OA\Property(property: "registered", type: "boolean"), + new OA\Property(property: "is_confirmed", type: "boolean"), + new OA\Property(property: "checked_in", type: "boolean") + ] +)] +class PresentationSpeakerSummitAssistanceConfirmationRequestCreateRequest +{ +} + +#[OA\Schema( + schema: "PresentationSpeakerSummitAssistanceConfirmationRequestUpdateRequest", + type: "object", + properties: [ + new OA\Property(property: "on_site_phone", type: "string", maxLength: 50), + new OA\Property(property: "registered", type: "boolean"), + new OA\Property(property: "is_confirmed", type: "boolean"), + new OA\Property(property: "checked_in", type: "boolean") + ] +)] +class PresentationSpeakerSummitAssistanceConfirmationRequestUpdateRequest +{ +} + +// + +#[OA\Schema( + schema: 'PresentationActionType', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', example: 1630500518), + new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518), + new OA\Property(property: 'label', type: 'string', example: 'Review'), + new OA\Property(property: 'summit_id', type: 'integer', example: 42, description: 'Summit ID, add ?expand=summit to get full summit object'), + new OA\Property(property: 'order', type: 'integer', example: 1, description: 'Order within a selection plan. Only present when filtering by selection_plan_id', ), + ] +)] +class PresentationActionTypeSchema +{ +} + +#[OA\Schema( + schema: 'PaginatedPresentationActionTypesResponse', + allOf: [ + new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), + new OA\Schema( + type: 'object', + properties: [ + new OA\Property( + property: 'data', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/PresentationActionType') + ) + ] + ) + ] +)] +class PaginatedPresentationActionTypesResponseSchema +{ +} + +#[OA\Schema( + schema: 'PresentationActionTypeCreateRequest', + type: 'object', + required: ['label'], + properties: [ + new OA\Property(property: 'label', type: 'string', example: 'Review', maxLength: 255), + new OA\Property(property: 'selection_plan_id', type: 'integer', example: 42, description: 'If provided, the order field will be set within the context of the selection plan'), + ] +)] +class PresentationActionTypeCreateRequestSchema +{ +} + +#[OA\Schema( + schema: 'PresentationActionTypeUpdateRequest', + type: 'object', + properties: [ + new OA\Property(property: 'label', type: 'string', example: 'Review', maxLength: 255), + ] +)] +class PresentationActionTypeUpdateRequestSchema +{ +} From 41aedcee63cb22bf29df71fabc395b2848e0b8f4 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 20 Oct 2025 14:14:44 -0300 Subject: [PATCH 2/6] 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 4f9d5a66b..f3a766029 100644 --- a/app/Swagger/SummitPresentationSchemas.php +++ b/app/Swagger/SummitPresentationSchemas.php @@ -149,6 +149,7 @@ class PresentationTrackChairScoreTypeUpdateRequest {} #[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), @@ -158,8 +159,6 @@ class PresentationTrackChairScoreTypeUpdateRequest {} 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 0e4e52ebaa74f6d8d08cc675dfb920759a649f69 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 27 Nov 2025 15:37:03 +0000 Subject: [PATCH 3/6] 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 f3a766029..079490b94 100644 --- a/app/Swagger/SummitPresentationSchemas.php +++ b/app/Swagger/SummitPresentationSchemas.php @@ -149,7 +149,6 @@ class PresentationTrackChairScoreTypeUpdateRequest {} #[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), @@ -157,14 +156,12 @@ class PresentationTrackChairScoreTypeUpdateRequest {} 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 58d05c4abc9a87940587b82150f610c11fddd693 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 5 Dec 2025 15:32:44 +0000 Subject: [PATCH 4/6] 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/6] 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"), From ba62c96d4854e300522aca980879fc0e1e469d9d Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 27 Jan 2026 13:58:46 +0000 Subject: [PATCH 6/6] fix: merge conflict Signed-off-by: Matias Perrone --- app/Swagger/SummitPresentationSchemas.php | 172 ---------------------- 1 file changed, 172 deletions(-) diff --git a/app/Swagger/SummitPresentationSchemas.php b/app/Swagger/SummitPresentationSchemas.php index 079490b94..2cdbd9046 100644 --- a/app/Swagger/SummitPresentationSchemas.php +++ b/app/Swagger/SummitPresentationSchemas.php @@ -177,178 +177,6 @@ class SummitSelectedPresentationList {} )] class SummitSelectedPresentationListReorderRequest {} - -#[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 {} - - -// Summit Speaker Assistance Schemas - -#[OA\Schema( - schema: "PresentationSpeakerSummitAssistanceConfirmationRequest", - type: "object", - 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: "on_site_phone", type: "string", nullable: true), - new OA\Property(property: "registered", type: "boolean"), - new OA\Property(property: "is_confirmed", type: "boolean"), - new OA\Property(property: "checked_in", type: "boolean"), - new OA\Property(property: "summit_id", type: "integer"), - new OA\Property(property: "speaker_email", type: "string"), - new OA\Property(property: "speaker_full_name", type: "string"), - new OA\Property(property: "speaker_id", type: "integer", description: "PresentationSpeaker Id, full object available in 'speaker' expand (speaker field)"), - new OA\Property(property: "confirmation_date", type: "integer", nullable: true), - ] -)] -class PresentationSpeakerSummitAssistanceConfirmationRequest -{ -} - -#[OA\Schema( - schema: "PaginatedPresentationSpeakerSummitAssistanceConfirmationRequestsResponse", - allOf: [ - new OA\Schema(ref: "#/components/schemas/PaginateDataSchemaResponse"), - new OA\Schema( - properties: [ - new OA\Property( - property: "data", - type: "array", - items: new OA\Items(ref: "#/components/schemas/PresentationSpeakerSummitAssistanceConfirmationRequest") - ) - ] - ) - ] -)] -class PaginatedPresentationSpeakerSummitAssistanceConfirmationRequestsResponse -{ -} - -#[OA\Schema( - schema: "PresentationSpeakerSummitAssistanceConfirmationRequestCreateRequest", - type: "object", - required: ["speaker_id"], - properties: [ - new OA\Property(property: "speaker_id", type: "integer"), - new OA\Property(property: "on_site_phone", type: "string", maxLength: 50), - new OA\Property(property: "registered", type: "boolean"), - new OA\Property(property: "is_confirmed", type: "boolean"), - new OA\Property(property: "checked_in", type: "boolean") - ] -)] -class PresentationSpeakerSummitAssistanceConfirmationRequestCreateRequest -{ -} - -#[OA\Schema( - schema: "PresentationSpeakerSummitAssistanceConfirmationRequestUpdateRequest", - type: "object", - properties: [ - new OA\Property(property: "on_site_phone", type: "string", maxLength: 50), - new OA\Property(property: "registered", type: "boolean"), - new OA\Property(property: "is_confirmed", type: "boolean"), - new OA\Property(property: "checked_in", type: "boolean") - ] -)] -class PresentationSpeakerSummitAssistanceConfirmationRequestUpdateRequest -{ -} - -// - -#[OA\Schema( - schema: 'PresentationActionType', - type: 'object', - properties: [ - new OA\Property(property: 'id', type: 'integer', example: 1), - new OA\Property(property: 'created', type: 'integer', example: 1630500518), - new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518), - new OA\Property(property: 'label', type: 'string', example: 'Review'), - new OA\Property(property: 'summit_id', type: 'integer', example: 42, description: 'Summit ID, add ?expand=summit to get full summit object'), - new OA\Property(property: 'order', type: 'integer', example: 1, description: 'Order within a selection plan. Only present when filtering by selection_plan_id', ), - ] -)] -class PresentationActionTypeSchema -{ -} - -#[OA\Schema( - schema: 'PaginatedPresentationActionTypesResponse', - allOf: [ - new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), - new OA\Schema( - type: 'object', - properties: [ - new OA\Property( - property: 'data', - type: 'array', - items: new OA\Items(ref: '#/components/schemas/PresentationActionType') - ) - ] - ) - ] -)] -class PaginatedPresentationActionTypesResponseSchema -{ -} - -#[OA\Schema( - schema: 'PresentationActionTypeCreateRequest', - type: 'object', - required: ['label'], - properties: [ - new OA\Property(property: 'label', type: 'string', example: 'Review', maxLength: 255), - new OA\Property(property: 'selection_plan_id', type: 'integer', example: 42, description: 'If provided, the order field will be set within the context of the selection plan'), - ] -)] -class PresentationActionTypeCreateRequestSchema -{ -} - -#[OA\Schema( - schema: 'PresentationActionTypeUpdateRequest', - type: 'object', - properties: [ - new OA\Property(property: 'label', type: 'string', example: 'Review', maxLength: 255), - ] -)] -class PresentationActionTypeUpdateRequestSchema -{ -} - - // Summit Speaker Assistance Schemas #[OA\Schema(