<?php

namespace App\Http\Resources\Company;

use Illuminate\Http\Resources\Json\JsonResource;

class WorkerTimesheet 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 [
            'id' => $this->id,
            'project_worker_id' => $this->project_worker_id,
            'company_worker_id' => $this->company_worker_id,
            'worker_id' => $this->worker_id,
            'worker_type' => ucfirst($this->worker_type),
            'first_name' => $this->first_name,
            'last_name' => $this->last_name,
            'full_name' => $this->first_name.' '.$this->last_name,
            'total_hours' => $this->total_hours,
            'date' => $this->date,
            'time_in' => $this->time_in,
            'time_out' => $this->time_out,
            'status' => $this->status,
            'request_modification_message' => $this->request_modification_message,
            'requested_by' => $this->requested_by,
            'approved_by' => $this->approved_by,
        ];
    }
}
