diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitApiController.php index bf6dd1bcf..40d1fdc28 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitApiController.php @@ -45,24 +45,6 @@ use utils\PagingInfo; use OpenApi\Attributes as OA; -#[ - OA\Info(version: "1.0.0", description: "Summit API", title: "Summit API Documentation"), - OA\Server(url: L5_SWAGGER_CONST_HOST, description: "server"), - OA\SecurityScheme( - type: 'oauth2', - securityScheme: 'summit_badges_oauth2', - flows: [ - new OA\Flow( - authorizationUrl: L5_SWAGGER_CONST_AUTH_URL, - tokenUrl: L5_SWAGGER_CONST_TOKEN_URL, - flow: 'authorizationCode', - scopes: [ - SummitScopes::ReadBadgeScanValidate => 'Validate Badge Scan', - ], - ), - ], - ) -] final class OAuth2SummitApiController extends OAuth2ProtectedController { @@ -136,6 +118,130 @@ public function __construct use ParseAndGetPaginationParams; + #[OA\Get( + path: "/api/v1/summits", + operationId: "getSummits", + summary: "Get summits list", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData + ] + ] + ], + parameters: [ + new OA\Parameter( + name: "page", + description: "Page number", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "per_page", + description: "Items per page", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 10) + ), + new OA\Parameter( + name: "filter", + description: "Filter criteria. Allowed fields: name, start_date, end_date, registration_begin_date, registration_end_date, ticket_types_count. Operands: == (equal), < (less than), > (greater than), <= (less than or equal), >= (greater than or equal), [] (especially for date ranges), =@ (starts with), @@ (contains)", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "order", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Order by: id, name, start_date, registration_begin_date" + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/SummitCollection") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ], + )] + #[OA\Get( + path: "/api/public/v1/summits", + operationId: "getSummitsPublic", + summary: "Get summits list (public)", + tags: ["Summits (Public)"], + parameters: [ + new OA\Parameter( + name: "page", + description: "Page number", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "per_page", + description: "Items per page", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 10) + ), + new OA\Parameter( + name: "filter", + description: "Filter criteria. Allowed fields: name, start_date, end_date, registration_begin_date, registration_end_date, ticket_types_count. Operands: == (equal), < (less than), > (greater than), <= (less than or equal), >= (greater than or equal), [] (especially for date ranges), =@ (starts with), @@ (contains)", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "order", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Order by: id, name, start_date, registration_begin_date" + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/SummitCollection") + ), + ] + )] /** * @return mixed */ @@ -218,6 +324,116 @@ function () { ); } + #[OA\Get( + path: "/api/v1/summits/all", + operationId: "getAllSummits", + summary: "Get all summits", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadAllSummitData + ] + ] + ], + parameters: [ + new OA\Parameter( + name: "page", + description: "Page number", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "per_page", + description: "Items per page", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 10) + ), + new OA\Parameter( + name: "filter", + description: "Filter criteria: name, start_date, end_date, registration_begin_date, registration_end_date, ticket_types_count, submission_begin_date, submission_end_date, voting_begin_date, voting_end_date, selection_begin_date, selection_end_date, selection_plan_enabled, begin_allow_booking_date, end_allow_booking_date", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "expand", + description: "Relations to expand: featured_speakers, schedule, type, locations", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + description: "Relations to add: ticket_types, locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/SummitCollection") + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ] + ), + ] + #[OA\Get( + path: "/api/public/v1/summits/all", + operationId: "getAllSummitsPublic", + summary: "Get all summits (public)", + tags: ["Summits (Public)"], + parameters: [ + new OA\Parameter( + name: "page", + description: "Page number", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "per_page", + description: "Items per page", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 10) + ), + new OA\Parameter( + name: "filter", + description: "Filter criteria", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/SummitCollection") + ), + ] + )] /** * @return mixed */ @@ -322,6 +538,137 @@ function () { ); } + #[OA\Get( + path: "/api/v1/summits/{id}", + operationId: "getSummit", + summary: "Get summit by ID or slug", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData + ] + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID or 'current'", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ] + ), + ] + #[OA\Get( + path: "/api/public/v1/summits/{id}", + operationId: "getSummitPublic", + summary: "Get summit by ID or slug (public)", + tags: ["Summits (Public)"], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID or 'current'", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + ] + ), + ] + #[OA\Get( + path: "/api/v2/summits/{id}", + operationId: "getSummitV2", + summary: "Get summit by ID or slug (v2)", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData + ] + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + ] + )] /** * @param $summit_id * @return mixed @@ -359,6 +706,37 @@ public function getSummit($summit_id) }); } + #[OA\Get( + path: "/api/public/v1/summits/all/current", + operationId: "getAllCurrentSummitPublic", + summary: "Get current summit (public)", + tags: ["Summits (Public)"], + parameters: [ + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + ] + ) + ] /** * @return JsonResponse|mixed */ @@ -396,6 +774,44 @@ private function getSummitOr404($id):Summit{ return $summit; } + #[OA\Get( + path: "/api/public/v1/summits/all/{id}", + operationId: "getAllCurrentSummitByIDOrSlugPublic", + summary: "Get all summit by ID or Slug (public)", + tags: ["Summits (Public)"], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + ] + ) + ] public function getAllSummitByIdOrSlugPublic($id){ return $this->processRequest(function () use ($id) { $summit = $this->getSummitOr404($id); @@ -415,6 +831,53 @@ public function getAllSummitByIdOrSlugPublic($id){ }); } + #[OA\Get( + path: "/api/v1/summits/all/{id}", + operationId: "getAllSummitByIdOrSlug", + summary: "Get all summit by ID or Slug", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadAllSummitData + ] + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID or slug", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ] + ) + ] /** * @param $id * @return JsonResponse|mixed @@ -453,6 +916,69 @@ public function getAllSummitByIdOrSlug($id) }); } + #[OA\Get( + path: "/api/v1/summits/all/{id}/registration-stats", + operationId: "getAllSummitByIdOrSlugRegistrationStats", + summary: "Get summit registration statistics", + tags: ["Summits", "Statistics"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadAllSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID or slug", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "filter", + description: "Filter by start_date and end_date", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "relations", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships (ids): locations, wifi_connections, selection_plans, meeting_booking_room_allowed_attributes, summit_sponsors, order_extra_questions, tax_types, payment_profiles, email_flows_events, summit_documents, featured_speakers, dates_with_events, presentation_action_types, schedule_settings, badge_view_types, lead_report_settings, badge_types, badge_features_types, badge_access_level_types, dates_with_events, supported_currencies" + ), + new OA\Parameter( + name: "expand", + in: "query", + required: false, + schema: new OA\Schema(type: "string"), + description: "Expand relationships: featured_speakers, schedule, type, locations" + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ] + ) + ] /** * @param $id * @return mixed @@ -501,6 +1027,75 @@ public function getAllSummitByIdOrSlugRegistrationStats($id) }); } + #[OA\Get( + path: "/api/v1/summits/all/{id}/registration-stats/check-ins", + operationId: "getAttendeesCheckinsOverTimeStats", + summary: "Get attendees check-ins statistics", + tags: ["Summits", "Statistics"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadAllSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "group_by", + description: "Group by criteria", + in: "query", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "filter", + description: "Filter criteria: start_date (op: >=), end_date (op: <=)", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "page", + description: "Page number", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "per_page", + description: "Items per page", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 10) + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(type: "array", items: new OA\Items(ref: "#/components/schemas/PaginatedRegistrationStatsCheckInsResponse")) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ], + )] /** * @param $id * @return mixed @@ -547,6 +1142,69 @@ function () { }); } + #[OA\Get( + path: "/api/v1/summits/all/{id}/registration-stats/purchased-tickets", + operationId: "getPurchasedTicketsOverTimeStats", + summary: "Get purchased tickets statistics", + tags: ["Summits", "Statistics"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadAllSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "group_by", + description: "Group by criteria", + in: "query", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "page", + description: "Page number", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "per_page", + description: "Items per page", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 10) + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(type: "array", items: new OA\Items(ref: "#/components/schemas/PaginatedRegistrationStatsPurchasedTicketsResponse")) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ], + ) + ] /** * @param $id * @return mixed @@ -595,6 +1253,40 @@ function () { use GetAndValidateJsonPayload; + #[OA\Post( + path: "/api/v1/summits", + operationId: "addSummit", + summary: "Create a new summit", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + ] + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Summit created", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + 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_PRECONDITION_FAILED, description: "Validation Error"), + ], + ) + ] /** * @return mixed */ @@ -618,6 +1310,52 @@ public function addSummit() }); } + #[OA\Put( + path: "/api/v1/summits/{id}", + operationId: "updateSummit", + summary: "Update summit", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Summit updated", + content: new OA\JsonContent(ref: "#/components/schemas/Summit") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + 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_PRECONDITION_FAILED, description: "Validation Error"), + ], + ) + ] /** * @param $summit_id * @return mixed @@ -648,6 +1386,41 @@ public function updateSummit($summit_id) }); } + #[OA\Delete( + path: "/api/v1/summits/{id}", + operationId: "deleteSummit", + summary: "Delete summit", + tags: ["Summits"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Summit deleted"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ], + ) + ] /** * @param $summit_id * @return mixed @@ -662,7 +1435,45 @@ public function deleteSummit($summit_id) }); } - + #[OA\Get( + path: "/api/v1/summits/{id}/external-orders/{external_order_id}", + operationId: "getExternalOrder", + summary: "Get external order", + tags: ["Summits", "External Orders"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadSummitsConfirmExternalOrders + ] + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "external_order_id", + description: "External Order ID", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(type: "object") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + ] + ) + ] /** * @param $summit_id * @param $external_order_id @@ -684,6 +1495,53 @@ public function getExternalOrder($summit_id, $external_order_id) * @param $external_attendee_id * @return mixed */ + #[OA\Post( + path: "/api/v1/summits/{id}/external-orders/{external_order_id}/external-attendees/{external_attendee_id}/confirm", + operationId: "confirmExternalOrderAttendee", + summary: "Confirm external order attendee", + tags: ["Summits", "External Orders"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitsConfirmExternalOrders + ] + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "external_order_id", + description: "External Order ID", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "external_attendee_id", + description: "External Attendee ID", + in: "path", + required: true, + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(ref: "#/components/schemas/SummitAttendee") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ] + ) + ] public function confirmExternalOrderAttendee($summit_id, $external_order_id, $external_attendee_id) { return $this->processRequest(function () use ($summit_id, $external_order_id, $external_attendee_id) { @@ -723,6 +1581,60 @@ protected function getSummitRepository(): ISummitRepository return $this->repository; } + #[OA\Post( + path: "/api/v1/summits/{id}/logo", + operationId: "addSummitLogo", + summary: "Add summit logo", + tags: ["Summits", "Media"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema( + required: ["file"], + properties: [ + new OA\Property(property: "file", type: "string", format: "binary", description: "Logo file") + ] + ) + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Logo created", + content: new OA\JsonContent(ref: "#/components/schemas/File") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + 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_PRECONDITION_FAILED, description: "Validation Error"), + ], + ) + ] /** * @param LaravelRequest $request * @param $summit_id @@ -756,6 +1668,42 @@ public function addSummitLogo(LaravelRequest $request, $summit_id) }); } + #[OA\Delete( + path: "/api/v1/summits/{id}/logo", + operationId: "deleteSummitLogo", + summary: "Delete summit logo", + tags: ["Summits", "Media"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Logo deleted"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ], + ) + ] /** * @param $summit_id * @return JsonResponse|mixed @@ -778,6 +1726,57 @@ public function deleteSummitLogo($summit_id) }); } + #[OA\Post( + path: "/api/v1/summits/{id}/logo/secondary", + operationId: "addSummitSecondaryLogo", + summary: "Add summit secondary logo", + tags: ["Summits", "Media"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\MediaType( + mediaType: "multipart/form-data", + schema: new OA\Schema( + properties: [ + new OA\Property(property: "file", type: "string", format: "binary") + ] + ) + ) + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Secondary logo created", + content: new OA\JsonContent(type: "object") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + 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"), + ], + )] /** * @param LaravelRequest $request * @param $summit_id @@ -811,7 +1810,43 @@ public function addSummitSecondaryLogo(LaravelRequest $request, $summit_id) }); } + #[OA\Delete( + path: "/api/v1/summits/{id}/logo/secondary", + operationId: "deleteSummitSecondaryLogo", + summary: "Delete summit secondary logo", + tags: ["Summits", "Media"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Secondary logo deleted"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ], + )] /** + * @param LaravelRequest $request * @param $summit_id * @return JsonResponse|mixed */ @@ -833,6 +1868,48 @@ public function deleteSummitSecondaryLogo($summit_id) }); } + #[OA\Post( + path: "/api/v1/summits/{id}/featured-speakers/{speaker_id}", + operationId: "addFeatureSpeaker", + summary: "Add featured speaker to summit", + tags: ["Summits", "Featured Speakers"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "speaker_id", + description: "Speaker ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response(response: Response::HTTP_CREATED, description: "Speaker added as featured"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + ], + ) + ] /** * @param $summit_id * @param $speaker_id @@ -849,6 +1926,58 @@ public function addFeatureSpeaker($summit_id, $speaker_id) }); } + #[OA\Put( + path: "/api/v1/summits/{id}/featured-speakers/{speaker_id}", + operationId: "updateFeatureSpeaker", + summary: "Update featured speaker order", + tags: ["Summits", "Featured Speakers"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "speaker_id", + description: "Speaker ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent( + required: ["order"], + properties: [ + new OA\Property(property: "order", type: "integer", minimum: 1, description: "Display order") + ] + ) + ), + responses: [ + new OA\Response(response: Response::HTTP_CREATED, description: "Featured speaker updated"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + ], + ) + ] /** * @param $summit_id * @param $speaker_id @@ -869,6 +1998,48 @@ public function updateFeatureSpeaker($summit_id, $speaker_id) }); } + #[OA\Delete( + path: "/api/v1/summits/{id}/featured-speakers/{speaker_id}", + operationId: "removeFeatureSpeaker", + summary: "Remove featured speaker from summit", + tags: ["Summits", "Featured Speakers"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "speaker_id", + description: "Speaker ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "Featured speaker removed"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + ], + ) + ] /** * @param $summit_id * @param $speaker_id @@ -885,6 +2056,74 @@ public function removeFeatureSpeaker($summit_id, $speaker_id) }); } + #[OA\Get( + path: "/api/v1/summits/{id}/featured-speakers", + operationId: "getAllFeatureSpeaker", + summary: "Get all featured speakers for summit", + tags: ["Summits", "Featured Speakers"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadAllSummitData, + SummitScopes::ReadSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + 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", + required: false, + schema: new OA\Schema(type: "integer", default: 1) + ), + new OA\Parameter( + name: "per_page", + description: "Items per page", + in: "query", + required: false, + schema: new OA\Schema(type: "integer", default: 10) + ), + new OA\Parameter( + name: "filter", + description: "Filter by: first_name, last_name, email, id, full_name, member_id, member_user_external_id", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + new OA\Parameter( + name: "order", + description: "Order by: first_name, last_name, id, email, order", + in: "query", + required: false, + schema: new OA\Schema(type: "string") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(type: "object") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + ], + ) + ] /** * @param $summit_id * @return JsonResponse|mixed @@ -952,6 +2191,44 @@ function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit) { ); } + #[OA\Put( + path: "/api/v1/summits/{id}/qr-codes/all/enc-key", + operationId: "generateQREncKey", + summary: "Generate QR encryption key", + tags: ["Summits", "QR Code"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::SummitAdministrators, + IGroup::Administrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "QR encryption key generated", + content: new OA\JsonContent(type: "object") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + ], + )] /** * @param $summit_id * @return JsonResponse|mixed @@ -970,6 +2247,47 @@ public function generateQREncKey($summit_id) }); } + #[OA\Get( + path: "/api/v1/summits/{id}/lead-report-settings/metadata", + operationId: "getLeadReportSettingsMetadata", + summary: "Get lead report settings metadata", + tags: ["Summits", "Lead Reports"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::Sponsors, + IGroup::SponsorExternalUsers, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(type: "object") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + ], + )] /** * @param $summit_id * @return mixed @@ -982,6 +2300,47 @@ public function getLeadReportSettingsMetadata($summit_id) { }); } + #[OA\Get( + path: "/api/v1/summits/{id}/lead-report-settings", + operationId: "getLeadReportSettings", + summary: "Get lead report settings", + tags: ["Summits", "Lead Reports"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::Sponsors, + IGroup::SponsorExternalUsers, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Success", + content: new OA\JsonContent(type: "array", items: new OA\Items(type: "object")) + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + ], + )] /** * @param $summit_id * @return mixed @@ -999,6 +2358,51 @@ public function getLeadReportSettings($summit_id){ }); } + #[OA\Post( + path: "/api/v1/summits/{id}/lead-report-settings", + operationId: "addLeadReportSettings", + summary: "Add lead report settings", + tags: ["Summits", "Lead Reports"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(type: "object") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Lead report settings created", + content: new OA\JsonContent(type: "object") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + 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_PRECONDITION_FAILED, description: "Validation Error"), + ], + ) + ] /** * @param $summit_id * @return mixed @@ -1023,6 +2427,51 @@ public function addLeadReportSettings($summit_id) { }); } + #[OA\Put( + path: "/api/v1/summits/{id}/lead-report-settings", + operationId: "updateLeadReportSettings", + summary: "Update lead report settings", + tags: ["Summits", "Lead Reports"], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::WriteSummitData + ] + ] + ], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: "id", + description: "Summit ID", + in: "path", + required: true, + schema: new OA\Schema(type: "integer") + ), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(type: "object") + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: "Lead report settings updated", + content: new OA\JsonContent(type: "object") + ), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + 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_PRECONDITION_FAILED, description: "Validation Error"), + ], + ) + ] /** * @param $summit_id * @return mixed @@ -1050,20 +2499,23 @@ public function updateLeadReportSettings($summit_id) { #[OA\Get( path: "/api/v1/summits/{summit_id}/badge/{badge}/validate", - description: "required-groups ".IGroup::SponsorExternalUsers.", ".IGroup::SuperAdmins.", ".IGroup::Administrators, summary: 'Validate Scanned Badges', operationId: 'validateBadge', tags: ['Badges'], + security: [ + [ + 'summit_oauth2' => [ + SummitScopes::ReadBadgeScanValidate + ] + ] + ], x: [ 'required-groups' => [ IGroup::SponsorExternalUsers, IGroup::SuperAdmins, - IGroup::Administrators + IGroup::Administrators, ] ], - security: [['summit_badges_oauth2' => [ - SummitScopes::ReadBadgeScanValidate - ]]], parameters: [ new OA\Parameter( name: 'summit_id', @@ -1082,12 +2534,12 @@ public function updateLeadReportSettings($summit_id) { ], responses: [ new OA\Response( - response: 200, + response: Response::HTTP_OK, description: 'Badge validation success', content: new OA\JsonContent(ref: '#/components/schemas/ValidateBadgeResponse') ), new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), - new OA\Response(response: Response::HTTP_NOT_FOUND, description: "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"), new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error") ] diff --git a/app/Security/SummitScopes.php b/app/Security/SummitScopes.php index 3c9cc24d5..1b5d302e0 100644 --- a/app/Security/SummitScopes.php +++ b/app/Security/SummitScopes.php @@ -121,4 +121,7 @@ final class SummitScopes const WriteAttendeeNotesData = '%s/attendee/notes/write'; const ReadAttendeeNotesData = '%s/attendee/notes/read'; + const WriteSummitsConfirmExternalOrders = '%s/summits/confirm-external-orders'; + const ReadSummitsConfirmExternalOrders = '%s/summits/read-external-orders'; } + diff --git a/app/Swagger/Models/SummitAbstractLocationSchema.php b/app/Swagger/Models/SummitAbstractLocationSchema.php index 99f86e62b..f2da592cb 100644 --- a/app/Swagger/Models/SummitAbstractLocationSchema.php +++ b/app/Swagger/Models/SummitAbstractLocationSchema.php @@ -1,35 +1,28 @@ 'Read All Summit Data', - SummitScopes::WriteSummitData => 'Write Summit Data', - ], - ), - ], - ) + type: 'oauth2', + securityScheme: 'summit_oauth2', + flows: [ + new OA\Flow( + authorizationUrl: L5_SWAGGER_CONST_AUTH_URL, + tokenUrl: L5_SWAGGER_CONST_TOKEN_URL, + flow: 'authorizationCode', + scopes: [ + SummitScopes::ReadSummitData => 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + SummitScopes::ReadBadgeScanValidate => 'Validate Badge Scan', + ], + ), + ], +) ] -class SummitAuthSchema {} + +class SummitAuthSchema +{ +} \ No newline at end of file diff --git a/app/Swagger/SummitPresentationAPISchemas.php b/app/Swagger/SummitPresentationAPISchemas.php index 03197ffc3..8140c423a 100644 --- a/app/Swagger/SummitPresentationAPISchemas.php +++ b/app/Swagger/SummitPresentationAPISchemas.php @@ -4,32 +4,7 @@ use OpenApi\Attributes as OA; -// PRESENTATION VIDEO SCHEMAS - -#[OA\Schema( - schema: "PresentationVideo", - required: ["id", "created", "last_edited"], - properties: [ - new OA\Property(property: "id", type: "integer"), - new OA\Property(property: "created", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "name", type: "string", nullable: true), - new OA\Property(property: "description", type: "string", nullable: true), - new OA\Property(property: "display_on_site", type: "boolean"), - new OA\Property(property: "featured", type: "boolean"), - new OA\Property(property: "order", type: "integer"), - new OA\Property(property: "presentation_id", type: "integer"), - new OA\Property(property: "class_name", type: "string"), - new OA\Property(property: "youtube_id", type: "string", nullable: true), - new OA\Property(property: "external_url", type: "string", format: "uri", nullable: true), - new OA\Property(property: "data_uploaded", type: "integer", format: "int64", nullable: true, description: "Epoch timestamp"), - new OA\Property(property: "highlighted", type: "boolean"), - new OA\Property(property: "views", type: "integer"), - ] -)] -class PresentationVideoSchema -{ -} +// PRESENTATION VIDEO SCHEMAS moved to Models/PresentationVideoSchema.php #[OA\Schema( schema: "PresentationVideoRequest", @@ -51,25 +26,6 @@ class PresentationVideoRequestSchema // PRESENTATION SLIDE SCHEMAS -#[OA\Schema( - schema: "PresentationSlide", - required: ["id", "created", "last_edited"], - properties: [ - new OA\Property(property: "id", type: "integer"), - new OA\Property(property: "created", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "name", type: "string", nullable: true), - new OA\Property(property: "description", type: "string", nullable: true), - new OA\Property(property: "display_on_site", type: "boolean"), - new OA\Property(property: "featured", type: "boolean"), - new OA\Property(property: "order", type: "integer"), - new OA\Property(property: "link", type: "string", nullable: true), - new OA\Property(property: "has_file", type: "boolean"), - ] -)] -class PresentationSlideSchema -{ -} #[OA\Schema( schema: "PresentationSlideRequest", @@ -88,26 +44,6 @@ class PresentationSlideRequestSchema { } -// PRESENTATION LINK SCHEMAS - -#[OA\Schema( - schema: "PresentationLink", - required: ["id", "created", "last_edited"], - properties: [ - new OA\Property(property: "id", type: "integer"), - new OA\Property(property: "created", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "name", type: "string", nullable: true), - new OA\Property(property: "description", type: "string", nullable: true), - new OA\Property(property: "display_on_site", type: "boolean"), - new OA\Property(property: "featured", type: "boolean"), - new OA\Property(property: "order", type: "integer"), - new OA\Property(property: "link", type: "string", nullable: true), - ] -)] -class PresentationLinkSchema -{ -} #[OA\Schema( schema: "PresentationLinkRequest", @@ -125,27 +61,6 @@ class PresentationLinkRequestSchema { } -// PRESENTATION MEDIA UPLOAD SCHEMAS - -#[OA\Schema( - schema: "PresentationMediaUpload", - required: ["id", "created", "last_edited", "media_upload_type_id"], - properties: [ - new OA\Property(property: "id", type: "integer"), - new OA\Property(property: "created", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "name", type: "string", nullable: true), - new OA\Property(property: "description", type: "string", nullable: true), - new OA\Property(property: "display_on_site", type: "boolean"), - new OA\Property(property: "order", type: "integer"), - new OA\Property(property: "filename", type: "string", nullable: true), - new OA\Property(property: "media_upload_type_id", type: "integer"), - new OA\Property(property: "public_url", type: "string", format: "uri", nullable: true), - ] -)] -class PresentationMediaUploadSchema -{ -} #[OA\Schema( schema: "PresentationMediaUploadRequest", @@ -160,161 +75,6 @@ class PresentationMediaUploadRequestSchema { } -// PRESENTATION SCHEMAS - -#[OA\Schema( - schema: "Presentation", - required: ["id", "created", "last_edited", "title"], - properties: [ - new OA\Property(property: "id", type: "integer"), - new OA\Property(property: "created", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "title", type: "string"), - new OA\Property(property: "description", type: "string"), - new OA\Property(property: "social_description", type: "string"), - new OA\Property(property: "start_date", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "end_date", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "location_id", type: "integer"), - new OA\Property(property: "summit_id", type: "integer"), - new OA\Property(property: "type_id", type: "integer"), - new OA\Property(property: "class_name", type: "string"), - new OA\Property(property: "allow_feedback", type: "boolean"), - new OA\Property(property: "avg_feedback_rate", type: "float"), - new OA\Property(property: "is_published", type: "boolean"), - new OA\Property(property: "published_date", type: "ime_epoch"), - new OA\Property(property: "head_count", type: "integer"), - new OA\Property(property: "track_id", type: "integer"), - new OA\Property(property: "meeting_url", type: "string"), - new OA\Property(property: "attendance_count", type: "integer"), - new OA\Property(property: "current_attendance_count", type: "integer"), - new OA\Property(property: "image", type: "url"), - new OA\Property(property: "level", type: "string"), - new OA\Property(property: "created_by_id", type: "integer"), - new OA\Property(property: "updated_by_id", type: "integer"), - new OA\Property(property: "show_sponsors", type: "boolean"), - new OA\Property(property: "duration", type: "integer"), - new OA\Property(property: "stream_is_secure", type: "boolean"), - new OA\Property(property: "submission_source", type: "string"), - new OA\Property(property: "rsvp_link", type: "string"), - new OA\Property(property: "rsvp_template_id", type: "integer"), - new OA\Property(property: "rsvp_max_user_number", type: "integer"), - new OA\Property(property: "rsvp_max_user_wait_list_number", type: "integer"), - new OA\Property(property: "rsvp_regular_count", type: "integer"), - new OA\Property(property: "rsvp_wait_count", type: "integer"), - new OA\Property(property: "rsvp_external", type: "boolean"), - new OA\Property(property: "rsvp_type", type: "string"), - new OA\Property(property: "rsvp_capacity", type: "string"), - - new OA\Property(property: "creator_id", type: "integer"), - new OA\Property(property: "moderator_speaker_id", type: "integer"), - new OA\Property(property: "selection_plan_id", type: "integer"), - new OA\Property(property: "problem_addressed", type: "string"), - new OA\Property(property: "attendees_expected_learnt", type: "string"), - new OA\Property(property: "to_record", type: "boolean"), - new OA\Property(property: "attending_media", type: "boolean"), - new OA\Property(property: "status", type: "string"), - new OA\Property(property: "progress", type: "integer", description: "Progress percentage"), - new OA\Property(property: "slug", type: "string"), - new OA\Property(property: "selection_status", type: "string"), - new OA\Property(property: "disclaimer_accepted_date", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "disclaimer_accepted", type: "boolean"), - new OA\Property(property: "custom_order", type: "integer"), - new OA\Property(property: "attendee_votes_count", type: "integer"), - new OA\Property(property: "review_status", type: "string"), - - new OA\Property(property: "speakers", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "integer"), - new OA\Schema(type: "PresentationSpeaker"), - ]), description: "List of speakers associated with the presentation. Ids when the is present in relations, PresentationSpeaker when is present in expand."), - new OA\Property(property: "moderator", type: "PresentationSpeaker"), - new OA\Property(property: "creator", type: "Member"), - new OA\Property(property: "selection_plan", type: "SelectionPlan"), - new OA\Property(property: "slides", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "PresentationSlide"), - new OA\Schema(type: "integer"), - ]), description: "List of slides associated with the presentation. PresentationSlide objects when present in expand, Ids when present in relations."), - new OA\Property(property: "public_comments", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "SummitPresentationComment"), - new OA\Schema(type: "integer"), - ]), description: "List of public comments associated with the presentation. SummitPresentationComment objects when present in expand, Ids when present in relations."), - new OA\Property(property: "links", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "PresentationLink"), - new OA\Schema(type: "integer"), - ]), description: "List of links associated with the presentation. PresentationLink objects when present in expand, Ids when present in relations."), - new OA\Property(property: "videos", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "PresentationVideo"), - new OA\Schema(type: "integer"), - ]), description: "List of videos associated with the presentation. PresentationVideo objects when present in expand, Ids when present in relations."), - new OA\Property(property: "media_uploads", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(ref: "#/components/schemas/PresentationMediaUpload"), - new OA\Schema(type: "integer"), - ]), description: "List of media uploads associated with the presentation. MediaUpload objects when present in expand, Ids when present in relations."), - new OA\Property(property: "extra_questions", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "PresentationExtraQuestionAnswer"), - new OA\Schema(type: "integer"), - ]), description: "List of extra questions associated with the presentation. PresentationExtraQuestionAnswer objects when present in expand, Ids when present in relations."), - new OA\Property(property: "actions", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "PresentationAction"), - new OA\Schema(type: "integer"), - ]), description: "List of actions associated with the presentation. PresentationAction objects when present in expand, Ids when present in relations."), - - new OA\Property(property: "sponsors", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "Company"), - new OA\Schema(type: "integer"), - ]), description: "List of sponsors associated with the presentation. Company objects when present in expand, Ids when present in relations."), - new OA\Property(property: "tags", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "Tag"), - new OA\Schema(type: "integer"), - ]), description: "List of tags associated with the presentation. Tag objects when present in expand, Ids when present in relations."), - new OA\Property(property: "feedback", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "SummitEventFeedback"), - new OA\Schema(type: "integer"), - ]), description: "List of feedback entries associated with the presentation. SummitEventFeedback objects when present in expand, Ids when present in relations."), - new OA\Property(property: "current_attendance", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "SummitEventAttendanceMetric"), - new OA\Schema(type: "integer"), - ]), description: "List of current attendance metrics associated with the presentation. SummitEventAttendanceMetric objects when present in expand, Ids when present in relations."), - new OA\Property( - property: "location", - type: ["SummitAbstractLocation", "integer"], - description: "List of locations associated with the presentation. SummitAbstractLocation objects when present in expand, Ids when present in relations." - ), - new OA\Property( - property: "rsvp_template", - type: "RSVPTemplate", - description: "RSVP template associated with the presentation, only present in expand and if the presentation is has the field rsvp_template_id with a value greater than zero (0).", - ), - new OA\Property( - property: "track", - type: ["PresentationCategory", "integer"], - description: "List of presentation categories associated with the presentation. PresentationCategory objects when present in expand, Ids when present in relations.", - ), - new OA\Property( - property: "type", - type: ["SummitEventType", "integer"], - description: "List of presentation types associated with the presentation. SummitEventType objects when present in expand, Ids when present in relations.", - ), - new OA\Property( - property: "created_by", - type: "Member", - description: "Member who created the presentation, only present in expand.", - ), - new OA\Property( - property: "updated_by", - type: "Member", - description: "Member who updated the presentation, only present in expand.", - ), - new OA\Property(property: "allowed_ticket_types", type: "array", items: new OA\Items(oneOf: [ - new OA\Schema(type: "SummitTicketType"), - new OA\Schema(type: "integer"), - ]), description: "List of allowed ticket types associated with the presentation. SummitTicketType objects when present in expand, Ids when present in relations."), - - ] - -)] -class PresentationSchema -{ -} #[OA\Schema( schema: "PresentationSubmission", @@ -382,25 +142,6 @@ class PresentationSubmissionRequestSchema { } -// PRESENTATION COMMENT SCHEMAS - -#[OA\Schema( - schema: "SummitPresentationComment", - required: ["id", "created", "last_edited", "body"], - properties: [ - new OA\Property(property: "id", type: "integer"), - new OA\Property(property: "created", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Epoch timestamp"), - new OA\Property(property: "body", type: "string"), - new OA\Property(property: "is_public", type: "boolean"), - new OA\Property(property: "is_activity", type: "boolean"), - new OA\Property(property: "creator_id", type: "integer"), - new OA\Property(property: "creator", type: "object", nullable: true), - ] -)] -class SummitPresentationCommentSchema -{ -} #[OA\Schema( schema: "PresentationCommentRequest", diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index 0fa3b73fc..127d91df0 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -494,3 +494,55 @@ class SummitMediaFileTypeCreateRequestSchema {} ] )] class SummitMediaFileTypeUpdateRequestSchema {} + +#[OA\Schema( + schema: 'RegistrationStat', + type: 'object', + properties: [ + new OA\Property(property: 'qty', type: 'integer'), + new OA\Property(property: 'label', type: 'string'), + ] +)] +class RegistrationStatSchema +{ +} + +#[OA\Schema( + schema: 'PaginatedRegistrationStatsCheckInsResponse', + type: 'object', + 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/RegistrationStat') + ) + ] + ) + ] +)] +class PaginatedRegistrationStatsCheckInsResponse +{ +} + +#[OA\Schema( + schema: 'PaginatedRegistrationStatsPurchasedTicketsResponse', + type: 'object', + 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/RegistrationStat') + ) + ] + ) + ] +)] +class PaginatedRegistrationStatsPurchasedTicketsResponseSchema +{ +} diff --git a/app/Swagger/schemas.php b/app/Swagger/schemas.php index 28aa34b1c..3f62e8990 100644 --- a/app/Swagger/schemas.php +++ b/app/Swagger/schemas.php @@ -11,6 +11,24 @@ use OpenApi\Attributes as OA; use function Laravel\Prompts\form; +#[OA\Schema( + schema: "SummitCollection", + title: "Summit Collection", + 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/Summit") + ) + ] + ) + ] +)] +class SummitCollection {} + #[OA\Schema( schema: 'Owner', type: 'object', @@ -155,22 +173,6 @@ class RSVPInvitationSchema )] class RSVPInvitationCSVSchema {} - -#[OA\Schema( - schema: 'SummitEvent', - type: 'object', - properties: [ - new OA\Property(property: 'id', type: 'integer'), - new OA\Property(property: 'created', type: 'integer', example: 1630500518), - new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518), - new OA\Property(property: 'title', type: 'string', example: 'This is a title'), - new OA\Property(property: 'description', type: 'string', example: 'This is a Description'), - ] -)] -class SummitEventSchema -{ -} - #[OA\Schema( schema: 'SendRSVPInvitationsRequest', type: 'object', diff --git a/database/seeders/ApiEndpointsSeeder.php b/database/seeders/ApiEndpointsSeeder.php index 438df2fda..ef2db1d9b 100644 --- a/database/seeders/ApiEndpointsSeeder.php +++ b/database/seeders/ApiEndpointsSeeder.php @@ -6439,13 +6439,17 @@ private function seedSummitEndpoints() 'name' => 'get-external-order', 'route' => '/api/v1/summits/{id}/external-orders/{external_order_id}', 'http_method' => 'GET', - 'scopes' => [sprintf('%s/summits/read-external-orders', $current_realm)], + 'scopes' => [ + sprintf(SummitScopes::ReadSummitsConfirmExternalOrders, $current_realm) + ], ), array( 'name' => 'confirm-external-order', 'route' => '/api/v1/summits/{id}/external-orders/{external_order_id}/external-attendees/{external_attendee_id}/confirm', 'http_method' => 'POST', - 'scopes' => [sprintf('%s/summits/confirm-external-orders', $current_realm)], + 'scopes' => [ + sprintf(SummitScopes::WriteSummitsConfirmExternalOrders, $current_realm) + ], ), [ 'name' => 'import-assets-from-mux',