<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return response()->json([
        'message' => 'Kenyan Restaurant POS API',
        'version' => '1.0.0',
        'status' => 'running',
        'timestamp' => now()->toISOString(),
        'endpoints' => [
            'auth' => '/api/auth/*',
            'menu' => '/api/menu/*',
            'orders' => '/api/orders/*',
            'kitchen' => '/api/kitchen/*',
            'inventory' => '/api/inventory/*',
            'reports' => '/api/reports/*'
        ]
    ]);
});

// Add a login route to prevent middleware redirect errors
Route::get('/login', function () {
    return response()->json([
        'error' => 'This is an API endpoint. Please use the frontend application for login.',
        'frontend_url' => '/pos/login'
    ], 401);
})->name('login');