<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PersonalExpenseRequest extends FormRequest
{
    public function authorize()
    {
        return auth()->check();
    }

    public function rules()
    {
        return [
            'user_id' => 'required|exists:users,id',
            'company_id' => 'nullable|exists:companies,id',
            'description' => 'nullable|string|max:1000',
            'amount' => 'required|numeric|min:0',
            'spent_at' => 'nullable|date',
        ];
    }
}