Add robust company slug for job-offer blacklist matching

Company matching relied on normText(), which kept legal-form suffixes,
spacing and umlaut spelling — so "Bosch GmbH", "Bosch AG" and "bosch gmbh"
did not match the same entry, making the blacklist unreliable.

Introduce firmaSlug(): transliterate German umlauts, strip diacritics and
trailing legal-form tokens (GmbH/AG/SE/KG/…), then kebab-join. Add a
firma_slug field to jobangebote_blacklist (schema + ALTER/backfill migration)
and match on it for typ firma/firma_stelle/auto, falling back to firma_norm
for legacy rows. POST /joboffers rejects blacklisted offers via matchBlacklist
automatically since offerSignature now carries the slug.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-06 22:25:59 +02:00
co-authored by Claude Opus 4.8
parent 4e5933890f
commit f935e00b53
3 changed files with 76 additions and 8 deletions
+1
View File
@@ -938,6 +938,7 @@ function buildOpenApiSpec(baseUrl = '') {
quelle: { type: 'string', nullable: true },
external_id: { type: 'string', nullable: true },
firma_norm: { type: 'string', nullable: true },
firma_slug: { type: 'string', nullable: true, description: 'Rechtsform-/Umlaut-robuster Firmen-Slug; primärer Abgleich für typ=firma/firma_stelle/auto.' },
stelle_norm: { type: 'string', nullable: true },
ort_norm: { type: 'string', nullable: true },
firma: { type: 'string', nullable: true },