diff --git a/app/Http/Controllers/Api/V1/DashboardController.php b/app/Http/Controllers/Api/V1/DashboardController.php index 0a6d631..48458a3 100644 --- a/app/Http/Controllers/Api/V1/DashboardController.php +++ b/app/Http/Controllers/Api/V1/DashboardController.php @@ -44,4 +44,4 @@ public function approvals(DashboardApprovalsRequest $request): JsonResponse return ApiResponse::handle(['data' => $data], __('message.fetched')); } -} \ No newline at end of file +} diff --git a/app/Http/Requests/V1/Dashboard/DashboardApprovalsRequest.php b/app/Http/Requests/V1/Dashboard/DashboardApprovalsRequest.php index 147700a..6f00141 100644 --- a/app/Http/Requests/V1/Dashboard/DashboardApprovalsRequest.php +++ b/app/Http/Requests/V1/Dashboard/DashboardApprovalsRequest.php @@ -25,4 +25,4 @@ public function messages(): array 'limit.max' => __('error.validation.max', ['max' => 50]), ]; } -} \ No newline at end of file +} diff --git a/app/Http/Requests/V1/Dashboard/DashboardChartsRequest.php b/app/Http/Requests/V1/Dashboard/DashboardChartsRequest.php index dca0959..92ffdfc 100644 --- a/app/Http/Requests/V1/Dashboard/DashboardChartsRequest.php +++ b/app/Http/Requests/V1/Dashboard/DashboardChartsRequest.php @@ -24,4 +24,4 @@ public function messages(): array 'period.in' => __('error.dashboard.invalid_period'), ]; } -} \ No newline at end of file +} diff --git a/app/Services/DashboardService.php b/app/Services/DashboardService.php index 607f746..5423370 100644 --- a/app/Services/DashboardService.php +++ b/app/Services/DashboardService.php @@ -351,4 +351,4 @@ private function getMyPendingDrafts(int $tenantId, int $userId, int $limit): arr ]; })->toArray(); } -} \ No newline at end of file +} diff --git a/app/Swagger/v1/DashboardApi.php b/app/Swagger/v1/DashboardApi.php index 7816429..edabede 100644 --- a/app/Swagger/v1/DashboardApi.php +++ b/app/Swagger/v1/DashboardApi.php @@ -40,19 +40,25 @@ * @OA\Property(property="start_date", type="string", format="date", example="2024-12-17", description="시작일"), * @OA\Property(property="end_date", type="string", format="date", example="2025-01-15", description="종료일"), * @OA\Property(property="deposit_trend", type="array", description="입금 추이", + * * @OA\Items(type="object", + * * @OA\Property(property="date", type="string", format="date", example="2025-01-15"), * @OA\Property(property="amount", type="number", format="float", example=5000000) * ) * ), * @OA\Property(property="withdrawal_trend", type="array", description="출금 추이", + * * @OA\Items(type="object", + * * @OA\Property(property="date", type="string", format="date", example="2025-01-15"), * @OA\Property(property="amount", type="number", format="float", example=3000000) * ) * ), * @OA\Property(property="sales_by_client", type="array", description="거래처별 매출 (상위 10개)", + * * @OA\Items(type="object", + * * @OA\Property(property="client_id", type="integer", example=1), * @OA\Property(property="client_name", type="string", example="(주)테스트"), * @OA\Property(property="amount", type="number", format="float", example=15000000) @@ -66,7 +72,9 @@ * description="대시보드 결재 현황", * * @OA\Property(property="pending_approvals", type="array", description="결재 대기 문서 (내가 결재할 문서)", + * * @OA\Items(type="object", + * * @OA\Property(property="id", type="integer", example=1, description="결재문서 ID"), * @OA\Property(property="title", type="string", example="출장 신청서", description="제목"), * @OA\Property(property="drafter_name", type="string", example="홍길동", description="기안자명"), @@ -75,7 +83,9 @@ * ) * ), * @OA\Property(property="my_drafts", type="array", description="내가 기안한 진행중인 문서", + * * @OA\Items(type="object", + * * @OA\Property(property="id", type="integer", example=2, description="결재문서 ID"), * @OA\Property(property="title", type="string", example="휴가 신청서", description="제목"), * @OA\Property(property="status", type="string", example="pending", description="상태"), @@ -101,6 +111,7 @@ class DashboardApi * description="성공", * * @OA\JsonContent( + * * @OA\Property(property="success", type="boolean", example=true), * @OA\Property(property="message", type="string", example="데이터를 조회했습니다."), * @OA\Property(property="data", ref="#/components/schemas/DashboardSummary") @@ -135,6 +146,7 @@ public function summary() {} * description="성공", * * @OA\JsonContent( + * * @OA\Property(property="success", type="boolean", example=true), * @OA\Property(property="message", type="string", example="데이터를 조회했습니다."), * @OA\Property(property="data", ref="#/components/schemas/DashboardCharts") @@ -170,6 +182,7 @@ public function charts() {} * description="성공", * * @OA\JsonContent( + * * @OA\Property(property="success", type="boolean", example=true), * @OA\Property(property="message", type="string", example="데이터를 조회했습니다."), * @OA\Property(property="data", ref="#/components/schemas/DashboardApprovals") @@ -181,4 +194,4 @@ public function charts() {} * ) */ public function approvals() {} -} \ No newline at end of file +} diff --git a/lang/ko/error.php b/lang/ko/error.php index 269235c..be00441 100644 --- a/lang/ko/error.php +++ b/lang/ko/error.php @@ -228,4 +228,9 @@ 'user_not_found' => '직원 정보를 찾을 수 없습니다.', 'no_base_salary' => '기본급이 설정되지 않았습니다.', ], + + // 대시보드 관련 + 'dashboard' => [ + 'invalid_period' => '기간은 week, month, quarter 중 하나여야 합니다.', + ], ]; diff --git a/lang/ko/message.php b/lang/ko/message.php index c9e0dff..3d8ca2a 100644 --- a/lang/ko/message.php +++ b/lang/ko/message.php @@ -288,4 +288,9 @@ 'fetched' => '급여 설정을 조회했습니다.', 'updated' => '급여 설정이 수정되었습니다.', ], + + // 대시보드 + 'dashboard' => [ + 'unknown_client' => '미지정', + ], ];