<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

use App\Http\Controllers\Api\AuthController;
use App\Http\Controllers\Api\WebsiteController;

Route::post('/register', [AuthController::class, 'register']);
Route::post('/login', [AuthController::class, 'login']);

Route::middleware('auth:sanctum')->group(function () {
    Route::post('/logout', [AuthController::class, 'logout']);
    Route::get('/user', [AuthController::class, 'user']);

    Route::get('/websites', [WebsiteController::class, 'index']);
    Route::post('/websites', [WebsiteController::class, 'store']);
    Route::post('/websites/bulk', [WebsiteController::class, 'bulkStore']);
    Route::delete('/websites/{id}', [WebsiteController::class, 'destroy']);
    
    Route::post('/websites/{id}/scan', [WebsiteController::class, 'scan']);
    Route::post('/websites/{id}/retry', [WebsiteController::class, 'retry']);
    Route::post('/websites/scan-bulk', [WebsiteController::class, 'bulkScan']);
});
