<?php

namespace Hilco\Models;

use Auth;
use DB;
use Debugbar;
use Exception;
use HilcoB2B\M3Request;
use Hilco\GuzzleWrappers\APIGuzzleWrapper;
use Illuminate\Database\Eloquent\Model;
use Log;

class SubscriptionItem extends UuidModel
{
    protected $table = 'SubscriptionItems';
    protected $fillable = ['subscriptiongroup_id', 'lastmodifiedby_webuser_id'];

    public function subscriptionGroup() {
        return $this->hasOne(SubscriptionGroup::class, 'id', 'subscriptiongroup_id');
    }

    public function createdByWebUser() {
        return $this->hasOne(WebUser::class, 'id', 'createdby_webuser_id');
    }
    public function modifiedByWebUser() {
        return $this->hasOne(WebUser::class, 'id', 'modifiedby_webuser_id');
    }

    public function part() {
        return $this->hasOne(Part::class, 'id', 'part_id');
    }
}