<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Rate extends Model
{
    use HasFactory;

    protected $fillable = [
        'member_id',
        'member_course_id',
        'course_subscription_id',
        'price',
        'date',
        'months',
        'note',
        'status',
        'record_id',
        'is_subscription',
        'member_subscription_id',
    ];

    public function member()
    {
        return $this->belongsTo(Member::class);
    }

    public function record()
    {
        return $this->belongsTo(Record::class);
    }

    public function member_course()
    {
        return $this->belongsTo(MemberCourse::class, 'member_course_id');
    }
    public function member_subscription()
    {
        return $this->belongsTo(MemberSubscription::class, 'member_subscription_id');
    }

    public function course_subscription()
    {
        return $this->belongsTo(CourseSubscription::class, 'course_subscription_id');
    }

}
