<?php

use Illuminate\Support\Facades\Route;
use ViartasThemes\ViartasTheme\Controllers\DashboardController;
use ViartasThemes\ViartasTheme\Controllers\AccountingController;
use ViartasThemes\ViartasTheme\Controllers\UserController;

/*
|--------------------------------------------------------------------------
| Viartas Admin Theme Routes
|--------------------------------------------------------------------------
|
| These routes are loaded by the ThemeServiceProvider and are assigned
| the "web" middleware group. Customize as needed.
|
*/

Route::middleware(['web', 'auth'])->prefix('admin')->name('viartas.')->group(function () {

    // Dashboard
    Route::get('/', [DashboardController::class, 'index'])->name('dashboard');

    // Analytics
    Route::get('/analytics', [DashboardController::class, 'analytics'])->name('analytics');

    // Accounting Module
    Route::prefix('accounting')->name('accounting.')->group(function () {
        Route::get('/invoices', [AccountingController::class, 'invoices'])->name('invoices');
        Route::get('/expenses', [AccountingController::class, 'expenses'])->name('expenses');
        Route::get('/reports', [AccountingController::class, 'reports'])->name('reports');
    });

    // Users Module
    Route::prefix('users')->name('users.')->group(function () {
        Route::get('/', [UserController::class, 'index'])->name('index');
        Route::get('/roles', [UserController::class, 'roles'])->name('roles');
        Route::get('/permissions', [UserController::class, 'permissions'])->name('permissions');
    });

    // Settings
    Route::get('/settings', [DashboardController::class, 'settings'])->name('settings');
});
