refactor(inventory): enhance error reporting for negative stock validation
This commit is contained in:
@@ -113,12 +113,16 @@ class InventoryStockMovementMigrationTest extends TestCase
|
||||
public function test_migration_rejects_an_inventory_with_negative_available_stock(): void
|
||||
{
|
||||
DB::table('inventories')->insert([
|
||||
'id' => 23,
|
||||
'real_stock' => 1,
|
||||
'reserved_stock' => 2,
|
||||
]);
|
||||
|
||||
$this->expectException(\RuntimeException::class);
|
||||
$this->expectExceptionMessage('stock disponible actual es negativo');
|
||||
$this->expectExceptionMessage(
|
||||
'stock disponible actual es negativo. Inventarios detectados (máximo 20): '
|
||||
.'id=23 [real=1, vendidas=0, reintegradas=0, reservadas=2, reservas_entradas=0, resultado=-1]'
|
||||
);
|
||||
|
||||
$this->stockMigration()->up();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user