commit melhorias compras4
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-22 16:28:03 +02:00
parent efd97e265b
commit 36dcfdf00c
118 changed files with 6042 additions and 92 deletions
+14
View File
@@ -166,6 +166,20 @@ final class SupplierPayables
}, fn (int $id) => $this->document($u, $id), self::historyEnabled() ? fn (int $id) => $this->paymentHistory($u, $id) : null);
}
/** Native financial positions with read authorization only; commands are forbidden. */
public function readEngine(User $user): Payables
{
$context = $this->readContext($user);
return new Payables(DB::connection(), $user->id, $context['person'], $context['scope'], function (string $action) use ($user, $context) {
if ($action !== 'view') {
throw new \LogicException('A composição de consulta não executa comandos financeiros.');
}
$fresh = $this->readContext($user);
abort_unless($fresh['scope'] === $context['scope'] && $fresh['person'] === $context['person'], 409, 'Identidade/contexto alterado; reabra a consulta.');
}, fn (int $id) => $this->document($user, $id), self::historyEnabled() ? fn (int $id) => $this->paymentHistory($user, $id) : null);
}
/** @param array<string,mixed> $options
* @return array<string,mixed>
*/