<?php

use Illuminate\Support\Facades\Route;
use Modules\LabCore\Http\Controllers\Api\AgentController;

/*
| LabBridge Agent API.
| The RouteServiceProvider already applies the `api` prefix + `api` middleware,
| so these resolve under /api/lab/...
| Each agent authenticates with its per-agent bearer token (lab_agents.api_token).
*/
Route::prefix('lab')->group(function () {

    Route::prefix('agent')->group(function () {
        Route::post('register',  [AgentController::class, 'register']);
        Route::post('heartbeat', [AgentController::class, 'heartbeat']);
    });

    Route::post('results',       [AgentController::class, 'results']);
    Route::post('events',        [AgentController::class, 'events']);
    Route::get('worklist',       [AgentController::class, 'worklist']);
    Route::post('sync/manifest', [AgentController::class, 'syncManifest']);
});
