<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class JournalHeader extends Model
{
    use HasFactory;

    protected $table = 'journal_headers';

    protected $fillable = [
        'journal_date',
        'reference',
        'description',
        'source_module',
        'created_by',
        'updated_by',
    ];

    protected $casts = [
        'journal_date' => 'date',
    ];

    public function lines()
    {
        return $this->hasMany(JournalLine::class, 'journal_header_id');
    }
}
