diff --git a/app/Domains/Tenant/Models/WebsiteType.php b/app/Domains/Tenant/Models/WebsiteType.php index 8bc62b7..308236f 100644 --- a/app/Domains/Tenant/Models/WebsiteType.php +++ b/app/Domains/Tenant/Models/WebsiteType.php @@ -16,6 +16,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; 'secondary_color', 'danger_color', 'success_color', + 'login_header_footer_color', 'site_logo', ])] class WebsiteType extends Model diff --git a/app/Domains/Tenant/Resources/TenantResource.php b/app/Domains/Tenant/Resources/TenantResource.php index 5c98f9e..abdff89 100644 --- a/app/Domains/Tenant/Resources/TenantResource.php +++ b/app/Domains/Tenant/Resources/TenantResource.php @@ -32,18 +32,6 @@ class TenantResource extends JsonResource 'header_bg_color' => $this->header_bg_color, 'footer_bg_color' => $this->footer_bg_color, 'website_type_code' => $this->website_type_code, - 'website_type' => $this->whenLoaded( - 'websiteType', - fn () => $this->websiteType ? [ - 'codigo' => $this->websiteType->codigo, - 'nombre' => $this->websiteType->nombre, - 'primary_color' => $this->websiteType->primary_color, - 'secondary_color' => $this->websiteType->secondary_color, - 'danger_color' => $this->websiteType->danger_color, - 'success_color' => $this->websiteType->success_color, - 'site_logo' => $this->websiteType->siteLogo?->getTemporaryUrl(1440), - ] : null - ), 'extras' => $this->whenLoaded( 'websiteExtras', fn () => $this->websiteExtras diff --git a/app/Domains/Tenant/Services/TenantInformationService.php b/app/Domains/Tenant/Services/TenantInformationService.php index 11826bb..10fdf18 100644 --- a/app/Domains/Tenant/Services/TenantInformationService.php +++ b/app/Domains/Tenant/Services/TenantInformationService.php @@ -14,7 +14,6 @@ class TenantInformationService 'headerLogo', 'footerLogo', 'socialMedia', - 'websiteType.siteLogo', 'websiteExtras.websiteTypeExtra', ]; diff --git a/database/migrations/2026_07_31_000500_add_presentation_fields_to_website_type_table.php b/database/migrations/2026_07_31_000500_add_presentation_fields_to_website_type_table.php index 2127445..0be6a26 100644 --- a/database/migrations/2026_07_31_000500_add_presentation_fields_to_website_type_table.php +++ b/database/migrations/2026_07_31_000500_add_presentation_fields_to_website_type_table.php @@ -13,7 +13,8 @@ return new class extends Migration $table->string('secondary_color')->nullable()->after('primary_color'); $table->string('danger_color')->nullable()->after('secondary_color'); $table->string('success_color')->nullable()->after('danger_color'); - $table->unsignedBigInteger('site_logo')->nullable()->after('success_color'); + $table->string('login_header_footer_color')->nullable()->after('success_color'); + $table->unsignedBigInteger('site_logo')->nullable()->after('login_header_footer_color'); $table->foreign('site_logo') ->references('id') @@ -34,6 +35,7 @@ return new class extends Migration 'secondary_color', 'danger_color', 'success_color', + 'login_header_footer_color', 'site_logo', ]); }); diff --git a/public/images/website_types/shopit_logo.png b/public/images/website_types/shopit_logo.png new file mode 100644 index 0000000..12cd594 Binary files /dev/null and b/public/images/website_types/shopit_logo.png differ diff --git a/tests/Feature/Tenant/BootstrapTenantControllerTest.php b/tests/Feature/Tenant/BootstrapTenantControllerTest.php index 84f40e2..ac87b6c 100644 --- a/tests/Feature/Tenant/BootstrapTenantControllerTest.php +++ b/tests/Feature/Tenant/BootstrapTenantControllerTest.php @@ -172,6 +172,7 @@ class BootstrapTenantControllerTest extends TestCase $this->getJson('/api/tenants/bootstrap/acme.com') ->assertOk() + ->assertJsonMissingPath('data.website_type') ->assertJsonPath('data.extras.contact.phone', '+54 341 555 0101') ->assertJsonMissingPath('data.extras.banner'); } diff --git a/tests/Feature/Tenant/StoreTenantWithExtrasTest.php b/tests/Feature/Tenant/StoreTenantWithExtrasTest.php index 025d706..4bd1b3e 100644 --- a/tests/Feature/Tenant/StoreTenantWithExtrasTest.php +++ b/tests/Feature/Tenant/StoreTenantWithExtrasTest.php @@ -39,7 +39,7 @@ class StoreTenantWithExtrasTest extends TestCase $response ->assertCreated() ->assertJsonPath('data.website_type_code', 'onticket') - ->assertJsonPath('data.website_type.codigo', 'onticket') + ->assertJsonMissingPath('data.website_type') ->assertJsonPath('data.extras.eventConfig.title', 'Festival'); $tenant = Tenant::query()->where('codigo', 'festival')->sole(); diff --git a/tests/Feature/Tenant/WebsiteExtrasTest.php b/tests/Feature/Tenant/WebsiteExtrasTest.php index 6ddfded..8681fd4 100644 --- a/tests/Feature/Tenant/WebsiteExtrasTest.php +++ b/tests/Feature/Tenant/WebsiteExtrasTest.php @@ -26,6 +26,7 @@ class WebsiteExtrasTest extends TestCase 'secondary_color', 'danger_color', 'success_color', + 'login_header_footer_color', 'site_logo', 'created_at', 'updated_at', @@ -70,6 +71,7 @@ class WebsiteExtrasTest extends TestCase 'secondary_color' => '#222222', 'danger_color' => '#ff0000', 'success_color' => '#00aa55', + 'login_header_footer_color' => '#333333', 'site_logo' => $siteLogo->id, ]); $typeExtra = $type->extras()->create([ @@ -95,6 +97,7 @@ class WebsiteExtrasTest extends TestCase $this->assertSame('#222222', $type->secondary_color); $this->assertSame('#ff0000', $type->danger_color); $this->assertSame('#00aa55', $type->success_color); + $this->assertSame('#333333', $type->login_header_footer_color); $this->assertTrue($type->siteLogo()->firstOrFail()->is($siteLogo)); $this->assertSame($type->codigo, $typeExtra->website_type_code); $this->assertSame('whatsapp', $typeExtra->codigo); diff --git a/tests/Feature/Tenant/WebsiteTypeServiceTest.php b/tests/Feature/Tenant/WebsiteTypeServiceTest.php index f317d81..8bb317e 100644 --- a/tests/Feature/Tenant/WebsiteTypeServiceTest.php +++ b/tests/Feature/Tenant/WebsiteTypeServiceTest.php @@ -23,6 +23,7 @@ class WebsiteTypeServiceTest extends TestCase 'secondary_color' => '#222222', 'danger_color' => '#ff0000', 'success_color' => '#00aa55', + 'login_header_footer_color' => '#333333', 'site_logo' => UploadedFile::fake()->image('site-logo.png'), ]); @@ -34,6 +35,7 @@ class WebsiteTypeServiceTest extends TestCase Storage::disk('s3')->assertExists($siteLogo->path); $this->assertDatabaseHas('website_type', [ 'codigo' => 'marketplace', + 'login_header_footer_color' => '#333333', 'site_logo' => $siteLogo->id, ]); }