Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion unit/models/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def __init__(
dba: Optional[str],
sole_proprietorship: Optional[bool],
business_vertical: Optional[BusinessVertical],
operating_address: Optional[Address],
tags: Optional[Dict[str, str]],
relationships: Optional[Dict[str, Relationship]],
):
Expand All @@ -160,6 +161,7 @@ def __init__(
"dba": dba,
"soleProprietorship": sole_proprietorship,
"businessVertical": business_vertical,
"operatingAddress": operating_address,
"tags": tags,
}
self.relationships = relationships
Expand All @@ -182,6 +184,7 @@ def from_json_api(_id, _type, attributes, relationships):
attributes.get("dba"),
attributes.get("soleProprietorship"),
attributes.get("businessVertical"),
attributes.get("operatingAddress"),
attributes.get("tags"),
relationships,
)
Expand Down Expand Up @@ -213,6 +216,7 @@ def __init__(
number_of_employees: Optional[NumberOfEmployees],
cash_flow: Optional[CashFlow],
countries_of_operation: Optional[List[str]],
operating_address: Optional[Address],
tags: Optional[Dict[str, str]],
relationships: Optional[Dict[str, Relationship]],
):
Expand Down Expand Up @@ -241,6 +245,7 @@ def __init__(
"contact": contact,
"officer": officer,
"beneficialOwners": beneficial_owners,
"operatingAddress": operating_address,
"tags": tags,
}
self.relationships = relationships
Expand Down Expand Up @@ -271,6 +276,7 @@ def from_json_api(_id, _type, attributes, relationships):
attributes.get("number_of_employees"),
attributes.get("cash_flow"),
attributes.get("countries_of_operation"),
attributes.get("operating_address"),
attributes.get("tags"),
relationships,
)
Expand Down Expand Up @@ -301,6 +307,7 @@ def __init__(
annual_revenue: Optional[AnnualRevenue] = None,
number_of_employees: Optional[NumberOfEmployees] = None,
business_vertical: Optional[BusinessVertical] = None,
operating_address: Optional[Address] = None,
):
self.full_name = full_name
self.date_of_birth = date_of_birth
Expand All @@ -321,6 +328,7 @@ def __init__(
self.number_of_employees = number_of_employees
self.business_vertical = business_vertical
self.website = website
self.operating_address = operating_address

def to_json_api(self) -> Dict:
payload = {
Expand Down Expand Up @@ -382,6 +390,9 @@ def to_json_api(self) -> Dict:
if self.business_vertical:
payload["data"]["attributes"]["businessVertical"] = self.business_vertical

if self.operating_address:
payload["data"]["attributes"]["operatingAddress"] = self.operating_address

return payload

def __repr__(self):
Expand Down Expand Up @@ -412,7 +423,8 @@ def __init__(
countries_of_operation: Optional[List[str]] = None,
stock_symbol: Optional[str] = None,
business_vertical: Optional[BusinessVertical] = None,
device_fingerprints: Optional[List[DeviceFingerprint]] = None
device_fingerprints: Optional[List[DeviceFingerprint]] = None,
operating_address: Optional[Address] = None,
):
self.name = name
self.address = address
Expand All @@ -436,6 +448,7 @@ def __init__(
self.stock_symbol = stock_symbol
self.business_vertical = business_vertical
self.device_fingerprints = device_fingerprints
self.operating_address = operating_address

def to_json_api(self) -> dict:
payload = {
Expand Down Expand Up @@ -487,6 +500,9 @@ def to_json_api(self) -> dict:
if self.stock_symbol:
payload["data"]["attributes"]["stockSymbol"] = self.stock_symbol

if self.operating_address:
payload["data"]["attributes"]["operatingAddress"] = self.operating_address

return payload

def __repr__(self):
Expand Down
Loading