<?php

use App\Libs\Services\FcmService;

return [
    "type"           => "location",
    "model"          => App\Models\Location::class,
    "label"          => "Locations",
    "label_singular" => "Location",
    "group"          => "locations",
    "order"          => FALSE,
    "fields"         => [
        [
            "name"          => "title",
            "label"         => "Name",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:150",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "description",
            "label"         => "Description",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "xss_clean|trim",
            "validation"    => ""
        ],
        [
            "name"          => "opening_hours",
            "label"         => "Opening hours",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "xss_clean|trim",
            "validation"    => ""
        ],
        [
            "name"          => "address",
            "label"         => "Address",
            "type"          => "textArea",
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => ""
        ],
        [
            "name"  => "map_position",
            "label" => "Map position",
            "type"  => "location"
        ],
        [
            "name"          => "website",
            "label"         => "Website",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "url|max:150",
        ],
        [
            "name" => "city_id",
            "label" => "City",
            "type" => "selectBox",
            "contentType" => "city",
            "labelField" => "title",
            "validation" => "required"
        ],
        /**[
            "name" => "city_zone_id",
            "label" => "City Zone",
            "type" => "selectBox",
            "contentType" => "city_zone",
            "labelField" => "title",
            "validation" => ""
        ],**/
        [
            "name"          => "tags",
            "label"         => "Tags",
            "type"          => "multiplePicker",
            "longList"      => TRUE,
            "allowInsert"   => TRUE,
            "objectTypes"   => ["tag"],
            "order"         => TRUE,
            "maxSize"       => 50,
            "placement"     => "sidebar"
        ],
        FcmService::getConfigForSendPushNotifications('location', 'New Locations'),
        [
            "name" => "image",
            "label" => "Image",
            "type" => "mediaPicker",
            "multiple" => FALSE,
            "mediaType" => "image",
            "placement" => "sidebar"
        ],
    ],
    "actions"        => [
        "edit", "order", "insert", "delete"
    ]
];
