<?php

namespace FleekDash\Controllers;

use WP_REST_Request;
use FleekDash\API\RollbackManagementAPI;

/**
 * Rollback Controller
 *
 * V2.2 Controller that delegates to existing RollbackManagementAPI logic
 *
 * @package FleekDash\Controllers
 * @since 2.2.0 - Phase 2 Migration
 */
class RollbackController
{
    /**
     * @var RollbackManagementAPI
     */
    private $api;

    public function __construct()
    {
        $this->api = new RollbackManagementAPI();
    }

    public function getVersions(WP_REST_Request $request)
    {
        return $this->api->getVersions($request);
    }

    public function startRollback(WP_REST_Request $request)
    {
        return $this->api->startRollback($request);
    }

    public function getRollbackStatus(WP_REST_Request $request)
    {
        return $this->api->getRollbackStatus($request);
    }

    public function cancelRollback(WP_REST_Request $request)
    {
        return $this->api->cancelRollback($request);
    }

    public function listBackups(WP_REST_Request $request)
    {
        return $this->api->listBackups($request);
    }

    public function restoreBackup(WP_REST_Request $request)
    {
        return $this->api->restoreBackup($request);
    }
}
