fix: allow authorised fiscal maintenance by the same responsible person
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-21 12:39:07 +02:00
parent 226fd308dd
commit 4a4d121275
17 changed files with 615 additions and 39 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Services;
final class SimulationFiscalSourceAcceptance
{
public static function eligible(array $source, ?string $hash = null): bool
{
if (($source['validation_status'] ?? null) === 'validated') {
return true;
}
$basis = $source['fiscal_acceptance'] ?? null;
return ($source['validation_status'] ?? null) === 'pending' && is_array($basis)
&& ($basis['scope'] ?? null) === 'fiscal_parameters'
&& ($basis['basis'] ?? null) === 'Tempo-official-sources-20261008'
&& preg_match('/^[a-f0-9]{64}$/D', (string) ($basis['sha256'] ?? '')) === 1
&& ($hash === null || $basis['sha256'] === $hash);
}
}