<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use Kylin\Parking\Http\Controllers\ParkingController;

/**
 * 停车管理 API 路由
 *
 * 所有路由需通过 auth:sanctum 鉴权，确保操作可追溯（依据《网络安全法》第二十一条）。
 */
Route::prefix('kylin/parking')->middleware(['auth:sanctum'])->group(function () {
    // 车辆出入场
    Route::post('/entry', [ParkingController::class, 'entry']);
    Route::post('/exit', [ParkingController::class, 'exit']);

    // 月卡管理
    Route::post('/monthly-cards', [ParkingController::class, 'createMonthlyCard']);
    Route::post('/monthly-cards/{id}/renew', [ParkingController::class, 'renewMonthlyCard']);
    Route::get('/monthly-cards/expiring-soon', [ParkingController::class, 'expiringSoon']);
});
