Skip to content

Commit 3d4bcdb

Browse files
Feature | Extend Swagger Coverage for controller OAuth2SummitLocationsApiController (#483)
* feat: Extend Swagger Coverage for controller OAuth2SummitLocationsApiController Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: Rename Not Found and add operationIds Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: Add documentation in trait Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: add operationId Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: fix path for getAllVenuesRooms Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: format security attribute en OpenAPI Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: Add security and X attr inside the trait documentation Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: add operationId in the related trait Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: Add "requestBody" for all the endpoints Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: Add file upload requestBody Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: revert unexpected changes and move OpenAPI docs from trait to controller Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: revert linting to main Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: Fix inconsistencies with HTTP code responses Signed-off-by: Matias Perrone <github@matiasperrone.com> --------- Signed-off-by: Matias Perrone <github@matiasperrone.com> Co-authored-by: Matias Perrone <github@matiasperrone.com>
1 parent 7caa5a9 commit 3d4bcdb

18 files changed

Lines changed: 3626 additions & 32 deletions

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

Lines changed: 2362 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
<?php
22

3-
namespace App\Swagger\schemas;
3+
namespace App\Swagger\Models;
44

55
use OpenApi\Attributes as OA;
66

7-
7+
/**
8+
* Schema for SummitAbstractLocation model
9+
* Base schema for all location types
10+
*/
811
#[OA\Schema(
912
schema: 'SummitAbstractLocation',
1013
type: 'object',
14+
description: 'Base location object for summits',
1115
properties: [
12-
new OA\Property(property: 'id', type: 'integer', example: 1),
13-
new OA\Property(property: 'created', type: 'integer', example: 1),
14-
new OA\Property(property: 'last_edited', type: 'integer', example: 1),
15-
new OA\Property(property: 'name', type: 'string'),
16-
new OA\Property(property: 'short_name', type: 'string'),
17-
new OA\Property(property: 'description', type: 'string'),
18-
new OA\Property(property: 'location_type', type: 'string'),
19-
new OA\Property(property: 'order', type: 'integer'),
20-
new OA\Property(property: 'opening_hour', type: 'integer'),
21-
new OA\Property(property: 'closing_hour', type: 'integer'),
22-
new OA\Property(property: 'class_name', type: 'string'),
23-
new OA\Property(property: 'published_events', type: 'array', items: new OA\Items(type: 'integer'), description: 'Array of published event IDs'),
16+
new OA\Property(property: 'id', type: 'integer', description: 'Unique identifier'),
17+
new OA\Property(property: 'created', type: 'integer', description: 'Creation timestamp (epoch)'),
18+
new OA\Property(property: 'last_edited', type: 'integer', description: 'Last modification timestamp (epoch)'),
19+
new OA\Property(property: 'name', type: 'string', description: 'Location name'),
20+
new OA\Property(property: 'short_name', type: 'string', description: 'Short name for the location'),
21+
new OA\Property(property: 'description', type: 'string', description: 'Location description'),
22+
new OA\Property(property: 'location_type', type: 'string', description: 'Type of location'),
23+
new OA\Property(property: 'order', type: 'integer', description: 'Display order'),
24+
new OA\Property(property: 'opening_hour', type: 'integer', description: 'Opening hour (0-23)'),
25+
new OA\Property(property: 'closing_hour', type: 'integer', description: 'Closing hour (0-23)'),
26+
new OA\Property(property: 'class_name', type: 'string', description: 'Class name identifier'),
27+
new OA\Property(
28+
property: 'published_events',
29+
type: 'array',
30+
items: new OA\Items(type: 'integer'),
31+
description: 'Array of published event IDs at this location'
32+
),
2433
]
2534
)]
26-
class SummitAbstractLocationSchema
27-
{
28-
}
35+
class SummitAbstractLocationSchema {}
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\Models;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
/**
8+
* Schema for SummitAirport model
9+
* Extends SummitExternalLocation with airport-specific properties
10+
*/
11+
#[OA\Schema(
12+
schema: 'SummitAirport',
13+
type: 'object',
14+
description: 'Summit airport',
15+
allOf: [
16+
new OA\Schema(ref: '#/components/schemas/SummitExternalLocation'),
17+
new OA\Schema(
18+
type: 'object',
19+
properties: [
20+
new OA\Property(property: 'airport_type', type: 'string', description: 'Type of airport (Primary, Alternate)'),
21+
]
22+
)
23+
]
24+
)]
25+
class SummitAirportSchema {}

