<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class IshareOrder extends Model
{
    protected $fillable = [
        'user_id',
        'recipient',
        'capacity',
        'status',
        'api_ref',
        'api_status',
        'is_customer',
        'reference',
    ];

    protected $table = 'ishare_orders';

    /**
     * Get the user that owns the order
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function payment()
    {
        return $this->hasOne(IshareOrderPayment::class, 'order_id', 'id');
    }
}
