<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ConsumerApplicationFollowUp extends Model
{
    use SoftDeletes;

    protected $table = 'consumer_application_follow_ups';

    protected $fillable = [
        'application_id',
        'follow_up_status',
        'follow_up_reason',
        'follow_up_stopped_by',
    ];

    public function application()
    {
        return $this->belongsTo('App\ConsumerApplication', 'application_id', 'id');
    }

    /**
     * Scope: Get only stopped follow-ups
     */
    public function scopeStopped($query)
    {
        return $query->where('follow_up_status', 'stopped');
    }

    /**
     * Scope: Get only active follow-ups
     */
    public function scopeActive($query)
    {
        return $query->where('follow_up_status', 'active');
    }
}
