| @@ -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,10 +9,8 @@ | ||
| 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'); |
| 17 | 15 | |
| 18 | 16 | $router->get('/{id}', 'CalendarController@getCalendar')->int('id'); |
| @@ -33,9 +31,9 @@ | ||
| 33 | 31 | $router->get('/{id}/events/{event_id}', 'CalendarController@getEvent')->int('id')->int('event_id'); |
| 34 | 32 | $router->put('/{id}/events/{event_id}', 'CalendarController@patchCalendarEvent')->int('id')->int('event_id'); |
| 35 | 33 | $router->delete('/{id}/events/{event_id}', 'CalendarController@deleteCalendarEvent')->int('id')->int('event_id'); |
| 36 | 34 | |
| 37 | - $router->get('/{id}/events/{event_id}/availability', 'CalendarController@getAvailabilitySettings')->int('event_id'); | |
| 35 | + $router->get('/{id}/events/{event_id}/availability', 'CalendarController@getAvailabilitySettings')->int('id')->int('event_id'); | |
| 38 | 36 | $router->post('/{id}/events/{event_id}/details', 'CalendarController@updateEventDetails')->int('id')->int('event_id'); |
| 39 | 37 | $router->post('/{id}/events/{event_id}/availability', 'CalendarController@updateEventAvailability')->int('id')->int('event_id'); |
| 40 | 38 | $router->post('/{id}/events/{event_id}/limits', 'CalendarController@updateEventLimits')->int('id')->int('event_id'); |
| 41 | 39 | |
| @@ -44,8 +42,13 @@ | ||
| 44 | 42 | $router->post('/{id}/events/{event_id}/email-notifications/clone', 'CalendarController@cloneEventEmailNotification')->int('id')->int('event_id'); |
| 45 | 43 | |
| 46 | 44 | $router->get('/{id}/events/{event_id}/booking-fields', 'CalendarController@getEventBookingFields')->int('id')->int('event_id'); |
| 47 | 45 | $router->post('/{id}/events/{event_id}/booking-fields', 'CalendarController@saveEventBookingFields')->int('id')->int('event_id'); |
| 46 | + | |
| 47 | + if (!defined('FLUENT_BOOKING_PRO_DIR_FILE')) { | |
| 48 | + // Pro registers this path (plus the POST) via PaymentMethodController; only own it standalone. | |
| 49 | + $router->get('/{id}/events/{event_id}/payment-settings', 'CalendarController@getEventPaymentSettings')->int('id')->int('event_id'); | |
| 50 | + } | |
| 48 | 51 | }); |
| 49 | 52 | |
| 50 | 53 | $router->prefix('admin')->withPolicy('AdminPolicy')->group(function ($router) { |
| 51 | 54 | $router->get('remaining-hosts', 'AdminController@getRemainingHosts'); |
| @@ -59,19 +62,26 @@ | ||
| 59 | 62 | |
| 60 | 63 | $router->prefix('bookings')->withPolicy('CalendarEventPolicy')->group(function ($router) { |
| 61 | 64 | $router->get('/', 'BookingController@getBookings'); |
| 62 | 65 | $router->get('event/{event_id}', 'BookingController@getEvent')->int('event_id'); |
| 66 | + $router->get('slots/{event_id}', 'BookingController@getSlots')->int('event_id'); | |
| 63 | 67 | $router->post('create/{event_id}', 'BookingController@createBooking')->int('event_id'); |
| 64 | 68 | }); |
| 65 | 69 | |
| 66 | 70 | $router->prefix('schedules')->withPolicy('MeetingPolicy')->group(function ($router) { |
| 67 | 71 | $router->get('/', 'SchedulesController@index'); // Need to check permission on the controller method |
| 72 | + $router->get('/export', 'SchedulesController@export'); | |
| 73 | + $router->get('/crm-contact-prefill', 'SchedulesController@getCrmContactPrefill'); | |
| 74 | + $router->get('/crm-contact-search', 'SchedulesController@searchCrmContacts'); | |
| 68 | 75 | $router->get('/{id}', 'SchedulesController@getBooking')->int('id'); |
| 69 | 76 | $router->delete('/{id}', 'SchedulesController@deleteBooking')->int('id'); |
| 70 | - $router->get('/{id}/slot', 'SchedulesController@getScheduleSpot')->int('id'); | |
| 71 | 77 | $router->put('/{id}', 'SchedulesController@patchBooking')->int('id'); |
| 72 | 78 | $router->get('/{id}/activities', 'SchedulesController@getBookingActivities')->int('id'); |
| 73 | 79 | $router->get('/{id}/meta-info', 'SchedulesController@getBookingMetaInfo')->int('id'); |
| 80 | + $router->get('/{id}/crm-contact', 'SchedulesController@getCrmContact')->int('id'); | |
| 81 | + $router->get('/{id}/crm-options', 'SchedulesController@getCrmOptions')->int('id'); | |
| 82 | + $router->post('/{id}/crm-contact/tags', 'SchedulesController@updateCrmTags')->int('id'); | |
| 83 | + $router->post('/{id}/crm-contact/lists', 'SchedulesController@updateCrmLists')->int('id'); | |
| 74 | 84 | $router->post('/{id}/send-confirmation-email', 'SchedulesController@sendConfirmationEmail')->int('id'); |
| 75 | 85 | |
| 76 | 86 | $router->get('/group-bookings/{group_id}/attendees', 'SchedulesController@getGroupAttendees')->int('group_id'); |
| 77 | 87 | }); |
| @@ -91,8 +101,13 @@ | ||
| 91 | 101 | $router->post('/global-modules', 'SettingsController@updateGlobalModules'); |
| 92 | 102 | $router->get('/pages', 'SettingsController@getPages'); |
| 93 | 103 | $router->post('/addons-settings', 'SettingsController@saveAddonsSettings'); |
| 94 | 104 | $router->post('/install-plugin', 'SettingsController@installPlugin'); |
| 105 | + | |
| 106 | + // MCP server settings — see docs/mcp-server-spec.md. | |
| 107 | + $router->get('/mcp', 'McpController@getSettings'); | |
| 108 | + $router->post('/mcp', 'McpController@updateSettings'); | |
| 109 | + $router->post('/mcp/install-adapter', 'McpController@installAdapter'); | |
| 95 | 110 | }); |
| 96 | 111 | |
| 97 | 112 | $router->prefix('availability')->withPolicy('AvailabilityPolicy')->group(function ($router) { |
| 98 | 113 | $router->get('/', 'AvailabilityController@index'); |
| @@ -114,18 +129,18 @@ | ||
| 114 | 129 | $router->get('/activities', 'ReportController@getActivities'); |
| 115 | 130 | }); |
| 116 | 131 | |
| 117 | 132 | $router->prefix('calendars')->withPolicy('CalendarPolicy')->group(function ($router) { |
| 118 | - $router->prefix('{id}/events/{slot_id}/integrations')->group(function ($router) { | |
| 119 | - $router->get('/', 'CalendarIntegrationController@index')->int('id')->int('slot_id'); | |
| 120 | - $router->post('/clone', 'CalendarIntegrationController@cloneIntegrations')->int('id')->int('slot_id'); | |
| 133 | + $router->prefix('{id}/events/{event_id}/integrations')->group(function ($router) { | |
| 134 | + $router->get('/', 'CalendarIntegrationController@index')->int('id')->int('event_id'); | |
| 135 | + $router->post('/clone', 'CalendarIntegrationController@cloneIntegrations')->int('id')->int('event_id'); | |
| 121 | 136 | |
| 122 | 137 | $router->prefix('{integration_id}')->group(function ($router) { |
| 123 | - $router->get('/', 'CalendarIntegrationController@find')->int('id')->int('slot_id')->int('integration_id'); | |
| 124 | - $router->post('/', 'CalendarIntegrationController@update')->int('id')->int('slot_id')->int('integration_id'); | |
| 125 | - $router->delete('/', 'CalendarIntegrationController@delete')->int('id')->int('slot_id')->int('integration_id'); | |
| 126 | - $router->get('/merge-fields', 'CalendarIntegrationController@integrationListComponent'); | |
| 127 | - $router->get('/config-field-options', 'CalendarIntegrationController@getConfigFieldOptions'); | |
| 138 | + $router->get('/', 'CalendarIntegrationController@find')->int('id')->int('event_id')->int('integration_id'); | |
| 139 | + $router->post('/', 'CalendarIntegrationController@update')->int('id')->int('event_id')->int('integration_id'); | |
| 140 | + $router->delete('/', 'CalendarIntegrationController@delete')->int('id')->int('event_id')->int('integration_id'); | |
| 141 | + $router->get('/merge-fields', 'CalendarIntegrationController@integrationListComponent')->int('id')->int('event_id')->int('integration_id'); | |
| 142 | + $router->get('/config-field-options', 'CalendarIntegrationController@getConfigFieldOptions')->int('id')->int('event_id')->int('integration_id'); | |
| 143 | + $router->post('/crm-taxonomy', 'CalendarIntegrationController@createCrmTaxonomy')->int('id')->int('event_id')->int('integration_id'); | |
| 128 | 144 | }); |
| 129 | 145 | }); |
| 130 | 146 | }); |
| 131 | - | |