<?php
/**
 * REST API routes loader class.
 *
 * @package    100Prints
 */

class Hundred_Prints_API_Loader {

	/**
	 * Register all REST API routes.
	 */
	public function register_rest_routes() {
		// Include route files
		require_once HUNDRED_PRINTS_PATH . 'api/class-route-templates.php';
		require_once HUNDRED_PRINTS_PATH . 'api/class-route-resolve.php';
		require_once HUNDRED_PRINTS_PATH . 'api/class-route-log.php';
		require_once HUNDRED_PRINTS_PATH . 'api/class-route-connect.php';
		require_once HUNDRED_PRINTS_PATH . 'api/class-route-status.php';
		require_once HUNDRED_PRINTS_PATH . 'api/class-route-sync.php';
		require_once HUNDRED_PRINTS_PATH . 'api/class-route-analytics.php';

		// Instantiate and register routes
		$routes = [
			new Hundred_Prints_Route_Templates(),
			new Hundred_Prints_Route_Resolve(),
			new Hundred_Prints_Route_Log(),
			new Hundred_Prints_Route_Connect(),
			new Hundred_Prints_Route_Status(),
			new Hundred_Prints_Route_Sync(),
			new Hundred_Prints_Route_Analytics(),
		];

		foreach ( $routes as $route ) {
			$route->register_routes();
		}
	}
}

