<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ManualPayment extends Model
{
    use \Illuminate\Database\Eloquent\Factories\HasFactory;

    protected $fillable = [
        'subscription_id', 'amount', 'transfer_date', 'sender_name', 
        'proof_path', 'payment_status', 'reviewed_by', 'reviewed_at', 'review_notes'
    ];

    public function subscription()
    {
        return $this->belongsTo(Subscription::class);
    }

    public function reviewer()
    {
        return $this->belongsTo(User::class, 'reviewed_by');
    }

    public function isApproved(): bool
    {
        return $this->payment_status === 'approved';
    }
}
