Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use models\utils\IEntity;
use Exception;
use ModelSerializers\SerializerRegistry;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpFoundation\Response;
use utils\Filter;
use utils\FilterElement;

Expand Down Expand Up @@ -67,6 +69,55 @@ public function __construct

use GetEntity;

#[OA\Get(
path: "/api/v1/summit-administrator-permission-groups",
summary: "Get all summit administrator permission groups",
security: [["bearer_token" => []]],
tags: ["summit-administrator-permission-groups"],
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", in: "query", required: false, schema: new OA\Schema(type: "string")),
new OA\Parameter(name: "order", description: "Order", in: "query", required: false, schema: new OA\Schema(type: "string")),
],
responses: [
new OA\Response(
response: Response::HTTP_OK,
description: "OK",
content: new OA\JsonContent(
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/SummitAdministratorPermissionGroup")
)
]
)
]
)
),
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_INTERNAL_SERVER_ERROR, description: "Server Error"),
]
)]
function getAll()
{
return $this->_getAll(
Expand Down Expand Up @@ -163,6 +214,29 @@ protected function updateEntity($id, array $payload): IEntity
return $this->service->update($id, $payload);
}

#[OA\Put(
path: "/api/v1/summit-administrator-permission-groups/{id}/members/{member_id}",
summary: "Add member to permission group",
security: [["bearer_token" => []]],
tags: ["summit-administrator-permission-groups"],
parameters: [
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
new OA\Parameter(name: "member_id", description: "Member ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
],
responses: [
new OA\Response(
response: Response::HTTP_OK,
description: "OK",
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
),
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 addMember($id, $member_id)
{
try {
Expand All @@ -189,6 +263,29 @@ public function addMember($id, $member_id)
}
}

#[OA\Delete(
path: "/api/v1/summit-administrator-permission-groups/{id}/members/{member_id}",
summary: "Remove member from permission group",
security: [["bearer_token" => []]],
tags: ["summit-administrator-permission-groups"],
parameters: [
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
new OA\Parameter(name: "member_id", description: "Member ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
],
responses: [
new OA\Response(
response: Response::HTTP_OK,
description: "OK",
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
),
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 removeMember($id, $member_id)
{
try {
Expand All @@ -215,6 +312,29 @@ public function removeMember($id, $member_id)
}
}

#[OA\Put(
path: "/api/v1/summit-administrator-permission-groups/{id}/summits/{summit_id}",
summary: "Add summit to permission group",
security: [["bearer_token" => []]],
tags: ["summit-administrator-permission-groups"],
parameters: [
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
new OA\Parameter(name: "summit_id", description: "Summit ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
],
responses: [
new OA\Response(
response: Response::HTTP_OK,
description: "OK",
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
),
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 addSummit($id, $summit_id)
{
try {
Expand All @@ -241,6 +361,29 @@ public function addSummit($id, $summit_id)
}
}

#[OA\Delete(
path: "/api/v1/summit-administrator-permission-groups/{id}/summits/{summit_id}",
summary: "Remove summit from permission group",
security: [["bearer_token" => []]],
tags: ["summit-administrator-permission-groups"],
parameters: [
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
new OA\Parameter(name: "summit_id", description: "Summit ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
],
responses: [
new OA\Response(
response: Response::HTTP_OK,
description: "OK",
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
),
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 removeSummit($id, $summit_id)
{
try {
Expand Down
35 changes: 35 additions & 0 deletions app/Swagger/SummitAdministratorPermissionGroupSchemas.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
namespace App\Swagger\schemas;

use OpenApi\Attributes as OA;

#[OA\Schema(
schema: "SummitAdministratorPermissionGroup",
type: "object",
properties: [
new OA\Property(property: "id", type: "integer"),
new OA\Property(property: "title", type: "string"),
new OA\Property(property: "created", type: "integer"),
new OA\Property(property: "last_edited", type: "integer"),
new OA\Property(
property: "members",
description: "Array of member IDs. Use expand=members to get full Member objects",
oneOf: [
new OA\Schema(type: "array", items: new OA\Items(type: "integer")),
new OA\Schema(type: "array", items: new OA\Items(ref: "#/components/schemas/Member"))
]
),
new OA\Property(
property: "summits",
description: "Array of summit IDs. Use expand=summits to get full Summit objects",
oneOf: [
new OA\Schema(type: "array", items: new OA\Items(type: "integer")),
new OA\Schema(type: "array", items: new OA\Items(ref: "#/components/schemas/Summit"))
]
),
]
)]
class SummitAdministratorPermissionGroupSchemas
{
}

66 changes: 65 additions & 1 deletion app/Swagger/SummitSchemas.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,68 @@

use OpenApi\Attributes as OA;

//
#[OA\Schema(
schema: "Summit",
type: "object",
properties: [
new OA\Property(property: "id", type: "integer"),
new OA\Property(property: "created", type: "integer"),
new OA\Property(property: "last_edited", type: "integer"),
new OA\Property(property: "name", type: "string"),
new OA\Property(property: "slug", type: "string"),
new OA\Property(property: "start_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "end_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "registration_begin_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "registration_end_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "start_showing_venues_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "schedule_start_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "active", type: "boolean"),
new OA\Property(property: "type_id", type: "integer"),
new OA\Property(property: "dates_label", type: "string"),
new OA\Property(property: "max_submission_allowed_per_user", type: "integer"),
new OA\Property(property: "published_events_count", type: "integer"),
new OA\Property(property: "time_zone_id", type: "string"),
new OA\Property(property: "time_zone_label", type: "string"),
new OA\Property(property: "invite_only_registration", type: "boolean"),
new OA\Property(property: "meeting_room_booking_start_time", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "meeting_room_booking_end_time", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "meeting_room_booking_slot_length", type: "integer"),
new OA\Property(property: "meeting_room_booking_max_allowed", type: "integer"),
new OA\Property(property: "begin_allow_booking_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "end_allow_booking_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "logo", type: "string", format: "url"),
new OA\Property(property: "secondary_logo", type: "string", format: "url"),
new OA\Property(property: "reassign_ticket_till_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "registration_disclaimer_content", type: "string"),
new OA\Property(property: "registration_disclaimer_mandatory", type: "boolean"),
new OA\Property(property: "registration_reminder_email_days_interval", type: "integer"),
new OA\Property(property: "registration_link", type: "string", format: "url"),
new OA\Property(property: "secondary_registration_link", type: "string", format: "url"),
new OA\Property(property: "secondary_registration_label", type: "string"),
new OA\Property(property: "registration_send_qr_as_image_attachment_on_ticket_email", type: "boolean"),
new OA\Property(property: "registration_send_ticket_as_pdf_attachment_on_ticket_email", type: "boolean"),
new OA\Property(property: "registration_send_ticket_email_automatically", type: "boolean"),
new OA\Property(property: "registration_send_order_email_automatically", type: "boolean"),
new OA\Property(property: "registration_allow_automatic_reminder_emails", type: "boolean"),
new OA\Property(property: "registration_allowed_refund_request_till_date", type: "integer", description: "Unix timestamp"),
new OA\Property(property: "registration_slug_prefix", type: "string"),
new OA\Property(property: "modality", type: "string"),
new OA\Property(property: "allow_update_attendee_extra_questions", type: "boolean"),
new OA\Property(property: "default_page_url", type: "string"),
new OA\Property(property: "speaker_confirmation_default_page_url", type: "string"),
new OA\Property(property: "virtual_site_url", type: "string"),
new OA\Property(property: "marketing_site_url", type: "string"),
new OA\Property(property: "marketing_site_oauth2_client_scopes", type: "string"),
new OA\Property(property: "support_email", type: "string", format: "email"),
new OA\Property(property: "speakers_support_email", type: "string", format: "email"),
new OA\Property(property: "default_ticket_type_currency", type: "string"),
new OA\Property(property: "default_ticket_type_currency_symbol", type: "string"),
new OA\Property(
property: "supported_currencies",
type: "array",
items: new OA\Items(type: "string"),
description: "Array of currency codes"
),
]
)]
class SummitSchema {}