feat: implement multi-tenant cart system with stock reservation and inventory tracking

This commit is contained in:
2026-07-01 16:21:53 -03:00
parent 230ea57ce0
commit 6a0b08c9d7
8 changed files with 144 additions and 18 deletions

View File

@@ -143,10 +143,10 @@ class ProductControllerTest extends TestCase
$this->assertDatabaseHas('productos_variantes', [
'producto_id' => $product->id,
'stock' => 10,
'stock_real' => 10,
]);
$variantS = ProductVariant::where('producto_id', $product->id)->where('stock', 10)->firstOrFail();
$variantS = ProductVariant::where('producto_id', $product->id)->where('stock_real', 10)->firstOrFail();
$this->assertDatabaseHas('productos_variantes_values', [
'producto_variante_id' => $variantS->id,
'products_attribute_id' => $productAttributes['size']->id,
@@ -321,7 +321,7 @@ class ProductControllerTest extends TestCase
// Variant should still exist untouched
$this->assertDatabaseHas('productos_variantes', [
'id' => $v1->id,
'stock' => 5,
'stock_real' => 5,
]);
}