<?php

use App\Http\Controllers\Currencies\FetchSystemPrimaryCurrencyController;
use App\Http\Controllers\Currencies\ListCurrencyController;
use App\Http\Controllers\Currencies\CreateCurrencyController;
use App\Http\Controllers\Currencies\DeleteCurrencyController;
use App\Http\Controllers\Currencies\History\ListCurrencyRateHistory;
use Illuminate\Support\Facades\Route;

Route::group(['as' => 'currency.', 'prefix' => 'currency'], function () {
    Route::get('/primary/show', [FetchSystemPrimaryCurrencyController::class, 'fetch'])->name('primary.show');
    Route::get('/list', [ListCurrencyController::class, 'list'])->name('list');
    Route::post('/create', [CreateCurrencyController::class, 'create'])->name('create');
    Route::delete('/delete/{id}', [DeleteCurrencyController::class, 'delete'])->name('delete');

    Route::group(['prefix' => 'history', 'as' => 'history.'], function () {
        Route::get('/list', [ListCurrencyRateHistory::class, 'list'])->name('list');
    });
});
