39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers\Api\V1;
|
||
|
|
|
||
|
|
use App\Helpers\ApiResponse;
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
use App\Services\EntertainmentService;
|
||
|
|
use Illuminate\Http\JsonResponse;
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 접대비 현황 컨트롤러
|
||
|
|
*
|
||
|
|
* CEO 대시보드용 접대비 현황 데이터를 제공합니다.
|
||
|
|
*/
|
||
|
|
class EntertainmentController extends Controller
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
private readonly EntertainmentService $entertainmentService
|
||
|
|
) {}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 접대비 현황 요약 조회
|
||
|
|
*
|
||
|
|
* @param Request $request
|
||
|
|
* @return JsonResponse
|
||
|
|
*/
|
||
|
|
public function summary(Request $request): JsonResponse
|
||
|
|
{
|
||
|
|
$limitType = $request->query('limit_type', 'quarterly');
|
||
|
|
$companyType = $request->query('company_type', 'medium');
|
||
|
|
$year = $request->query('year') ? (int) $request->query('year') : null;
|
||
|
|
$quarter = $request->query('quarter') ? (int) $request->query('quarter') : null;
|
||
|
|
|
||
|
|
$data = $this->entertainmentService->getSummary($limitType, $companyType, $year, $quarter);
|
||
|
|
|
||
|
|
return ApiResponse::handle($data, __('message.fetched'));
|
||
|
|
}
|
||
|
|
}
|