<?php

namespace App\Models\Crm;

use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class LeadFollow extends Model
{
    public $timestamps = false;

    protected $fillable = [
        'lead_id', 'user_id', 'type', 'content', 'next_follow_at',
    ];

    protected function casts(): array
    {
        return [
            'type' => 'integer',
            'next_follow_at' => 'datetime',
            'created_at' => 'datetime',
        ];
    }

    public function lead(): BelongsTo
    {
        return $this->belongsTo(Lead::class);
    }

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
