<?php

namespace App\Policies;

use App\Permissions\Modules\Admin;
use App\Permissions\Modules\Orders;
// use App\Models\Admin Admins;
use Illuminate\Auth\Access\HandlesAuthorization;

class OrdersPolicy
{
    use HandlesAuthorization;
    private $class_name='Cart';
    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }
    public function add($user)
    {
        return $user->role->havePermission(Orders::ORDERS_ADD);

    }
    public function edit($user)
    {
        return $user->role->havePermission(ORDERS::ORDERS_EDIT);

    }
    public function delete($user)
    {
        return $user->role->havePermission(ORDERS::ORDERS_DELETE);
    }
    public function view($user)
    {
        return $user->role->havePermission(ORDERS::ORDERS_VIEW);
    }

    public function detail_notes($user)
    {
        return $user->role->havePermission(ORDERS::ORDERS_DETAIL_TABS_NOTES);
    }
    public function details($user)
    {
        return $user->role->havePermission(ORDERS::ORDERS_DETAIL_TABS_DETAIL);
    }
    public function prescriptions($user)
    {
        return $user->role->havePermission(ORDERS::ORDERS_DETAIL_TABS_PRESCRIPTION);
    }
}
