<?php

namespace SugarCalendarBookings\Ajax;

use SugarCalendarBookings\BookingForm\BookingFormController;
use SugarCalendarBookings\Payments\PaymentsController;
use SugarCalendarBookings\Support\Ajax\AbstractRoutes;

/**
 * Frontend AJAX routes.
 *
 * @since 1.0.0
 */
class FrontendRoutes extends AbstractRoutes {

	/**
	 * Register the routes.
	 *
	 * @since 1.0.0
	 */
	protected function register() {

		// Appointments.
		$this->route( 'booking_form_appointment_create', [ BookingFormController::class, 'create' ] )->public();
		$this->route( 'booking_form_appointment_cancel', [ BookingFormController::class, 'cancel' ] )->public();

		// Payments.
		$this->route( 'payments_authorize', [ PaymentsController::class, 'authorize' ] )->public();
		$this->route( 'payments_capture', [ PaymentsController::class, 'capture' ] )->public();
	}
}
