<?php

namespace App\Http\Requests\DailyLogs;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'tank_id' => ['sometimes', 'required', 'integer', 'exists:tanks,id'],
            'batch_id' => ['sometimes', 'nullable', 'integer', 'exists:batches,id'],
            'date' => ['sometimes', 'required', 'date'],
            'deaths' => ['sometimes', 'nullable', 'integer', 'min:0'],
            'feed_given_g' => ['sometimes', 'nullable', 'integer', 'min:0'],
            'feed_not_delivered_g' => ['sometimes', 'nullable', 'integer', 'min:0'],
            'ph' => ['sometimes', 'nullable', 'numeric'],
            'nitrite' => ['sometimes', 'nullable', 'numeric'],
            'nitrate' => ['sometimes', 'nullable', 'numeric'],
            'ammonia' => ['sometimes', 'nullable', 'numeric'],
            'dissolved_oxygen' => ['sometimes', 'nullable', 'numeric'],
            'temp_c' => ['sometimes', 'nullable', 'numeric'],
            'alkalinity_kh' => ['sometimes', 'nullable', 'numeric'],
            'turbidity' => ['sometimes', 'nullable', 'numeric'],
            'conductivity' => ['sometimes', 'nullable', 'numeric'],
            'orp' => ['sometimes', 'nullable', 'numeric'],
            'floccules_notes' => ['sometimes', 'nullable', 'string'],
            'notes' => ['sometimes', 'nullable', 'string'],
        ];
    }
}
