<?php

namespace Bixo\Account\Policies;

use Bixo\Account\Models\Coa;
use Illuminate\Foundation\Auth\User as Authenticatable;

trait CoaAction
{

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

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

        $this->model->is_owner;
    }

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

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

        $this->model->is_owner;
    }

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

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

        $this->model->is_owner;
    }

}