<?php

namespace App\Models\CRM;

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

class EurAccount extends Model
{
    /** @use HasFactory<\Database\Factories\CRM\EurAccountFactory> */
    use HasFactory;

    protected $fillable = [
        'account_number',

        'documentable_id',
        'documentable_type',
        'status'
    ];

    public function documentable()
    {
        return $this->morphTo();
    }

    public function scopeActive($query)
    {
        return $query->where('status', 'active');
    }
}
