<?php
namespace App\Permissions\Modules;

use App\Model\UserTypes;

class Appointment extends BasePermissions{

    const APPOINTMENT = "APPOINTMENT_";
    const APPOINTMENT_ADD = self::APPOINTMENT."ADD";
    const APPOINTMENT_VIEW = self::APPOINTMENT."VIEW";
    const APPOINTMENT_EDIT = self::APPOINTMENT."EDIT";
    const APPOINTMENT_DELETE = self::APPOINTMENT."DELETE";
    const APPOINTMENT_DETAIL = self::APPOINTMENT."DETAIL";
    const APPOINTMENT_BOOK_AN_APPOINTMENT = self::APPOINTMENT."BOOK_AN_APPOINTMENT";
    const APPOINTMENT_MEETING_HISTORY = self::APPOINTMENT."MEETING_HISTORY";

    public function permissions()
    {
        $appointment =  [
            [
                "text"=>"Appointment Add",
                "id"=>self::APPOINTMENT_ADD,
                "state" => $this->selectNodes(self::APPOINTMENT_ADD)
            ],
            [
                "text"=>"Appointment View",
                "id"=>self::APPOINTMENT_VIEW,
                "state" => $this->selectNodes(self::APPOINTMENT_VIEW)
            ],
            [
                "text"=>"Appointment Edit",
                "id"=>self::APPOINTMENT_EDIT,
                "state" => $this->selectNodes(self::APPOINTMENT_EDIT)
            ],
            [
                "text"=>"Appointment Delete",
                "id"=>self::APPOINTMENT_DELETE,
                "state" => $this->selectNodes(self::APPOINTMENT_DELETE)
            ],
            [
                "text"=>"Appointment Detail",
                "id"=>self::APPOINTMENT_DETAIL,
                "state" => $this->selectNodes(self::APPOINTMENT_DETAIL)
            ],
            [
                "text"=>"Book An Appointment",
                "id"=>self::APPOINTMENT_BOOK_AN_APPOINTMENT,
                "state" => $this->selectNodes(self::APPOINTMENT_BOOK_AN_APPOINTMENT)
            ],
            [
                "text"=>"Meeting History",
                "id"=>self::APPOINTMENT_MEETING_HISTORY,
                "state" => $this->selectNodes(self::APPOINTMENT_MEETING_HISTORY)
            ]
        ];
        return ["text"=>"Appointment","id"=>self::APPOINTMENT,"children"=>$appointment];
    }
    public function frontEndPermissions()
    {
        $appointment_permissions = [
            [
                "text"=>"Appointment Add",
                "ability" => $this->apiPermissionSelected(self::APPOINTMENT_ADD)
            ],
            [
                "text"=>"Appointment View",
                "ability" => $this->apiPermissionSelected(self::APPOINTMENT_VIEW)
            ],
            [
                "text"=>"Appointment Edit",
                "ability" => $this->apiPermissionSelected(self::APPOINTMENT_EDIT)
            ],
            [
                "text"=>"Appointment Delete",
                "ability" => $this->apiPermissionSelected(self::APPOINTMENT_DELETE)
            ],
            [
                "text"=>"Appointment Detail",
                "ability" => $this->apiPermissionSelected(self::APPOINTMENT_DETAIL)
            ],
            [
                "text"=>"Book An Appointment ",
                "ability" => $this->apiPermissionSelected(self::APPOINTMENT_BOOK_AN_APPOINTMENT)
            ],
            [
                "text"=>"Meeting History ",
                "ability" => $this->apiPermissionSelected(self::APPOINTMENT_MEETING_HISTORY)
            ]
        ];
        return ["text"=>"Appointment Permissions","permissions"=>$appointment_permissions];
    }
}
