<?php // phpcs:ignore
/**
 * Goodmeet_API Class
 *
 * This class manages the Goodmeet_API functionality for the goodmeet plugin.
 *
 * @package SOVLIX\GOODMEET
 */

namespace SOVLIX\GOODMEET;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'Goodmeet_API' ) ) {
	/**
	 * Goodmeet_API Class
	 *
	 * Handles Goodmeet_API-related tasks and functionality for the goodmeet plugin.
	 *
	 * @since 1.0.0
	 */
	class Goodmeet_API {
		/**
		 * Goodmeet_API constructor.
		 *
		 * Initializes the Goodmeet_API class.
		 */
		public function __construct() {
			add_action( 'rest_api_init', array( $this, 'register_api' ) );
		}

		/**
		 * Register the Goodmeet_API
		 *
		 * Performs tasks related to registering the Goodmeet_API for the goodmeet plugin.
		 *
		 * @return void
		 *
		 * @since 1.0.0
		 */
		public function register_api() {
			$meetings = new API\Goodmeet_Meetings();
			$meetings->register_routes();
			$settings = new API\Goodmeet_Settings();
			$settings->register_routes();
		}
	}
}
