Skip to content

Commit 4b586da

Browse files
feat: Add openapi documentation for SummitAdministratorPermissionGroup
1 parent abbde7c commit 4b586da

3 files changed

Lines changed: 243 additions & 1 deletion

File tree

app/Http/Controllers/Apis/Protected/Main/OAuth2SummitAdministratorPermissionGroupApiController.php

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
use models\utils\IEntity;
2525
use Exception;
2626
use ModelSerializers\SerializerRegistry;
27+
use OpenApi\Attributes as OA;
28+
use Symfony\Component\HttpFoundation\Response;
2729
use utils\Filter;
2830
use utils\FilterElement;
2931

@@ -67,6 +69,55 @@ public function __construct
6769

6870
use GetEntity;
6971

72+
#[OA\Get(
73+
path: "/api/v1/summit-administrator-permission-groups",
74+
summary: "Get all summit administrator permission groups",
75+
security: [["bearer_token" => []]],
76+
tags: ["summit-administrator-permission-groups"],
77+
parameters: [
78+
new OA\Parameter(
79+
name: "page",
80+
description: "Page number",
81+
in: "query",
82+
required: false,
83+
schema: new OA\Schema(type: "integer", default: 1)
84+
),
85+
new OA\Parameter(
86+
name: "per_page",
87+
description: "Items per page",
88+
in: "query",
89+
required: false,
90+
schema: new OA\Schema(type: "integer", default: 10)
91+
),
92+
new OA\Parameter(name: "filter", description: "Filter", in: "query", required: false, schema: new OA\Schema(type: "string")),
93+
new OA\Parameter(name: "order", description: "Order", in: "query", required: false, schema: new OA\Schema(type: "string")),
94+
],
95+
responses: [
96+
new OA\Response(
97+
response: Response::HTTP_OK,
98+
description: "OK",
99+
content: new OA\JsonContent(
100+
allOf: [
101+
new OA\Schema(ref: "#/components/schemas/PaginateDataSchemaResponse"),
102+
new OA\Schema(
103+
type: "object",
104+
properties: [
105+
new OA\Property(
106+
property: "data",
107+
type: "array",
108+
items: new OA\Items(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
109+
)
110+
]
111+
)
112+
]
113+
)
114+
),
115+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),
116+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
117+
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
118+
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"),
119+
]
120+
)]
70121
function getAll()
71122
{
72123
return $this->_getAll(
@@ -163,6 +214,29 @@ protected function updateEntity($id, array $payload): IEntity
163214
return $this->service->update($id, $payload);
164215
}
165216

217+
#[OA\Put(
218+
path: "/api/v1/summit-administrator-permission-groups/{id}/members/{member_id}",
219+
summary: "Add member to permission group",
220+
security: [["bearer_token" => []]],
221+
tags: ["summit-administrator-permission-groups"],
222+
parameters: [
223+
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
224+
new OA\Parameter(name: "member_id", description: "Member ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
225+
],
226+
responses: [
227+
new OA\Response(
228+
response: Response::HTTP_OK,
229+
description: "OK",
230+
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
231+
),
232+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),
233+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
234+
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
235+
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"),
236+
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
237+
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"),
238+
]
239+
)]
166240
public function addMember($id, $member_id)
167241
{
168242
try {
@@ -189,6 +263,29 @@ public function addMember($id, $member_id)
189263
}
190264
}
191265

266+
#[OA\Delete(
267+
path: "/api/v1/summit-administrator-permission-groups/{id}/members/{member_id}",
268+
summary: "Remove member from permission group",
269+
security: [["bearer_token" => []]],
270+
tags: ["summit-administrator-permission-groups"],
271+
parameters: [
272+
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
273+
new OA\Parameter(name: "member_id", description: "Member ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
274+
],
275+
responses: [
276+
new OA\Response(
277+
response: Response::HTTP_OK,
278+
description: "OK",
279+
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
280+
),
281+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),
282+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
283+
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
284+
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"),
285+
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
286+
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"),
287+
]
288+
)]
192289
public function removeMember($id, $member_id)
193290
{
194291
try {
@@ -215,6 +312,29 @@ public function removeMember($id, $member_id)
215312
}
216313
}
217314

