<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\MobileApiController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::prefix('mobile')->group(function () {
    Route::get('ping', [MobileApiController::class, 'ping']);
    Route::post('login', [MobileApiController::class, 'login']);
    Route::get('dashboard', [MobileApiController::class, 'dashboard']);
    Route::get('early-warning', [MobileApiController::class, 'earlyWarning']);
    Route::get('books/{master}/examinations', [MobileApiController::class, 'examinations']);
    Route::get('examinations/{id}', [MobileApiController::class, 'examination']);
    Route::get('examinations/{id}/expertise', [MobileApiController::class, 'expertise']);
    Route::post('examinations/{id}/expertise/template', [MobileApiController::class, 'setExpertiseTemplate']);
    Route::post('examinations/{id}/expertise', [MobileApiController::class, 'saveExpertise']);
});

Route::group([
    'middleware' => 'auth:api'
], function () {
    
});
