Skip to content

Commit 5d8ca86

Browse files
committed
chore: Review responses, endpoints verbas and routes, new schemas added and new refs
1 parent cdbd941 commit 5d8ca86

12 files changed

+1157
-394
lines changed

app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSpeakersApiController.php

Lines changed: 791 additions & 218 deletions
Large diffs are not rendered by default.

app/Swagger/CompaniesSchemas.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ class PaginatedCompaniesResponseSchema
2626
{
2727
}
2828

29+
#[OA\Schema(
30+
schema: "PaginatedBaseCompaniesResponse",
31+
description: "Paginated response for Companies (Public View)",
32+
properties: [
33+
new OA\Property(property: "total", type: "integer", example: 100),
34+
new OA\Property(property: "per_page", type: "integer", example: 15),
35+
new OA\Property(property: "current_page", type: "integer", example: 1),
36+
new OA\Property(property: "last_page", type: "integer", example: 7),
37+
new OA\Property(
38+
property: "data",
39+
type: "array",
40+
items: new OA\Items(ref: "#/components/schemas/BaseCompany")
41+
),
42+
],
43+
type: "object"
44+
)]
45+
class PaginatedBaseCompaniesResponseSchema
46+
{
47+
}
48+
2949
#[OA\Schema(
3050
schema: "CompanyCreateRequest",
3151
description: "Request to create a Company",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace App\Swagger\Summit;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'AdminPresentationSpeaker',
9+
type: 'object',
10+
allOf: [
11+
new OA\Schema(ref: '#/components/schemas/SummitPresentationSpeaker'),
12+
new OA\Schema(
13+
type: 'object',
14+
properties: [
15+
new OA\Property(property: 'email', type: 'string', example: 'john@example.com'),
16+
new OA\Property(property: 'summit_assistance', ref: '#/components/schemas/PresentationSpeakerSummitAssistanceConfirmationRequest', description: 'PresentationSpeakerSummitAssistanceConfirmationRequest full object when included in relations'),
17+
new OA\Property(property: 'registration_code', ref: '#/components/schemas/SpeakerSummitRegistrationPromoCode', description: 'SpeakerSummitRegistrationPromoCode full object when included in relations'),
18+
new OA\Property(property: 'all_presentations', type: 'array', items: new OA\Items(type: 'integer'), description: 'Presentations IDs when included in relations, full object when included in ?expand=presentations and relations'),
19+
new OA\Property(property: 'all_moderated_presentations', type: 'array', items: new OA\Items(type: 'integer'), description: 'Moderated Presentations IDs when included in relations, full object when included in ?expand=presentations and relations'),
20+
new OA\Property(property: 'summit_assistances', type: 'array', items: new OA\Items(type: 'object'), description: 'PresentationSpeakerSummitAssistanceConfirmationRequest full objects when included in relations'),
21+
new OA\Property(property: 'registration_codes', type: 'array', items: new OA\Items(type: 'integer'), description: 'SummitRegistrationPromoCode and SummitRegistrationPromoCode IDs when included in relations'),
22+
new OA\Property(property: 'affiliations', type: 'array', items: new OA\Items(type: 'object'), description: 'Affiliation objects when included in relations'),
23+
]
24+
),
25+
],
26+
)]
27+
class AdminPresentationSpeakerSchema
28+
{
29+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
9+
#[OA\Schema(
10+
schema: "BaseCompany",
11+
description: "Company (Public View)",
12+
type: "object",
13+
properties: [
14+
new OA\Property(property: "id", type: "integer", example: 1),
15+
new OA\Property(property: "created", type: "integer", format: "int64", description: "Creation timestamp (epoch)", example: 1234567890),
16+
new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Last edit timestamp (epoch)", example: 1234567890),
17+
new OA\Property(property: "name", type: "string", example: "Acme Corporation"),
18+
new OA\Property(property: "url", type: "string", format: "uri", example: "https://www.acme.com"),
19+
new OA\Property(property: "url_segment", type: "string", example: "acme-corporation"),
20+
new OA\Property(property: "city", type: "string", example: "San Francisco"),
21+
new OA\Property(property: "state", type: "string", example: "California"),
22+
new OA\Property(property: "country", type: "string", example: "United States"),
23+
new OA\Property(property: "description", type: "string", example: "Leading technology company"),
24+
new OA\Property(property: "industry", type: "string", example: "Technology"),
25+
new OA\Property(property: "contributions", type: "string", example: "OpenStack contributions"),
26+
new OA\Property(property: "member_level", type: "string", example: "Platinum"),
27+
new OA\Property(property: "overview", type: "string", example: "Company overview"),
28+
new OA\Property(property: "products", type: "string", example: "Cloud services, Software"),
29+
new OA\Property(property: "commitment", type: "string", example: "Commitment to open source"),
30+
new OA\Property(property: "commitment_author", type: "string", example: "John Doe, CEO"),
31+
new OA\Property(property: "logo", type: "string", format: "uri", example: "https://cdn.example.com/logo.png"),
32+
new OA\Property(property: "big_logo", type: "string", format: "uri", example: "https://cdn.example.com/big_logo.png"),
33+
new OA\Property(property: "color", type: "string", example: "#FF5733"),
34+
],
35+
)]
36+
class BaseCompanySchema
37+
{
38+
}

