<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CostCenterHistoryDetail extends Model
{
    protected $fillable = [
        'cost_center_history_id',
        'chart_of_account_id',
        'account_id',
    ];

    /**
     * Get the cost center history that this detail belongs to
     */
    public function costCenterHistory(): BelongsTo
    {
        return $this->belongsTo(CostCenterHistory::class);
    }

    /**
     * Get the chart of account for this detail
     */
    public function chartOfAccount(): BelongsTo
    {
        return $this->belongsTo(ChartOfAccount::class);
    }

    /**
     * Get the account for this detail
     */
    public function account(): BelongsTo
    {
        return $this->belongsTo(Account::class);
    }
}
