<?php

namespace Database\Factories;

use App\Models\NotificationTemplate;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

/** @extends Factory<NotificationTemplate> */
class NotificationTemplateFactory extends Factory
{
    protected $model = NotificationTemplate::class;

    public function definition(): array
    {
        $title = fake()->unique()->words(3, true);

        return [
            'uuid' => (string) Str::uuid(),
            'title' => Str::title($title),
            'slug' => Str::slug($title, '_'),
            'type' => 'transactional',
            'channel' => fake()->randomElement(['push', 'sms', 'email', 'in_app']),
            'subject' => Str::title($title),
            'message' => 'Hello {{user_name}}, '.fake()->sentence(),
            'variables' => ['user_name'],
            'language' => 'en',
            'status' => 'active',
        ];
    }
}
