<?php

namespace Bixo\Payment\Policies;

use Bixo\Payment\Models\Invoice;
use Illuminate\Foundation\Auth\User as Authenticatable;

trait InvoiceAction
{

    /**
     * Determine if the given user can copy the given invoice.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function copy(Authenticatable $user, Invoice $invoice)
    {

        if ($authUser->canDo('payment.invoice.action.copy')) {
            return true;
        }

        $this->model->is_owner;
    }

    /**
     * Determine if the given user can empty the given invoice.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    function empty(Authenticatable $user, Invoice $invoice) {

        if ($authUser->canDo('payment.invoice.action.empty')) {
            return true;
        }

        $this->model->is_owner;
    }

    /**
     * Determine if the given user can transfer the given invoice.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function transfer(Authenticatable $user, Invoice $invoice)
    {

        if ($authUser->canDo('payment.invoice.action.transfer')) {
            return true;
        }

        $this->model->is_owner;
    }

}