fix(portal-clis): emit the contract's id field from jobnet and jobdanmark search results (#518)

/add-portal's contract says every search result carries at least id,
title, company, location, date, url, and the four other shipped CLIs
emit id. When #340 added the company/location/date/url aliases to these
two, id was left out: jobnet exposed the value only as jobAdId,
jobdanmark only as slug, so a consumer reading every portal's JSON
through one shape had to special-case both to call detail.

Purely additive: id equals jobAdId on jobnet and slug on jobdanmark, the
native keys stay, nothing is renamed. Each SKILL.md notes the alias. The
additive-contract test in each CLI now asserts id and its equality with
the native key; both fail on master.
This commit is contained in:
Ayobami Adegoke authored and GitHub committed 2026-10-05 19:27:43 +02:00
1 parent e9115b02f8
commit 895c02191d
7 files changed
+30 -4

No files matched your search

@@ -74,6 +74,10 @@ export function normalizeItem(item: ApiSearchItem): Record<string, unknown> {
applicationDeadline: item.applicationDeadline ?? null,
url: fullUrl,
slug,
// /scrape contract aliases (add-portal.md: every result carries at least
// id, title, company, location, date, url). `id` is the slug - the value
// `detail` takes - under the name every other portal CLI uses.
id: slug,
company: item.companyName,
location: extractCity(item.companyAddress),
date: toContractDate(item.publishedDate),