<?php

namespace Database\Factories;

use App\Domains\Bio\Models\BioPage;
use App\Domains\Workspace\Actions\CreateWorkspace;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class BioPageFactory extends Factory
{
    protected $model = BioPage::class;

    public function definition(): array
    {
        $user = User::factory()->create();
        $workspace = (new CreateWorkspace)->handle($user, ['name' => 'Test']);

        return [
            'workspace_id' => $workspace->id,
            'slug' => Str::slug(fake()->words(2, true)),
            'title' => ['en' => fake()->sentence(4), 'de' => fake()->sentence(4)],
            'description' => ['en' => fake()->sentence(), 'de' => fake()->sentence()],
            'theme' => [],
            'is_published' => true,
        ];
    }
}
