feat(website-extras): refactor WebsiteExtra management to use 'codigo' for identification, update routes, requests, and services

This commit is contained in:
2026-07-31 09:27:35 -03:00
parent 40a7dece11
commit 6b3a12b624
14 changed files with 210 additions and 68 deletions

View File

@@ -27,6 +27,7 @@ class WebsiteExtrasTest extends TestCase
$this->assertEqualsCanonicalizing([
'id',
'website_type_code',
'codigo',
'nombre',
'descripcion',
'is_required',
@@ -52,6 +53,7 @@ class WebsiteExtrasTest extends TestCase
'nombre' => 'Tienda',
]);
$typeExtra = $type->extras()->create([
'codigo' => 'whatsapp',
'nombre' => 'WhatsApp',
'descripcion' => 'Configuracion del canal de WhatsApp',
'is_required' => true,
@@ -69,6 +71,7 @@ class WebsiteExtrasTest extends TestCase
$this->assertTrue($type->extras()->firstOrFail()->is($typeExtra));
$this->assertSame($type->codigo, $typeExtra->website_type_code);
$this->assertSame('whatsapp', $typeExtra->codigo);
$this->assertTrue($type->tenants()->firstOrFail()->is($tenant));
$this->assertTrue($tenant->websiteType()->firstOrFail()->is($type));
$this->assertSame($type->codigo, $tenant->website_type_code);
@@ -91,6 +94,7 @@ class WebsiteExtrasTest extends TestCase
'nombre' => 'Tienda',
]);
$typeExtra = $type->extras()->create([
'codigo' => 'whatsapp',
'nombre' => 'WhatsApp',
'descripcion' => 'Configuracion del canal de WhatsApp',
'config_schema' => ['type' => 'object'],