- DashboardCeoController/Service: 6개 섹션 API 신규 (매출/매입/생산/미출고/시공/근태) - DailyReportController/Service: 엑셀 다운로드 API 추가 (GET /daily-report/export) - 라우트: dashboard 하위 6개 + daily-report/export 엔드포인트 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
93 lines
2.2 KiB
PHP
93 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1;
|
|
|
|
use App\Helpers\ApiResponse;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\DashboardCeoService;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
/**
|
|
* CEO 대시보드 섹션별 API 컨트롤러
|
|
*
|
|
* 6개 섹션: 매출, 매입, 생산, 미출고, 시공, 근태
|
|
*/
|
|
class DashboardCeoController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly DashboardCeoService $service
|
|
) {}
|
|
|
|
/**
|
|
* 매출 현황 요약
|
|
* GET /api/v1/dashboard/sales/summary
|
|
*/
|
|
public function salesSummary(): JsonResponse
|
|
{
|
|
return ApiResponse::handle(
|
|
fn () => $this->service->salesSummary(),
|
|
__('message.fetched')
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 매입 현황 요약
|
|
* GET /api/v1/dashboard/purchases/summary
|
|
*/
|
|
public function purchasesSummary(): JsonResponse
|
|
{
|
|
return ApiResponse::handle(
|
|
fn () => $this->service->purchasesSummary(),
|
|
__('message.fetched')
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 생산 현황 요약
|
|
* GET /api/v1/dashboard/production/summary
|
|
*/
|
|
public function productionSummary(): JsonResponse
|
|
{
|
|
return ApiResponse::handle(
|
|
fn () => $this->service->productionSummary(),
|
|
__('message.fetched')
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 미출고 내역 요약
|
|
* GET /api/v1/dashboard/unshipped/summary
|
|
*/
|
|
public function unshippedSummary(): JsonResponse
|
|
{
|
|
return ApiResponse::handle(
|
|
fn () => $this->service->unshippedSummary(),
|
|
__('message.fetched')
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 시공 현황 요약
|
|
* GET /api/v1/dashboard/construction/summary
|
|
*/
|
|
public function constructionSummary(): JsonResponse
|
|
{
|
|
return ApiResponse::handle(
|
|
fn () => $this->service->constructionSummary(),
|
|
__('message.fetched')
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 근태 현황 요약
|
|
* GET /api/v1/dashboard/attendance/summary
|
|
*/
|
|
public function attendanceSummary(): JsonResponse
|
|
{
|
|
return ApiResponse::handle(
|
|
fn () => $this->service->attendanceSummary(),
|
|
__('message.fetched')
|
|
);
|
|
}
|
|
}
|