<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;

class SubscriptionTransactions extends Model
{
    use HasFactory;

    protected $fillable = [
        'organisation_id',
        'amount',
        'date_paid',
        'date_settled',
        'fee',
        'amount_settled',
        'status',
        'payment_gateway',
        'currency',
        'reference_id',
        'type',
        'subscription_id',
        'email',
        "card_info"
    ];

    //Define Parent Relationships
    public function subscription() : BelongsTo{
        return $this->belongsTo(Subscription::class);
    }

    //Define child relationships
    public function organisation() : BelongsTo {
        return $this->belongsTo(Organisation::class);
    }
}
