feat(seeder): update image paths in ProductCatalogFromImagesSeeder and TenantSeeder, add new catalog images

This commit is contained in:
2026-07-31 11:45:29 -03:00
parent 3968a10f6a
commit ec1d80dff2
37 changed files with 52 additions and 12 deletions

View File

@@ -80,7 +80,7 @@ class ProductCatalogFromImagesSeeder extends Seeder
throw new RuntimeException("Tenant 'sonder' not found."); throw new RuntimeException("Tenant 'sonder' not found.");
} }
$catalogPath = storage_path('public/catalog'); $catalogPath = public_path('images/catalog');
if (! is_dir($catalogPath)) { if (! is_dir($catalogPath)) {
throw new RuntimeException("Catalog directory not found at path: {$catalogPath}"); throw new RuntimeException("Catalog directory not found at path: {$catalogPath}");

View File

@@ -56,34 +56,34 @@ class TenantSeeder extends Seeder
'success_color' => '#198754', 'success_color' => '#198754',
'header_bg_color' => '#ffffff', 'header_bg_color' => '#ffffff',
'footer_bg_color' => '#313131', 'footer_bg_color' => '#313131',
'header_logo' => $this->uploadedImage('images/sonder_header.png', 'sonder_header.png'), 'header_logo' => $this->uploadedImage('images/tennants/sonder/sonder_header.png', 'sonder_header.png'),
'footer_logo' => $this->uploadedImage('images/sonder_footer.png', 'sonder_footer.png'), 'footer_logo' => $this->uploadedImage('images/tennants/sonder/sonder_footer.png', 'sonder_footer.png'),
'social_media' => self::SOCIAL_MEDIA, 'social_media' => self::SOCIAL_MEDIA,
'website_type_code' => 'shopit', 'website_type_code' => 'shopit',
'extras' => [ 'extras' => [
'carousel' => [ 'carousel' => [
$this->uploadedImage( $this->uploadedImage(
'images/sonder-main-carousel/01-urban-team.png', 'images/tennants/sonder/sonder-main-carousel/01-urban-team.png',
'01-urban-team.png', '01-urban-team.png',
), ),
$this->uploadedImage( $this->uploadedImage(
'images/sonder-main-carousel/02-running-shoes.png', 'images/tennants/sonder/sonder-main-carousel/02-running-shoes.png',
'02-running-shoes.png', '02-running-shoes.png',
), ),
$this->uploadedImage( $this->uploadedImage(
'images/sonder-main-carousel/03-streetwear.png', 'images/tennants/sonder/sonder-main-carousel/03-streetwear.png',
'03-streetwear.png', '03-streetwear.png',
), ),
$this->uploadedImage( $this->uploadedImage(
'images/sonder-main-carousel/04-football-training.png', 'images/tennants/sonder/sonder-main-carousel/04-football-training.png',
'04-football-training.png', '04-football-training.png',
), ),
$this->uploadedImage( $this->uploadedImage(
'images/sonder-main-carousel/05-activewear-essentials.png', 'images/tennants/sonder/sonder-main-carousel/05-activewear-essentials.png',
'05-activewear-essentials.png', '05-activewear-essentials.png',
), ),
$this->uploadedImage( $this->uploadedImage(
'images/sonder-main-carousel/06-city-runners.png', 'images/tennants/sonder/sonder-main-carousel/06-city-runners.png',
'06-city-runners.png', '06-city-runners.png',
), ),
], ],
@@ -108,11 +108,11 @@ class TenantSeeder extends Seeder
'header_bg_color' => '#ffffff', 'header_bg_color' => '#ffffff',
'footer_bg_color' => '#015327', 'footer_bg_color' => '#015327',
'header_logo' => $this->uploadedImage( 'header_logo' => $this->uploadedImage(
'images/futbol_infantil_header.png', 'images/tennants/fiesta_futbol_infantil/futbol_infantil_header.png',
'futbol_infantil_header.png', 'futbol_infantil_header.png',
), ),
'footer_logo' => $this->uploadedImage( 'footer_logo' => $this->uploadedImage(
'images/futbol_infantil_footer.png', 'images/tennants/fiesta_futbol_infantil/futbol_infantil_footer.png',
'futbol_infantil_footer.png', 'futbol_infantil_footer.png',
), ),
'social_media' => self::SOCIAL_MEDIA, 'social_media' => self::SOCIAL_MEDIA,
@@ -124,7 +124,7 @@ class TenantSeeder extends Seeder
'button_text' => 'Comprar entradas', 'button_text' => 'Comprar entradas',
'button_href' => '/tickets', 'button_href' => '/tickets',
'background_image_id' => $this->uploadedImage( 'background_image_id' => $this->uploadedImage(
'images/futbol_infantil_hero.jpg', 'images/tennants/fiesta_futbol_infantil/futbol_infantil_hero.jpg',
'futbol_infantil_hero.jpg', 'futbol_infantil_hero.jpg',
), ),
], ],

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 458 KiB

After

Width:  |  Height:  |  Size: 458 KiB

View File

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 208 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 165 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View File

Before

Width:  |  Height:  |  Size: 386 KiB

After

Width:  |  Height:  |  Size: 386 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,40 @@
<?php
namespace Tests\Feature\Tenant;
use App\Domains\Tenant\Services\WebsiteTypeService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class WebsiteTypeServiceTest extends TestCase
{
use RefreshDatabase;
public function test_it_creates_a_website_type_and_uploads_its_logo_to_s3(): void
{
Storage::fake('s3');
$websiteType = app(WebsiteTypeService::class)->create([
'codigo' => 'marketplace',
'nombre' => 'Marketplace',
'primary_color' => '#111111',
'secondary_color' => '#222222',
'danger_color' => '#ff0000',
'success_color' => '#00aa55',
'site_logo' => UploadedFile::fake()->image('site-logo.png'),
]);
$siteLogo = $websiteType->siteLogo()->firstOrFail();
$this->assertSame('marketplace', $websiteType->codigo);
$this->assertSame($siteLogo->id, $websiteType->site_logo);
$this->assertStringStartsWith('website-types/', $siteLogo->path);
Storage::disk('s3')->assertExists($siteLogo->path);
$this->assertDatabaseHas('website_type', [
'codigo' => 'marketplace',
'site_logo' => $siteLogo->id,
]);
}
}