Agrarmonitor #2

Merged
bjoernpoettker merged 21 commits from Agrarmonitor into main 2026-05-25 11:02:59 +00:00
Owner
No description provided.
bjoernpoettker added 21 commits 2026-05-25 11:02:45 +00:00
- New backend module (agrarmonitor) with status check and device registration
- Frontend settings tab with connection status display and registration form
- Environment variables for base URLs, credentials, cookie path and encryption key
- Docker Compose env passthrough for agrarmonitor config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into Agrarmonitor
Build and Push Multi-Platform Images / build-and-push (push) Failing after 23s
6e20dec723
Merge branch 'main' into Agrarmonitor
Build and Push Multi-Platform Images / build-and-push (push) Successful in 49s
6f6a4d83e5
fix: disable auto-retry and improve error messages in Agrarmonitor
Build and Push Multi-Platform Images / build-and-push (push) Successful in 43s
9f39578471
- Set autoRetry: false and timeoutMs: 10000 in AgrarmonitorService
- Show specific error message on timeout or backend error in frontend

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Delete agrarmonitor-web.service.ts (HTML-scraping no longer needed)
- Rewrite AgrarmonitorPollingService to call connector directly
  (eingangsrechnungenLivesearch, setEingangsdatum, setLieferscheinNummer)
- Fix quality issues: concurrency guard, customer-sync try/catch,
  tag dedup via Set, parseInt NaN guard, page_size overflow warning
- Update AgrarmonitorModule to import TypeORM/PaperlessModule
- Remove node-html-parser dependency
- Update agrarmonitor-connector to latest Gitea commit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GET  /api/agrarmonitor/polling-config
PUT  /api/agrarmonitor/polling-config
POST /api/agrarmonitor/run-polling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GET  /api/settings/clients       — list all Betriebe ordered by name
PUT  /api/settings/clients/:id   — update AgrarmonitorBetriebId

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add SettingClient interface and getClients/updateClient methods
- Add AgrarmonitorPollingConfig/Result interfaces
- Add getPollingConfig, updatePollingConfig, runPolling to agrarmonitorApi

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Benutzer & Betriebe tab:
- Add Betriebe table with inline-editable AgrarmonitorBetriebId column

Agrarmonitor tab:
- Add Polling-Konfiguration card (tag-IDs, auto-loaded, save button)
- Add Polling ausführen card (run button, result display with error list)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
docs: add Agrarmonitor polling design plans
Build and Push Multi-Platform Images / build-and-push (push) Successful in 57s
1d11d8a3bd
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: two polling bugs — correspondent 400 and Agrarmonitor 403
Build and Push Multi-Platform Images / build-and-push (push) Successful in 30s
74cd2477f1
- 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>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: set loginStrategy to 'redirect' in AgrarmonitorService
Build and Push Multi-Platform Images / build-and-push (push) Successful in 42s
a726f863f0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: implement ProcessVerarbeiteteDocuments (Upload-Check)
Build and Push Multi-Platform Images / build-and-push (push) Successful in 37s
8c5a81ed27
Ported ProcessVerarbeiteteDocuments() from C# ProcessUploads.cs:
- Checks docs tagged "hochgeladen" → eingangsrechnungVorhanden()
- On match: livesearch, update title/type/created/correspondent/tags,
  set custom fields (externeBelegnummer, AgrarmonitorLink), addNote
- Tag "hochgeladen" → "fertig" swap; owner via Client.AgrarmonitorBetriebId
- 401/403 guard: clearClient() + break (same pattern as runPolling)
- Cron: AGRARMONITOR_UPLOAD_CHECK_CRON (default: 0 * * * * *)
- New settings: agrarmonitor_tag_hochgeladen, agrarmonitor_link_field
- Endpoint: POST /api/agrarmonitor/process-uploads
- Frontend: polling-config extended with tagHochgeladen + linkField select,
  new card "Dokumenten-Verarbeitung" with run button + result display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bjoernpoettker merged commit bbdaf19fff into main 2026-05-25 11:02:59 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bjoernpoettker/paperlessmanager#2