<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Discount extends Model
{
    protected $fillable = ["id", "company_id", "description", "conditions", "price", "percentatge", "active"];

    protected $casts = [
        "active" => "boolean"
    ];

    public function company(){
        return $this->belongsTo("App\Company", "company_id");
    }

    public function user_subscription(){
        return $this->hasMany("App\UserSubscription");
    }

    public function box_orders(){
        return $this->hasMany("App\BoxOrder");
    }

    public function box_order_lines(){
        return $this->hasMany("App\BoxOrderLine");
    }

    public function box_products_variants(){
        return $this->hasMany("App\BoxProductVariant");
    }
}
