<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use ImovelZapAi\Financial\Presentation\Http\Controllers\Api\FinancialController;

Route::middleware([
    'auth:sanctum',
    'tenant.resolve',
    'tenant.required',
    'tenant.active',
    'role:Admin|Gestor|Corretor',
])->prefix('financial')->group(function (): void {
    Route::get('dashboard', [FinancialController::class, 'dashboard']);
    Route::get('/', [FinancialController::class, 'index']);
    Route::get('deals/{dealId}', [FinancialController::class, 'show']);
    Route::post('deals/{dealId}/payments', [FinancialController::class, 'storePayment']);
    Route::get('deals/{dealId}/commissions', [FinancialController::class, 'commissions']);
    Route::get('deals/{dealId}/transfers', [FinancialController::class, 'transfers']);
    Route::get('deals/{dealId}/receipts', [FinancialController::class, 'receipts']);
});
