<?php

namespace App\Models\Real\Relations;

use App\Models\Card\Card;
use App\Models\Real\Order;
use App\Models\Real\Company;
use App\Models\Real\Package;
use App\Models\Virtual\Order as VirtualOrder;
use App\Models\Virtual\OrderCard as VirtualOrderCard;

trait OrderRelations
{
    public function company()
    {
        return $this->belongsTo(Company::class, 'company_id', 'id');
    }

    public function package()
    {
        return $this->belongsTo(Package::class, 'package_id', 'id');
    }

    public function order()
    {
        return $this->belongsTo(Order::class, 'order_id', 'id');
    }

    public function card()
    {
        return $this->belongsTo(Card::class, 'sim', 'sim');
    }

    public function virtual()
    {
        return $this->belongsTo(VirtualOrder::class, 'virtual_order_id', 'id');
    }

    public function virtual_order_cards()
    {
        return $this->hasOne(VirtualOrderCard::class, 'sim', 'sim');
    }
}
