<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

/**
 * Class DataPenempatanTran
 *
 * @property string $trans_id
 * @property string $trans_kode
 * @property string|null $akun_penempatan
 * @property int $penempatan_id
 * @property int $debet
 * @property int $kredit
 * @property string $keterangan
 * @property Carbon $trans_tglbuku
 * @property Carbon $trans_date
 * @property int $created_by
 * @property int $status
 *
 * @package App\Models
 */
class TransaksiPenempatanBank extends Model
{
	protected $table = 'data_penempatan_trans';
	protected $primaryKey = 'trans_id';
	public $incrementing = false;
	public $timestamps = false;

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

	protected $guarded = [];

    public function penempatan()
	{
		return $this->belongsTo(PenempatanBank::class, 'penempatan_id','id');
	}

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