commit compras4 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 19:13:31 +02:00
parent 9cf9764710
commit 7486007fcf
41 changed files with 1270 additions and 66 deletions
+22 -2
View File
@@ -1794,12 +1794,32 @@ test('native partial-order Finance amendment exposes a recoverable form and pres
$this->post('/ordens/'.$order->id.'/reafectacao', $data)->assertConflict();
});
test('native partial-order issuance commits only forty then sixty and preserves replay and quantity caps', function () {
test('native partial-order issuance commits only forty then sixty and preserves replay and quantity caps', function (int $cycle) {
if (! method_exists(BudgetControl::class, 'commitOrderParts')) {
$this->markTestSkipped('Explicit unpublished common source required.');
}
(new PurchaseOrder)->fill(['number' => 'Unpersisted legacy metadata warmup']);
(new PurchaseOrderItem)->fill(['description' => 'Unpersisted legacy metadata warmup']);
if ($cycle === 2) {
if (! method_exists(BudgetControl::class, 'beginRequisitionCycle')) {
$this->markTestSkipped('Explicit cycle-capable common QA source required.');
}
budgetDistributionFixtureSchema();
(require __DIR__.'/../../database/qa-migrations/2026_11_22_000007_create_budget_order_parts.php')->up();
(require __DIR__.'/../../database/qa-migrations/2026_11_22_000008_create_purchase_order_sources.php')->up();
(require __DIR__.'/../../database/qa-migrations/2026_11_27_000001_add_requisition_cycles.php')->up();
config(['requisition-expiry.qa_enabled' => true]);
$engine = app(CommonBudget::class)->for($this->buyer, [$this->r->id => 1]);
$engine->beginRequisitionCycle($this->r->id, 1, (string) Str::uuid());
$engine->closeRequisitionCycle($this->r->id, 1, (string) Str::uuid());
$this->r->setAttribute('approval_cycle', 2);
$this->r->save();
$step = $this->r->steps()->make(['tenant_id' => $this->tenant->id, 'position' => 1, 'role' => 'department_head',
'decision' => 'approved', 'approver_id' => $this->head->id, 'decided_at' => now()]);
$step->setAttribute('approval_cycle', 2);
$step->save();
app(CommonBudget::class)->for($this->buyer, [$this->r->id => 2])->beginRequisitionCycle($this->r->id, 2, (string) Str::uuid());
}
$award = nativeOrderPartsAward($this);
$input = nativeOrderPartsInput($this, $award, '0.400', 0);
$workflow = app(OrderPartsWorkflow::class);
@@ -1824,7 +1844,7 @@ test('native partial-order issuance commits only forty then sixty and preserves
$this->withoutVite();
$this->get('/ordens/preparar')->assertOk()->assertViewHas('page', fn (array $page) => $page['props']['candidates']['data'] === []);
$this->post('/adjudicacoes/'.$award->id.'/emitir')->assertConflict();
});
})->with([1, 2]);
test('native partial-order issuance rolls back the document and all financial effects when its audit fails', function () {
if (! method_exists(BudgetControl::class, 'commitOrderParts')) {