commit melhorias compras1
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-21 21:04:40 +02:00
parent 976271f948
commit 12dd6df28a
108 changed files with 4391 additions and 408 deletions
+14 -3
View File
@@ -53,7 +53,14 @@ final class SupplierPayablePage
$now = $adapter->readContext($user);
abort_unless($now['scope'] === $context['scope'] && $now['person'] === $context['person'], 409, 'Identidade/contexto alterado; reabra a consulta.');
};
$engine = new Payables(DB::connection(), $actor->id, $context['person'], $scope,
// The default local engine is deliberately older than the optional paged
// composition. Negotiate the checked runtime capability, without replacing it.
$definition = new \ReflectionClass(Payables::class);
$constructor = $definition->getConstructor();
abort_unless($constructor !== null && $constructor->getNumberOfParameters() >= 8 && $constructor->getNumberOfRequiredParameters() <= 8
&& $definition->hasMethod('listingPage'), 503,
'Pacote financeiro sem autorização de leitura paginada; composição explícita pendente.');
$engine = $definition->newInstanceArgs([DB::connection(), $actor->id, $context['person'], $scope,
static function () {
throw new \LogicException('Snapshots de consulta nunca executam comandos.');
},
@@ -65,8 +72,12 @@ final class SupplierPayablePage
}
return $history;
} : null, $read);
$data = $engine->listingPage(array_keys($documents), (int) ($options['proposal_page'] ?? 1), (int) ($options['event_page'] ?? 1), $size);
} : null, $read]);
$listing = $definition->getMethod('listingPage');
abort_unless($listing->isPublic() && $listing->getNumberOfRequiredParameters() <= 4 && $listing->getNumberOfParameters() >= 4,
503, 'Pacote financeiro sem leitura paginada compatível.');
$data = $listing->invoke($engine, array_keys($documents), (int) ($options['proposal_page'] ?? 1), (int) ($options['event_page'] ?? 1), $size);
abort_unless(is_array($data), 503, 'Resposta de leitura paginada incompatível.');
$data['pagination']['documents'] = ['page' => $pager->currentPage(), 'last_page' => $pager->lastPage(), 'total' => $pager->total(), 'per_page' => $pager->perPage()];
$data['listing_query'] = ['page' => $page, 'per_page' => $size, 'q' => $text, 'recognition' => $recognition, 'proposal_page' => (int) ($options['proposal_page'] ?? 1), 'event_page' => (int) ($options['event_page'] ?? 1)];
if ($invoiceId !== null) {