<?php

namespace App\Http\Resources\Company;

use Illuminate\Http\Resources\Json\JsonResource;

class LoanApprovedRequestDetails extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'worker_id' => $this->worker_id,
            'first_name' => $this->first_name,
            'last_name' => $this->last_name,
            'rate' => $this->rate,
            'original_rate' => $this->original_rate,
            'date_requested' => $this->date_requested,
            'date_from' => $this->date_from,
            'date_to' => $this->date_to,
            'company_name' => $this->company_name,
            'company_tel' => $this->company_tel,
            'street_address' => $this->street_address,
            'city' => $this->city,
            'state' => $this->state,
            'zipcode' => $this->zipcode,
            'requester_note' => $this->requester_note,
            'approved_date' => $this->approved_date,
            'approved_by' => $this->approver_first_name.' '.$this->approver_last_name,
            'approver_note' => $this->approver_note,
            'contact_person_name' => $this->contact_person_name,
            'contact_person_no' => $this->contact_person_no,
            'request_contact_id' => $this->request_contact_id,
            'request_contact' => $this->request_contact,
        ];
    }
}
