<?php
/**
 * Branch Batch Routes — ADD these to your branch routes file
 *
 * The branch routes file is loaded from: /gmind/routes/branch.php
 * (or wherever your branch routes are registered — could be in web.php
 *  directly, or in a separate branch_admin.php file).
 *
 * ✅ FIXED: Update route now uses /update suffix to avoid conflict with
 *    POST /branch/batches (store route).
 *
 * Add these lines somewhere AFTER the $router is created.
 * If you already have index/create/store/delete routes, you only need
 * to add the 2 NEW routes marked with ✅ NEW below.
 */

// ─── Branch Batches ──────────────────────────────────────────────────────────

$router->get('/branch/batches', 'BranchAdmin\Controllers\BranchBatchController@index', ['branch_admin']);
$router->get('/branch/batches/create', 'BranchAdmin\Controllers\BranchBatchController@create', ['branch_admin']);
$router->post('/branch/batches', 'BranchAdmin\Controllers\BranchBatchController@store', ['branch_admin']);

// ✅ NEW — Edit form (GET)
$router->get('/branch/batches/{id}/edit', 'BranchAdmin\Controllers\BranchBatchController@edit', ['branch_admin']);

// ✅ NEW — Update handler (POST) — uses /update suffix to avoid conflict with store route
$router->post('/branch/batches/{id}/update', 'BranchAdmin\Controllers\BranchBatchController@update', ['branch_admin']);

$router->post('/branch/batches/{id}/delete', 'BranchAdmin\Controllers\BranchBatchController@delete', ['branch_admin']);

// ─── ALTERNATIVE: If your router supports PUT method, you can also add this ──
// $router->put('/branch/batches/{id}', 'BranchAdmin\Controllers\BranchBatchController@update', ['branch_admin']);
