Skip to content

Commit

Permalink
Merge pull request #325 from Riminder/fix/connector-bullhorn
Browse files Browse the repository at this point in the history
fix: add sending comments to bullhorn
  • Loading branch information
Thomas65535 authored Jan 16, 2025
2 parents 08dfcb7 + 5c46633 commit 495925b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/hrflow_connectors/v1/connectors/bullhorn/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,29 @@ def profile_format(data: BullhornProfile) -> t.Dict:

def format_application(data: HrFlowProfile) -> t.Dict:
info = data.get("info") or {}
metadatas = data.get("metadatas") or []

attachments = (
[data["attachments"][0]] if data.get("attachments") is not None else []
)

comment = next(
(
metadata["value"]
for metadata in metadatas
if metadata.get("name") == "comment"
),
None,
)

profile = {
"firstName": info.get("first_name"),
"lastName": info.get("last_name"),
"name": info.get("full_name"),
"address": get_location(info),
"email": info.get("email"),
"mobile": info.get("phone"),
"comment": comment,
}

attachment_list = get_attachments(
Expand Down
5 changes: 5 additions & 0 deletions src/hrflow_connectors/v1/connectors/bullhorn/warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def write_application(
adapter.info(f"connexion info {params}, rest_url: {rest_url}")

for profile in profiles:
comment = profile.pop("comment", None)
if parameters.candidate_id:
candidate_id = parameters.candidate_id
if not parameters.candidate_id:
Expand Down Expand Up @@ -358,6 +359,10 @@ def write_application(
"source": parameters.source,
"dateWebResponse": int(time.time() * 1000),
}

if comment:
job_submission_payload["comments"] = comment

adapter.info("Creating or updating if candidate jobSubmission")
job_submission_response = create_or_update_entity(
"JobSubmission",
Expand Down

0 comments on commit 495925b

Please sign in to comment.