<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use ImovelZapAi\ClientPortal\Presentation\Http\Controllers\Api\ClientPortalController;

Route::middleware([
    'auth:sanctum',
    'tenant.resolve',
    'tenant.required',
    'tenant.active',
    'role:Admin|Gestor|Corretor',
])->group(function (): void {
    Route::get('client-portals/dashboard', [ClientPortalController::class, 'dashboard']);
    Route::get('client-portals', [ClientPortalController::class, 'index']);
    Route::post('client-portals', [ClientPortalController::class, 'store']);
    Route::get('client-portals/{id}', [ClientPortalController::class, 'show']);
    Route::post('client-portals/{id}/send', [ClientPortalController::class, 'send']);
    Route::post('client-portals/{id}/revoke', [ClientPortalController::class, 'revoke']);
    Route::post('documents/{documentId}/approve', [ClientPortalController::class, 'approve']);
    Route::post('documents/{documentId}/reject', [ClientPortalController::class, 'reject']);
});
