<?php

use CodeIgniter\Router\RouteCollection;

/**
 * Discipline Module Routes
 *
 * @var RouteCollection $routes
 */

$routes->group('api/discipline', [
    'namespace' => 'App\Modules\Discipline\Controllers',
    'filter'    => 'dashboard_auth',
], function ($routes) {
    $routes->get('violations', 'ViolationController::index');
    $routes->get('levels', 'DisciplineLevelController::index');
    $routes->get('student-violations', 'StudentViolationController::index');
    $routes->post('student-violations', 'StudentViolationController::create');
    $routes->post('violations-admin', 'ViolationAdminController::create', ['filter' => 'admin_only']);
    $routes->put('violations-admin/(:num)', 'ViolationAdminController::update/$1', ['filter' => 'admin_only']);
});

