<?php

namespace App\Models;

use Database\Factories\BankFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

/**
 * Master bank/rekening tujuan pembayaran (RPD §12.2).
 *
 * @property int $id
 * @property string $kode
 * @property string $keterangan
 * @property bool $status
 */
class Bank extends Model
{
    /** @use HasFactory<BankFactory> */
    use HasFactory;

    protected $fillable = ['kode', 'keterangan', 'status'];

    protected function casts(): array
    {
        return [
            'status' => 'boolean',
        ];
    }

    public function billings(): HasMany
    {
        return $this->hasMany(Billing::class);
    }
}
