<?php

namespace App\Modules\HR\Payroll\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Modules\HR\Core\Models\Employee;

class EmployeeAddition extends Model
{
    use HasFactory;

    protected $fillable = [
        'employee_id',
        'addition_id',
        'calculation_type',
        'amount',
        'status',
    ];

    protected $casts = [
        'status' => 'boolean',
        'amount' => 'decimal:2',
    ];

    public function employee(): BelongsTo
    {
        return $this->belongsTo(Employee::class);
    }

    public function addition(): BelongsTo
    {
        return $this->belongsTo(Addition::class);
    }
}
