<?php

    return [
        "type"           => "routes",
        "model"          => App\Models\Route::class,
        "label"          => "Rotas",
        "label_singular" => "Rota",
        "hierarchic"     => true,
        "group"          => "outros",
        "order"          => true,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Nome da rota",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => true,
                "preValidation" => "xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => true,
                "search"        => true,
                "sort"          => true
            ],
            [
                "name"          => "description",
                "label"         => "Descrição da rota",
                "type"          => "textArea",
                "maxLength"     => 600,
                "multiLanguage" => true,
                "preValidation" => "xss_clean|trim",
                "validation"    => "max:600",
            ],
            [
                "name"          => "icon",
                "label"         => "Icone da rota",
                "type"          => "mediaPicker",
                "multiple"      => false,
                "mediaType"     => "svg",
            ],
            [
                "name"          => "waypoints",
                "label"         => "Pontos da rota",
                "type"          => "multiplePicker",
                "allowInsert"   => false,
                "longList"      => true,
                "order"         => true,
                "objectTypes"   => ["properties"],
                "maxSize"       => 20
            ],
            [
                "name"          => "route_type",
                "label"         => "Tipo de percurso",
                "type"          => "selectBox",
                "list"          => [
                    App\Models\Route::TYPE_LOCAL => "Local",
                    App\Models\Route::TYPE_INTERCITY   => "Intermunicipal"
                ],
                "preValidation" => "trim",
                "validation"    => "required|in:" . App\Models\Route::TYPE_LOCAL . "," . App\Models\Route::TYPE_INTERCITY,
                "placement"     => "sidebar"
            ],
            [
                "name"          => "circular_route",
                "label"         => "Rota circular",
                "type"          => "checkBox",
                "multiLanguage" => false,
                "placement"     => "sidebar",
            ],

        ],
        "actions"        => [
            "edit", "order", "insert", "delete"
        ]
    ];
