feat(catalog): add group_order field to catalog items and update related logic

This commit is contained in:
2026-08-25 10:45:12 -03:00
parent 6b06028771
commit 87a4fa6288
9 changed files with 84 additions and 2 deletions

View File

@@ -354,8 +354,10 @@ class CatalogControllerTest extends TestCase
]);
$food = $this->createItem($tenant, 'Hamburger');
$food->update(['group_order' => 2]);
$food->category()->associate($category)->save();
$this->createItem($tenant, 'Parking');
$parking = $this->createItem($tenant, 'Parking');
$parking->update(['group_order' => 1]);
$this->getJson("/api/tenants/{$tenant->codigo}/catalog")
->assertOk()
@@ -364,6 +366,9 @@ class CatalogControllerTest extends TestCase
->assertJsonPath('0.items.0.nombre', 'Hamburger')
->assertJsonPath('1.title', 'All products')
->assertJsonCount(2, '1.items.data')
->assertJsonPath('1.items.data.0.nombre', 'Parking')
->assertJsonPath('1.items.data.1.nombre', 'Hamburger')
->assertJsonMissingPath('1.items.data.0.group_order')
->assertJsonPath('1.items.meta.total', 2);
}