Conferir e publicar instituições pelo editor assistido com MFA nativo
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-10 21:09:18 +02:00
parent 5a5cc9e815
commit ef24cbdc92
12 changed files with 612 additions and 97 deletions
+13
View File
@@ -38,6 +38,19 @@ final class FundingProgrammes
abort_unless($this->access($actor), 403);
}
/** @param array<string,mixed> $reference */
public function matchesReference(User $actor, string $id, array $reference): bool
{
$this->guard($actor);
$row = DB::table('funding_programmes')->where('id', $id)->firstOrFail();
$expected = $this->normalize($actor, $reference, false);
$actual = json_decode($row->draft, true, 512, JSON_THROW_ON_ERROR);
abort_unless(is_array($actual), 503);
return json_encode(Arr::sortRecursive($actual), JSON_THROW_ON_ERROR)
=== json_encode(Arr::sortRecursive($expected), JSON_THROW_ON_ERROR);
}
public function publicQuery(): Builder
{
abort_unless($this->installed(), 404);