<?php

namespace App\Http\Requests\DailyLogs;

use Illuminate\Foundation\Http\FormRequest;

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

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