commit compras5 2911
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-29 19:49:19 +02:00
parent a935499d64
commit 96b30368bc
96 changed files with 3397 additions and 111 deletions
+9
View File
@@ -12,6 +12,7 @@ use App\Services\ReceiptWorkflow;
use App\Services\RequisitionWorkflow;
use Illuminate\Support\Str;
use Inertia\Testing\AssertableInertia as Assert;
use Tempo\Inventory\ReceiptMovementWriter;
require_once __DIR__.'/../Support/ReceiptFixture.php';
@@ -28,6 +29,14 @@ test('receipt preparation uses encrypted history without registering a receipt o
expect(GoodsReceipt::query()->count())->toBe(0)->and(StockMovement::query()->count())->toBe(0);
});
test('legacy receipts remain usable after agreement conversion arithmetic is loaded without selecting another stock writer', function () {
require_once base_path('packages/inventory-write/development/src/QuantityConversion.php');
$this->postJson($this->url, $this->payload)->assertCreated();
expect(StockMovement::query()->sole()->quantity_milli)->toBe(600);
$writer = new ReflectionClass(ReceiptMovementWriter::class);
expect(realpath($writer->getFileName()))->toBe(realpath(base_path('packages/inventory-write/releases/0.1.0/src/ReceiptMovementWriter.php')));
});
test('partial then total receipts preserve pending quantities and credit only accepted stock', function () {
$this->postJson($this->url, receiptPayload($this->f, '0.400'))->assertCreated()->assertJsonPath('status', 'partial');
$first = GoodsReceipt::query()->firstOrFail();