diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SpeakerActiveInvolvementApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SpeakerActiveInvolvementApiController.php index efd5ee260..a004ee3c0 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SpeakerActiveInvolvementApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SpeakerActiveInvolvementApiController.php @@ -1,4 +1,7 @@ -repository = $repository; } + #[OA\Get( + path: '/api/v1/speakers/active-involvements', + summary: 'Get all default speaker active involvements', + description: 'Retrieves a list of default active involvements for speakers. These are predefined involvement types that speakers can select to describe their current activities (e.g., "Active Contributor", "User", "Evaluator").', + operationId: 'getAllSpeakerActiveInvolvements', + security: [ + [ + 'speaker_active_involvement_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ] + ] + ], + tags: ['Speakers'], + parameters: [ + new OA\Parameter( + name: 'expand', + in: 'query', + required: false, + description: 'No expandable relationships available for this resource', + schema: new OA\Schema(type: 'string', example: '') + ), + ], + responses: [ + new OA\Response( + response: 200, + description: 'Active involvements retrieved successfully', + content: new OA\JsonContent(ref: '#/components/schemas/SpeakerActiveInvolvementsResponse') + ), + 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"), + ] + )] /** * @return mixed */ @@ -71,4 +111,4 @@ public function getAll(){ return $this->error500($ex); } } -} \ No newline at end of file +} diff --git a/app/Swagger/Security/SpeakerActiveInvolvementAuthSchema.php b/app/Swagger/Security/SpeakerActiveInvolvementAuthSchema.php new file mode 100644 index 000000000..775070bcf --- /dev/null +++ b/app/Swagger/Security/SpeakerActiveInvolvementAuthSchema.php @@ -0,0 +1,25 @@ + 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + ], + ), + ], + ) +] +class SpeakerActiveInvolvementAuthSchema{} diff --git a/app/Swagger/SummitSpeakersSchemas.php b/app/Swagger/SummitSpeakersSchemas.php index 6b3e2f895..6cd22d65a 100644 --- a/app/Swagger/SummitSpeakersSchemas.php +++ b/app/Swagger/SummitSpeakersSchemas.php @@ -4,4 +4,32 @@ use OpenApi\Attributes as OA; -// +#[OA\Schema( + schema: 'SpeakerActiveInvolvement', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', format: 'int64', example: 1633024800), + new OA\Property(property: 'last_edited', type: 'integer', format: 'int64', example: 1633024800), + new OA\Property(property: 'involvement', type: 'string', example: 'Active Contributor'), + new OA\Property(property: 'is_default', type: 'boolean', example: true), + ] +)] +class SpeakerActiveInvolvementSchema {} + +#[OA\Schema( + schema: 'SpeakerActiveInvolvementsResponse', + type: 'object', + properties: [ + new OA\Property(property: 'total', type: 'integer', example: 5), + new OA\Property(property: 'per_page', type: 'integer', example: 5), + new OA\Property(property: 'current_page', type: 'integer', example: 1), + new OA\Property(property: 'last_page', type: 'integer', example: 1), + new OA\Property( + property: 'data', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SpeakerActiveInvolvement') + ), + ] +)] +class SpeakerActiveInvolvementsResponseSchema {}