Accept conditional service calculation with versioned fiscal profile

This commit is contained in:
2026-10-26 16:48:44 +02:00
parent bc2707bb65
commit 9f480045fa
25 changed files with 801 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
<?php
require __DIR__.'/../vendor/autoload.php';
$app=require __DIR__.'/../bootstrap/app.php'; $app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
\App\Shared\Testing\TestingDatabaseGuard::assertSafe();
$in=json_decode(stream_get_contents(STDIN),true,32,JSON_THROW_ON_ERROR);
app(\App\Shared\Context\CompanyContext::class)->selectFor($in['actor'],$in['tenant'],$in['company'],$in['unit']);
if($in['pause'] ?? false) {
$paused=false;
\Illuminate\Support\Facades\DB::listen(function($q) use(&$paused) { if(!$paused && str_contains($q->sql,'"companies"') && str_contains($q->sql,'for update')) { $paused=true; echo "LOCK_HELD\n"; flush(); usleep(1500000); } });
}
echo json_encode(app(\App\Modules\Services\ServiceFiscal::class)->calculate($in['draft'],$in['actor'],$in['command']),JSON_THROW_ON_ERROR).PHP_EOL;