<?php

use Illuminate\Support\Facades\Route;
use Pterodactyl\Http\Controllers\ModpackAPIController;

/*
|--------------------------------------------------------------------------
| ModpackChecker Client Routes
|--------------------------------------------------------------------------
|
| Blueprint auto-prefixes these with /api/client/extensions/modpackchecker/
| So our paths here are relative to that prefix.
|
*/

// Manual check (POST — makes live API call)
Route::post('/servers/{server}/check', [ModpackAPIController::class, 'manualCheck']);

// Dashboard badge status (GET — reads from DB cache only)
Route::get('/status', [ModpackAPIController::class, 'getStatus']);

// Server status from cache (GET — no external API calls)
Route::get('/servers/{server}/status', [ModpackAPIController::class, 'serverStatus']);

// Release history for recalibrate dropdown (GET — makes external API call)
Route::get('/servers/{server}/releases', [ModpackAPIController::class, 'releases']);

// Recalibrate current version (POST — saves user selection)
Route::post('/servers/{server}/calibrate', [ModpackAPIController::class, 'calibrate']);

// Ignore/restore server (POST — toggles is_ignored flag)
Route::post('/servers/{server}/ignore', [ModpackAPIController::class, 'toggleIgnore']);
