<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * StaffAchievement Model
 *
 * @property int $id
 * @property int $staff_history_id
 * @property string $achievement_description
 * @property \Illuminate\Support\Carbon $achievement_date
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 */
class StaffAchievement extends Model
{
    use HasFactory, SoftDeletes;

    protected $table = 'staff_achievements';

    protected $fillable = [
        'staff_history_id',
        'achievement_description',
        'achievement_date',
    ];

    protected $casts = [
        'achievement_date' => 'date',
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
        'deleted_at' => 'datetime',
    ];

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