<?php

return [
    "type"           => "competition",
    "model"          => App\Models\Competition::class,
    "label"          => "content_types.competition_plural",
    "label_singular" => "content_types.competition_singular",
    "group"          => "competitions",
    "isPage"         => TRUE,
    "baseUri"        => [
        'en'         => '/competitions',
        'de'         => '/ausschreibung'
    ],
    "search"         => [
        "title" => "title",
        "fields" => [
            "title",
            "wa_id",
            "location_city",
            "location",
            "official_number",
            "promoter",
            "description"
        ],
        "relations" => [
            "locationCountry"
        ],
    ],
    "fields"         => [
        [
            "name"          => "wa_id",
            "label"         => "WA ID",
            "type"          => "textBox",
            "maxLength"     => 20,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:20",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE,
            "unique"        => TRUE,
            "listHeaderProps"   => [
                "width"  => "60",
                "nowrap"    => true
            ]
        ],
        [
            "name"          => "title",
            "label"         => "content_types.title",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:255",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE,
            "listHeaderProps"   => [
                "maxWidth"  => "400",
                "nowrap"    => true
            ]
        ],
        [
            "name"          => "meta_title",
            "label"         => "content_types.meta_title",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:255",
        ],
        [
            "name"          => "meta_description",
            "label"         => "content_types.meta_description",
            "type"          => "textArea",
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "",
        ],
        [
            "name"          => "official_number",
            "label"         => "content_types.official_number",
            "type"          => "textBox",
            "maxLength"     => 30,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:30",
        ],
        [
            "name"          => "competition_url",
            "label"         => "content_types.ted_url",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|url|max:255",
        ],
        [
            "name"          => "updated_competition_id",
            "label"         => "content_types.updated_competition",
            "type"          => "selectBox",
            "contentType"   => "competition",
            "contentField"  => "wa_id",
            "mandatory"     => FALSE,
            "inList"        => FALSE,
            "search"        => TRUE,
            "preValidation" => "trim",
            "validation"    => "nullable",
            "listField"     => "wa_id",
            "listHeaderProps"   => [
                "maxWidth"  => "200",
                "nowrap"    => true
            ],
        ],
        [
            "name"          => "updated_competition_url",
            "label"         => "content_types.updated_competition_url",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|url|max:255",
        ],
        [
            "name"          => "description",
            "label"         => "content_types.description",
            "type"          => "textArea",
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable",
        ],
        [
            "name"          => "note",
            "label"         => "content_types.note",
            "type"          => "textArea",
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable",
        ],
        [
            "name"          => "is_public",
            "label"         => "content_types.is_public",
            "type"          => "checkBox",
            "validation"    => "nullable|boolean",
            "inList"        => TRUE,
            "sort"          => TRUE,
        ],
        [
            "name"        => "cpvs",
            "label"       => "content_types.cpvs",
            "type"        => "multiplePicker",
            "allowInsert" => TRUE,
            "objectTypes" => ["cpv"],
            "order"       => TRUE,
            "maxSize"     => 50,
            "listExtraFields"  => ['full_code'],
            "inList"        => TRUE,
            "listField"     => "code",
        ],
        [
            "name"          => "location_address",
            "label"         => "content_types.location_address",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:255",
        ],
        [
            "name"          => "location_postal_code",
            "label"         => "content_types.location_postal_code",
            "type"          => "textBox",
            "maxLength"     => 50,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:50",
        ],
        [
            "name"          => "location_city",
            "label"         => "content_types.location_city",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:255",
        ],
        [
            "name"          => "location_nuts_code",
            "label"         => "content_types.location_nuts_code",
            "type"          => "textBox",
            "maxLength"     => 40,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:40",
        ],
        [
            "name"          => "nuts3_region_id",
            "label"         => "content_types.nuts3_region",
            "type"          => "selectBox",
            "contentType"   => "nuts3_region",
            "contentField"  => "title",
            "mandatory"     => FALSE,
            "inList"        => FALSE,
            "preValidation" => "trim",
            "validation"    => ""
        ],
        [
            "name"          => "location_country_id",
            "label"         => "content_types.location_country",
            "type"          => "selectBox",
            "contentType"   => "country",
            "mandatory"     => FALSE,
            "inList"        => FALSE,
            "preValidation" => "trim"
        ],
        [
            "name"          => "promoter",
            "label"         => "content_types.promoter",
            "type"          => "textArea",
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
        ],
        [
            "name"          => "promoter_address",
            "label"         => "content_types.promoter_address",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:255",
        ],
        [
            "name"          => "promoter_postal_code",
            "label"         => "content_types.promoter_postal_code",
            "type"          => "textBox",
            "maxLength"     => 50,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:50",
        ],
        [
            "name"          => "promoter_city",
            "label"         => "content_types.promoter_city",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:255",
        ],
        [
            "name"          => "promoter_nuts_code",
            "label"         => "content_types.promoter_nuts_code",
            "type"          => "textBox",
            "maxLength"     => 40,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:40",
        ],
        [
            "name"          => "promoter_country_id",
            "label"         => "content_types.promoter_country",
            "type"          => "selectBox",
            "contentType"   => "country",
            "mandatory"     => FALSE,
            "inList"        => FALSE,
            "preValidation" => "trim"
        ],
        [
            "name"          => "contact_name",
            "label"         => "content_types.contact_name",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable:max:255",
        ],
        [
            "name"          => "contact_phone",
            "label"         => "content_types.contact_phone",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable:max:255",
        ],
        [
            "name"          => "contact_email",
            "label"         => "content_types.contact_email",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable:max:255",
        ],
        [
            "name"          => "original_language_code",
            "label"         => "content_types.original_language",
            "type"          => "textBox",
            "maxLength"     => 2,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:2",
        ],
        [
            "name"          => "publication_date",
            "label"         => "content_types.publication_date",
            "type"          => "datePicker",
            "inputType"     => "date",
            "validation"    => "required",
        ],
        [
            "name"          => "submission_until",
            "label"         => "content_types.submission_date",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "information_request_until",
            "label"         => "content_types.information_request_until",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "registration_deadline",
            "label"         => "content_types.registration_deadline",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "application_deadline",
            "label"         => "content_types.application_deadline",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "deadline",
            "label"         => "content_types.deadline",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "disabled"      => TRUE,
            "validation"    => "",
        ],
        [
            "name"          => "plans_deadline",
            "label"         => "content_types.plans_deadline",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "model_deadline",
            "label"         => "content_types.model_deadline",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "jury_date",
            "label"         => "content_types.jury_date",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "announcement_date",
            "label"         => "content_types.announcement_date",
            "type"          => "datePicker",
            "inputType"     => "datetime",
            "validation"    => "",
        ],
        [
            "name"          => "procedureTypes",
            "label"         => "content_types.procedure_types",
            "type"          => "multiplePicker",
            "objectTypes"   => ["procedure_type"],
            "contentField"  => "title",
            "order"         => TRUE,
            "maxSize"       => 3,
        ],
        [
            "name"          => "procedure_type_code",
            "label"         => "content_types.procedure_type_code",
            "type"          => "textBox",
            "maxLength"     => 20,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:20",
        ],
        [
            "name"          => "procedure_type_text",
            "label"         => "content_types.procedure_type_text",
            "type"          => "editor",
            "multiLanguage" => FALSE,
            "preValidation" => "trim|xss_clean",
            "validation"    => "",
        ],
        [
            "name"          => "content",
            "label"         => "content_types.content",
            "type"          => "editor",
            "multiLanguage" => FALSE,
            "preValidation" => "trim|xss_clean",
            "validation"    => ""
        ],
        [
            "name"          => "aditional_content",
            "label"         => "content_types.additional_content",
            "type"          => "editor",
            "multiLanguage" => FALSE,
            "preValidation" => "trim|xss_clean",
            "validation"    => ""
        ],
        [
            "name"      => "images",
            "label"     => "content_types.competition_images",
            "type"      => "mediaPicker",
            "multiple"  => TRUE,
            "mediaType" => "image",
        ],
        [
            "name"      => "documents",
            "label"     => "content_types.competition_documents",
            "type"      => "mediaPicker",
            "multiple"  => TRUE,
            "mediaType" => "document",
            "maxSize"   => 3,
        ],
        [
            "name"          => "documents_url",
            "label"         => "content_types.documents_url",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|url|max:255",
        ],
        [
            "name"          => "xml_url",
            "label"         => "content_types.xml_url",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|url|max:255",
        ],
        [
            "name"          => "html_url",
            "label"         => "content_types.html_url",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|url|max:255",
        ],
        [
            "name"          => "participant",
            "label"         => "content_types.participant",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:255",
        ],
        [
            "name"          => "money_value",
            "label"         => "content_types.money_value",
            "type"          => "textBox",
            "maxLength"     => 12,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|numeric|min:0",
        ],
        [
            "name"          => "coordination",
            "label"         => "content_types.coordination",
            "type"          => "textArea",
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable",
        ],
    ],
    "actions"        => [
        "insert", "edit", "delete"
    ]
];
