Merge branch 'refactor/inventory_stock' of https://gitea.quo.ar/tbianchini/shopit-back into refactor/inventory_stock
This commit is contained in:
@@ -124,8 +124,6 @@ class FoodControllerTest extends TestCase
|
||||
|
||||
$updated = $this->variantPayload($secondDate->id, 'Cena', 'Vianda', 80, 8500);
|
||||
$updated['id'] = $variantId;
|
||||
unset($updated['stock']);
|
||||
$updated['stock_difference'] = -20;
|
||||
$updated['description'] = 'Cena para llevar';
|
||||
|
||||
$this->postJson('/api/v1/adminapp/tenant/foods', [
|
||||
@@ -242,7 +240,7 @@ class FoodControllerTest extends TestCase
|
||||
Inventory::query()->whereKey($replacementInventoryId)->delete();
|
||||
|
||||
$updated = $this->patchJson('/api/v1/adminapp/tenant/foods/history-stock', [
|
||||
'variants' => [['id' => $historicalVariantId, 'stock_difference' => -55]],
|
||||
'variants' => [['id' => $historicalVariantId, 'stock' => 45]],
|
||||
])
|
||||
->assertOk()
|
||||
->assertJsonPath('data.history.0.variants.0.id', $historicalVariantId)
|
||||
@@ -260,7 +258,7 @@ class FoodControllerTest extends TestCase
|
||||
]);
|
||||
|
||||
$this->patchJson('/api/v1/adminapp/tenant/foods/history-stock', [
|
||||
'variants' => [['id' => $activeVariantId, 'stock_difference' => -60]],
|
||||
'variants' => [['id' => $activeVariantId, 'stock' => 20]],
|
||||
])
|
||||
->assertUnprocessable()
|
||||
->assertJsonValidationErrors(['variants.0.id']);
|
||||
|
||||
Reference in New Issue
Block a user