app/Swagger/SummitLocationsAttributeValuesSchemas.php renamed to app/Swagger/Models/SummitBookableVenueRoomAttributeValueExpandedSchema.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@
88
* Schemas for SummitBookableVenueRoomAttributeValue entities
99
*/
1010

11-
#[OA\Schema(
12-
schema: 'SummitBookableVenueRoomAttributeValue',
13-
type: 'object',
14-
properties: [
15-
new OA\Property(property: 'id', type: 'integer', example: 1, description: 'Attribute value ID'),
16-
new OA\Property(property: 'created', type: 'integer', example: 1630500518, description: 'Creation timestamp (Unix)'),
17-
new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518, description: 'Last edit timestamp (Unix)'),
18-
new OA\Property(property: 'value', type: 'string', example: 'Large', description: 'The attribute value text'),
19-
new OA\Property(property: 'type_id', type: 'integer', example: 1, description: 'Associated attribute type ID'),
20-
]
21-
)]
22-
class SummitBookableVenueRoomAttributeValueSchema {}
23-
2411
#[OA\Schema(
2512
schema: 'SummitBookableVenueRoomAttributeValueExpanded',
2613
type: 'object',
@@ -37,3 +24,4 @@ class SummitBookableVenueRoomAttributeValueSchema {}
3724
]
3825
)]
3926
class SummitBookableVenueRoomAttributeValueExpandedSchema {}
27+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Swagger\Models;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
/**
8+
* Schema for SummitBookableVenueRoomAttributeValue model
9+
*/
10+
#[OA\Schema(
11+
schema: 'SummitBookableVenueRoomAttributeValue',
12+
type: 'object',
13+
description: 'Bookable venue room attribute value',
14+
properties: [
15+
new OA\Property(property: 'id', type: 'integer', example: 1, description: 'Attribute value ID'),
16+
new OA\Property(property: 'created', type: 'integer', example: 1630500518, description: 'Creation timestamp (Unix)'),
17+
new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518, description: 'Last edit timestamp (Unix)'),
18+
new OA\Property(property: 'value', type: 'string', example: 'Large', description: 'The attribute value text'),
19+
new OA\Property(property: 'type_id', type: 'integer', example: 1, description: 'Associated attribute type ID'),
20+
]
21+
)]
22+
class SummitBookableVenueRoomAttributeValueSchema {}
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\Models;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
/**
8+
* Schema for SummitBookableVenueRoom model
9+
* Extends SummitVenueRoom with booking-specific properties
10+
*/
11+
#[OA\Schema(
12+
schema: 'SummitBookableVenueRoom',
13+
type: 'object',
14+
description: 'Summit bookable venue room',
15+
allOf: [
16+
new OA\Schema(ref: '#/components/schemas/SummitVenueRoom'),
17+
new OA\Schema(
18+
type: 'object',
19+
properties: [
20+
new OA\Property(property: 'time_slot_cost', type: 'number', format: 'float', description: 'Cost per time slot'),
21+
new OA\Property(property: 'currency', type: 'string', description: 'Currency code (e.g., USD)'),
22+
new OA\Property(
23+
property: 'attribute_values',
24+
type: 'array',
25+
items: new OA\Items(ref: '#/components/schemas/SummitBookableVenueRoomAttributeValue'),
26+
description: 'Attribute values for this room'
27+
),
28+
]
29+
)
30+
]
31+
)]
32+
class SummitBookableVenueRoomSchema {}
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\Models;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
/**
8+
* Schema for SummitExternalLocation model
9+
* Extends SummitGeoLocatedLocation with external location-specific properties
10+
*/
11+
#[OA\Schema(
12+
schema: 'SummitExternalLocation',
13+
type: 'object',
14+
description: 'Summit external location',
15+
allOf: [
16+
new OA\Schema(ref: '#/components/schemas/SummitGeoLocatedLocation'),
17+
new OA\Schema(
18+
type: 'object',
19+
properties: [
20+
new OA\Property(property: 'capacity', type: 'integer', description: 'Location capacity'),
21+
]
22+
)
23+
]
24+
)]
25+
class SummitExternalLocationSchema {}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace App\Swagger\Models;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
/**
8+
* Schema for SummitGeoLocatedLocation model
9+
* Extends SummitAbstractLocation with geographic properties
10+
*/
11+
#[OA\Schema(
12+
schema: 'SummitGeoLocatedLocation',
13+
type: 'object',
14+
description: 'Geo-located summit location with address and coordinates',
15+
allOf: [
16+
new OA\Schema(ref: '#/components/schemas/SummitAbstractLocation'),
17+
new OA\Schema(
18+
type: 'object',
19+
properties: [
20+
new OA\Property(property: 'address_1', type: 'string', description: 'Primary address line'),
21+
new OA\Property(property: 'address_2', type: 'string', description: 'Secondary address line'),
22+
new OA\Property(property: 'zip_code', type: 'string', description: 'ZIP/Postal code'),
23+
new OA\Property(property: 'city', type: 'string', description: 'City name'),
24+
new OA\Property(property: 'state', type: 'string', description: 'State/Province'),
25+
new OA\Property(property: 'country', type: 'string', description: 'Country'),
26+
new OA\Property(property: 'lng', type: 'number', format: 'float', description: 'Longitude coordinate'),
27+
new OA\Property(property: 'lat', type: 'number', format: 'float', description: 'Latitude coordinate'),
28+
new OA\Property(property: 'website_url', type: 'string', format: 'uri', description: 'Website URL'),
29+
new OA\Property(property: 'display_on_site', type: 'boolean', description: 'Whether to display on public site'),
30+
new OA\Property(property: 'details_page', type: 'boolean', description: 'Whether to show details page'),
31+
new OA\Property(property: 'location_message', type: 'string', description: 'Custom message for this location'),
32+
new OA\Property(
33+
property: 'maps',
34+
type: 'array',
35+
items: new OA\Items(type: 'integer'),
36+
description: 'Array of map IDs'
37+
),
38+
new OA\Property(
39+
property: 'images',
40+
type: 'array',
41+
items: new OA\Items(type: 'integer'),
42+
description: 'Array of image IDs'
43+
),
44+
]
45+
)
46+
]
47+
)]
48+
class SummitGeoLocatedLocationSchema {}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Swagger\Models;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
/**
8+
* Schema for SummitHotel model
9+
* Extends SummitExternalLocation with hotel-specific properties
10+
*/
11+
#[OA\Schema(
12+
schema: 'SummitHotel',
13+
type: 'object',
14+
description: 'Summit hotel',
15+
allOf: [
16+
new OA\Schema(ref: '#/components/schemas/SummitExternalLocation'),
17+
new OA\Schema(
18+
type: 'object',
19+
properties: [
20+
new OA\Property(property: 'booking_link', type: 'string', format: 'uri', description: 'Booking URL'),
21+
new OA\Property(property: 'hotel_type', type: 'string', description: 'Type of hotel (Primary, Alternate)'),
22+
new OA\Property(property: 'sold_out', type: 'boolean', description: 'Whether the hotel is sold out'),
23+
]
24+
)
25+
]
26+
)]
27+
class SummitHotelSchema {}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Swagger\Models;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
/**
8+
* Schema for SummitLocationBanner model
9+
*/
10+
#[OA\Schema(
11+
schema: 'SummitLocationBanner',
12+
type: 'object',
13+
description: 'Summit location banner',
14+
properties: [
15+
new OA\Property(property: 'id', type: 'integer', description: 'Unique identifier'),
16+
new OA\Property(property: 'created', type: 'integer', format: 'int64', description: 'Creation timestamp (epoch)'),
17+
new OA\Property(property: 'last_edited', type: 'integer', format: 'int64', description: 'Last modification timestamp (epoch)'),
18+
new OA\Property(property: 'title', type: 'string', description: 'Banner title'),
19+
new OA\Property(property: 'content', type: 'string', description: 'Banner content/message'),
20+
new OA\Property(property: 'type', type: 'string', description: 'Banner type (Primary, Secondary)'),
21+
new OA\Property(property: 'enabled', type: 'boolean', description: 'Whether the banner is enabled'),
22+
new OA\Property(property: 'location_id', type: 'integer', description: 'ID of the parent location'),
23+
new OA\Property(property: 'class_name', type: 'string', description: 'Class type'),
24+
]
25+
)]
26+
class SummitLocationBannerSchema {}

0 commit comments

Comments
 (0)