<?php

/**
 * HRM Scheduling module routes — employee-to-contract scheduling.
 * @var \CodeIgniter\Router\RouteCollection $routes
 */
$routes->group('scheduling', ['filter' => 'auth'], static function ($routes) {
    $routes->get('staff', '\Modules\Scheduling\Controllers\StaffSchedulingController::index', ['filter' => 'permission:scheduling.view']);
    $routes->post('staff/assign', '\Modules\Scheduling\Controllers\StaffSchedulingController::assign', ['filter' => 'permission:scheduling.create']);
    $routes->post('staff/(:num)/remove', '\Modules\Scheduling\Controllers\StaffSchedulingController::remove/$1', ['filter' => 'permission:scheduling.delete']);

    $routes->get('shifts', '\Modules\Scheduling\Controllers\ShiftPlanningController::index', ['filter' => 'permission:scheduling.view']);
    $routes->post('shifts', '\Modules\Scheduling\Controllers\ShiftPlanningController::store', ['filter' => 'permission:scheduling.create']);
    $routes->post('shifts/(:num)/remove', '\Modules\Scheduling\Controllers\ShiftPlanningController::remove/$1', ['filter' => 'permission:scheduling.delete']);

    $routes->get('calendar', '\Modules\Scheduling\Controllers\SchedulingCalendarController::index', ['filter' => 'permission:scheduling.view']);

    $routes->get('assignments', '\Modules\Scheduling\Controllers\AssignmentController::index', ['filter' => 'permission:scheduling.view']);
    $routes->post('assignments', '\Modules\Scheduling\Controllers\AssignmentController::store', ['filter' => 'permission:scheduling.create']);
    $routes->post('assignments/(:num)/remove', '\Modules\Scheduling\Controllers\AssignmentController::remove/$1', ['filter' => 'permission:scheduling.delete']);
});
