| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | defined('ABSPATH') || exit; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * @var $router FluentBooking\Framework\Http\Router | |
| 6 | + * @var FluentBooking\Framework\Http\Router $router | |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | $router->prefix('calendars')->withPolicy('CalendarPolicy')->group(function ($router) { |
| 10 | 10 | |
| @@ -9,12 +9,11 @@ | ||
| 9 | 9 | $router->prefix('calendars')->withPolicy('CalendarPolicy')->group(function ($router) { |
| 10 | 10 | |
| 11 | 11 | $router->get('/', 'CalendarController@getAllCalendars')->meta('calendar_type', 'booking'); |
| 12 | 12 | |
| 13 | - $router->get('event-lists', 'CalendarController@getCalendarEventLists'); | |
| 14 | - | |
| 15 | 13 | $router->post('/', 'CalendarController@createCalendar'); |
| 16 | 14 | $router->post('check-slug', 'CalendarController@checkSlug'); |
| 15 | + $router->get('location-fields', 'CalendarController@getNewEventLocationFields'); | |
| 17 | 16 | |
| 18 | 17 | $router->get('/{id}', 'CalendarController@getCalendar')->int('id'); |
| 19 | 18 | $router->post('/{id}', 'CalendarController@updateCalendar')->int('id'); |
| 20 | 19 | $router->delete('/{id}', 'CalendarController@deleteCalendar')->int('id'); |
| @@ -25,8 +24,10 @@ | ||
| 25 | 24 | // Landing Page API |
| 26 | 25 | $router->get('/{id}/sharing-settings', 'CalendarController@getSharingSettings')->int('id'); |
| 27 | 26 | $router->post('/{id}/sharing-settings', 'CalendarController@saveSharingSettings')->int('id'); |
| 28 | 27 | |
| 28 | + $router->post('/{id}/event-order', 'CalendarController@saveCalendarEventOrder')->int('id'); | |
| 29 | + | |
| 29 | 30 | $router->post('/{id}/clone-event/{event_id}', 'CalendarController@cloneCalendarEvent')->int('id')->int('event_id'); |
| 30 | 31 | |
| 31 | 32 | $router->get('/{id}/events/{event_id}', 'CalendarController@getEvent')->int('id')->int('event_id'); |
| 32 | 33 | $router->put('/{id}/events/{event_id}', 'CalendarController@patchCalendarEvent')->int('id')->int('event_id'); |
| @@ -31,9 +32,9 @@ | ||
| 31 | 32 | $router->get('/{id}/events/{event_id}', 'CalendarController@getEvent')->int('id')->int('event_id'); |
| 32 | 33 | $router->put('/{id}/events/{event_id}', 'CalendarController@patchCalendarEvent')->int('id')->int('event_id'); |
| 33 | 34 | $router->delete('/{id}/events/{event_id}', 'CalendarController@deleteCalendarEvent')->int('id')->int('event_id'); |
| 34 | 35 | |
| 35 | - $router->get('/{id}/events/{event_id}/availability', 'CalendarController@getAvailabilitySettings')->int('event_id'); | |
| 36 | + $router->get('/{id}/events/{event_id}/availability', 'CalendarController@getAvailabilitySettings')->int('id')->int('event_id'); | |
| 36 | 37 | $router->post('/{id}/events/{event_id}/details', 'CalendarController@updateEventDetails')->int('id')->int('event_id'); |
| 37 | 38 | $router->post('/{id}/events/{event_id}/availability', 'CalendarController@updateEventAvailability')->int('id')->int('event_id'); |
| 38 | 39 | $router->post('/{id}/events/{event_id}/limits', 'CalendarController@updateEventLimits')->int('id')->int('event_id'); |
| 39 | 40 | |
| @@ -42,8 +43,13 @@ | ||
| 42 | 43 | $router->post('/{id}/events/{event_id}/email-notifications/clone', 'CalendarController@cloneEventEmailNotification')->int('id')->int('event_id'); |
| 43 | 44 | |
| 44 | 45 | $router->get('/{id}/events/{event_id}/booking-fields', 'CalendarController@getEventBookingFields')->int('id')->int('event_id'); |
| 45 | 46 | $router->post('/{id}/events/{event_id}/booking-fields', 'CalendarController@saveEventBookingFields')->int('id')->int('event_id'); |
| 47 | + | |
| 48 | + if (!defined('FLUENT_BOOKING_PRO_DIR_FILE')) { | |
| 49 | + // Pro registers this path (plus the POST) via PaymentMethodController; only own it standalone. | |
| 50 | + $router->get('/{id}/events/{event_id}/payment-settings', 'CalendarController@getEventPaymentSettings')->int('id')->int('event_id'); | |
| 51 | + } | |
| 46 | 52 | }); |
| 47 | 53 | |
| 48 | 54 | $router->prefix('admin')->withPolicy('AdminPolicy')->group(function ($router) { |
| 49 | 55 | $router->get('remaining-hosts', 'AdminController@getRemainingHosts'); |
| @@ -50,22 +56,36 @@ | ||
| 50 | 56 | $router->get('other-hosts', 'AdminController@getOtherHosts'); |
| 51 | 57 | $router->get('all-hosts', 'AdminController@getAllHosts'); |
| 52 | 58 | }); |
| 53 | 59 | |
| 60 | +$router->prefix('events')->withPolicy('CalendarEventPolicy')->group(function ($router) { | |
| 61 | + $router->get('/{event_id}', 'EventController@getEvent')->int('event_id'); | |
| 62 | +}); | |
| 63 | + | |
| 54 | 64 | $router->prefix('bookings')->withPolicy('CalendarEventPolicy')->group(function ($router) { |
| 55 | 65 | $router->get('/', 'BookingController@getBookings'); |
| 56 | - $router->get('event', 'BookingController@getEvent'); | |
| 66 | + $router->get('event/{event_id}', 'BookingController@getEvent')->int('event_id'); | |
| 67 | + $router->get('slots/{event_id}', 'BookingController@getSlots')->int('event_id'); | |
| 57 | 68 | $router->post('create/{event_id}', 'BookingController@createBooking')->int('event_id'); |
| 69 | + $router->get('reschedule/{event_id}/{id}/slots', 'BookingController@getRescheduleSlots')->int('event_id')->int('id'); | |
| 70 | + $router->post('reschedule/{event_id}/{id}', 'BookingController@rescheduleBooking')->int('event_id')->int('id'); | |
| 58 | 71 | }); |
| 59 | 72 | |
| 60 | 73 | $router->prefix('schedules')->withPolicy('MeetingPolicy')->group(function ($router) { |
| 61 | 74 | $router->get('/', 'SchedulesController@index'); // Need to check permission on the controller method |
| 75 | + $router->get('/export', 'SchedulesController@export'); | |
| 76 | + $router->get('/crm-contact-prefill', 'SchedulesController@getCrmContactPrefill'); | |
| 77 | + $router->get('/crm-contact-search', 'SchedulesController@searchCrmContacts'); | |
| 62 | 78 | $router->get('/{id}', 'SchedulesController@getBooking')->int('id'); |
| 63 | 79 | $router->delete('/{id}', 'SchedulesController@deleteBooking')->int('id'); |
| 64 | - $router->get('/{id}/slot', 'SchedulesController@getScheduleSpot')->int('id'); | |
| 65 | 80 | $router->put('/{id}', 'SchedulesController@patchBooking')->int('id'); |
| 66 | 81 | $router->get('/{id}/activities', 'SchedulesController@getBookingActivities')->int('id'); |
| 67 | 82 | $router->get('/{id}/meta-info', 'SchedulesController@getBookingMetaInfo')->int('id'); |
| 83 | + $router->get('/{id}/crm-contact', 'SchedulesController@getCrmContact')->int('id'); | |
| 84 | + $router->get('/{id}/crm-options', 'SchedulesController@getCrmOptions')->int('id'); | |
| 85 | + $router->post('/{id}/crm-contact/tags', 'SchedulesController@updateCrmTags')->int('id'); | |
| 86 | + $router->post('/{id}/crm-contact/lists', 'SchedulesController@updateCrmLists')->int('id'); | |
| 87 | + $router->post('/{id}/send-confirmation-email', 'SchedulesController@sendConfirmationEmail')->int('id'); | |
| 68 | 88 | |
| 69 | 89 | $router->get('/group-bookings/{group_id}/attendees', 'SchedulesController@getGroupAttendees')->int('group_id'); |
| 70 | 90 | }); |
| 71 | 91 | |
| @@ -84,8 +104,14 @@ | ||
| 84 | 104 | $router->post('/global-modules', 'SettingsController@updateGlobalModules'); |
| 85 | 105 | $router->get('/pages', 'SettingsController@getPages'); |
| 86 | 106 | $router->post('/addons-settings', 'SettingsController@saveAddonsSettings'); |
| 87 | 107 | $router->post('/install-plugin', 'SettingsController@installPlugin'); |
| 108 | + $router->post('/optin', 'SettingsController@updateOptin'); | |
| 109 | + | |
| 110 | + // MCP server settings — see docs/mcp-server-spec.md. | |
| 111 | + $router->get('/mcp', 'McpController@getSettings'); | |
| 112 | + $router->post('/mcp', 'McpController@updateSettings'); | |
| 113 | + $router->post('/mcp/install-adapter', 'McpController@installAdapter'); | |
| 88 | 114 | }); |
| 89 | 115 | |
| 90 | 116 | $router->prefix('availability')->withPolicy('AvailabilityPolicy')->group(function ($router) { |
| 91 | 117 | $router->get('/', 'AvailabilityController@index'); |
| @@ -107,18 +133,18 @@ | ||
| 107 | 133 | $router->get('/activities', 'ReportController@getActivities'); |
| 108 | 134 | }); |
| 109 | 135 | |
| 110 | 136 | $router->prefix('calendars')->withPolicy('CalendarPolicy')->group(function ($router) { |
| 111 | - $router->prefix('{id}/events/{slot_id}/integrations')->group(function ($router) { | |
| 112 | - $router->get('/', 'CalendarIntegrationController@index')->int('id')->int('slot_id'); | |
| 113 | - $router->post('/clone', 'CalendarIntegrationController@cloneIntegrations')->int('id')->int('slot_id'); | |
| 137 | + $router->prefix('{id}/events/{event_id}/integrations')->group(function ($router) { | |
| 138 | + $router->get('/', 'CalendarIntegrationController@index')->int('id')->int('event_id'); | |
| 139 | + $router->post('/clone', 'CalendarIntegrationController@cloneIntegrations')->int('id')->int('event_id'); | |
| 114 | 140 | |
| 115 | 141 | $router->prefix('{integration_id}')->group(function ($router) { |
| 116 | - $router->get('/', 'CalendarIntegrationController@find')->int('id')->int('slot_id')->int('integration_id'); | |
| 117 | - $router->post('/', 'CalendarIntegrationController@update')->int('id')->int('slot_id')->int('integration_id'); | |
| 118 | - $router->delete('/', 'CalendarIntegrationController@delete')->int('id')->int('slot_id')->int('integration_id'); | |
| 119 | - $router->get('/merge-fields', 'CalendarIntegrationController@integrationListComponent'); | |
| 120 | - $router->get('/config-field-options', 'CalendarIntegrationController@getConfigFieldOptions'); | |
| 142 | + $router->get('/', 'CalendarIntegrationController@find')->int('id')->int('event_id')->int('integration_id'); | |
| 143 | + $router->post('/', 'CalendarIntegrationController@update')->int('id')->int('event_id')->int('integration_id'); | |
| 144 | + $router->delete('/', 'CalendarIntegrationController@delete')->int('id')->int('event_id')->int('integration_id'); | |
| 145 | + $router->get('/merge-fields', 'CalendarIntegrationController@integrationListComponent')->int('id')->int('event_id')->int('integration_id'); | |
| 146 | + $router->get('/config-field-options', 'CalendarIntegrationController@getConfigFieldOptions')->int('id')->int('event_id')->int('integration_id'); | |
| 147 | + $router->post('/crm-taxonomy', 'CalendarIntegrationController@createCrmTaxonomy')->int('id')->int('event_id')->int('integration_id'); | |
| 121 | 148 | }); |
| 122 | 149 | }); |
| 123 | 150 | }); |
| 124 | - | |