<?php

namespace Bixo\Account\Policies;

use Illuminate\Foundation\Auth\User as Authenticatable;

trait InvoiceExim
{

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

        return false;
    }

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

        return false;
    }
}