Skip to content

Commit

Permalink
fix: split list-valued tags into individual tags in Greenhouse job fo…
Browse files Browse the repository at this point in the history
…rmatting for improved frontend usability
  • Loading branch information
itsnedhir committed Jan 15, 2025
1 parent a404d2e commit 288542e
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions src/hrflow_connectors/v2/connectors/greenhouse/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,14 @@ def format_greenhouse_job(data: t.Dict) -> t.Dict:
name="closed_at",
value=data.get("closed_at"),
),
dict(
name="departments",
value=[
department["name"] for department in data.get("departments", [])
],
),
dict(
name="offices",
value=[office["name"] for office in data.get("offices", [])],
),
*[
dict(name="department", value=department["name"])
for department in data.get("departments", [])
],
*[
dict(name="office", value=office["name"])
for office in data.get("offices", [])
],
dict(
name="employment_type",
value=data.get("custom_fields", {}).get("employment_type"),
Expand All @@ -84,20 +82,24 @@ def format_greenhouse_job(data: t.Dict) -> t.Dict:
value=data.get("copied_from_id"),
),
],
ranges_floats=[
dict(
name="salary_range",
value_min=data.get("custom_fields", {})
.get("salary_range", {})
.get("min_value", None),
value_max=data.get("custom_fields", {})
.get("salary_range", {})
.get("max_value", None),
unit=data.get("custom_fields", {})
.get("salary_range", {})
.get("unit", None),
)
],
ranges_floats=(
[
dict(
name="salary_range",
value_min=data.get("custom_fields", {})
.get("salary_range", {})
.get("min_value", None),
value_max=data.get("custom_fields", {})
.get("salary_range", {})
.get("max_value", None),
unit=data.get("custom_fields", {})
.get("salary_range", {})
.get("unit", None),
)
]
if data.get("custom_fields", {}).get("salary_range")
else []
),
)
return job

Expand Down

0 comments on commit 288542e

Please sign in to comment.