<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class CobroFormaPago extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'idCFP'             => strval($this->idCFP),
            'idCobro'           => strval($this->idCobro),
            'dateCFP'           => date("d-m-Y",strtotime($this->dateCFP)),
            'typeCFP'           => $this->typeCFP,
            'montoCFP'          => number_format($this->montoCFP, 2, ',', '.'),
            'idMoneda'          => $this->idMoneda,
            'refCFP'            => $this->refCFP,
            'bancoCFP'          => $this->bancoCFP,
            'bancoOrigenCFP'    => $this->bancoOrigenCFP,
            'cedulaCFP'         => $this->cedulaCFP,
            'idDT'              => strval($this->idDT),
            'idPlanilla'        => $this->idPlanilla,
        ];
    }
}
