<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use ImovelZapAi\Documents\Presentation\Http\Controllers\Api\DocumentController;

Route::middleware([
    'auth:sanctum',
    'tenant.resolve',
    'tenant.required',
    'tenant.active',
    'role:Admin|Gestor|Corretor',
])->group(function (): void {
    Route::get('documents/dashboard', [DocumentController::class, 'dashboard']);
    Route::get('documents/templates', [DocumentController::class, 'templates']);
    Route::post('documents/templates', [DocumentController::class, 'storeTemplate']);
    Route::put('documents/templates/{id}', [DocumentController::class, 'updateTemplate']);
    Route::get('documents/variables', [DocumentController::class, 'variables']);
    Route::get('documents', [DocumentController::class, 'index']);
    Route::post('documents', [DocumentController::class, 'store']);
    Route::get('documents/{id}', [DocumentController::class, 'show']);
    Route::post('documents/{id}/versions', [DocumentController::class, 'version']);
    Route::post('documents/{id}/share', [DocumentController::class, 'share']);
    Route::post('documents/{id}/comments', [DocumentController::class, 'comment']);
});
