<?php

use App\Models\SubPlan;

return [
    "type"           => "sub_plan",
    "model"          => SubPlan::class,
    "label"          => "content_types.sub_plan_plural",
    "label_singular" => "content_types.sub_plan_singular",
    "group"          => "content",
    "order"          => TRUE,
    "search" => [
        "fields" => [
            "title",
            "content",
        ],
        "parentRelationships" => [
        ]
    ],
    "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"          => "subscription_plan_id",
            "label"         => "Subscription Plan",
            "type"          => "selectBox",
            "selectModel"   => [
                "endpoint" => 'subscription-plan/auto-complete',
            ],
            "mandatory"     => FALSE,
            "preValidation" => "trim",
        ],
        [
            "name"          => "is_basic_plan",
            "label"         => "Is basic user registration",
            "type"          => "checkBox",
        ],
        [
            "name"          => "is_highlighted",
            "label"         => "Is Highlighted",
            "type"          => "checkBox",
        ],
        [
            "name"          => "subtitle",
            "label"         => "Subtitle",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:150",
        ],
        [
            "name" => "subPlanOptions",
            "label" => "Subscription Plan Options",
            "type" => "repeater",
            "objectType" => "sub_plan_option",
            "order" => true,
        ],
        [
            "name" => "subPlanFeatures",
            "label" => "Subscription Plan Features",
            "type" => "repeater",
            "objectType" => "sub_plan_feature",
            "order" => true,
        ],
        [
            "name" => "subscriptionRewards",
            "label" => "Subscription Rewards",
            "type" => "multiplePicker",
            "allowInsert" => TRUE,
            "objectTypes" => ["subscription_reward"],
            "order" => true,
        ],
        [
            "name"          => "label",
            "label"         => "Label",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:150",
        ],
        [
            "name"          => "note",
            "label"         => "Notes",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "xss_clean|trim",
        ],
        [
            "name"          => "link_text",
            "label"         => "Link Text",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:150",
        ],
        [
            "name"          => "title_sign_up",
            "label"         => "Title Sign Up",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:150",
            "placement"     => "sign_up"
        ],
        [
            "name"          => "overview",
            "label"         => "Overview",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "xss_clean|trim",
            "placement"     => "sign_up"
        ],
        [
            "name" => "signSubPlanFeatures",
            "label" => "Sign Up Subscription Plan Features",
            "type" => "repeater",
            "objectType" => "sign_sub_plan_feature",
            "order" => true,
            "placement"     => "sign_up"
        ],
    ],
    "actions"        => [
        "edit", "insert", "delete"
    ]
];
