<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules()
    {
        return [
            'company_id' => 'required|exists:companies,id',
            'counterparty_company_id' => 'nullable|exists:companies,id',
            'deal_date' => 'nullable|date',
            'amount' => 'nullable|numeric|min:0',
            'notes' => 'nullable|string',
        ];
    }
}