<?php

namespace Database\Factories;

use App\Models\Email;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<Email>
 */
class EmailFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'message_id' => fake()->unique()->sha256(),
            'subject' => fake()->sentence(),
            'from_name' => fake()->name(),
            'from_email' => fake()->safeEmail(),
            'to' => [fake()->safeEmail()],
            'cc' => [fake()->safeEmail()],
            'bcc' => [],
            'timestamp' => fake()->dateTime(),
            'body_text' => fake()->paragraph(),
            'body_html' => '<p>'.fake()->paragraph().'</p>',
            'is_seen' => fake()->boolean(),
            'is_flagged' => fake()->boolean(),
            'size' => fake()->numberBetween(1000, 50000),
            'mailbox' => 'INBOX',
            'raw_headers' => fake()->text(),
            'raw_body' => fake()->text(),
            'attachments' => [],
            'created_at' => now(),
            'updated_at' => now(),
        ];
    }
}
