<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class Banco extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'idBanco'           => $this->idBanco,
            'codBanco'          => $this->codBanco,
            'idE'               => strval($this->idE),
            'typeCuenta'        => $this->typeCuenta,
            'nroCuenta'         => $this->nroCuenta,
            'idMoneda'          => $this->idMoneda,
            'codCTA'            => $this->codCTA, //(new Cuenta)->getCTA($this->codCTA),
            'visiblePago'       => $this->visiblePago,
            'heredable'         => $this->heredable,
            'descripcionBanco'  => is_null($this->descripcionBanco)?'':$this->descripcionBanco,
            'ctaSysOld'         => $this->ctaSysOld,
            'nombreBanco'       => $this->nombreBanco,
            'codE'              => $this->codE,
            'nameE'             => $this->nameE,
            'codMoneda'         => $this->codMoneda,
        ];
    }
}
