<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AFAOrderPayment extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'afa_order_payments';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'afa_order_id',
        'contact',
        'amount',
        'profit',
        'transaction_id',
        'payment_provider_id',
        'status'
    ];

    /**
     * Get the AFA registration associated with this payment.
     */
    public function registration()
    {
        return $this->belongsTo(AFARegistration::class, 'afa_order_id');
    }

    public function paymentProvider()
    {
        return $this->belongsTo(PaymentProvider::class, 'payment_provider_id');
    }
}
