PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Infrastructure / Routes / Mobile / MobileV1.php
ameliabooking / src / Infrastructure / Routes / Mobile Last commit date
MobileV1.php 3 weeks ago
MobileV1.php
54 lines
1 <?php
2
3 namespace AmeliaBooking\Infrastructure\Routes\Mobile;
4
5 use AmeliaBooking\Application\Controller\Mobile\Appointments\GetAppointmentMobileController;
6 use AmeliaBooking\Application\Controller\Mobile\Appointments\GetAppointmentsMobileController;
7 use AmeliaBooking\Application\Controller\Mobile\Appointments\UpdateAppointmentStatusMobileController;
8 use AmeliaBooking\Application\Controller\Mobile\Events\GetEventMobileController;
9 use AmeliaBooking\Application\Controller\Mobile\Events\GetEventsMobileController;
10 use AmeliaBooking\Application\Controller\Mobile\Events\ScanEventTicketMobileController;
11 use AmeliaBooking\Application\Controller\Mobile\GetMobileInfoController;
12 use Slim\App;
13
14 /**
15 * Dedicated routes for the Amelia Staff mobile app.
16 *
17 * These routes always run in cabinet-provider context — the `source` param is
18 * never read from the client. A Bearer JWT is required; requests without one
19 * receive a 409 `{data: {reauthorize: true}}` response, the same shape as an
20 * expired-session error, so the app drives the user back to login. Both are
21 * enforced by MobileV1Controller, which every controller below extends.
22 *
23 * Versioned under /mobile/v1/ so the contract can evolve independently of the
24 * shared web-cabinet routes (/appointments, /events) without breaking either.
25 */
26 class MobileV1
27 {
28 /**
29 * @param App $app
30 *
31 * @throws \InvalidArgumentException
32 */
33 public static function routes(App $app)
34 {
35 // Version-negotiation handshake. Intentionally UNVERSIONED and
36 // UNAUTHENTICATED (no Bearer token) — it is the contract the app uses to
37 // detect version skew, so it must never change shape or require auth.
38 // Must ship in the same release as the /mobile/v1/* routes below.
39 $app->get('/mobile/info', GetMobileInfoController::class);
40
41 $app->get('/mobile/v1/appointments', GetAppointmentsMobileController::class);
42
43 $app->get('/mobile/v1/appointments/{id:[0-9]+}', GetAppointmentMobileController::class);
44
45 $app->post('/mobile/v1/appointments/status/{id:[0-9]+}', UpdateAppointmentStatusMobileController::class);
46
47 $app->get('/mobile/v1/events', GetEventsMobileController::class);
48
49 $app->get('/mobile/v1/events/{id:[0-9]+}', GetEventMobileController::class);
50
51 $app->post('/mobile/v1/events/scan', ScanEventTicketMobileController::class);
52 }
53 }
54