Skip to content

feat(api): enrich the jobs schema with salary, seniority, sponsorship, and liveness (#258) - #311

Merged
Taleef7 merged 3 commits into
mainfrom
feat/issue-258-enrich-jobs-schema
Aug 30, 2026
Merged

feat(api): enrich the jobs schema with salary, seniority, sponsorship, and liveness (#258)#311
Taleef7 merged 3 commits into
mainfrom
feat/issue-258-enrich-jobs-schema

Conversation

@Taleef7

@Taleef7 Taleef7 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Closes #258 (Epic #245).

Summary of Changes

  1. Database Migration (013_enrich_jobs_schema.sql):

    • Added columns to jobs: salary_min, salary_max, salary_currency, seniority, sponsor_likelihood, content_hash, last_seen_at, and liveness (default 'active').
    • Created indices on content_hash, liveness, (salary_min, salary_max), seniority, and sponsor_likelihood.
  2. Job Enrichment Utilities (apps/api/src/lib/job-enrich.ts):

    • Implemented parseSalaryFromText(text): handles comma ranges, k-suffixes, annualized hourly rates (x2080), noise filtering (< 10k or > 2M), and prioritizes currency/salary-scoped ranges over arbitrary numeric ranges (such as years of experience).
    • Implemented parseSeniority(title, description): evaluates title first, mapping leadership, senior, junior, and mid levels with fail-closed 'unknown' fallback.
    • Implemented computeContentHash({ company, title, descriptionText }): deterministic sha256 hex string.
  3. Source Normalization & Store Fallbacks:

    • Updated normalizeAdzuna to capture and round salary_min and salary_max to USD.
    • Updated createJob in Postgres and in-memory stores to compute fallbacks for salary, seniority, and content hash if not provided by the ingestion source.
    • Updated seedDemoData and mock-store.ts seeds with the new schema fields.
  4. Testing & Verification:

    • Added unit test suite apps/api/src/lib/job-enrich.test.ts.
    • Extended apps/api/src/lib/job-sources/normalize.test.ts and apps/api/src/data/job-store.test.ts.
    • All 278 API tests and 322 agent tests pass cleanly. Full monorepo check (npm run check) succeeds with 0 errors.

@Taleef7

Taleef7 commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85292d0b0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/api/src/lib/job-sources/normalize.ts Outdated
Comment thread apps/api/src/lib/job-enrich.ts Outdated
Comment thread apps/web/src/lib/api.ts
Taleef added 2 commits August 30, 2026 10:39
…ranges, forward enriched fields through POST /jobs route
@Taleef7
Taleef7 merged commit ecfbbe4 into main Aug 30, 2026
7 checks passed
@Taleef7
Taleef7 deleted the feat/issue-258-enrich-jobs-schema branch August 30, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(api): enrich the jobs schema — salary/seniority/sponsorship/liveness columns, salary+seniority parsers, stop discarding Adzuna salary

1 participant