<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\MovimentiController as ApiMovimentiController;
use App\Http\Controllers\Api\CategorieController as ApiCategorieController;
use App\Http\Controllers\Api\ContoController as ApiContoController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->group(function () {
    Route::post('/movimenti/spesa', [ApiMovimentiController::class, 'insMovimentiSpesa']);
    Route::post('/movimenti/entrata', [ApiMovimentiController::class, 'insMovimentiEntrata']);
    Route::get('/movimenti', [ApiMovimentiController::class, 'getList']);
    Route::get('/categorie', [ApiCategorieController::class, 'listCategorie']);
    Route::post('/categorie', [ApiCategorieController::class, 'insCategorie']);
    Route::put('/categorie/{id}', [ApiCategorieController::class, 'updateCategorie']);
    Route::delete('/categorie/{id}', [ApiCategorieController::class, 'deleteCategorie']);
    Route::get('/conti', [ApiContoController::class, 'listConti']);
    Route::post('/conti', [ApiContoController::class, 'insConto']);
    Route::put('/conti/{id}', [ApiContoController::class, 'updateConto']);
    Route::delete('/conti/{id}', [ApiContoController::class, 'deleteConto']);
});
