<?php

return [
    "type"           => "department",
    "model"          => App\Models\Department::class,
    "label"          => "content_types.department_plural",
    "label_singular" => "content_types.department_singular",
    "hierarchic"     => TRUE,
    "order"          => TRUE,
    "group"          => "competitions",
    "search"         => [
        "title" => "title",
        "fields" => [
            "title",
        ],
        "relations" => [
        ],
    ],
    "fields"         => [
        [
            "name"          => "title",
            "label"         => "title",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:150",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "code",
            "label"         => "Code",
            "type"          => "textBox",
            "maxLength"     => 2,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:2",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"        => "cpvs",
            "label"       => "CPVs",
            "type"        => "multiplePicker",
            "allowInsert" => TRUE,
            "objectTypes" => ["cpv"],
            "order"       => TRUE,
            "maxSize"     => 50,
            "listExtraFields"  => ['full_code'],
        ],
    ],
    "actions"        => [
        "insert", "edit", "delete", "order"
    ]
];
