<?php

namespace Modules\SpecialAttendance\Entities;

use App\Models\User;
use Modules\Tardy\Entities\TardyRule;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class DeductionDetail extends Model
{
    use HasFactory;

    protected $guarded = [];

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

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

    public function consideredBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'considered_by', 'id');
    }
}
