<?php

namespace App\Http\Requests\TenantStatField;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'target_table' => 'sometimes|string|max:50',
            'field_key' => 'sometimes|string|max:100',
            'field_name' => 'sometimes|string|max:100',
            'field_type' => 'sometimes|string|max:20',
            'aggregation_types' => 'nullable|array',
            'aggregation_types.*' => 'string|in:avg,sum,min,max,count',
            'is_critical' => 'sometimes|boolean',
            'display_order' => 'sometimes|integer|min:0',
            'description' => 'nullable|string',
        ];
    }
}
