refactor(catalog): nest catalog routes under tenant
Move Catalog endpoints under /api/tenants/{tenant:codigo} and derive tenant
context from the route instead of request payload fields.
- scope marcas, categorias, productos, and product-attributes by tenant
- enforce tenant ownership in catalog controllers
- remove tenant_codigo and tenant_code from Catalog request validation
- update product attribute tests to use tenant-scoped routes
This commit is contained in:
@@ -18,8 +18,7 @@ class ProductAttributeControllerTest extends TestCase
|
||||
'dominio' => 'acme.com',
|
||||
]);
|
||||
|
||||
$response = $this->postJson('/api/product-attributes', [
|
||||
'tenant_codigo' => 'acme',
|
||||
$response = $this->postJson('/api/tenants/acme/product-attributes', [
|
||||
'codigo' => 'color',
|
||||
'nombre' => 'Color',
|
||||
'is_required' => true,
|
||||
@@ -69,8 +68,7 @@ class ProductAttributeControllerTest extends TestCase
|
||||
'dominio' => 'acme.com',
|
||||
]);
|
||||
|
||||
$response = $this->postJson('/api/product-attributes', [
|
||||
'tenant_codigo' => 'acme',
|
||||
$response = $this->postJson('/api/tenants/acme/product-attributes', [
|
||||
'codigo' => 'material',
|
||||
'nombre' => 'Material',
|
||||
'type' => 'text',
|
||||
|
||||
Reference in New Issue
Block a user