<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;

/**
 * Class DataKreditProduk
 *
 * @property int $id
 * @property string $nama
 * @property int $plafon_min
 * @property int $plafon_maks
 * @property int $jkw_min
 * @property int $jkw_maks
 * @property string|null $deskripsi
 * @property int|null $created_by
 * @property int|null $deleted_by
 * @property int|null $updated_by
 * @property int|null $status
 * @property string $akun_pinjaman_id
 * @property string $akun_pendapatan_bunga_id
 * @property string $akun_pendapatan_administrasi_id
 * @property string $akun_pendapatan_denda_id
 *
 * @property Collection|DataKreditMaster[] $data_kredit_masters
 *
 * @package App\Models
 */
class ProdukKredit extends Model
{
	protected $table = 'data_kredit_produk';
	public $incrementing = false;
	public $timestamps = false;

	protected $casts = [
		'id' => 'int',
		'plafon_min' => 'int',
		'plafon_maks' => 'int',
		'jkw_min' => 'int',
		'jkw_maks' => 'int',
		'created_by' => 'int',
		'deleted_by' => 'int',
		'updated_by' => 'int',
		'status' => 'int'
	];

	protected $fillable = [
		'nama',
		'plafon_min',
		'plafon_maks',
		'jkw_min',
		'jkw_maks',
		'deskripsi',
		'created_by',
		'deleted_by',
		'updated_by',
		'status',
		'akun_pinjaman_id',
		'akun_pendapatan_bunga_id',
		'akun_pendapatan_administrasi_id',
		'akun_pendapatan_denda_id'
	];

	public function kredit()
	{
		return $this->hasMany(Kredit::class, 'produk_id');
	}
}
