<?php

use App\Http\Controllers\Api\AkunController;
use App\Http\Controllers\Api\AnggotaController;
use App\Http\Controllers\Api\BankController;
use App\Http\Controllers\Api\DashboardController;
use App\Http\Controllers\Api\DepositoController;
use App\Http\Controllers\Api\JurnalController;
use App\Http\Controllers\Api\KasController;
use App\Http\Controllers\Api\LaporanController;
use App\Http\Controllers\Api\PegawaiController;
use App\Http\Controllers\Api\PenempatanController;
use App\Http\Controllers\Api\ProdukDepositoController;
use App\Http\Controllers\Api\ProdukTabunganController;
use App\Http\Controllers\Api\ProfilController;
use App\Http\Controllers\Api\RoleController;
use App\Http\Controllers\Api\TabunganController;
use App\Http\Controllers\Api\TransaksiDepositoController;
use App\Http\Controllers\Api\TransaksiKasController;
use App\Http\Controllers\Api\TransaksiPenempatanController;
use App\Http\Controllers\Api\TransaksiTabunganController;
use App\Http\Controllers\Api\UserController;
use Illuminate\Support\Facades\Route;

Route::middleware('auth:sanctum')->group(function () {
    // Route::middleware([])->group(function () {
    Route::resource('/user', UserController::class);
    Route::resource('/user', UserController::class);
    Route::resource('/role', RoleController::class);
    Route::resource('/anggota', AnggotaController::class);
    Route::resource('/tabungan', TabunganController::class);
    Route::resource('/deposito', DepositoController::class);
    Route::resource('/produk/tabungan', ProdukTabunganController::class);
    Route::resource('/produk/deposito', ProdukDepositoController::class);
    Route::resource('/akun', AkunController::class);
    Route::resource('/bank', BankController::class);
    Route::resource('/pegawai', PegawaiController::class);
    Route::resource('/penempatan-bank', PenempatanController::class);

    Route::resource('/transaksi/tabungan', TransaksiTabunganController::class);
    Route::resource('/transaksi/penempatan', TransaksiPenempatanController::class);
    Route::resource('/transaksi/kas', TransaksiKasController::class);
    Route::resource('/transaksi/deposito', TransaksiDepositoController::class);
    Route::resource('/jurnal', JurnalController::class);
    Route::resource('/profil', ProfilController::class);
    Route::resource('/kas', KasController::class);
    Route::get('/saldo-akun/{id}', [JurnalController::class, 'saldoAkun']);

    Route::get('/laporan/transaksi-rincian', [LaporanController::class, 'laporanTransaksiRincian']);
    Route::get('/laporan/transaksi-rekap', [LaporanController::class, 'laporanTransaksiRekap']);
    Route::get('/laporan/nominatif-anggota', [LaporanController::class, 'laporanNominatifAnggota']);
    Route::get('/laporan/nominatif-tabungan', [LaporanController::class, 'laporanNominatifTabungan']);
    Route::get('/laporan/nominatif-deposito', [LaporanController::class, 'laporanNominatifDeposito']);
    Route::get('/laporan/buku-besar', [LaporanController::class, 'laporanBukuBesar']);
    Route::get('/laporan/neraca', [JurnalController::class, 'getNeraca']);
    Route::get('/laporan/laba-rugi', [JurnalController::class, 'getLabaRugi']);

    Route::get('/dashboard-info', [LaporanController::class, 'laporanNominatifAnggota']);
    Route::get('/kelurahan', [AnggotaController::class, 'kelurahan']);
    Route::get('/kecamatan', [AnggotaController::class, 'kecamatan']);
    Route::get('/kabupaten', [AnggotaController::class, 'kabupaten']);

    Route::get('/dashboard', [DashboardController::class, 'index']);

    Route::get('/laporan/verbal', [JurnalController::class, 'getVerbal']);
    Route::post('/laporan/verbal', [JurnalController::class, 'simpanVerbal']);
});
