<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\V1\ConfigParameter;
use App\Http\Controllers\Api\V1\LaporanController;
use App\Http\Controllers\Api\V1\MemberinController;
use App\Http\Controllers\Api\V1\TransaksiMember;
use App\Http\Controllers\Api\V1\TransaksiParkir;

/*
|--------------------------------------------------------------------------
| 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')->get('/user', function (Request $request) {
    return $request->user();
});

Route::get('location', [ConfigParameter::class, 'index']);

Route::prefix('transaksi')->group(function () {
    Route::get('stiker/telusuri', [TransaksiMember::class, 'status']);
    Route::resource('stiker', TransaksiMember::class);
    Route::resource('parkir', TransaksiParkir::class);        
});

Route::resource('member', MemberinController::class)->names('memberin');

Route::prefix('report')->group(function () {
    Route::post('harian', [LaporanController::class, 'harian']);
    Route::post('payment', [LaporanController::class, 'payment']);
    Route::post('operator', [LaporanController::class, 'operator']);
    Route::post('gate', [LaporanController::class, 'gate']);
    Route::post('daily', [LaporanController::class, 'daily']);
});
