feat: 보고서(Reports) API 구현

- 일일 일보 조회/엑셀 다운로드 API 추가
- 지출 예상 내역서 조회/엑셀 다운로드 API 추가
- ReportService: 전일/당일 잔액 계산, 월별 지출 예상 집계
- Laravel Excel을 이용한 엑셀 내보내기 구현
- Swagger 문서 작성 완료
This commit is contained in:
2025-12-17 22:51:17 +09:00
parent cbed92a95c
commit 77914da7b7
9 changed files with 815 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Http\Requests\V1\Report;
use Illuminate\Foundation\Http\FormRequest;
class DailyReportRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'date' => ['nullable', 'date', 'date_format:Y-m-d'],
];
}
/**
* Custom attribute names
*/
public function attributes(): array
{
return [
'date' => __('validation.attributes.date'),
];
}
}

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Http\Requests\V1\Report;
use Illuminate\Foundation\Http\FormRequest;
class ExpenseEstimateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'year_month' => ['nullable', 'regex:/^\d{4}-\d{2}$/'],
];
}
/**
* Custom attribute names
*/
public function attributes(): array
{
return [
'year_month' => __('validation.attributes.year_month'),
];
}
/**
* Custom validation messages
*/
public function messages(): array
{
return [
'year_month.regex' => __('validation.date_format', ['format' => 'YYYY-MM']),
];
}
}