Show job offer posting date (anzeige_datum) alongside ingestion date
- Add anzeige_datum DATE column to jobangebote (with ALTER TABLE migration for pre-existing tables) — the original posting date supplied by the third party - Accept anzeige_datum in POST /api/v1/joboffers (create + upsert) and document it in the OpenAPI spec - Render both on /jobangebote: "Anzeige: <anzeige_datum>" and "Einspielung: <created_at>" Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -536,6 +536,7 @@ function createExternalApi(deps) {
|
||||
}
|
||||
const quelle = sanitizeInput(b.quelle || 'drittanbieter');
|
||||
const externalId = b.external_id != null ? sanitizeInput(String(b.external_id)) : null;
|
||||
const anzeigeDatum = sanitizeInput(b.anzeige_datum || '');
|
||||
const fields = [
|
||||
sanitizeInput(b.firma),
|
||||
sanitizeInput(b.stelle),
|
||||
@@ -544,6 +545,7 @@ function createExternalApi(deps) {
|
||||
sanitizeInput(b.beschreibung || ''),
|
||||
sanitizeInput(b.quelle_url || ''),
|
||||
sanitizeInput(b.art || ''),
|
||||
anzeigeDatum,
|
||||
sanitizeInput(b.status || 'offen'),
|
||||
];
|
||||
|
||||
@@ -556,7 +558,7 @@ function createExternalApi(deps) {
|
||||
if (existing) {
|
||||
await dbRun(
|
||||
`UPDATE jobangebote SET firma = ?, stelle = ?, ort = ?, gehalt = ?,
|
||||
beschreibung = ?, quelle_url = ?, art = ?, status = ?,
|
||||
beschreibung = ?, quelle_url = ?, art = ?, anzeige_datum = ?, status = ?,
|
||||
updated_at = CURRENT_TIMESTAMP WHERE id = ?`,
|
||||
[...fields, existing.id]
|
||||
);
|
||||
@@ -567,8 +569,8 @@ function createExternalApi(deps) {
|
||||
|
||||
const result = await dbRun(
|
||||
`INSERT INTO jobangebote
|
||||
(external_id, quelle, firma, stelle, ort, gehalt, beschreibung, quelle_url, art, status)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
(external_id, quelle, firma, stelle, ort, gehalt, beschreibung, quelle_url, art, anzeige_datum, status)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
[externalId, quelle, ...fields]
|
||||
);
|
||||
const row = await dbGet('SELECT * FROM jobangebote WHERE id = ?', [result.lastID]);
|
||||
|
||||
Reference in New Issue
Block a user