Skip to content

Commit 9b2f2af

Browse files
andrestejerina97matiasperrone
authored andcommitted
feat: Extend Swagger Coverage for controller OAuth2SummitSponsorApiController
1 parent ca920e2 commit 9b2f2af

11 files changed

Lines changed: 2707 additions & 1 deletion

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

Lines changed: 2314 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'ExtraQuestionTypeValue',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'value', type: 'string', example: 'Option 1'),
13+
new OA\Property(property: 'order', type: 'integer', example: 1),
14+
]
15+
)]
16+
class ExtraQuestionTypeValueSchema {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorAd',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'text', type: 'string', example: 'Ad text'),
14+
new OA\Property(property: 'alt', type: 'string', example: 'Alt text for image'),
15+
new OA\Property(property: 'link', type: 'string', example: 'https://example.com'),
16+
new OA\Property(property: 'order', type: 'integer', example: 1),
17+
new OA\Property(property: 'image', ref: '#/components/schemas/File', nullable: true),
18+
]
19+
)]
20+
class SponsorAdSchema {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorMaterial',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'type', type: 'string', example: 'Presentation', enum: ['Presentation', 'Demo', 'Handout', 'Other']),
14+
new OA\Property(property: 'name', type: 'string', example: 'Material Name'),
15+
new OA\Property(property: 'description', type: 'string', example: 'Material description', nullable: true),
16+
new OA\Property(property: 'order', type: 'integer', example: 1),
17+
new OA\Property(property: 'file', ref: '#/components/schemas/File', nullable: true),
18+
]
19+
)]
20+
class SponsorMaterialSchema {}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'Sponsor',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'company_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'sponsorship_type_id', type: 'integer', example: 1),
14+
new OA\Property(property: 'order', type: 'integer', example: 1),
15+
new OA\Property(property: 'badge_scans_count', type: 'integer', example: 0),
16+
new OA\Property(property: 'links_count', type: 'integer', example: 0),
17+
new OA\Property(property: 'company', type: 'object', description: 'Company object'),
18+
new OA\Property(property: 'sponsorship', type: 'object', description: 'Sponsorship object'),
19+
new OA\Property(property: 'is_published', type: 'boolean', example: true),
20+
new OA\Property(property: 'sponsorships', type: 'array', items: new OA\Items(type: 'object'), nullable: true),
21+
]
22+
)]
23+
class SponsorSchema {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorSocialNetwork',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'link', type: 'string', example: 'https://twitter.com/example'),
14+
new OA\Property(property: 'enabled', type: 'boolean', example: true),
15+
new OA\Property(property: 'icon_css_class', type: 'string', example: 'fab fa-twitter'),
16+
]
17+
)]
18+
class SponsorSocialNetworkSchema {}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SummitLeadReportSetting',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(
14+
property: 'columns',
15+
type: 'array',
16+
items: new OA\Items(type: 'string', example: 'first_name'),
17+
description: 'Array of column names'
18+
),
19+
]
20+
)]
21+
class SummitLeadReportSettingSchema {}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SummitSponsorExtraQuestionType',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'type', type: 'string', example: 'TEXT', enum: ['TEXT', 'CHECKBOX', 'RADIO_BUTTON', 'DROP_DOWN']),
14+
new OA\Property(property: 'label', type: 'string', example: 'Question Label'),
15+
new OA\Property(property: 'mandatory', type: 'boolean', example: false),
16+
new OA\Property(property: 'order', type: 'integer', example: 1),
17+
new OA\Property(
18+
property: 'values',
19+
type: 'array',
20+
items: new OA\Items(ref: '#/components/schemas/ExtraQuestionTypeValue'),
21+
nullable: true
22+
),
23+
]
24+
)]
25+
class SummitSponsorExtraQuestionTypeSchema {}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use App\Security\SummitScopes;
6+
use OpenApi\Attributes as OA;
7+
8+
#[OA\SecurityScheme(
9+
type: 'oauth2',
10+
securityScheme: 'summit_sponsor_oauth2',
11+
flows: [
12+
new OA\Flow(
13+
authorizationUrl: L5_SWAGGER_CONST_AUTH_URL,
14+
tokenUrl: L5_SWAGGER_CONST_TOKEN_URL,
15+
flow: 'authorizationCode',
16+
scopes: [
17+
SummitScopes::ReadSummitData => 'Read Summit Sponsor Data',
18+
SummitScopes::ReadAllSummitData => 'Read All Summit Sponsor Data',
19+
SummitScopes::WriteSummitData => 'Write Summit Sponsor Data',
20+
],
21+
),
22+
],
23+
)
24+
]
25+
class SponsorOAuth2Schema {}

0 commit comments

Comments
 (0)