<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;

class Order extends AbstractModel
{

    use SoftDeletes;

    protected $table = 'orders';

    protected $fillable = [
        'company_id', 'marking', 'forwarder_id', 'address_id', 'current_step', 'complete'
    ];

    public function orderSteps()
    {
        return $this->hasMany(OrderStep::class, 'order_id');
    }

    public function packages()
    {
        return $this->hasMany(Package::class, 'order_id');
    }

    public function shippingArrangement()
    {
        return $this->hasOne(ShippingArrangement::class, 'order_id');
    }

    public function deliveryArrangement()
    {
        return $this->hasOne(DeliveryArrangement::class, 'order_id');
    }
}
