<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * @property integer $id
 * @property integer $customer_id
 * @property string $status
 * @property boolean $is_guest
 * @property string $customer_email
 * @property string $customer_first_name
 * @property string $customer_last_name
 * @property string $shipping_method
 * @property string $coupon_code
 * @property int $total_item_count
 * @property int $total_qty_ordered
 * @property float $grand_total
 * @property float $base_grand_total
 * @property float $grand_total_invoiced
 * @property float $base_grand_total_invoiced
 * @property float $grand_total_refunded
 * @property float $base_grand_total_refunded
 * @property float $sub_total
 * @property float $base_sub_total
 * @property float $sub_total_invoiced
 * @property float $base_sub_total_invoiced
 * @property float $sub_total_refunded
 * @property float $base_sub_total_refunded
 * @property float $discount_percent
 * @property float $discount_amount
 * @property float $base_discount_amount
 * @property float $discount_invoiced
 * @property float $base_discount_invoiced
 * @property float $discount_refunded
 * @property float $base_discount_refunded
 * @property float $tax_amount
 * @property float $base_tax_amount
 * @property float $tax_amount_invoiced
 * @property float $base_tax_amount_invoiced
 * @property float $tax_amount_refunded
 * @property float $base_tax_amount_refunded
 * @property float $shipping_amount
 * @property float $base_shipping_amount
 * @property float $shipping_invoiced
 * @property float $base_shipping_invoiced
 * @property float $shipping_refunded
 * @property float $base_shipping_refunded
 * @property string $customer_type
 * @property string $created_at
 * @property string $updated_at
 * @property Customer $customer
 * @property Invoice[] $invoices
 * @property OrderAddress[] $orderAddresses
 * @property OrderItem[] $orderItems
 * @property OrderPayment[] $orderPayments
 * @property Refund[] $refunds
 */
class Orders extends Model
{
    /**
     * The "type" of the auto-incrementing ID.
     * 
     * @var string
     */
    protected $keyType = 'integer';

    /**
     * @var array
     */
    protected $fillable = ['customer_id', 'status', 'is_guest', 'customer_email', 'customer_first_name', 'customer_last_name', 'shipping_method', 'coupon_code', 'total_item_count', 'total_qty_ordered', 'grand_total', 'base_grand_total', 'grand_total_invoiced', 'base_grand_total_invoiced', 'grand_total_refunded', 'base_grand_total_refunded', 'sub_total', 'base_sub_total', 'sub_total_invoiced', 'base_sub_total_invoiced', 'sub_total_refunded', 'base_sub_total_refunded', 'discount_percent', 'discount_amount', 'base_discount_amount', 'discount_invoiced', 'base_discount_invoiced', 'discount_refunded', 'base_discount_refunded', 'tax_amount', 'base_tax_amount', 'tax_amount_invoiced', 'base_tax_amount_invoiced', 'tax_amount_refunded', 'base_tax_amount_refunded', 'shipping_amount', 'base_shipping_amount', 'shipping_invoiced', 'base_shipping_invoiced', 'shipping_refunded', 'base_shipping_refunded', 'customer_type', 'created_at', 'updated_at'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function customer()
    {
        return $this->belongsTo('App\Customer');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function invoices()
    {
        return $this->hasMany('App\Invoice');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function orderAddresses()
    {
        return $this->hasMany('App\OrderAddress');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function orderItems()
    {
        return $this->hasMany('App\OrderItem');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function orderPayments()
    {
        return $this->hasMany('App\OrderPayment');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function refunds()
    {
        return $this->hasMany('App\Refund');
    }
}
