Skip to content

Commit

Permalink
attach alias name to organization name (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuseinov authored Feb 2, 2024
1 parent 3f6ad6e commit 3f1a9c0
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _map_data(row, insert_index):
return {
"first_name": _get_name(row),
"last_name": row["last_name"],
"organization_name": row["organization_name"],
"organization_name": _get_organization_name(row),
"application_submission_uuid": row["application_submission_uuid"],
"email": row["email_address"],
"phone_number": row.get("phone_number", "cell_phone_number"),
Expand All @@ -132,6 +132,12 @@ def _map_data(row, insert_index):
}


def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)


def _get_name(row):
first_name = row.get("first_name", None)
middle_name = row.get("middle_name", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _map_data(row):
return {
"first_name": _get_name(row),
"last_name": row["last_name"],
"organization_name": row["organization_name"],
"organization_name": _get_organization_name(row),
"application_submission_uuid": row["application_submission_uuid"],
"email": row["email_address"],
"phone_number": row.get("phone_number", "cell_phone_number"),
Expand All @@ -120,6 +120,11 @@ def _map_data(row):
"audit_created_by": OATS_ETL_USER,
}

def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)


def _get_name(row):
first_name = row.get("first_name", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SELECT osp.subject_property_id,
op.middle_name,
oo.organization_id,
oo.organization_name,
oo.alias_name,
opo.phone_number,
opo.cell_phone_number,
opo.email_address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ WITH ordered_parties AS (
op.last_name,
oo.organization_id,
oo.organization_name,
oo.alias_name,
opo.phone_number,
opo.cell_phone_number,
opo.email_address,
Expand Down Expand Up @@ -43,6 +44,7 @@ parties_with_submission_uuid as (
last_name,
organization_id,
organization_name,
alias_name,
phone_number,
cell_phone_number,
email_address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _map_data(row, insert_index):
return {
"first_name": _get_name(row),
"last_name": row["last_name"],
"organization_name": row["organization_name"],
"organization_name": _get_organization_name(row),
"notice_of_intent_submission_uuid": row["notice_of_intent_submission_uuid"],
"email": row["email_address"],
"phone_number": row.get("phone_number", "cell_phone_number"),
Expand All @@ -132,6 +132,12 @@ def _map_data(row, insert_index):
}


def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)


def _get_name(row):
first_name = row.get("first_name", None)
middle_name = row.get("middle_name", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _map_data(row):
return {
"first_name": _get_name(row),
"last_name": row["last_name"],
"organization_name": row["organization_name"],
"organization_name": _get_organization_name(row),
"notice_of_intent_submission_uuid": row["notice_of_intent_submission_uuid"],
"email": row["email_address"],
"phone_number": row.get("phone_number", "cell_phone_number"),
Expand All @@ -121,6 +121,12 @@ def _map_data(row):
}


def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)


def _get_name(row):
first_name = row.get("first_name", "")
middle_name = row.get("middle_name", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SELECT osp.subject_property_id,
op.middle_name,
oo.organization_id,
oo.organization_name,
oo.alias_name,
opo.phone_number,
opo.cell_phone_number,
opo.email_address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ WITH ordered_parties AS (
op.last_name,
oo.organization_id,
oo.organization_name,
oo.alias_name,
opo.phone_number,
opo.cell_phone_number,
opo.email_address,
Expand Down Expand Up @@ -43,6 +44,7 @@ parties_with_submission_uuid as (
last_name,
organization_id,
organization_name,
alias_name,
phone_number,
cell_phone_number,
email_address,
Expand Down

0 comments on commit 3f1a9c0

Please sign in to comment.