feat(pargar): cap inbound mande/document logs after insert

Keep the newest 2000 success rows per inbound type so dumps stop growing from Pargar webhooks, and store compact document payloads instead of full JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-03 10:19:56 +03:30
co-authored by Cursor
parent c802c67e0d
commit 7e6cd92df4
6 changed files with 323 additions and 5 deletions
@@ -279,11 +279,7 @@ class PargarInboundController extends Controller
'type' => PargarSyncService::TYPE_DOCUMENT,
'sync_status' => PargarSyncService::STATUS_SUCCESS,
'pargar_ref' => $accountId !== '' ? $accountId : null,
'data' => json_encode(array_merge($data, [
'_summary' => $summary,
'wallet_applied' => false,
'code_build' => 'docs-then-mande-auto',
]), JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT),
'data' => $this->sync()->compactInboundDocumentData($data, $summary),
]);
\Illuminate\Support\Facades\Log::info('Pargar documents stored; queue auto mande sync', [