From 6481b1fa09519aa46b858eda9a2d3eda33a1308e Mon Sep 17 00:00:00 2001 From: smarcet Date: Thu, 2 Oct 2025 13:23:36 -0300 Subject: [PATCH 1/2] chore: add to table SummitAttendeeTicket fild summit id to improve performance chore: add needed IDX --- ...DoctrineSummitAttendeeTicketRepository.php | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php index 9629a92fd..769fb9d63 100644 --- a/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php +++ b/app/Repositories/Summit/DoctrineSummitAttendeeTicketRepository.php @@ -52,26 +52,26 @@ public function __construct(EntityManagerInterface $em, ClassMetadata $class) /** @var array}> */ private array $joinCatalog = [ - 'o' => ['e.order', 'join', []], - 's' => ['e.summit', 'join', []], - 'ord_m' => ['o.owner', 'leftJoin', ['o']], - 'a' => ['e.owner', 'leftJoin', []], - 'a_c' => ['a.company', 'leftJoin', ['a']], - 'm' => ['a.member', 'leftJoin', ['a']], - 'am' => ['a.manager', 'leftJoin', ['a']], - 'm2' => ['am.member', 'leftJoin', ['am']], - 'b' => ['e.badge', 'leftJoin', []], - 'bt' => ['b.type', 'leftJoin', ['b']], - 'al' => ['bt.access_levels', 'leftJoin', ['bt']], - 'bf' => ['b.features', 'leftJoin', ['b']], - 'bt_bf' => ['bt.badge_features', 'leftJoin', ['bt']], - 'prt' => ['b.prints', 'leftJoin', ['b']], - 'rr' => ['e.refund_requests', 'leftJoin', []], - 'ta' => ['e.applied_taxes', 'leftJoin', []], - 'tt' => ['e.ticket_type', 'join', []], - 'pc' => ['e.promo_code', 'leftJoin', []], - 'pct' => ['pc.tags', 'leftJoin', ['pc']], - 'avt' => ['bt.allowed_view_types', 'join', ['bt']], + 'o' => ['e.order', 'join', []], + 's' => ['e.summit', 'join', []], + 'ord_m' => ['o.owner', 'leftJoin', ['o']], + 'a' => ['e.owner', 'leftJoin', []], + 'a_c' => ['a.company', 'leftJoin', ['a']], + 'm' => ['a.member', 'leftJoin', ['a']], + 'am' => ['a.manager', 'leftJoin', ['a']], + 'm2' => ['am.member', 'leftJoin', ['am']], + 'b' => ['e.badge', 'leftJoin', []], + 'bt' => ['b.type', 'leftJoin', ['b']], + 'al' => ['bt.access_levels', 'leftJoin', ['bt']], + 'bf' => ['b.features', 'leftJoin', ['b']], + 'bt_bf' => ['bt.badge_features', 'leftJoin', ['bt']], + 'prt' => ['b.prints', 'leftJoin', ['b']], + 'rr' => ['e.refund_requests', 'leftJoin', []], + 'ta' => ['e.applied_taxes', 'leftJoin', []], + 'tt' => ['e.ticket_type', 'join', []], + 'pc' => ['e.promo_code', 'leftJoin', []], + 'pct' => ['pc.tags', 'leftJoin', ['pc']], + 'avt' => ['bt.allowed_view_types', 'join', ['bt']], ]; private function ensureJoin(QueryBuilder $qb, string $alias): void From b250a58aaa13d9028b596421ac7dae237ba0f0b2 Mon Sep 17 00:00:00 2001 From: Jose Andres Tejerina Date: Wed, 12 Nov 2025 16:19:48 -0300 Subject: [PATCH 2/2] feat: Extend Swagger Coverage for controller PaymentGatewayWebHookController --- .../PaymentGatewayWebHookController.php | 88 +++++++++++++++++++ app/Swagger/schemas.php | 19 ++++ 2 files changed, 107 insertions(+) diff --git a/app/Http/Controllers/PaymentGatewayWebHookController.php b/app/Http/Controllers/PaymentGatewayWebHookController.php index 303613253..770626b03 100644 --- a/app/Http/Controllers/PaymentGatewayWebHookController.php +++ b/app/Http/Controllers/PaymentGatewayWebHookController.php @@ -16,6 +16,7 @@ use App\Services\Model\IProcessPaymentService; use App\Services\Model\ISummitOrderService; use Illuminate\Http\Request as LaravelRequest; +use Illuminate\Http\Response; use Illuminate\Support\Facades\Cache; use models\oauth2\IResourceServerContext; use models\summit\IPaymentConstants; @@ -25,6 +26,8 @@ use models\exceptions\EntityNotFoundException; use models\exceptions\ValidationException; use Exception; +use OpenApi\Attributes as OA; + /** * Class PaymentGatewayWebHookController * @package App\Http\Controllers @@ -97,6 +100,45 @@ private function getProcessPaymentService(string $application_type):?IProcessPay * @param LaravelRequest $request * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Post( + path: "/api/public/v1/summits/all/payments/{application_name}/confirm", + summary: "Generic payment gateway webhook confirmation", + description: "Handles payment gateway webhook callbacks for a given application type.", + operationId: "genericConfirm", + tags: ["PaymentGatewayHook"], + security: [], + parameters: [ + new OA\Parameter( + name: "application_name", + in: "path", + required: true, + description: "Application name (e.g. Show admin)", + schema: new OA\Schema(type: "string") + ) + ], + requestBody: new OA\RequestBody( + required: false, + content: new OA\JsonContent(ref: '#/components/schemas/PaymentGatewayWebhookRequest') + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Payment processed successfully" + ), + new OA\Response( + response: Response::HTTP_ALREADY_REPORTED, + description: "Already reported" + ), + new OA\Response( + response: Response::HTTP_BAD_REQUEST, + description: "Payload error" + ), + new OA\Response( + response: Response::HTTP_PRECONDITION_FAILED, + description: "Precondition failed - missing configuration or invalid data" + ) + ] + )] public function genericConfirm($application_type, LaravelRequest $request){ try { @@ -156,6 +198,52 @@ public function genericConfirm($application_type, LaravelRequest $request){ * @param LaravelRequest $request * @return \Illuminate\Http\JsonResponse|mixed */ + #[OA\Post( + path: "/api/public/v1/summits/{summit_id}/payments/{application_name}/confirm", + summary: "Summit payment gateway webhook confirmation", + description: "Handles payment gateway webhook callbacks for a given summit and application type.", + operationId: "confirm", + tags: ["PaymentGatewayHook"], + security: [], + parameters: [ + new OA\Parameter( + name: "summit_id", + in: "path", + required: true, + description: "Summit identifier", + schema: new OA\Schema(type: "integer") + ), + new OA\Parameter( + name: "application_name", + in: "path", + required: true, + description: "Application Name (e.g ShowAdmin)", + schema: new OA\Schema(type: "string") + ) + ], + requestBody: new OA\RequestBody( + required: false, + content: new OA\JsonContent(ref: '#/components/schemas/PaymentGatewayWebhookRequest') + ), + responses: [ + new OA\Response( + response: Response::HTTP_OK, + description: "Payment processed successfully" + ), + new OA\Response( + response: Response::HTTP_ALREADY_REPORTED, + description: "Already reported" + ), + new OA\Response( + response: Response::HTTP_BAD_REQUEST, + description: "Payload error" + ), + new OA\Response( + response: Response::HTTP_PRECONDITION_FAILED, + description: "Precondition failed - missing configuration or invalid data" + ) + ] + )] public function confirm($summit_id, $application_type, LaravelRequest $request){ try { diff --git a/app/Swagger/schemas.php b/app/Swagger/schemas.php index 1eff77226..2d30e4189 100644 --- a/app/Swagger/schemas.php +++ b/app/Swagger/schemas.php @@ -351,3 +351,22 @@ class RSVPUpdateRequestSchema_{ ] )] class RSVPAdminAddRequestSchema {} + +#[OA\Schema( + schema: 'PaymentGatewayWebhookRequest', + type: 'object', + description: 'Generic payment gateway webhook payload. The structure depends on the payment provider (e.g., Stripe, etc.)', + example: [ + 'id' => 'evt_1234567890', + 'cart_id' => '1234567890', + 'type' => 'charge.succeeded', + 'data' => [ + 'object' => [ + 'id' => 'ch_1234567890', + 'status' => 'succeeded' + ] + ] + ] +)] +class PaymentGatewayWebhookRequestSchema {} +