Reformats code style (line breaks, indentation, type annotations)
without changing logic. Also includes minor feature additions bundled
in the same lint run (stats service, user-settings groups, agrarmonitor
polling improvements).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Renamed setting agrarmonitor_tag_posteingang → agrarmonitor_tag_manuell
- Documents not found in AM are now tagged as "Manuell bearbeiten"
instead of being moved back to Posteingang
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Before moving a document back to Posteingang, check if it's still
waiting in the Agrarmonitor Dateieingang
- If yes: skip silently (upload is pending processing)
- If no: move to Posteingang tag as before
- Handle 401/403 by clearing the session and aborting the check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add agrarmonitor_tag_posteingang setting (default empty)
- When a document is not found in Agrarmonitor, move it back to Posteingang
tag instead of skipping (if tagPosteingang is configured)
- Expose tagPosteingang in polling config API and settings UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Only set eingangsDatum when belegNummer is present
- Import documents when buchungsDatum is set (revert inverted condition)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- getOrCreateCorrespondent first checks CorrespondentSetting by kundenId
- Falls back to name search only when no mapping exists
- Saves the mapping after creation for future polling runs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Detect duplicates after sync (same AgrarmonitorId, multiple correspondents)
- Auto-merge duplicates with identical names (delete empty, move docs to larger)
- Expose conflicts with different names for manual resolution
- New mergeCorrespondents endpoint + service method
- Conflict resolution modal in SettingsPage with radio selection per conflict
- deleteCorrespondent added to PaperlessService
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract getOrCreateCorrespondent helper to deduplicate logic
- Add syncCorrespondentIds to match Paperless correspondents to
Agrarmonitor IDs via Lieferantennummer and persist in CorrespondentSetting
- New POST /api/agrarmonitor/sync-correspondents endpoint
- "Agrarmonitor-Abgleich" button in Correspondents settings tab
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 400 on Korrespondenten-Sync: getCorrespondentByName was called with
searchName "(12345)" but checked exact match against full displayName
"Firma (12345)". Always returned null → duplicate addCorrespondent on
every run → Paperless 400. Fix: search by displayName directly.
- 403 on Livesearch: cached Agrarmonitor session expired. Fix: detect
401/403 from connector, call clearClient() to invalidate cache, break
out of the polling loop so next cron run re-authenticates.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>