Merge branch 'refactor/inventory_stock' of https://gitea.quo.ar/tbianchini/shopit-back into refactor/inventory_stock

This commit is contained in:
2026-09-29 08:23:09 -03:00
parent c5aeb19735
commit 96378a6c2e
596 changed files with 239 additions and 7622 deletions

View File

@@ -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']);