Add third-party REST API (/api/v1) + Swagger UI and Jobangebote page

- REST API under /api/v1 with X-API-Key auth (API_TOKEN), documented with
  OpenAPI 3.0; Swagger UI at /swagger, spec at /swagger.json
- Endpoints: applications CRUD + timeline, attachments/emails download,
  generation trigger/status, settings, statistics, export, templates, joboffers
- Jobangebote page (/jobangebote) listing offers ingested via the REST API,
  with "Als Bewerbung übernehmen" and delete actions; header nav + badge
- jobangebote table with (quelle, external_id) upsert for third-party ingestion

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-03 21:30:33 +02:00
co-authored by Claude
parent 0af731695a
commit 88875dbc33
7 changed files with 1889 additions and 0 deletions
+19
View File
@@ -20,6 +20,18 @@
<span id="unassignedBadge" class="hidden absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 flex items-center justify-center rounded-full bg-red-500 text-white text-[10px] font-bold ring-2 ring-blue-800 dark:ring-gray-900">0</span>
</a>
<!-- Jobangebote (ingested via third-party REST API) link -->
<a href="/jobangebote"
id="jobangeboteLink"
class="relative flex items-center gap-1.5 px-3 py-2 rounded-md bg-white/20 hover:bg-white/30 transition-colors text-white text-sm font-medium"
title="Über die REST-API eingespielte Jobangebote">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>
</svg>
<span class="hidden sm:inline">Jobangebote</span>
<span id="jobangeboteBadge" class="hidden absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 flex items-center justify-center rounded-full bg-green-500 text-white text-[10px] font-bold ring-2 ring-blue-800 dark:ring-gray-900">0</span>
</a>
<!-- Vorlagen (base documents) link -->
<a href="/vorlagen"
class="flex items-center gap-1.5 px-3 py-2 rounded-md bg-white/20 hover:bg-white/30 transition-colors text-white text-sm font-medium"
@@ -68,5 +80,12 @@
if (b && d && d.count > 0) { b.textContent = d.count; b.classList.remove('hidden'); }
}).catch(function () { /* ignore — badge stays hidden */ });
})();
// Jobangebote badge: count of open offers ingested via the REST API.
(function () {
fetch('/jobangebote/anzahl-offen').then(function (r) { return r.json(); }).then(function (d) {
var b = document.getElementById('jobangeboteBadge');
if (b && d && d.count > 0) { b.textContent = d.count; b.classList.remove('hidden'); }
}).catch(function () { /* ignore */ });
})();
</script>
</header>