<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Http\Resources\Json\JsonResource;

class WorkerBillableRate extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        // Log::info('WorkerBillableRate input:', $this->resource->toArray());
        // return parent::toArray($request);
        return [
            'id' => $this->id,
            'company_experience_id' => $this->company_experience_id,
            'company_id' => $this->company_id,
            'burden_rate' => (float) $this->burden_rate,
            'burden_rate_type' => $this->burden_rate_type,
        ];
    }
}
