<?php

namespace App\Models;

use App\Models\Concerns\BelongsToBusiness;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class ReminderTemplate extends Model
{
    use BelongsToBusiness, HasFactory, SoftDeletes;

    protected $fillable = [
        'business_id',
        'name',
        'type',
        'channel',
        'subject',
        'body',
        'status',
        'variables',
        'meta',
    ];

    protected function casts(): array
    {
        return [
            'variables' => 'array',
            'meta' => 'array',
        ];
    }

    public function scheduledReminders(): HasMany
    {
        return $this->hasMany(ScheduledReminder::class);
    }
}
