<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Home::index');

//$routes->post('auth/register', 'AuthController::register');
//$routes->post('api/add-contact', 'ContactController::addContact');

$routes->options('(:any)', 'Auth::options');

$routes->group('auth', function($routes) {
    $routes->post('checkUser', 'Auth::checkUser');
    $routes->post('handleAuth', 'Auth::handleAuth');
    $routes->post('verifyOtpAndFinalize', 'Auth::verifyOtpAndFinalize');
    $routes->post('auth/logout', 'Auth::logout');
});

$routes->post('trigger-alert', 'AlertController::trigger');
//$routes->post('auth/sendOtp', 'AuthController::sendOtp');
//$routes->post('auth/verifyOtp', 'AuthController::verifyOtp');

$routes->post('session/start', 'SessionController::startSession');
$routes->post('session/heartbeat', 'SessionController::heartbeat');
$routes->post('session/emergency', 'SessionController::triggerEmergency');
$routes->post('session/stop', 'SessionController::stopSession');
$routes->post('session/validate-qr', 'SessionController::validateQr');
$routes->get('session/myqr', 'SessionController::myQr');
$routes->post('session/update_wallet', 'SessionController::update_wallet');
$routes->post('session/get_wallet', 'SessionController::get_wallet');
$routes->post('session/status', 'SessionController::status');

$routes->post('session/sms', 'SessionController::testSms');

$routes->get('tracking/getLiveLocation', 'TrackingController::getLiveLocation');
$routes->get('tracking/getRouteHistory', 'TrackingController::getRouteHistory');

/*$routes->group('api', function($routes) {
    // Tracking Portal Routes
    $routes->get('tracking/getLiveLocation', 'TrackingController::getLiveLocation');
});*/

$routes->post('payment/create_order', 'PaymentController::create_order');
$routes->post('payment/payment_update_wallet', 'PaymentController::payment_update_wallet');

$routes->post('user/update_profile', 'ContactController::update_profile');
$routes->post('user/update_contact', 'ContactController::update_contact');
$routes->post('user/upload_profile_image', 'ContactController::upload_profile_image');
$routes->post('user/get_user_data', 'ContactController::get_user_data');


$routes->post('api/update-location', 'VolunteerApi::updateLocation');
$routes->post('api/alert-volunteers', 'VolunteerApi::alertVolunteers');
$routes->post('api/register-volunteer', 'VolunteerApi::registerVolunteer');


