<?php
/**
 * Super Admin Routes - Pattern System
 * 
 * Add these routes to your main routes file (usually in /gmind/routes/web.php 
 * or wherever your super-admin routes are defined)
 * 
 * Make sure your router matches route params by NAME (not position),
 * so {id} in the route matches the method parameter name $id
 */

use SuperAdmin\Controllers\SuperAdminPatternController;

// Pattern CRUD
$router->get('/super-admin/patterns', [SuperAdminPatternController::class, 'index']);
$router->get('/super-admin/patterns/create', [SuperAdminPatternController::class, 'create']);
$router->post('/super-admin/patterns/create', [SuperAdminPatternController::class, 'create']);
$router->get('/super-admin/patterns/edit/{id}', [SuperAdminPatternController::class, 'edit']);
$router->post('/super-admin/patterns/edit/{id}', [SuperAdminPatternController::class, 'edit']);

// Background upload (AJAX)
$router->post('/super-admin/patterns/upload-background/{id}', [SuperAdminPatternController::class, 'uploadBackground']);

// Save mapping (AJAX)
$router->post('/super-admin/patterns/save-ajax/{id}', [SuperAdminPatternController::class, 'saveAjax']);

// Live preview
$router->get('/super-admin/patterns/preview/{id}', [SuperAdminPatternController::class, 'preview']);
$router->post('/super-admin/patterns/preview/{id}', [SuperAdminPatternController::class, 'preview']);

// Lock / Unlock / Clone / Default / Delete
$router->get('/super-admin/patterns/lock/{id}', [SuperAdminPatternController::class, 'lock']);
$router->get('/super-admin/patterns/unlock/{id}', [SuperAdminPatternController::class, 'unlock']);
$router->get('/super-admin/patterns/clone/{id}', [SuperAdminPatternController::class, 'clone']);
$router->get('/super-admin/patterns/set-default/{id}', [SuperAdminPatternController::class, 'setDefault']);
$router->get('/super-admin/patterns/delete/{id}', [SuperAdminPatternController::class, 'delete']);

// Assign pattern to course (AJAX)
$router->post('/super-admin/patterns/assign-course', [SuperAdminPatternController::class, 'assignToCourse']);
