<?php
// ============================================================
// ADD these routes inside the protected group in Routes.php
// (inside the `$routes->group('', ['filter'=>'auth'], ...)` block)
// ============================================================

// --- Work Orders (replace the existing work order block) ---
$routes->get('workorders',                        'WorkOrders::index');
$routes->get('workorders/create',                 'WorkOrders::create');
$routes->post('workorders/store',                 'WorkOrders::store');
$routes->get('workorders/view/(:num)',            'WorkOrders::view/$1');
$routes->get('workorders/edit/(:num)',            'WorkOrders::edit/$1');
$routes->post('workorders/update/(:num)',         'WorkOrders::update/$1');
$routes->post('workorders/delete/(:num)',         'WorkOrders::delete/$1');
$routes->post('workorders/status',               'WorkOrders::updateStatus');
$routes->post('workorders/comment/(:num)',        'WorkOrders::addComment/$1');
$routes->post('workorders/upload/(:num)',         'WorkOrders::uploadAttachment/$1');
$routes->post('workorders/escalate/(:num)',       'WorkOrders::escalate/$1');
$routes->get('workorders/schedule',              'WorkOrders::schedule');

// Labor
$routes->post('workorders/labor/add/(:num)',     'WorkOrders::addLabor/$1');
$routes->post('workorders/labor/delete/(:num)',  'WorkOrders::deleteLabor/$1');  // laborId

// Materials
$routes->post('workorders/material/add/(:num)',    'WorkOrders::addMaterial/$1');
$routes->post('workorders/material/delete/(:num)', 'WorkOrders::deleteMaterial/$1');  // matId

// Approval
$routes->post('workorders/approve/(:num)',        'WorkOrders::approve/$1');
$routes->post('workorders/reject/(:num)',         'WorkOrders::reject/$1');

// Meter readings
$routes->post('workorders/meter/(:num)',          'WorkOrders::addMeterReading/$1');
