feat: Refactor event form functionality by removing social media data from AdminAppBootstrapResource and AdminAppBootstrapService; add EventFormController, EventFormResource, and EventFormService; implement routes and tests for event form

This commit is contained in:
2026-08-03 14:02:08 -03:00
parent 12697c2268
commit 3b36abd46d
12 changed files with 162 additions and 36 deletions

View File

@@ -3,14 +3,12 @@
namespace Tests\Unit\Bootstrap;
use App\Domains\Bootstrap\Resources\AdminAppBootstrapResource;
use App\Domains\Tenant\Models\SocialMedia;
use App\Domains\Tenant\Models\WebsiteType;
use Illuminate\Database\Eloquent\Collection;
use Tests\TestCase;
class AdminAppBootstrapResourceTest extends TestCase
{
public function test_it_exposes_the_website_type_and_forms(): void
public function test_it_exposes_the_website_type(): void
{
$websiteType = new WebsiteType([
'codigo' => 'shopit',
@@ -19,22 +17,11 @@ class AdminAppBootstrapResourceTest extends TestCase
]);
$websiteType->setRelation('siteLogo', null);
$websiteType->setRelation('footerLogo', null);
$socialMedia = new SocialMedia([
'code' => 'instagram',
'name' => 'Instagram',
'icon' => 'fa-brands fa-instagram',
]);
$data = AdminAppBootstrapResource::make([
'website_type' => $websiteType,
'social_media' => new Collection([$socialMedia]),
])->resolve(request());
$this->assertSame('shopit', $data['website_type_code']);
$this->assertSame('event', $data['forms'][0]['code']);
$this->assertSame(
'instagram',
$data['forms'][0]['social_media']->resolve(request())[0]['code']
);
$this->assertArrayNotHasKey('forms', $data);
}
}