From 71c1decf2f2be1404f77eda0eb39684c146bb9ba Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 9 Oct 2025 15:20:20 -0300 Subject: [PATCH 1/9] feat: Extend Swagger Coverage for controller `OAuth2SummitTaxTypeApiController` --- .../OAuth2SummitTaxTypeApiController.php | 191 +++++++++++++++++- app/Swagger/SummitRegistrationSchemas.php | 167 ++++++++++++++- 2 files changed, 350 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php index 6739d3ee6..655bbb408 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php @@ -21,7 +21,9 @@ use models\utils\IBaseRepository; use models\utils\IEntity; use ModelSerializers\SerializerRegistry; +use Illuminate\Http\Response; use Illuminate\Support\Facades\Log; +use OpenApi\Attributes as OA; use Exception; /** * Class OAuth2SummitTaxTypeApiController @@ -49,6 +51,145 @@ final class OAuth2SummitTaxTypeApiController extends OAuth2ProtectedController use DeleteSummitChildElement; + #[OA\Get( + path: '/api/v1/summits/{id}/tax-types', + summary: 'Get all tax types for a summit', + security: [['OAuth2' => ['openid', 'profile', 'email']]], + tags: ['Summits', 'Tax Types'], + parameters: [ + new OA\Parameter(ref: '#/components/parameters/page'), + new OA\Parameter(ref: '#/components/parameters/per_page'), + new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'filter', in: 'query', description: 'Filter by name (name=@value, name==value)', schema: new OA\Schema(type: 'string')), + new OA\Parameter(name: 'order', in: 'query', description: 'Order by: +/-id, +/-name', schema: new OA\Schema(type: 'string')), + new OA\Parameter(name: 'relations', in: 'query', description: 'Relations to include: ticket_types', schema: new OA\Schema(type: 'string')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'Successful response', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedSummitTaxTypesResponse') + ), + 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_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] + public function getAllBySummit($summit_id){ + return parent::getAllBySummit($summit_id); + } + + #[OA\Post( + path: '/api/v1/summits/{id}/tax-types', + summary: 'Create a new tax type', + security: [['OAuth2' => ['openid', 'profile', 'email']]], + tags: ['Summits', 'Tax Types'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/SummitTaxTypeCreateRequest') + ), + responses: [ + new OA\Response( + response: Response::HTTP_CREATED, + description: 'Tax type created', + content: new OA\JsonContent(ref: '#/components/schemas/SummitTaxType') + ), + 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 add($summit_id){ + return parent::add($summit_id); + } + + #[OA\Get( + path: '/api/v1/summits/{id}/tax-types/{tax_id}', + summary: 'Get a tax type by ID', + security: [['OAuth2' => ['openid', 'profile', 'email']]], + tags: ['Summits', 'Tax Types'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'Successful response', + content: new OA\JsonContent(ref: '#/components/schemas/SummitTaxType') + ), + 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_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] + public function get($summit_id, $tax_id){ + return parent::get($summit_id, $tax_id); + } + + #[OA\Put( + path: '/api/v1/summits/{id}/tax-types/{tax_id}', + summary: 'Update a tax type', + security: [['OAuth2' => ['openid', 'profile', 'email']]], + tags: ['Summits', 'Tax Types'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/SummitTaxTypeUpdateRequest') + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'Tax type updated', + content: new OA\JsonContent(ref: '#/components/schemas/SummitTaxType') + ), + 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 update($summit_id, $tax_id){ + return parent::update($summit_id, $tax_id); + } + + #[OA\Delete( + path: '/api/v1/summits/{id}/tax-types/{tax_id}', + summary: 'Delete a tax type', + security: [['OAuth2' => ['openid', 'profile', 'email']]], + tags: ['Summits', 'Tax Types'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: "No Content"), + 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_INTERNAL_SERVER_ERROR, description: "Server Error"), + ] + )] + public function delete($summit_id, $tax_id){ + return parent::delete($summit_id, $tax_id); + } + /** * @return array */ @@ -163,6 +304,30 @@ protected function deleteChild(Summit $summit, $child_id): void * @param $ticket_type_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Put( + path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', + summary: 'Add a tax type to a ticket type', + security: [['OAuth2' => ['openid', 'profile', 'email']]], + tags: ['Summits', 'Tax Types'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'ticket_type_id', in: 'path', required: true, description: 'Ticket Type ID', schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'Tax type added to ticket type successfully', + content: new OA\JsonContent(ref: '#/components/schemas/SummitTaxType') + ), + 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 addTaxToTicketType($summit_id, $tax_id, $ticket_type_id){ try { @@ -193,6 +358,30 @@ public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id){ * @param $ticket_type_id * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Delete( + path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', + summary: 'Remove a tax type from a ticket type', + security: [['OAuth2' => ['openid', 'profile', 'email']]], + tags: ['Summits', 'Tax Types'], + parameters: [ + new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), + new OA\Parameter(name: 'ticket_type_id', in: 'path', required: true, description: 'Ticket Type ID', schema: new OA\Schema(type: 'integer')), + ], + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: 'Tax type removed from ticket type successfully', + content: new OA\JsonContent(ref: '#/components/schemas/SummitTaxType') + ), + 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 removeTaxFromTicketType($summit_id, $tax_id, $ticket_type_id){ try { @@ -216,4 +405,4 @@ public function removeTaxFromTicketType($summit_id, $tax_id, $ticket_type_id){ return $this->error500($ex); } } -} \ No newline at end of file +} diff --git a/app/Swagger/SummitRegistrationSchemas.php b/app/Swagger/SummitRegistrationSchemas.php index 2d2860b2a..e93d6f03d 100644 --- a/app/Swagger/SummitRegistrationSchemas.php +++ b/app/Swagger/SummitRegistrationSchemas.php @@ -4,6 +4,81 @@ use OpenApi\Attributes as OA; + +#[OA\Schema( + schema: 'SummitTaxType', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', example: 1630500518), + new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518), + new OA\Property(property: 'name', type: 'string', example: 'VAT'), + new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001', nullable: true), + new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0), + new OA\Property(property: 'summit_id', type: 'integer', example: 42), + new OA\Property( + property: 'ticket_types', + type: 'array', + items: new OA\Items(oneOf: [ + new OA\Schema(type: 'integer'), + new OA\Schema(type: 'SummitTicketType') + ]), + example: [1, 2, 3], + description: 'Array of ticket type IDs or its Model (only present when relations=ticket_types), expanded when expand includes ticket_types.' + ), + ] +)] +class SummitTaxTypeSchema +{ +} + +#[OA\Schema( + schema: 'PaginatedSummitTaxTypesResponse', + 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/SummitTaxType') + ) + ] + ) + ] +)] +class PaginatedSummitTaxTypesResponseSchema +{ +} + +#[OA\Schema( + schema: 'SummitTaxTypeCreateRequest', + type: 'object', + required: ['name', 'rate'], + properties: [ + new OA\Property(property: 'name', type: 'string', example: 'VAT'), + new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001'), + new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0, description: 'Rate must be greater than 0'), + ] +)] +class SummitTaxTypeCreateRequestSchema +{ +} + +#[OA\Schema( + schema: 'SummitTaxTypeUpdateRequest', + type: 'object', + properties: [ + new OA\Property(property: 'name', type: 'string', example: 'VAT'), + new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001'), + new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0, description: 'Rate must be greater than 0'), + ] +)] +class SummitTaxTypeUpdateRequestSchema +{ +} + // Badge Types #[OA\Schema( @@ -22,7 +97,7 @@ ) ] )] -class PaginatedSummitBadgeTypesResponse +class PaginatedSummitBadgeTypesResponseSchema { } @@ -38,7 +113,7 @@ class PaginatedSummitBadgeTypesResponse new OA\Property(property: "is_default", type: "boolean", example: false), ] )] -class SummitBadgeTypeCreateRequest +class SummitBadgeTypeCreateRequestSchema { } @@ -53,11 +128,83 @@ class SummitBadgeTypeCreateRequest new OA\Property(property: "is_default", type: "boolean", nullable: true, example: false), ] )] -class SummitBadgeTypeUpdateRequest +class SummitBadgeTypeUpdateRequestSchema +{ +} + +#[OA\Schema( + schema: 'SummitTaxType', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', example: 1630500518), + new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518), + new OA\Property(property: 'name', type: 'string', example: 'VAT'), + new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001', nullable: true), + new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0), + new OA\Property(property: 'summit_id', type: 'integer', example: 42), + new OA\Property( + property: 'ticket_types', + type: 'array', + items: new OA\Items(oneOf: [ + new OA\Schema(type: 'integer'), + new OA\Schema(type: 'SummitTicketType') + ]), + example: [1, 2, 3], + description: 'Array of ticket type IDs or its Model (only present when relations=ticket_types), expanded when expand includes ticket_types.' + ), + ] +)] +class SummitTaxTypeSchema +{ +} + +#[OA\Schema( + schema: 'PaginatedSummitTaxTypesResponse', + 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/SummitTaxType') + ) + ] + ) + ] +)] +class PaginatedSummitTaxTypesResponseSchema { } -// +#[OA\Schema( + schema: 'SummitTaxTypeCreateRequest', + type: 'object', + required: ['name', 'rate'], + properties: [ + new OA\Property(property: 'name', type: 'string', example: 'VAT'), + new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001'), + new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0, description: 'Rate must be greater than 0'), + ] +)] +class SummitTaxTypeCreateRequestSchema +{ +} + +#[OA\Schema( + schema: 'SummitTaxTypeUpdateRequest', + type: 'object', + properties: [ + new OA\Property(property: 'name', type: 'string', example: 'VAT'), + new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001'), + new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0, description: 'Rate must be greater than 0'), + ] +)] +class SummitTaxTypeUpdateRequestSchema +{ +} // Summit Badge Feature Types @@ -77,7 +224,9 @@ class SummitBadgeTypeUpdateRequest ) ] )] -class PaginatedSummitBadgeFeatureTypesResponseSchema {} +class PaginatedSummitBadgeFeatureTypesResponseSchema +{ +} #[OA\Schema( schema: 'SummitBadgeFeatureTypeCreateRequest', @@ -89,7 +238,9 @@ class PaginatedSummitBadgeFeatureTypesResponseSchema {} new OA\Property(property: 'template_content', type: 'string', example: '
{{name}}
'), ] )] -class SummitBadgeFeatureTypeCreateRequestSchema {} +class SummitBadgeFeatureTypeCreateRequestSchema +{ +} #[OA\Schema( schema: 'SummitBadgeFeatureTypeUpdateRequest', @@ -100,4 +251,6 @@ class SummitBadgeFeatureTypeCreateRequestSchema {} new OA\Property(property: 'template_content', type: 'string', example: '
{{name}}
'), ] )] -class SummitBadgeFeatureTypeUpdateRequestSchema {} +class SummitBadgeFeatureTypeUpdateRequestSchema +{ +} From 795dba1d8f830b164a9d427258d24e6f751a4912 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 14 Oct 2025 14:50:03 -0300 Subject: [PATCH 2/9] fix: Change "namespace" word positioning --- .../Protected/Summit/OAuth2SummitTaxTypeApiController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php index 655bbb408..508113665 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php @@ -1,4 +1,7 @@ - Date: Thu, 13 Nov 2025 21:07:05 +0000 Subject: [PATCH 3/9] feat: Extend Swagger Coverage for controller `OAuth2SummitPresentationActionTypeApiController` --- .../OAuth2SummitTaxTypeApiController.php | 80 +++++++++++++++++-- app/Swagger/Security/TaxTypesAuthSchema.php | 26 ++++++ 2 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 app/Swagger/Security/TaxTypesAuthSchema.php diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php index 508113665..a7829035f 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ +use App\Models\Foundation\Main\IGroup; use App\Models\Foundation\Summit\Repositories\ISummitTaxTypeRepository; +use App\Security\SummitScopes; use App\Services\Model\ISummitTaxTypeService; use models\exceptions\EntityNotFoundException; use models\exceptions\ValidationException; @@ -57,7 +59,10 @@ final class OAuth2SummitTaxTypeApiController extends OAuth2ProtectedController #[OA\Get( path: '/api/v1/summits/{id}/tax-types', summary: 'Get all tax types for a summit', - security: [['OAuth2' => ['openid', 'profile', 'email']]], + security: [['tax_types_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], tags: ['Summits', 'Tax Types'], parameters: [ new OA\Parameter(ref: '#/components/parameters/page'), @@ -87,7 +92,17 @@ public function getAllBySummit($summit_id){ #[OA\Post( path: '/api/v1/summits/{id}/tax-types', summary: 'Create a new tax type', - security: [['OAuth2' => ['openid', 'profile', 'email']]], + security: [['tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], tags: ['Summits', 'Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), @@ -117,7 +132,18 @@ public function add($summit_id){ #[OA\Get( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Get a tax type by ID', - security: [['OAuth2' => ['openid', 'profile', 'email']]], + security: [['tax_types_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], tags: ['Summits', 'Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), @@ -143,7 +169,17 @@ public function get($summit_id, $tax_id){ #[OA\Put( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Update a tax type', - security: [['OAuth2' => ['openid', 'profile', 'email']]], + security: [['tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], tags: ['Summits', 'Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), @@ -174,7 +210,17 @@ public function update($summit_id, $tax_id){ #[OA\Delete( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Delete a tax type', - security: [['OAuth2' => ['openid', 'profile', 'email']]], + security: [['tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], tags: ['Summits', 'Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), @@ -310,7 +356,17 @@ protected function deleteChild(Summit $summit, $child_id): void #[OA\Put( path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', summary: 'Add a tax type to a ticket type', - security: [['OAuth2' => ['openid', 'profile', 'email']]], + security: [['tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], tags: ['Summits', 'Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), @@ -364,7 +420,17 @@ public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id){ #[OA\Delete( path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', summary: 'Remove a tax type from a ticket type', - security: [['OAuth2' => ['openid', 'profile', 'email']]], + security: [['tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + IGroup::SummitRegistrationAdmins, + ] + ], tags: ['Summits', 'Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), diff --git a/app/Swagger/Security/TaxTypesAuthSchema.php b/app/Swagger/Security/TaxTypesAuthSchema.php new file mode 100644 index 000000000..6a3363b6e --- /dev/null +++ b/app/Swagger/Security/TaxTypesAuthSchema.php @@ -0,0 +1,26 @@ + 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], + ) +] +class TaxTypesAuthSchema{} From 75c238253c0ae23a3abeea0e90276796e165473f Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 13 Nov 2025 21:10:34 +0000 Subject: [PATCH 4/9] fix: Tag name --- .../Summit/OAuth2SummitTaxTypeApiController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php index a7829035f..c61f0ed3a 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php @@ -63,7 +63,7 @@ final class OAuth2SummitTaxTypeApiController extends OAuth2ProtectedController SummitScopes::ReadSummitData, SummitScopes::ReadAllSummitData, ]]], - tags: ['Summits', 'Tax Types'], + tags: ['Summits Tax Types'], parameters: [ new OA\Parameter(ref: '#/components/parameters/page'), new OA\Parameter(ref: '#/components/parameters/per_page'), @@ -103,7 +103,7 @@ public function getAllBySummit($summit_id){ IGroup::SummitRegistrationAdmins, ] ], - tags: ['Summits', 'Tax Types'], + tags: ['Summits Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), ], @@ -144,7 +144,7 @@ public function add($summit_id){ IGroup::SummitRegistrationAdmins, ] ], - tags: ['Summits', 'Tax Types'], + tags: ['Summits Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), @@ -180,7 +180,7 @@ public function get($summit_id, $tax_id){ IGroup::SummitRegistrationAdmins, ] ], - tags: ['Summits', 'Tax Types'], + tags: ['Summits Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), @@ -221,7 +221,7 @@ public function update($summit_id, $tax_id){ IGroup::SummitRegistrationAdmins, ] ], - tags: ['Summits', 'Tax Types'], + tags: ['Summits Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), @@ -367,7 +367,7 @@ protected function deleteChild(Summit $summit, $child_id): void IGroup::SummitRegistrationAdmins, ] ], - tags: ['Summits', 'Tax Types'], + tags: ['Summits Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), @@ -431,7 +431,7 @@ public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id){ IGroup::SummitRegistrationAdmins, ] ], - tags: ['Summits', 'Tax Types'], + tags: ['Summits Tax Types'], parameters: [ new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), new OA\Parameter(name: 'tax_id', in: 'path', required: true, description: 'Tax Type ID', schema: new OA\Schema(type: 'integer')), From b58e49a9a5e5b55abcfdd2faabe60ef60d4ccd4d Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Mon, 24 Nov 2025 14:49:56 +0000 Subject: [PATCH 5/9] chore: add description for complex expand models. Fix issues on params --- .../OAuth2SummitTaxTypeApiController.php | 153 +++++++++++------- app/Swagger/Models/SummitTaxTypeSchema.php | 33 ++++ app/Swagger/Models/SummitTicketTypeSchema.php | 42 +++++ app/Swagger/SummitRegistrationSchemas.php | 30 +--- 4 files changed, 174 insertions(+), 84 deletions(-) create mode 100644 app/Swagger/Models/SummitTaxTypeSchema.php create mode 100644 app/Swagger/Models/SummitTicketTypeSchema.php diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php index c61f0ed3a..72bbab670 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php @@ -59,14 +59,31 @@ final class OAuth2SummitTaxTypeApiController extends OAuth2ProtectedController #[OA\Get( path: '/api/v1/summits/{id}/tax-types', summary: 'Get all tax types for a summit', - security: [['tax_types_oauth2' => [ - SummitScopes::ReadSummitData, - SummitScopes::ReadAllSummitData, - ]]], + security: [ + [ + 'tax_types_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ] + ] + ], tags: ['Summits Tax Types'], parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/per_page'), + + new OA\Parameter( + name: 'page', + in: 'query', + required: false, + description: 'Page number for pagination', + schema: new OA\Schema(type: 'integer', example: 1) + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + description: 'Items per page', + schema: new OA\Schema(type: 'integer', example: 10, maximum: 100) + ), new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'integer')), new OA\Parameter(name: 'filter', in: 'query', description: 'Filter by name (name=@value, name==value)', schema: new OA\Schema(type: 'string')), new OA\Parameter(name: 'order', in: 'query', description: 'Order by: +/-id, +/-name', schema: new OA\Schema(type: 'string')), @@ -85,16 +102,21 @@ final class OAuth2SummitTaxTypeApiController extends OAuth2ProtectedController new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), ] )] - public function getAllBySummit($summit_id){ + public function getAllBySummit($summit_id) + { return parent::getAllBySummit($summit_id); } #[OA\Post( path: '/api/v1/summits/{id}/tax-types', summary: 'Create a new tax type', - security: [['tax_types_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], + security: [ + [ + 'tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ] + ] + ], x: [ 'required-groups' => [ IGroup::SuperAdmins, @@ -125,17 +147,22 @@ public function getAllBySummit($summit_id){ new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), ] )] - public function add($summit_id){ + public function add($summit_id) + { return parent::add($summit_id); } #[OA\Get( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Get a tax type by ID', - security: [['tax_types_oauth2' => [ - SummitScopes::ReadSummitData, - SummitScopes::ReadAllSummitData, - ]]], + security: [ + [ + 'tax_types_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ] + ] + ], x: [ 'required-groups' => [ IGroup::SuperAdmins, @@ -162,16 +189,21 @@ public function add($summit_id){ new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), ] )] - public function get($summit_id, $tax_id){ + public function get($summit_id, $tax_id) + { return parent::get($summit_id, $tax_id); } #[OA\Put( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Update a tax type', - security: [['tax_types_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], + security: [ + [ + 'tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ] + ] + ], x: [ 'required-groups' => [ IGroup::SuperAdmins, @@ -203,16 +235,21 @@ public function get($summit_id, $tax_id){ new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), ] )] - public function update($summit_id, $tax_id){ + public function update($summit_id, $tax_id) + { return parent::update($summit_id, $tax_id); } #[OA\Delete( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Delete a tax type', - security: [['tax_types_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], + security: [ + [ + 'tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ] + ] + ], x: [ 'required-groups' => [ IGroup::SuperAdmins, @@ -235,14 +272,15 @@ public function update($summit_id, $tax_id){ new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), ] )] - public function delete($summit_id, $tax_id){ + public function delete($summit_id, $tax_id) + { return parent::delete($summit_id, $tax_id); } /** * @return array */ - protected function getFilterRules():array + protected function getFilterRules(): array { return [ 'name' => ['=@', '=='], @@ -252,7 +290,8 @@ protected function getFilterRules():array /** * @return array */ - protected function getFilterValidatorRules():array{ + protected function getFilterValidatorRules(): array + { return [ 'name' => 'sometimes|required|string', ]; @@ -260,7 +299,8 @@ protected function getFilterValidatorRules():array{ /** * @return array */ - protected function getOrderRules():array{ + protected function getOrderRules(): array + { return [ 'id', 'name', @@ -273,8 +313,7 @@ public function __construct ISummitRepository $summit_repository, ISummitTaxTypeService $service, IResourceServerContext $resource_server_context - ) - { + ) { parent::__construct($resource_server_context); $this->repository = $repository; $this->summit_repository = $summit_repository; @@ -356,9 +395,13 @@ protected function deleteChild(Summit $summit, $child_id): void #[OA\Put( path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', summary: 'Add a tax type to a ticket type', - security: [['tax_types_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], + security: [ + [ + 'tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ] + ] + ], x: [ 'required-groups' => [ IGroup::SuperAdmins, @@ -387,25 +430,23 @@ protected function deleteChild(Summit $summit, $child_id): void new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), ] )] - public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id){ + public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id) + { try { $summit = SummitFinderStrategyFactory::build($this->getSummitRepository(), $this->getResourceServerContext())->find($summit_id); - if (is_null($summit)) return $this->error404(); + if (is_null($summit)) + return $this->error404(); $child = $this->service->addTaxTypeToTicketType($summit, $tax_id, $ticket_type_id); return $this->updated(SerializerRegistry::getInstance()->getSerializer($child)->serialize()); - } - catch (ValidationException $ex1) { + } catch (ValidationException $ex1) { Log::warning($ex1); return $this->error412(array($ex1->getMessage())); - } - catch(EntityNotFoundException $ex2) - { + } catch (EntityNotFoundException $ex2) { Log::warning($ex2); - return $this->error404(array('message'=> $ex2->getMessage())); - } - catch (Exception $ex) { + return $this->error404(array('message' => $ex2->getMessage())); + } catch (Exception $ex) { Log::error($ex); return $this->error500($ex); } @@ -420,9 +461,13 @@ public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id){ #[OA\Delete( path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', summary: 'Remove a tax type from a ticket type', - security: [['tax_types_oauth2' => [ - SummitScopes::WriteSummitData, - ]]], + security: [ + [ + 'tax_types_oauth2' => [ + SummitScopes::WriteSummitData, + ] + ] + ], x: [ 'required-groups' => [ IGroup::SuperAdmins, @@ -451,25 +496,23 @@ public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id){ new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error"), ] )] - public function removeTaxFromTicketType($summit_id, $tax_id, $ticket_type_id){ + public function removeTaxFromTicketType($summit_id, $tax_id, $ticket_type_id) + { try { $summit = SummitFinderStrategyFactory::build($this->getSummitRepository(), $this->getResourceServerContext())->find($summit_id); - if (is_null($summit)) return $this->error404(); + if (is_null($summit)) + return $this->error404(); $child = $this->service->removeTaxTypeFromTicketType($summit, $tax_id, $ticket_type_id); return $this->updated(SerializerRegistry::getInstance()->getSerializer($child)->serialize()); - } - catch (ValidationException $ex1) { + } catch (ValidationException $ex1) { Log::warning($ex1); return $this->error412(array($ex1->getMessage())); - } - catch(EntityNotFoundException $ex2) - { + } catch (EntityNotFoundException $ex2) { Log::warning($ex2); - return $this->error404(array('message'=> $ex2->getMessage())); - } - catch (Exception $ex) { + return $this->error404(array('message' => $ex2->getMessage())); + } catch (Exception $ex) { Log::error($ex); return $this->error500($ex); } diff --git a/app/Swagger/Models/SummitTaxTypeSchema.php b/app/Swagger/Models/SummitTaxTypeSchema.php new file mode 100644 index 000000000..c82263da7 --- /dev/null +++ b/app/Swagger/Models/SummitTaxTypeSchema.php @@ -0,0 +1,33 @@ + Date: Tue, 2 Dec 2025 21:52:30 +0000 Subject: [PATCH 6/9] chore: add operationId and fix namespace in security schema --- .../OAuth2SummitTaxTypeApiController.php | 9 ++++- app/Swagger/Security/TaxTypesAuthSchema.php | 36 ++++++++++--------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php index 72bbab670..879ed86ef 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitTaxTypeApiController.php @@ -59,6 +59,7 @@ final class OAuth2SummitTaxTypeApiController extends OAuth2ProtectedController #[OA\Get( path: '/api/v1/summits/{id}/tax-types', summary: 'Get all tax types for a summit', + operationId: 'getAllTaxTypes', security: [ [ 'tax_types_oauth2' => [ @@ -110,6 +111,7 @@ public function getAllBySummit($summit_id) #[OA\Post( path: '/api/v1/summits/{id}/tax-types', summary: 'Create a new tax type', + operationId: 'createTaxType', security: [ [ 'tax_types_oauth2' => [ @@ -155,6 +157,7 @@ public function add($summit_id) #[OA\Get( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Get a tax type by ID', + operationId: 'getTaxType', security: [ [ 'tax_types_oauth2' => [ @@ -197,6 +200,7 @@ public function get($summit_id, $tax_id) #[OA\Put( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Update a tax type', + operationId: 'updateTaxType', security: [ [ 'tax_types_oauth2' => [ @@ -243,6 +247,7 @@ public function update($summit_id, $tax_id) #[OA\Delete( path: '/api/v1/summits/{id}/tax-types/{tax_id}', summary: 'Delete a tax type', + operationId: 'deleteTaxType', security: [ [ 'tax_types_oauth2' => [ @@ -395,6 +400,7 @@ protected function deleteChild(Summit $summit, $child_id): void #[OA\Put( path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', summary: 'Add a tax type to a ticket type', + operationId: 'addTaxTypeToTicketType', security: [ [ 'tax_types_oauth2' => [ @@ -461,6 +467,7 @@ public function addTaxToTicketType($summit_id, $tax_id, $ticket_type_id) #[OA\Delete( path: '/api/v1/summits/{id}/tax-types/{tax_id}/ticket-types/{ticket_type_id}', summary: 'Remove a tax type from a ticket type', + operationId: 'removeTaxTypeFromTicketType', security: [ [ 'tax_types_oauth2' => [ @@ -517,4 +524,4 @@ public function removeTaxFromTicketType($summit_id, $tax_id, $ticket_type_id) return $this->error500($ex); } } -} +} \ No newline at end of file diff --git a/app/Swagger/Security/TaxTypesAuthSchema.php b/app/Swagger/Security/TaxTypesAuthSchema.php index 6a3363b6e..de8bc818c 100644 --- a/app/Swagger/Security/TaxTypesAuthSchema.php +++ b/app/Swagger/Security/TaxTypesAuthSchema.php @@ -1,26 +1,28 @@ 'Read Summit Data', - SummitScopes::ReadAllSummitData => 'Read All Summit Data', - SummitScopes::WriteSummitData => 'Write Summit Data', - ], - ), - ], - ) + type: 'oauth2', + securityScheme: 'tax_types_oauth2', + flows: [ + new OA\Flow( + authorizationUrl: L5_SWAGGER_CONST_AUTH_URL, + tokenUrl: L5_SWAGGER_CONST_TOKEN_URL, + flow: 'authorizationCode', + scopes: [ + SummitScopes::ReadSummitData => 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], +) ] -class TaxTypesAuthSchema{} +class TaxTypesAuthSchema +{ +} \ No newline at end of file From c4dab130d00ffb5e2e2990f50fb868cd2595221c Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Tue, 2 Dec 2025 21:53:40 +0000 Subject: [PATCH 7/9] fix: schema types and names --- app/Swagger/Models/SummitTicketTypeSchema.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Swagger/Models/SummitTicketTypeSchema.php b/app/Swagger/Models/SummitTicketTypeSchema.php index 79a814aff..adff7042a 100644 --- a/app/Swagger/Models/SummitTicketTypeSchema.php +++ b/app/Swagger/Models/SummitTicketTypeSchema.php @@ -21,8 +21,8 @@ new OA\Property(property: 'currency_symbol', type: 'string'), new OA\Property(property: 'quantity_2_sell', type: 'integer'), new OA\Property(property: 'max_quantity_per_order', type: 'integer'), - new OA\Property(property: 'sales_start_date:datetime_epoch'), - new OA\Property(property: 'sales_end_date:datetime_epoch'), + new OA\Property(property: 'sales_start_date', type: 'integer'), + new OA\Property(property: 'sales_end_date', type: 'integer'), new OA\Property(property: 'badge_type_id', type: 'integer', description: 'SummitBadgeType ID, or add ?expand=badge_type for full object'), new OA\Property(property: 'quantity_sold', type: 'integer'), new OA\Property(property: 'audience', type: 'string'), @@ -39,4 +39,4 @@ ])] class SummitTicketTypeSchema { -} \ No newline at end of file +} From a6d57747d45cefe3fa2822c6dd92373d4f903bb5 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Fri, 5 Dec 2025 15:25:50 +0000 Subject: [PATCH 8/9] chore: include PR requested changes --- app/Swagger/Models/SummitTaxTypeSchema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Swagger/Models/SummitTaxTypeSchema.php b/app/Swagger/Models/SummitTaxTypeSchema.php index c82263da7..7617b9f59 100644 --- a/app/Swagger/Models/SummitTaxTypeSchema.php +++ b/app/Swagger/Models/SummitTaxTypeSchema.php @@ -21,7 +21,7 @@ type: 'array', items: new OA\Items(oneOf: [ new OA\Schema(type: 'integer'), - new OA\Schema(type: 'SummitTicketType') + new OA\Schema(ref: '#/components/schemas/SummitTicketType') ]), example: [1, 2, 3], description: 'Array of ticket type IDs or its Model (only present when relations=ticket_types), expanded when expand includes ticket_types.' @@ -30,4 +30,4 @@ )] class SummitTaxTypeSchema { -} \ No newline at end of file +} From a134fa4d86b0c9aecc8c4a2f8d82d64d50ac29a7 Mon Sep 17 00:00:00 2001 From: Matias Perrone Date: Thu, 18 Dec 2025 19:57:11 +0000 Subject: [PATCH 9/9] fix: issues on rebase --- app/Swagger/SummitRegistrationSchemas.php | 74 ----------------------- 1 file changed, 74 deletions(-) diff --git a/app/Swagger/SummitRegistrationSchemas.php b/app/Swagger/SummitRegistrationSchemas.php index 366a2479a..b0c396f20 100644 --- a/app/Swagger/SummitRegistrationSchemas.php +++ b/app/Swagger/SummitRegistrationSchemas.php @@ -104,80 +104,6 @@ class SummitBadgeTypeUpdateRequestSchema { } -#[OA\Schema( - schema: 'SummitTaxType', - type: 'object', - properties: [ - new OA\Property(property: 'id', type: 'integer', example: 1), - new OA\Property(property: 'created', type: 'integer', example: 1630500518), - new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518), - new OA\Property(property: 'name', type: 'string', example: 'VAT'), - new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001', nullable: true), - new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0), - new OA\Property(property: 'summit_id', type: 'integer', example: 42), - new OA\Property( - property: 'ticket_types', - type: 'array', - items: new OA\Items(oneOf: [ - new OA\Schema(type: 'integer'), - new OA\Schema(type: 'SummitTicketType') - ]), - example: [1, 2, 3], - description: 'Array of ticket type IDs or its Model (only present when relations=ticket_types), expanded when expand includes ticket_types.' - ), - ] -)] -class SummitTaxTypeSchema -{ -} - -#[OA\Schema( - schema: 'PaginatedSummitTaxTypesResponse', - 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/SummitTaxType') - ) - ] - ) - ] -)] -class PaginatedSummitTaxTypesResponseSchema -{ -} - -#[OA\Schema( - schema: 'SummitTaxTypeCreateRequest', - type: 'object', - required: ['name', 'rate'], - properties: [ - new OA\Property(property: 'name', type: 'string', example: 'VAT'), - new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001'), - new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0, description: 'Rate must be greater than 0'), - ] -)] -class SummitTaxTypeCreateRequestSchema -{ -} - -#[OA\Schema( - schema: 'SummitTaxTypeUpdateRequest', - type: 'object', - properties: [ - new OA\Property(property: 'name', type: 'string', example: 'VAT'), - new OA\Property(property: 'tax_id', type: 'string', example: 'VAT-001'), - new OA\Property(property: 'rate', type: 'number', format: 'float', example: 21.0, description: 'Rate must be greater than 0'), - ] -)] -class SummitTaxTypeUpdateRequestSchema -{ -} - // Summit Badge Feature Types #[OA\Schema(