Skip to content

Commit 54b98ac

Browse files
committed
chore: Add missing schemas and route
Signed-off-by: Matias Perrone <github@matiasperrone.com>
1 parent 1bcf4f2 commit 54b98ac

2 files changed

Lines changed: 92 additions & 1 deletion

File tree

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

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,46 @@ public function __construct
107107
$this->service = $service;
108108
}
109109

110+
#[OA\Get(
111+
path: '/api/v1/summits/{id}/tickets/{ticket_id}',
112+
operationId: 'getSummitAttendeeTicketById',
113+
summary: 'Get a specific ticket for a summit by ticket ID',
114+
description: '',
115+
security: [['summit_tickets_oauth2' => [
116+
SummitScopes::ReadAllSummitData,
117+
SummitScopes::ReadRegistrationOrders,
118+
]]],
119+
x: ['required-groups' => [
120+
IGroup::SuperAdmins,
121+
IGroup::Administrators,
122+
IGroup::SummitAdministrators,
123+
IGroup::SummitRegistrationAdmins,
124+
IGroup::BadgePrinters,
125+
IGroup::SummitAccessControl
126+
]],
127+
tags: ['Tickets'],
128+
parameters: [
129+
new OA\Parameter(name: 'id', in: 'path', required: true, description: 'Summit ID', schema: new OA\Schema(type: 'string')),
130+
new OA\Parameter(name: 'ticket_id', in: 'path', required: true, description: 'Ticket ID', schema: new OA\Schema(type: 'string')),
131+
new OA\Parameter(name: 'relations', in: 'query', required: false, description: 'Relationships, allowed values: applied_taxes, refund_requests', schema: new OA\Schema(type: 'string')),
132+
new OA\Parameter(name: 'expand', in: 'query', required: false, description: 'Expand relationships, allowed values: owner, order, ticket_type, badge, promo_code, refund_requests, applied_taxes', schema: new OA\Schema(type: 'string')),
133+
134+
],
135+
responses: [
136+
new OA\Response(
137+
response: Response::HTTP_OK,
138+
description: 'Successful operation',
139+
content: new OA\JsonContent(ref: '#/components/schemas/SummitAttendeeTicket')
140+
),
141+
new OA\Response(response: Response::HTTP_BAD_REQUEST, description: 'Bad request'),
142+
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: 'Unauthorized'),
143+
new OA\Response(response: Response::HTTP_NOT_FOUND, description: 'Summit not found'),
144+
]
145+
)]
110146

111147
#[OA\Get(
112148
path: '/api/v1/summits/{id}/tickets',
113-
operationId: 'getAllTickets',
149+
operationId: 'getAllSummitAttendeeTickets',
114150
summary: 'Get all tickets for a summit',
115151
description: 'Returns a paginated list of tickets for the specified summit with filtering and sorting capabilities',
116152
security: [['summit_tickets_oauth2' => [
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'SummitAttendeeTicket',
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: 'number', type: 'string'),
16+
new OA\Property(property: 'status', type: 'string'),
17+
new OA\Property(property: 'external_order_id', type: 'string'),
18+
new OA\Property(property: 'external_attendee_id', type: 'string'),
19+
new OA\Property(property: 'bought_date', type: 'integer', format: "time_epoch"),
20+
new OA\Property(property: 'ticket_type_id', type: 'integer'),
21+
new OA\Property(property: 'owner_id', type: 'integer'),
22+
new OA\Property(property: 'order_id', type: 'integer'),
23+
new OA\Property(property: 'badge_id', type: 'integer'),
24+
new OA\Property(property: 'promo_code_id', type: 'integer'),
25+
new OA\Property(property: 'raw_cost', type: 'float'),
26+
new OA\Property(property: 'net_selling_cost', type: 'float'),
27+
new OA\Property(property: 'raw_cost_in_cents', type: 'integer'),
28+
new OA\Property(property: 'final_amount', type: 'float'),
29+
new OA\Property(property: 'final_amount_in_cents', type: 'integer'),
30+
new OA\Property(property: 'discount', type: 'float'),
31+
new OA\Property(property: 'discount_rate', type: 'float'),
32+
new OA\Property(property: 'discount_in_cents', type: 'integer'),
33+
new OA\Property(property: 'refunded_amount', type: 'float'),
34+
new OA\Property(property: 'refunded_amount_in_cents', type: 'integer'),
35+
new OA\Property(property: 'total_refunded_amount', type: 'float'),
36+
new OA\Property(property: 'total_refunded_amount_in_cents', type: 'integer'),
37+
new OA\Property(property: 'currency', type: 'string'),
38+
new OA\Property(property: 'currency_symbol', type: 'string'),
39+
new OA\Property(property: 'taxes_amount', type: 'float'),
40+
new OA\Property(property: 'taxes_amount_in_cents', type: 'integer'),
41+
new OA\Property(property: 'is_active', type: 'boolean'),
42+
new OA\Property(property: 'qr_code', type: 'string'),
43+
new OA\Property(property: 'badge_prints_count', type: 'integer', example: 16),
44+
new OA\Property(property: 'owner', ref:'#/components/schemas/SummitAttendee', description: 'An object of SummitAttendee, when expanded'),
45+
new OA\Property(property: 'order', ref:'#/components/schemas/SummitOrder', description: 'An object of SummitOrder, when expanded'),
46+
new OA\Property(property: 'ticket_type', ref:'#/components/schemas/SummitTicketType', description: 'An object of SummitTicketType, when expanded'),
47+
new OA\Property(property: 'badge', type: 'object', description: 'An object of SummitBadge, when expanded'),
48+
new OA\Property(property: 'promo_code', type: 'object', description: 'An object of SummitPromoCode, when expanded'),
49+
new OA\Property(property: 'refund_requests', type: 'object', description: 'An object of SummitRefundRequest, when expanded'),
50+
new OA\Property(property: 'applied_taxes', type: 'object', description: 'An object of SummitAppliedTax, when expanded'),
51+
])
52+
]
53+
class SummitAttendeeTicketSchema
54+
{
55+
}

0 commit comments

Comments
 (0)