- Updated the index.html template to include a new column for "Næste todo" in the sag table.
- Added new JavaScript functions to load and manage case statuses in settings.html, including normalization and rendering of statuses.
- Introduced a new tag search feature in tags_admin.html, allowing users to filter tags by name, type, and module with pagination support.
- Enhanced the backend router.py to include a new endpoint for listing tag usage across modules with server-side filtering and pagination.
- Improved the overall UI and UX of the tag administration page, including responsive design adjustments and better error handling.
- Created migration 146 to seed case type tags with various categories and keywords.
- Created migration 147 to seed brand and type tags, including a comprehensive list of brands and case types.
- Added migration 148 to introduce a new column `is_next` in `sag_todo_steps` for persistent next-task selection.
- Implemented a new script `run_migrations.py` to facilitate running SQL migrations against the PostgreSQL database with options for dry runs and error handling.
- Fix get_files_by_status query: LATERAL join to get latest extraction
per file, returning vendor_name, vendor_match_confidence, total_amount
- Fix renderUnhandledFiles: use best_vendor_name, convert confidence
0-1 to %, use total_amount field
- Add rerun button for all files (not just failed) via rerunSingleFile()
- rerunSingleFile() calls /reprocess/{file_id} and reloads unhandled tab
- Fix retry_extraction endpoint to actually run extraction immediately
extract_vendor_suggestion now matches found CVR/domain/name against
vendors table for ALL code paths (not just fast path):
- CVR match → score 100
- Domain match → score 80
- Email-domain match → score 75
- Name substring → score 60
Frontend auto-links when match_score >= 80 (was only pdf_extraction source).
Shows score reason: CVR-match/domæne-match/navne-match in success toast.
Also: saves newly found CVR to extracted_vendor_cvr so fast path
works on subsequent calls for old emails too.
- extract_vendor_suggestion: fast path if extracted_vendor_cvr already set
- CVR lookup in vendors table → returns vendor_id if match found
- source='pdf_extraction' with confidence=0.95
- Frontend quickCreateVendor:
- If vendor_id returned → auto-link without modal (no manual input needed)
- New source label '📄 PDF-faktura' for pdf_extraction source
- Added execute_query_single import to emails router
Fixes 'list indices must be integers or slices, not str' error when
uploading a duplicate file. execute_query returns a list, so accessing
existing_file['file_id'] caused TypeError. Now uses execute_query_single
which returns a single dict row.