feat(website-type): implement BootstrapWebsiteTypeController and related request/resource for domain-based bootstrapping

This commit is contained in:
2026-07-31 13:39:31 -03:00
parent b478c23f3b
commit f603a82b5e
8 changed files with 160 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace Tests\Unit\Tenant;
use App\Domains\Tenant\Models\WebsiteType;
use App\Domains\Tenant\Resources\AdminApp\BootstrapAdminAppResource;
use Tests\TestCase;
class BootstrapAdminAppResourceTest extends TestCase
{
public function test_it_exposes_the_website_type_code(): void
{
$websiteType = new WebsiteType([
'codigo' => 'shopit',
'nombre' => 'ShopIt',
'dominio' => 'admin.shopit.test',
]);
$websiteType->setRelation('siteLogo', null);
$data = BootstrapAdminAppResource::make($websiteType)->resolve(request());
$this->assertSame('shopit', $data['codigo']);
$this->assertSame('shopit', $data['website_type_code']);
}
}