315+
#[OA\Put(
316+
path: "/api/v1/summit-administrator-permission-groups/{id}/summits/{summit_id}",
317+
summary: "Add summit to permission group",
318+
security: [["bearer_token" => []]],
319+
tags: ["summit-administrator-permission-groups"],
320+
parameters: [
321+
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
322+
new OA\Parameter(name: "summit_id", description: "Summit ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
323+
],
324+
responses: [
325+
new OA\Response(
326+
response: Response::HTTP_OK,
327+
description: "OK",
328+
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
329+
),
330+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),
331+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
332+
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
333+
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"),
334+
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
335+
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"),
336+
]
337+
)]
218338
public function addSummit($id, $summit_id)
219339
{
220340
try {
@@ -241,6 +361,29 @@ public function addSummit($id, $summit_id)
241361
}
242362
}
243363

364+
#[OA\Delete(
365+
path: "/api/v1/summit-administrator-permission-groups/{id}/summits/{summit_id}",
366+
summary: "Remove summit from permission group",
367+
security: [["bearer_token" => []]],
368+
tags: ["summit-administrator-permission-groups"],
369+
parameters: [
370+
new OA\Parameter(name: "id", description: "Permission Group ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
371+
new OA\Parameter(name: "summit_id", description: "Summit ID", in: "path", required: true, schema: new OA\Schema(type: "integer")),
372+
],
373+
responses: [
374+
new OA\Response(
375+
response: Response::HTTP_OK,
376+
description: "OK",
377+
content: new OA\JsonContent(ref: "#/components/schemas/SummitAdministratorPermissionGroup")
378+
),
379+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"),
380+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
381+
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
382+
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "not found"),
383+
new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"),
384+
new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"),
385+
]
386+
)]
244387
public function removeSummit($id, $summit_id)
245388
{
246389
try {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
namespace App\Swagger\schemas;
3+
4+
use OpenApi\Attributes as OA;
5+
6+
#[OA\Schema(
7+
schema: "SummitAdministratorPermissionGroup",
8+
type: "object",
9+
properties: [
10+
new OA\Property(property: "id", type: "integer"),
11+
new OA\Property(property: "title", type: "string"),
12+
new OA\Property(property: "created", type: "integer"),
13+
new OA\Property(property: "last_edited", type: "integer"),
14+
new OA\Property(
15+
property: "members",
16+
description: "Array of member IDs. Use expand=members to get full Member objects",
17+
oneOf: [
18+
new OA\Schema(type: "array", items: new OA\Items(type: "integer")),
19+
new OA\Schema(type: "array", items: new OA\Items(ref: "#/components/schemas/Member"))
20+
]
21+
),
22+
new OA\Property(
23+
property: "summits",
24+
description: "Array of summit IDs. Use expand=summits to get full Summit objects",
25+
oneOf: [
26+
new OA\Schema(type: "array", items: new OA\Items(type: "integer")),
27+
new OA\Schema(type: "array", items: new OA\Items(ref: "#/components/schemas/Summit"))
28+
]
29+
),
30+
]
31+
)]
32+
class SummitAdministratorPermissionGroupSchemas
33+
{
34+
}
35+

app/Swagger/SummitSchemas.php

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,68 @@
44

55
use OpenApi\Attributes as OA;
66

