Skip to content

Commit d723afe

Browse files
committed
chore: Add its own pagination schemas
Signed-off-by: Matias Perrone <github@matiasperrone.com>
1 parent d5f8f1f commit d723afe

2 files changed

Lines changed: 42 additions & 7 deletions

File tree

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
* Class OAuth2SummitOrderExtraQuestionTypeApiController
4141
* @package App\Http\Controllers
4242
*/
43-
#[OA\Tag(name: "Order Extra Questions", description: "Summit Order Extra Questions Management")]
4443
final class OAuth2SummitOrderExtraQuestionTypeApiController
4544
extends OAuth2ProtectedController
4645
{
@@ -140,7 +139,7 @@ public function __construct
140139
new OA\Response(
141140
response: Response::HTTP_OK,
142141
description: "Order extra questions retrieved successfully",
143-
content: new OA\JsonContent(ref: "#/components/schemas/PaginateDataSchemaResponse")
142+
content: new OA\JsonContent(ref: "#/components/schemas/PaginatedSummitOrderExtraQuestionTypesResponse")
144143
),
145144
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Summit not found"),
146145
]
@@ -198,7 +197,7 @@ public function __construct
198197
new OA\Response(
199198
response: Response::HTTP_OK,
200199
description: "Order extra questions retrieved successfully",
201-
content: new OA\JsonContent(ref: "#/components/schemas/PaginateDataSchemaResponse")
200+
content: new OA\JsonContent(ref: "#/components/schemas/PaginatedSummitOrderExtraQuestionTypesResponse")
202201
),
203202
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Summit not found"),
204203
]
@@ -728,7 +727,7 @@ public function deleteQuestionValue($summit_id, $question_id, $value_id)
728727
new OA\Response(
729728
response: Response::HTTP_CREATED,
730729
description: "Default questions seeded successfully",
731-
content: new OA\JsonContent(ref: "#/components/schemas/PaginateDataSchemaResponse")
730+
content: new OA\JsonContent(ref: "#/components/schemas/PaginatedSummitOrderExtraQuestionTypesResponse")
732731
),
733732
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
734733
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"),
@@ -792,7 +791,7 @@ public function seedDefaultSummitExtraOrderQuestionTypesBySummit($summit_id)
792791
new OA\Response(
793792
response: Response::HTTP_OK,
794793
description: "Sub question rules retrieved successfully",
795-
content: new OA\JsonContent(ref: "#/components/schemas/PaginateDataSchemaResponse")
794+
content: new OA\JsonContent(ref: "#/components/schemas/PaginatedSubQuestionRulesResponse")
796795
),
797796
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Question or Summit not found"),
798797
]
@@ -1122,7 +1121,7 @@ public function deleteSubQuestionRule($summit_id, $question_id, $rule_id)
11221121
new OA\Response(
11231122
response: Response::HTTP_OK,
11241123
description: "Allowed questions retrieved successfully",
1125-
content: new OA\JsonContent(ref: "#/components/schemas/PaginateDataSchemaResponse")
1124+
content: new OA\JsonContent(ref: "#/components/schemas/PaginatedSummitOrderExtraQuestionTypesResponse")
11261125
),
11271126
new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Summit or attendee not found"),
11281127
]
@@ -1173,7 +1172,7 @@ public function getOwnAttendeeAllowedExtraQuestions($summit_id)
11731172
new OA\Response(
11741173
response: Response::HTTP_OK,
11751174
description: "Allowed questions retrieved successfully",
1176-
content: new OA\JsonContent(ref: "#/components/schemas/PaginateDataSchemaResponse")
1175+
content: new OA\JsonContent(ref: "#/components/schemas/PaginatedSummitOrderExtraQuestionTypesResponse")
11771176
),
11781177
new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"),
11791178
new OA\Response(response: Response::HTTP_FORBIDDEN, description: "You are not Authorized"),

app/Swagger/SummitOrderExtraQuestionTypeSchemas.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,39 @@
4545
class SummitOrderExtraQuestionTypeSchemas
4646
{
4747
}
48+
49+
#[OA\Schema(
50+
schema: "PaginatedSummitOrderExtraQuestionTypesResponse",
51+
description: "Paginated list of summit order extra question types",
52+
allOf: [
53+
new OA\Schema(ref: "#/components/schemas/PaginateDataSchemaResponse"),
54+
new OA\Schema(
55+
properties: [
56+
new OA\Property(
57+
property: "data",
58+
type: "array",
59+
items: new OA\Items(ref: "#/components/schemas/SummitOrderExtraQuestionType")
60+
)
61+
]
62+
)
63+
]
64+
)]
65+
class PaginatedSummitOrderExtraQuestionTypesResponseSchema {}
66+
67+
#[OA\Schema(
68+
schema: "PaginatedSubQuestionRulesResponse",
69+
description: "Paginated list of sub question rules",
70+
allOf: [
71+
new OA\Schema(ref: "#/components/schemas/PaginateDataSchemaResponse"),
72+
new OA\Schema(
73+
properties: [
74+
new OA\Property(
75+
property: "data",
76+
type: "array",
77+
items: new OA\Items(ref: "#/components/schemas/SubQuestionRule")
78+
)
79+
]
80+
)
81+
]
82+
)]
83+
class PaginatedSubQuestionRulesResponseSchema {}

0 commit comments

Comments
 (0)