<?php

namespace Modules\Subscription\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Coupon\Models\Coupon;
use Modules\Package\Models\Package;
use Modules\Product\Models\Product;
use Modules\User\Enums\AccountStatusEnum;
use Modules\Store\Models\Store;
use Modules\User\Models\Visitor;

class Subscription extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable = [
        'status','start_date','end_date','total_package','discount','total_amount','store_id','package_id','coupon_id'
    ];


    /**
     * Get current description of the the Room
     * @return HasOne
     */
    public function store() :BelongsTo
    {
        return $this->belongsTo(Store::class)->withTrashed();
    }

    public function coupon()
    {
        return $this->belongsTo(Coupon::class)->withTrashed();
    }

    public function package()
    {
        return $this->belongsTo(Package::class)->withTrashed();
    }

}