7-
//
7+
#[OA\Schema(
8+
schema: "Summit",
9+
type: "object",
10+
properties: [
11+
new OA\Property(property: "id", type: "integer"),
12+
new OA\Property(property: "created", type: "integer"),
13+
new OA\Property(property: "last_edited", type: "integer"),
14+
new OA\Property(property: "name", type: "string"),
15+
new OA\Property(property: "slug", type: "string"),
16+
new OA\Property(property: "start_date", type: "integer", description: "Unix timestamp"),
17+
new OA\Property(property: "end_date", type: "integer", description: "Unix timestamp"),
18+
new OA\Property(property: "registration_begin_date", type: "integer", description: "Unix timestamp"),
19+
new OA\Property(property: "registration_end_date", type: "integer", description: "Unix timestamp"),
20+
new OA\Property(property: "start_showing_venues_date", type: "integer", description: "Unix timestamp"),
21+
new OA\Property(property: "schedule_start_date", type: "integer", description: "Unix timestamp"),
22+
new OA\Property(property: "active", type: "boolean"),
23+
new OA\Property(property: "type_id", type: "integer"),
24+
new OA\Property(property: "dates_label", type: "string"),
25+
new OA\Property(property: "max_submission_allowed_per_user", type: "integer"),
26+
new OA\Property(property: "published_events_count", type: "integer"),
27+
new OA\Property(property: "time_zone_id", type: "string"),
28+
new OA\Property(property: "time_zone_label", type: "string"),
29+
new OA\Property(property: "invite_only_registration", type: "boolean"),
30+
new OA\Property(property: "meeting_room_booking_start_time", type: "integer", description: "Unix timestamp"),
31+
new OA\Property(property: "meeting_room_booking_end_time", type: "integer", description: "Unix timestamp"),
32+
new OA\Property(property: "meeting_room_booking_slot_length", type: "integer"),
33+
new OA\Property(property: "meeting_room_booking_max_allowed", type: "integer"),
34+
new OA\Property(property: "begin_allow_booking_date", type: "integer", description: "Unix timestamp"),
35+
new OA\Property(property: "end_allow_booking_date", type: "integer", description: "Unix timestamp"),
36+
new OA\Property(property: "logo", type: "string", format: "url"),
37+
new OA\Property(property: "secondary_logo", type: "string", format: "url"),
38+
new OA\Property(property: "reassign_ticket_till_date", type: "integer", description: "Unix timestamp"),
39+
new OA\Property(property: "registration_disclaimer_content", type: "string"),
40+
new OA\Property(property: "registration_disclaimer_mandatory", type: "boolean"),
41+
new OA\Property(property: "registration_reminder_email_days_interval", type: "integer"),
42+
new OA\Property(property: "registration_link", type: "string", format: "url"),
43+
new OA\Property(property: "secondary_registration_link", type: "string", format: "url"),
44+
new OA\Property(property: "secondary_registration_label", type: "string"),
45+
new OA\Property(property: "registration_send_qr_as_image_attachment_on_ticket_email", type: "boolean"),
46+
new OA\Property(property: "registration_send_ticket_as_pdf_attachment_on_ticket_email", type: "boolean"),
47+
new OA\Property(property: "registration_send_ticket_email_automatically", type: "boolean"),
48+
new OA\Property(property: "registration_send_order_email_automatically", type: "boolean"),
49+
new OA\Property(property: "registration_allow_automatic_reminder_emails", type: "boolean"),
50+
new OA\Property(property: "registration_allowed_refund_request_till_date", type: "integer", description: "Unix timestamp"),
51+
new OA\Property(property: "registration_slug_prefix", type: "string"),
52+
new OA\Property(property: "modality", type: "string"),
53+
new OA\Property(property: "allow_update_attendee_extra_questions", type: "boolean"),
54+
new OA\Property(property: "default_page_url", type: "string"),
55+
new OA\Property(property: "speaker_confirmation_default_page_url", type: "string"),
56+
new OA\Property(property: "virtual_site_url", type: "string"),
57+
new OA\Property(property: "marketing_site_url", type: "string"),
58+
new OA\Property(property: "marketing_site_oauth2_client_scopes", type: "string"),
59+
new OA\Property(property: "support_email", type: "string", format: "email"),
60+
new OA\Property(property: "speakers_support_email", type: "string", format: "email"),
61+
new OA\Property(property: "default_ticket_type_currency", type: "string"),
62+
new OA\Property(property: "default_ticket_type_currency_symbol", type: "string"),
63+
new OA\Property(
64+
property: "supported_currencies",
65+
type: "array",
66+
items: new OA\Items(type: "string"),
67+
description: "Array of currency codes"
68+
),
69+
]
70+
)]
71+
class SummitSchema {}

0 commit comments

Comments
 (0)