<?php

use App\Modules\SuperAdmin\Controllers\CompanyController;
use App\Modules\SuperAdmin\Controllers\DashboardController;
use App\Modules\SuperAdmin\Controllers\FeatureController;
use App\Modules\SuperAdmin\Controllers\PlanController;
use App\Modules\SuperAdmin\Controllers\SubscriptionController;
use Illuminate\Support\Facades\Route;

Route::middleware(['auth:sanctum', 'super-admin'])
    ->prefix('super-admin')
    ->group(function (): void {
        Route::get('/summary', [DashboardController::class, 'summary']);

        Route::get('/companies', [CompanyController::class, 'index']);
        Route::patch('/companies/{company}/status', [CompanyController::class, 'updateStatus']);

        Route::get('/plans', [PlanController::class, 'index']);
        Route::post('/plans', [PlanController::class, 'store']);
        Route::patch('/plans/{plan}', [PlanController::class, 'update']);

        Route::get('/features', [FeatureController::class, 'index']);
        Route::patch('/features/{feature}', [FeatureController::class, 'update']);

        Route::get('/subscriptions', [SubscriptionController::class, 'index']);
        Route::patch('/subscriptions/{subscription}', [SubscriptionController::class, 'update']);
    });
