Refactor Catalog API: Remove Create Catalog Item Endpoint and Update Related Logic

- Removed the "Create Catalog" endpoint from the Postman collection.
- Updated the CatalogController to handle tenant-specific catalog items based on active events.
- Refactored CatalogItem model to automatically set event_id based on tenant's active_event_id during creation.
- Deleted StoreCatalogItemRequest and CatalogItemResource as they are no longer needed.
- Updated various services and controllers to utilize the new tenant-based catalog item retrieval logic.
- Added tests to ensure that catalog reads are limited to items associated with the active event.
This commit is contained in:
2026-09-18 13:51:13 -03:00
parent cdc17a13e2
commit 22ef5619f3
21 changed files with 107 additions and 482 deletions

View File

@@ -150,23 +150,6 @@ function bodyFor(string $method, string $uri): ?array
return jsonBody(['nombre' => 'Tenant Demo Actualizado', 'site_title' => 'ShopIt Demo', 'primary_color' => '#111827', 'cart_editing_policy' => 'full']);
}
if ($key === 'POST api/tenants/{tenant:codigo}/catalog-items') {
return jsonBody([
'type' => 'standard',
'category_id' => '{{category_id}}',
'slug' => 'producto-demo',
'nombre' => 'Producto Demo',
'descripcion' => 'Producto creado desde Postman',
'precio' => 10000,
'inventory_policy' => 'tracked',
'inventory_subject' => 'product',
'max_units_per_user' => 5,
'has_tickets' => false,
'real_stock' => 100,
'images' => [TINY_PNG],
]);
}
if ($key === 'POST api/storage-test/s3/upload') {
return formDataBody(['path' => 'postman/test-file.png', 'expires_in_minutes' => '60'], ['file']);
}