<?php
declare(strict_types=1);

namespace App\Modules\Accounting\Models;

use App\Core\Model;

class BankReconciliation extends Model
{
    protected static string $table = 'bank_reconciliations';
    protected static array $fillable = [
        'bank_account_id', 'reconciliation_date', 'statement_date',
        'statement_balance', 'book_balance', 'adjusted_balance', 'difference',
        'status', 'approved_at', 'approved_by', 'notes',
    ];
    protected static bool $timestamps = true;
    protected static bool $softDelete = true;

    public function items(): array
    {
        return BankReconciliationItem::query()
            ->where('reconciliation_id', '=', $this->id)
            ->orderBy('id', 'ASC')
            ->get();
    }
}
