feat(tenant): provision Desfile Pura Tendencia and extend tenant customization

- Add Desfile Pura Tendencia tenant migration with catalog, variants, event, menus and assets
- Support tenant header/footer background images
- Add configurable cart visibility
- Update tenant seeding and API resources
- Add migration and bootstrap feature tests
This commit is contained in:
2026-08-12 13:53:22 -03:00
parent 36c1c185ee
commit f50d3d0587
13 changed files with 772 additions and 0 deletions

View File

@@ -39,6 +39,20 @@ class BootstrapTenantControllerTest extends TestCase
'type' => AttachmentType::Image,
'mime_type' => 'image/png',
]);
$headerBackgroundAttachment = Attachment::create([
'key' => (string) Str::uuid(),
'path' => 'tenants/header-background.png',
'filename' => 'header-background.png',
'type' => AttachmentType::Image,
'mime_type' => 'image/png',
]);
$footerBackgroundAttachment = Attachment::create([
'key' => (string) Str::uuid(),
'path' => 'tenants/footer-background.png',
'filename' => 'footer-background.png',
'type' => AttachmentType::Image,
'mime_type' => 'image/png',
]);
$tenant = Tenant::create([
'codigo' => 'acme',
@@ -52,9 +66,12 @@ class BootstrapTenantControllerTest extends TestCase
'footer_bg_color' => '#ffffff',
'header_logo_id' => $headerAttachment->id,
'footer_logo_id' => $footerAttachment->id,
'header_bg_image_id' => $headerBackgroundAttachment->id,
'footer_bg_image_id' => $footerBackgroundAttachment->id,
'event_date_text' => '9, 10, 11 y 12 de Octubre 2026',
'display_categories' => false,
'display_seach_bar' => false,
'display_cart' => false,
]);
$response = $this->getJson('/api/tenants/bootstrap/acme.com');
@@ -70,13 +87,18 @@ class BootstrapTenantControllerTest extends TestCase
->assertJsonPath('data.event_date_text', '9, 10, 11 y 12 de Octubre 2026')
->assertJsonPath('data.display_categories', false)
->assertJsonPath('data.display_seach_bar', false)
->assertJsonPath('data.display_cart', false)
->assertJsonPath('data.header_bg_color', '#ffffff')->assertJsonPath('data.footer_bg_color', '#ffffff');
$headerUrl = $response->json('data.header_logo');
$footerUrl = $response->json('data.footer_logo');
$headerBackgroundUrl = $response->json('data.header_bg_image');
$footerBackgroundUrl = $response->json('data.footer_bg_image');
$this->assertStringContainsString($headerAttachment->key, $headerUrl);
$this->assertStringContainsString($footerAttachment->key, $footerUrl);
$this->assertStringContainsString($headerBackgroundAttachment->key, $headerBackgroundUrl);
$this->assertStringContainsString($footerBackgroundAttachment->key, $footerBackgroundUrl);
$this->assertTrue(
str_contains($headerUrl, 'Expires=') || str_contains($headerUrl, 'expiration=') || str_contains($headerUrl, 'X-Amz-Expires=')
);