<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class StoreCaseRequest extends FormRequest
{
    public function authorize(): bool { return true; }
    public function rules(): array
    {
        return [
            'client_id' => ['required', 'exists:clients,id'],
            'title' => ['required', 'string', 'max:200'],
            'description' => ['nullable', 'string'],
            'purpose' => ['required', 'string'],
            'lawful_basis' => ['nullable', 'string', 'max:120'],
            'status' => ['required', 'in:open,in_progress,pending,closed,archived'],
            'priority' => ['required', 'in:low,medium,high,urgent'],
            'assigned_user_id' => ['nullable', 'exists:users,id'],
            'starts_at' => ['nullable', 'date'],
            'ends_at' => ['nullable', 'date'],
        ];
    }
}
