<?php

    return [
        "type"           => "trackerActions",
        "model"          => App\Models\TrackerAction::class,
        "label"          => "Tracker Actions",
        "label_singular" => "Tracker Action",
        "group"          => "none",
        "parent" => array(
            "field" => "tracker_category_id",
            "contentType" => "trackerCategories"
        ),
        "order"          => TRUE,
        "search" => [
            "fields" => [
                "title",
            ],
            "parentRelationships" => [
                "trackerCategory",
            ]
        ],
        "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"          => "year",
                "label"         => "Year",
                "type"          => "textBox",
                "maxLength"     => 10,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:10",
                "inList"        => TRUE,
            ],
            [
                "name"          => "anchor",
                "label"         => "Anchor",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
            ],
            [
                "name"          => "action_status",
                "label"         => "Status",
                "type"          => "selectBox",
                "list"          => [
                    "completed"   => "Completed",
                    "in_progress" => "In Progress",
                    "not_started" => "Not Started",
                ],
                "defaultValue"  => "not_started",
                "preValidation" => "trim",
                "validation"    => "required|in:completed,in_progress,not_started",
                "inList"        => TRUE,
            ],
            [
                "name"          => "percentage",
                "label"         => "Completion Percentage",
                "type"          => "textBox",
                "preValidation" => "trim",
                "validation"    => "required|numeric|min:0|max:100",
                "defaultValue"  => 0,
            ],
            [
                "name"          => "progress_status",
                "label"         => "Progress Status",
                "type"          => "selectBox",
                "list"          => [
                    "ahead_of_target"   => "Ahead of Target",
                    "on_target"         => "On Target",
                    "delayed"           => "Delayed",
                    "heavily_delayed"   => "Heavily Delayed",
                ],
                "defaultValue"  => "on_target",
                "preValidation" => "trim",
                "validation"    => "required|in:ahead_of_target,on_target,delayed,heavily_delayed",
                "inList"        => TRUE,
            ],
            [
                "name"         => "type_gas",
                "label"        => "Gas",
                "type"         => "checkBox",
                "defaultValue" => FALSE,
                "inList"       => TRUE,
            ],
            [
                "name"         => "type_power",
                "label"        => "Power",
                "type"         => "checkBox",
                "defaultValue" => FALSE,
            ],
            [
                "name"         => "type_carbon",
                "label"        => "Carbon",
                "type"         => "checkBox",
                "defaultValue" => FALSE,
            ],
            [
                "name"         => "type_simplification",
                "label"        => "Simplification",
                "type"         => "checkBox",
                "defaultValue" => FALSE,
            ],
        ],
        "actions" => [
            "edit", "insert", "delete"
        ]
    ];
