<?php

namespace Bixo\Schedule\Policies;

use Bixo\Schedule\Models\FollowUps;
use Illuminate\Foundation\Auth\User as Authenticatable;

trait FollowUpsWorkflow
{

    /**
     * Determine if the given user can approve the given follow_ups.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function approve(Authenticatable $user, FollowUps $follow_ups)
    {
        if ($user->canDo('schedule.follow_ups.approve')) {
            return true;
        }

        return false;
    }

    /**
     * Determine if the given user can approve the given follow_ups.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function submit(Authenticatable $user, FollowUps $follow_ups)
    {
        if ($user->canDo('schedule.follow_ups.submit')) {
            return true;
        }

        return false;
    }

    /**
     * Determine if the given user can approve the given follow_ups.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function publish(Authenticatable $user, FollowUps $follow_ups)
    {
        if ($user->canDo('schedule.follow_ups.publish')) {
            return true;
        }

        return false;
    }

    /**
     * Determine if the given user can approve the given follow_ups.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function unpublish(Authenticatable $user, FollowUps $follow_ups)
    {
        if ($user->canDo('schedule.follow_ups.unpublish')) {
            return true;
        }

        return false;
    }

    /**
     * Determine if the given user can approve the given follow_ups.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function archive(Authenticatable $user, FollowUps $follow_ups)
    {
        if ($user->canDo('schedule.follow_ups.archive')) {
            return true;
        }

        return false;
    }

    /**
     * Determine if the given user can approve the given follow_ups.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function unarchive(Authenticatable $user, FollowUps $follow_ups)
    {
        if ($user->canDo('schedule.follow_ups.unarchive')) {
            return true;
        }

        return false;
    }

    /**
     * Determine if the given user can approve the given follow_ups.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function reject(Authenticatable $user, FollowUps $follow_ups)
    {
        if ($user->canDo('schedule.follow_ups.reject')) {
            return true;
        }

        return false;
    }

}