<?php

use App\Domains\Auth\Controllers\AdminAppLoginController;
use App\Domains\Auth\Controllers\AdminAppMeController;
use App\Domains\Auth\Controllers\CreateAdminAppResetPasswordAttemptController;
use App\Domains\Auth\Controllers\ResetPasswordController;
use App\Domains\Auth\Controllers\ValidateResetPasswordAttemptController;
use Illuminate\Support\Facades\Route;

Route::prefix('v1/adminapp')->group(function (): void {
    Route::post('login', AdminAppLoginController::class)->middleware('throttle:login');
    Route::post('password/reset-attempts', CreateAdminAppResetPasswordAttemptController::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', 'adminapp.tenant'])
        ->get('me', AdminAppMeController::class);
});
