<?php

/**
 * 통계 API 라우트 (v1)
 *
 * - 대시보드 요약 (sam_stat 기반)
 * - 도메인별 일간/월간 통계
 * - 알림 목록
 */

use App\Http\Controllers\Api\V1\StatController;
use Illuminate\Support\Facades\Route;

Route::prefix('stats')->group(function () {
    Route::get('/summary', [StatController::class, 'summary'])->name('v1.stats.summary');
    Route::get('/daily', [StatController::class, 'daily'])->name('v1.stats.daily');
    Route::get('/monthly', [StatController::class, 'monthly'])->name('v1.stats.monthly');
    Route::get('/alerts', [StatController::class, 'alerts'])->name('v1.stats.alerts');
});

// 미개발 Summary API (플레이스홀더 - 오류 방지용)
$placeholderSummary = function () {
    return response()->json([
        'success' => true,
        'message' => '해당 기능은 현재 준비 중입니다.',
        'data' => null,
    ]);
};

Route::get('production/summary', $placeholderSummary)->name('v1.production.summary');
Route::get('construction/summary', $placeholderSummary)->name('v1.construction.summary');
Route::get('unshipped/summary', $placeholderSummary)->name('v1.unshipped.summary');
Route::get('attendance/summary', $placeholderSummary)->name('v1.attendance.summary');
