<?php

namespace Modules\HR\Transformers;

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

class SalaryComponentResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'code' => $this->code,
            'type' => $this->type,
            'calculation_type' => $this->calculation_type,
            'calculation_value' => $this->calculation_value,
            'calculation_basis' => $this->calculation_basis,
            'formula' => $this->formula,
            'is_taxable' => $this->is_taxable,
            'is_basic' => $this->is_basic,
            'is_cpf' => $this->is_cpf,
            'affects_attendance' => $this->affects_attendance,
            'affects_overtime' => $this->affects_overtime,
            'include_in_gross' => $this->include_in_gross,
            'include_in_net' => $this->include_in_net,
            'is_pro_rated' => $this->is_pro_rated,
            'sort_order' => $this->sort_order,
            'status' => $this->status,
        ];
    }
}
