<?php

declare(strict_types=1);

namespace Database\Factories;

use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use ImovelZapAi\ClientPortal\Domain\Enums\PortalStatus;
use ImovelZapAi\ClientPortal\Infrastructure\Persistence\Eloquent\ClientPortalModel;
use ImovelZapAi\Conversations\Infrastructure\Persistence\Eloquent\ContactModel;
use ImovelZapAi\Tenancy\Infrastructure\Persistence\Eloquent\TenantModel;

/** @extends Factory<ClientPortalModel> */
class ClientPortalFactory extends Factory
{
    protected $model = ClientPortalModel::class;

    public function definition(): array
    {
        return [
            'tenant_id' => TenantModel::factory(),
            'contact_id' => ContactModel::factory(),
            'created_by' => User::factory(),
            'responsible_user_id' => User::factory(),
            'title' => 'Documentos — '.fake()->firstName(),
            'greeting_name' => fake()->firstName(),
            'status' => PortalStatus::Active,
            'intro_message' => 'Envie os documentos abaixo.',
            'expires_at' => now()->addDays(14),
            'last_activity_at' => now(),
            'documents_total' => 0,
            'documents_approved' => 0,
            'documents_submitted' => 0,
        ];
    }
}
