feat: 문서 관리 시스템 FormRequest 구현 (Phase 1.7)

- IndexRequest: 목록 조회 필터/페이징 검증
- StoreRequest: 문서 생성 검증 (템플릿, 데이터, 첨부파일)
- UpdateRequest: 문서 수정 검증

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-28 21:14:30 +09:00
parent b7f8157548
commit 9bceaab8a3
3 changed files with 151 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Http\Requests\Document;
use App\Models\Documents\Document;
use Illuminate\Foundation\Http\FormRequest;
class IndexRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
$statuses = implode(',', [
Document::STATUS_DRAFT,
Document::STATUS_PENDING,
Document::STATUS_APPROVED,
Document::STATUS_REJECTED,
Document::STATUS_CANCELLED,
]);
return [
'status' => "nullable|string|in:{$statuses}",
'template_id' => 'nullable|integer',
'search' => 'nullable|string|max:100',
'from_date' => 'nullable|date',
'to_date' => 'nullable|date|after_or_equal:from_date',
'sort_by' => 'nullable|string|in:created_at,document_no,title,status,submitted_at,completed_at',
'sort_dir' => 'nullable|string|in:asc,desc',
'per_page' => 'nullable|integer|min:1|max:100',
'page' => 'nullable|integer|min:1',
];
}
}