<?php

namespace App\Models;

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

class ScheduledNotificationLog extends Model
{
    protected $fillable = [
        'user_id',
        'reminder_type',
        'notifiable_type',
        'notifiable_id',
        'activity_at',
        'reminder_at',
        'status',
        'sent_at',
        'failed_at',
        'error_message',
    ];

    protected $casts = [
        'activity_at' => 'datetime',
        'reminder_at' => 'datetime',
        'sent_at' => 'datetime',
        'failed_at' => 'datetime',
    ];

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