37 lines
947 B
PHP
37 lines
947 B
PHP
<?php
|
|
/**
|
|
* Sync claim_report from TPA dump tables + ticket_master.
|
|
*
|
|
* Run:
|
|
* php tests/sync_claim_report_from_dump.php
|
|
* php tests/sync_claim_report_from_dump.php --policy=12
|
|
* php tests/sync_claim_report_from_dump.php --tpa=mediassist --policy=12
|
|
* php tests/sync_claim_report_from_dump.php --ticket-only
|
|
* php tests/sync_claim_report_from_dump.php --limit=500
|
|
*
|
|
* Prefer spark (same logic):
|
|
* php spark claim:sync-report --policy=12
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
$args = array_slice($argv, 1);
|
|
$sparkArgs = ['claim:sync-report'];
|
|
|
|
foreach ($args as $arg) {
|
|
if (str_starts_with($arg, '--')) {
|
|
$sparkArgs[] = $arg;
|
|
} elseif (ctype_digit($arg)) {
|
|
$sparkArgs[] = '--policy=' . $arg;
|
|
}
|
|
}
|
|
|
|
$root = dirname(__DIR__);
|
|
chdir($root);
|
|
|
|
$cmd = 'php spark ' . implode(' ', array_map('escapeshellarg', $sparkArgs));
|
|
echo "Running: {$cmd}" . PHP_EOL . PHP_EOL;
|
|
|
|
passthru($cmd, $exitCode);
|
|
exit($exitCode);
|