<?php
namespace App\Permissions\Modules;

use App\Model\UserTypes;

class Providers extends BasePermissions{

    const PROVIDER = "PROVIDER_";
    const PROVIDER_ADD = self::PROVIDER."ADD";
    const PROVIDER_EDIT = self::PROVIDER."EDIT";
    const PROVIDER_DELETE = self::PROVIDER."DELETE";
    const PROVIDER_VIEW = self::PROVIDER."VIEW";
    const PROVIDER_DETAIL = self::PROVIDER."DETAIL";
    const PROVIDER_MEETING_HISTORY = self::PROVIDER."MEETING_HISTORY";
    public function permissions()
    {
        $permissions =  [
            [
                "text"=>"Provider View",
                "id"=>self::PROVIDER_VIEW,
                "state" => $this->selectNodes(self::PROVIDER_VIEW)
            ],
            [
                "text"=>"Provider Add",
                "id"=>self::PROVIDER_ADD,
                "state" => $this->selectNodes(self::PROVIDER_ADD)
            ],
            [
                "text"=>"Provider Edit",
                "id"=>self::PROVIDER_EDIT,
                "state" => $this->selectNodes(self::PROVIDER_EDIT)
            ],
            [
                "text"=>"Provider Delete",
                "id"=>self::PROVIDER_DELETE,
                "state" => $this->selectNodes(self::PROVIDER_DELETE)
            ],
            [
                "text"=>"Provider Detail",
                "id"=>self::PROVIDER_DETAIL,
                "state" => $this->selectNodes(self::PROVIDER_DETAIL)
            ],
            [
                "text"=>"Provider Meeting History",
                "id"=>self::PROVIDER_MEETING_HISTORY,
                "state" => $this->selectNodes(self::PROVIDER_MEETING_HISTORY)
            ]
        ];
        return ["text"=>"Provider","id"=>self::PROVIDER,"children"=>$permissions];
    }
    public function frontEndPermissions()
    {
        $providers_permissions =
        [
            [
                "text"=>"Provider View",
                "ability" => $this->apiPermissionSelected(self::PROVIDER_VIEW)
            ],
            [
                "text"=>"Provider Add",
                "ability" => $this->apiPermissionSelected(self::PROVIDER_ADD)
            ],
            [
                "text"=>"Provider Edit",
                "ability" => $this->apiPermissionSelected(self::PROVIDER_EDIT)
            ],
            [
                "text"=>"Provider Delete",
                "ability" => $this->apiPermissionSelected(self::PROVIDER_DELETE)
            ],
            [
                "text"=>"Provider Detail",
                "ability" => $this->apiPermissionSelected(self::PROVIDER_DETAIL)
            ],
            [
                "text"=>"Provider Meeting History",
                "ability" => $this->apiPermissionSelected(self::PROVIDER_MEETING_HISTORY)
            ]
        ];
        return ["text"=>"Providers Permissions","permissions"=>$providers_permissions];
    }
}
