<?php

namespace App\Models\Tenant;

use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class EmployeeProfile extends Model
{
    use BelongsToTenant, SoftDeletes;

    protected $fillable = [
        'company_id', 'user_id', 'position',
        'base_salary', 'works_pct', 'parts_pct',
        'hire_date', 'notes',
    ];

    protected $casts = [
        'base_salary' => 'decimal:2',
        'works_pct' => 'decimal:2',
        'parts_pct' => 'decimal:2',
        'hire_date' => 'date',
    ];

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