<?php

declare(strict_types=1);

namespace App\Models\Barangay;

use App\Models\Model;

class RequestPayment extends Model
{
    protected ?string $table = 'barangay_request_payments';

    protected array $fillable = [
        'request_id', 'amount', 'method', 'reference',
        'qrph_raw', 'paid_at', 'verified_by',
    ];

    protected array $casts = [
        'amount'  => 'decimal:2',
        'paid_at' => 'datetime',
    ];

    public function documentRequest()
    {
        return $this->belongsTo(DocumentRequest::class, 'request_id');
    }

    public function verifiedBy()
    {
        return $this->belongsTo(\App\Models\User::class, 'verified_by');
    }
}
