<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class JurnalTrans extends Model
{
    protected $table = 'data_trans_jurnal';
    public $timestamps = false;

    protected $casts = [
        'debet' => 'int',
        'kredit' => 'int',
        'trans_date' => 'datetime',
        'trans_tglbuku' => 'datetime',
        'created_by' => 'int',
        'deleted_by' => 'int',
        'status' => 'int'
    ];

    protected $guarded = [];

    public function akun()
    {
        return $this->belongsTo(Akun::class, 'akun_jurnal', 'kode_akun');
    }

    public function transaksi()
    {
        return $this->belongsTo(TableTransaksi::class, 'trans_kode', 'kode');
    }
}
