<?php

use CodeIgniter\Router\RouteCollection;

/** @var RouteCollection $routes */
$routes->get('/', 'Home::index');
$routes->post('enroll', 'Checkout::enroll');
$routes->post('enroll/verify', 'Checkout::enrollVerify');
$routes->match(['get', 'post'], 'admin', 'Admin::index');
$routes->match(['get', 'post'], 'student/login', 'Student::login');
$routes->get('student/dashboard', 'Student::dashboard');
$routes->get('student/logout', 'Student::logout');

// Admin — Course Content Manager
$routes->post('admin/lesson/add',         'Admin::addLesson');
$routes->get('admin/lesson/(:num)',        'Admin::getLesson/$1');
$routes->post('admin/lesson/update/(:num)','Admin::updateLesson/$1');
$routes->post('admin/lesson/delete/(:num)','Admin::deleteLesson/$1');

// Admin — Student Manager
$routes->post('admin/student/add',         'Admin::addStudent');
$routes->get('admin/student/(:num)',        'Admin::getStudent/$1');
$routes->post('admin/student/update/(:num)','Admin::updateStudent/$1');
$routes->post('admin/student/delete/(:num)','Admin::deleteStudent/$1');

// Razorpay Webhook Callback
$routes->post('webhook/razorpay',           'Checkout::razorpayWebhook');


