<?php

use App\Domains\Auth\Controllers\CreateScannerResetPasswordAttemptController;
use App\Domains\Auth\Controllers\ResetPasswordController;
use App\Domains\Auth\Controllers\ScannerLoginController;
use App\Domains\Auth\Controllers\ScannerMeController;
use App\Domains\Auth\Controllers\ValidateResetPasswordAttemptController;
use Illuminate\Support\Facades\Route;

Route::prefix('v1/scanner')->group(function (): void {
    Route::post('login', ScannerLoginController::class)->middleware('throttle:login');
    Route::post('password/reset-attempts', CreateScannerResetPasswordAttemptController::class)
        ->middleware('throttle:5,1');
    Route::post('password/reset-attempts/validate', ValidateResetPasswordAttemptController::class)
        ->middleware('throttle:10,1');
    Route::post('password/reset', ResetPasswordController::class)
        ->middleware('throttle:5,1');
    Route::middleware(['auth:sanctum', 'scanner.tenant'])
        ->get('me', ScannerMeController::class);
});
