<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CallLater extends Model
{
    protected $fillable = [
        'activity_id',
        'client_case_id',
        'contract_id',
        'user_id',
        'call_back_at',
        'completed_at',
    ];

    protected function casts(): array
    {
        return [
            'call_back_at' => 'datetime',
            'completed_at' => 'datetime',
        ];
    }

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

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

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

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