fix: complete InvesteMoz validation and error corrections

This commit is contained in:
2026-10-29 21:47:33 +02:00
parent 63147312e2
commit daf8623441
718 changed files with 127308 additions and 20959 deletions
+12
View File
@@ -23,6 +23,10 @@ final class SimulationExecution
return $this->createPayload($payload, $actorId, $organizationId, $token, $key);
}
/**
* @param array<array-key, mixed> $snapshot
* @return array{simulation: Simulation, token: string|null, replayed: bool}
*/
public function createFiscalQaPreview(array $snapshot, int $actorId, string $key): array
{
abort_unless(IsolatedQaDatabase::allowsSchemaChanges(), 404);
@@ -34,6 +38,10 @@ final class SimulationExecution
$actorId, null, null, $key);
}
/**
* @param array<array-key, mixed> $input
* @return array{simulation: Simulation, token: string|null, replayed: bool}
*/
public function createPublishedFiscal(array $input, ?int $actorId, ?string $organizationId, ?string $token, string $key): array
{
$payload = ['scenario_kind' => 'fiscal_rule_published', 'fiscal_input' => $input, 'organization_id' => $organizationId];
@@ -42,6 +50,10 @@ final class SimulationExecution
fn (): array => app(SimulationPublishedFiscal::class)->admit($input));
}
/**
* @param array<array-key, mixed> $payload
* @return array{simulation: Simulation, token: string|null, replayed: bool}
*/
private function createPayload(array $payload, ?int $actorId, ?string $organizationId, ?string $token, string $key, ?callable $admit = null): array
{
$tokenHash = $actorId === null ? hash_hmac('sha256', (string) $token, (string) config('app.key')) : null;