app/Swagger/Models/CompanySchema.php

Lines changed: 31 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,40 @@
44

55
use OpenApi\Attributes as OA;
66

7-
8-
97
#[OA\Schema(
108
schema: "Company",
119
description: "Company",
12-
properties: [
13-
new OA\Property(property: "id", type: "integer", example: 1),
14-
new OA\Property(property: "created", type: "integer", format: "int64", description: "Creation timestamp (epoch)", example: 1234567890),
15-
new OA\Property(property: "last_edited", type: "integer", format: "int64", description: "Last edit timestamp (epoch)", example: 1234567890),
16-
new OA\Property(property: "name", type: "string", example: "Acme Corporation"),
17-
new OA\Property(property: "url", type: "string", format: "uri", example: "https://www.acme.com"),
18-
new OA\Property(property: "url_segment", type: "string", example: "acme-corporation"),
19-
new OA\Property(property: "city", type: "string", example: "San Francisco"),
20-
new OA\Property(property: "state", type: "string", example: "California"),
21-
new OA\Property(property: "country", type: "string", example: "United States"),
22-
new OA\Property(property: "description", type: "string", example: "Leading technology company"),
23-
new OA\Property(property: "industry", type: "string", example: "Technology"),
24-
new OA\Property(property: "contributions", type: "string", example: "OpenStack contributions"),
25-
new OA\Property(property: "member_level", type: "string", example: "Platinum"),
26-
new OA\Property(property: "overview", type: "string", example: "Company overview"),
27-
new OA\Property(property: "products", type: "string", example: "Cloud services, Software"),
28-
new OA\Property(property: "commitment", type: "string", example: "Commitment to open source"),
29-
new OA\Property(property: "commitment_author", type: "string", example: "John Doe, CEO"),
30-
new OA\Property(property: "logo", type: "string", format: "uri", example: "https://cdn.example.com/logo.png"),
31-
new OA\Property(property: "big_logo", type: "string", format: "uri", example: "https://cdn.example.com/big_logo.png"),
32-
new OA\Property(property: "color", type: "string", example: "#FF5733"),
33-
new OA\Property(property: "display_on_site", type: "boolean", example: true),
34-
new OA\Property(property: "featured", type: "boolean", example: false),
35-
new OA\Property(property: "contact_email", type: "string", format: "email", example: "contact@acme.com"),
36-
new OA\Property(property: "admin_email", type: "string", format: "email", example: "admin@acme.com"),
37-
new OA\Property(
38-
property: "sponsorships",
39-
type: "array",
40-
items: new OA\Items(oneOf: [
41-
new OA\Schema(type: "integer"),
42-
new OA\Schema(ref: "#/components/schemas/SummitSponsorship"),
43-
]),
44-
description: "Array of sponsorship IDs (only when relations=sponsorships)",
45-
),
46-
new OA\Property(
47-
property: "project_sponsorships",
48-
type: "array",
49-
items: new OA\Items(oneOf: [
50-
new OA\Schema(type: "integer"),
51-
new OA\Schema(ref: "#/components/schemas/ProjectSponsorshipType"),
52-
]),
53-
description: "Array of project sponsorship IDs (only when relations=project_sponsorships)",
54-
),
55-
],
56-
type: "object"
10+
type: "object",
11+
allOf: [
12+
new OA\Schema(ref: '#/components/schemas/BaseCompany'),
13+
new OA\Schema(
14+
type: 'object',
15+
properties: [
16+
new OA\Property(property: "display_on_site", type: "boolean", example: true),
17+
new OA\Property(property: "featured", type: "boolean", example: false),
18+
new OA\Property(property: "contact_email", type: "string", format: "email", example: "contact@acme.com"),
19+
new OA\Property(property: "admin_email", type: "string", format: "email", example: "admin@acme.com"),
20+
new OA\Property(
21+
property: "sponsorships",
22+
type: "array",
23+
items: new OA\Items(oneOf: [
24+
new OA\Schema(type: "integer"),
25+
new OA\Schema(ref: "#/components/schemas/SummitSponsorship"),
26+
]),
27+
description: "Array of sponsorship IDs (only when relations=sponsorships), full objects when ?expand=sponsorships",
28+
),
29+
new OA\Property(
30+
property: "project_sponsorships",
31+
type: "array",
32+
items: new OA\Items(oneOf: [
33+
new OA\Schema(type: "integer"),
34+
new OA\Schema(ref: "#/components/schemas/ProjectSponsorshipType"),
35+
]),
36+
description: "Array of project sponsorship IDs (only when relations=project_sponsorships), full objects when ?expand=project_sponsorships",
37+
),
38+
],
39+
)
40+
]
5741
)]
5842
class CompanySchema
5943
{
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'PresentationSpeakerSummitAssistanceConfirmationRequest',
10+
type: 'object',
11+
properties: [
12+
new OA\Property(property: 'id', type: 'integer', example: 1),
13+
new OA\Property(property: 'created', type: 'integer', example: 1, format: "time_epoch"),
14+
new OA\Property(property: 'last_edited', type: 'integer', example: 1, format: "time_epoch"),
15+
new OA\Property(property: 'on_site_phone', type: 'string'),
16+
new OA\Property(property: 'registered', type: 'boolean'),
17+
new OA\Property(property: 'is_confirmed', type: 'boolean'),
18+
new OA\Property(property: 'checked_in', type: 'boolean'),
19+
new OA\Property(property: 'summit_id', type: 'integer'),
20+
new OA\Property(property: 'speaker_email', type: 'string'),
21+
new OA\Property(property: 'speaker_full_name', type: 'string'),
22+
new OA\Property(property: 'speaker_id', type: 'integer'),
23+
new OA\Property(property: 'confirmation_date', type: 'integer', format: 'time_epoch'),
24+
new OA\Property(property: 'speaker', oneOf: [
25+
new OA\Schema(ref: '#/components/schemas/AdminPresentationSpeaker'),
26+
new OA\Schema(ref: '#/components/schemas/SummitPresentationSpeaker')
27+
]),
28+
])
29+
]
30+
class PresentationSpeakerSummitAssistanceConfirmationRequestSchema
31+
{
32+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'SpeakerSummitRegistrationPromoCode',
10+
type: 'object',
11+
properties: [
12+
new OA\Property(property: 'id', type: 'integer', example: 1),
13+
new OA\Property(property: 'created', type: 'integer', example: 1, format: "time_epoch"),
14+
new OA\Property(property: 'last_edited', type: 'integer', example: 1, format: "time_epoch"),
15+
new OA\Property(property: 'code', type: 'string'),
16+
new OA\Property(property: 'redeemed', type: 'boolean'),
17+
new OA\Property(property: 'email_sent', type: 'boolean'),
18+
new OA\Property(property: 'source', type: 'string'),
19+
new OA\Property(property: 'summit_id', type: 'integer'),
20+
new OA\Property(property: 'creator_id', type: 'integer'),
21+
new OA\Property(property: 'quantity_available', type: 'integer'),
22+
new OA\Property(property: 'quantity_used', type: 'integer'),
23+
new OA\Property(property: 'quantity_remaining', type: 'integer'),
24+
new OA\Property(property: 'valid_since_date', type: 'integer', format: "time_epoch"),
25+
new OA\Property(property: 'valid_until_date', type: 'integer', format: "time_epoch"),
26+
new OA\Property(property: 'class_name', type: 'string'),
27+
new OA\Property(property: 'description', type: 'string'),
28+
new OA\Property(property: 'notes', type: 'string'),
29+
new OA\Property(property: 'allows_to_delegate', type: 'boolean'),
30+
new OA\Property(property: 'allows_to_reassign', type: 'boolean'),
31+
// @TODO: add relations and expand of SummitRegistrationPromoCodeSerializer
32+
new OA\Property(property: 'type', type: 'string'),
33+
new OA\Property(property: 'speaker_id', type: 'integer'),
34+
new OA\Property(property: 'owner_name', type: 'string', description: 'Full name of the speaker owner of the promo code, only when expanded'),
35+
new OA\Property(property: 'owner_email', type: 'string', description: 'Email of the speaker owner of the promo code, only when expanded'),
36+
new OA\Property(property: 'speaker', oneOf: [
37+
new OA\Schema(ref: '#/components/schemas/AdminPresentationSpeaker'),
38+
new OA\Schema(ref: '#/components/schemas/SummitPresentationSpeaker')
39+
], description: 'Full Speaker object, only when expanded'),
40+
])
41+
]
42+
class SpeakerSummitRegistrationPromoCodeSchema
43+
{
44+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace App\Swagger\Summit;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SummitPresentationSpeaker',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'created', type: 'integer', example: 1, format: "time_epoch"),
13+
new OA\Property(property: 'last_edited', type: 'integer', example: 1, format: "time_epoch"),
14+
new OA\Property(property: 'first_name', type: 'string', example: 'John'),
15+
new OA\Property(property: 'last_name', type: 'string', example: 'Doe'),
16+
new OA\Property(property: 'title', type: 'string', example: 'Software Engineer'),
17+
new OA\Property(property: 'bio', type: 'string', example: 'Experienced software engineer with 10 years in cloud computing'),
18+
new OA\Property(property: 'email', type: 'string', format: 'email', example: 'john.doe@example.com'),
19+
new OA\Property(property: 'twitter', type: 'string', example: '@johndoe'),
20+
new OA\Property(property: 'irc', type: 'string', example: 'johndoe-irc'),
21+
new OA\Property(property: 'pic', type: 'string', format: 'uri', example: 'https://example.com/photos/johndoe.jpg'),
22+
new OA\Property(property: 'big_pic', type: 'string', format: 'uri'),
23+
new OA\Property(property: 'member_id', type: 'integer', format: 'int64'),
24+
new OA\Property(property: 'registration_request_id', type: 'integer', format: 'int64'),
25+
new OA\Property(property: 'funded_travel', type: 'boolean'),
26+
new OA\Property(property: 'willing_to_travel', type: 'boolean'),
27+
new OA\Property(property: 'willing_to_present_video', type: 'boolean'),
28+
new OA\Property(property: 'org_has_cloud', type: 'boolean'),
29+
new OA\Property(property: 'available_for_bureau', type: 'boolean'),
30+
new OA\Property(property: 'country', type: 'string', example: 'US'),
31+
new OA\Property(property: 'company', type: 'string'),
32+
new OA\Property(property: 'phone_number', type: 'string'),
33+
]
34+
)]
35+
class SummitPresentationSpeakerSchema
36+
{
37+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use App\Security\SummitScopes;
6+
use OpenApi\Attributes as OA;
7+
8+
#[
9+
OA\SecurityScheme(
10+
type: 'oauth2',
11+
securityScheme: 'summit_speakers_oauth2',
12+
flows: [
13+
new OA\Flow(
14+
authorizationUrl: L5_SWAGGER_CONST_AUTH_URL,
15+
tokenUrl: L5_SWAGGER_CONST_TOKEN_URL,
16+
flow: 'authorizationCode',
17+
scopes: [
18+
SummitScopes::ReadSummitData => 'Read Summit Data',
19+
SummitScopes::ReadAllSummitData => 'Read All Summit Data',
20+
SummitScopes::WriteSummitData => 'Write Summit Data',
21+
SummitScopes::ReadSpeakersData => 'Read Speakers Data',
22+
SummitScopes::WriteSpeakersData => 'Write Speakers Data',
23+
SummitScopes::ReadMySpeakersData => 'Read My Speakers Data',
24+
SummitScopes::WriteMySpeakersData => 'Write My Speakers Data',
25+
],
26+
),
27+
],
28+
)
29+
]
30+
class SummitSpeakersAuthSchema {}

0 commit comments

Comments
 (0)