<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SchemeCustomer extends Model
{
    protected $table = 'scheme_registrations';

    protected $primaryKey = 'registration_id';

    public $timestamps = false;

    protected $fillable = [
        'scheme_id',
        'customer_id',
        'start_date',
        'maturity_date',
        'status'
    ];

    public function scheme()
    {
        return $this->belongsTo(Scheme::class,'scheme_id');
    }

    public function customer()
    {
        return $this->belongsTo(Customer::class,'customer_id');
    }

    public function payments()
    {
        return $this->hasMany(SchemePayment::class,'registration_id');
    }
}