<?php

namespace App\Http\Requests\Finance;

use Illuminate\Foundation\Http\FormRequest;

class StoreFinanceHarvestEntryRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'id' => ['required', 'string', 'max:120'],
            'date' => ['required', 'date_format:Y-m-d'],
            'batch_id' => ['required', 'integer', 'min:1'],
            'kg_harvested' => ['required', 'numeric', 'min:0'],
            'kg_adjustment_loss' => ['nullable', 'numeric', 'min:0'],
            'loss_reason' => ['nullable', 'string', 'max:255'],
            'notes' => ['nullable', 'string', 'max:4000'],
            'created_at' => ['nullable', 'date'],
            'updated_at' => ['nullable', 'date'],
        ];
    }
}
