<?php

namespace App\Models;

use App\Models\Concerns\BelongsToCompany;
use Illuminate\Database\Eloquent\Model;

class SalaryComponent extends Model
{
    use BelongsToCompany;

    protected $table = 'salary_components';

    protected $fillable = [
        'company_id',
        'name',
        'type',
        'value_type',
        'default_amount',
        'is_taxable',
        'monthly',
        'weekly',
        'bi_weekly',
        'semi_monthly',
        'isAdded',
    ];

    protected $casts = [
        'default_amount' => 'decimal:2',
        'monthly' => 'decimal:2',
        'weekly' => 'decimal:2',
        'bi_weekly' => 'decimal:2',
        'semi_monthly' => 'decimal:2',
        'is_taxable' => 'boolean',
        'isAdded' => 'boolean',
    ];
}
