<?php
    /*
     *--------------------------------------------------------------------------
     * 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!
     *
    */

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Modules\Lpj\Http\Controllers\Api\DebiturController;

// Route untuk pencarian debitur (autocomplete)
Route::middleware(['web', 'auth'])->group(function () {
    Route::get('/debitur/search', [DebiturController::class, 'search'])
        ->name('debitur.search');
    
    // Route untuk get detail debitur berdasarkan code
    Route::get('/debitur/detail', [DebiturController::class, 'getByCode'])
        ->name('debitur.detail');
});
