Files
sam-api/app/Http/Requests/Leave/IndexRequest.php
hskwon e81e5d7084 feat: 휴가 관리 API 구현 (Phase 1)
- leaves, leave_balances 테이블 마이그레이션 추가
- Leave, LeaveBalance 모델 구현 (BelongsToTenant, SoftDeletes)
- LeaveService 서비스 구현 (CRUD, 승인/반려/취소, 잔여일수 관리)
- LeaveController 및 FormRequest 5개 생성
- API 엔드포인트 11개 등록 (/v1/leaves/*)
- Swagger 문서 (LeaveApi.php) 작성
- i18n 메시지 키 추가 (message.leave.*, error.leave.*)
2025-12-17 20:13:48 +09:00

31 lines
986 B
PHP

<?php
namespace App\Http\Requests\Leave;
use Illuminate\Foundation\Http\FormRequest;
class IndexRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'user_id' => 'nullable|integer',
'status' => 'nullable|string|in:pending,approved,rejected,cancelled',
'leave_type' => 'nullable|string|in:annual,half_am,half_pm,sick,family,maternity,parental',
'date_from' => 'nullable|date',
'date_to' => 'nullable|date|after_or_equal:date_from',
'year' => 'nullable|integer|min:2020|max:2099',
'department_id' => 'nullable|integer',
'sort_by' => 'nullable|string|in:created_at,start_date,end_date,days,status',
'sort_dir' => 'nullable|string|in:asc,desc',
'per_page' => 'nullable|integer|min:1|max:100',
'page' => 'nullable|integer|min:1',
];
}
}