refactor(inventory): update stock validation rules and enforce stock_difference requirement
This commit is contained in:
@@ -194,7 +194,7 @@ class EntryControllerTest extends TestCase
|
||||
'title' => 'Abono actualizado',
|
||||
'description' => 'Ahora incluye ambas fechas',
|
||||
'event_date_ids' => [$firstDate->id, $secondDate->id],
|
||||
'stock' => 20,
|
||||
'stock_difference' => 10,
|
||||
'price' => 250,
|
||||
],
|
||||
[
|
||||
@@ -268,7 +268,7 @@ class EntryControllerTest extends TestCase
|
||||
'id' => $entryId,
|
||||
'title' => 'Abono editado',
|
||||
'event_date_ids' => [$date->id, $otherDate->id],
|
||||
'stock' => 30,
|
||||
'stock_difference' => 10,
|
||||
'price' => 200,
|
||||
]],
|
||||
])->assertOk()
|
||||
@@ -329,7 +329,7 @@ class EntryControllerTest extends TestCase
|
||||
'title' => 'Entrada inválida',
|
||||
'description' => null,
|
||||
'event_date_ids' => [$foreignDate->id],
|
||||
'stock' => 10,
|
||||
'stock_difference' => 0,
|
||||
'price' => 100,
|
||||
]],
|
||||
])
|
||||
@@ -371,7 +371,7 @@ class EntryControllerTest extends TestCase
|
||||
'title' => 'Entrada inválida',
|
||||
'description' => null,
|
||||
'event_date_ids' => [$eventDate->id],
|
||||
'stock' => 10,
|
||||
'stock_difference' => 0,
|
||||
'price' => 100,
|
||||
]],
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user