<?php

namespace App\Models;

use CodeIgniter\Model;

class RefundRequestModel extends Model
{
    protected $table         = 'refund_requests';
    protected $useTimestamps = false;
    protected $allowedFields = ['payment_id', 'requested_by_user_id', 'reason', 'status', 'processed_by', 'processed_at', 'created_at'];

    public function pending(): array
    {
        return $this->where('status', 'pending')->orderBy('created_at', 'ASC')->findAll();
    }
}
