diff --git a/freshsalessdk/freshsalessdk.py b/freshsalessdk/freshsalessdk.py index cd16bcb..6a8c9ce 100644 --- a/freshsalessdk/freshsalessdk.py +++ b/freshsalessdk/freshsalessdk.py @@ -171,7 +171,7 @@ def get_appointments(self, id): class Accounts(APIBase): def __init__(self, domain, api_key): - default_params = {'include': 'appointments,owner', + default_params = {'include': 'appointments,owner,industry_type', 'sort': 'updated_at', 'sort_type': 'desc'} super().__init__(domain=domain, api_key=api_key, resource_type='sales_accounts', default_params=default_params) @@ -183,6 +183,12 @@ def _normalize(self, obj, container): if 'owner_id' in obj: owner = APIBase._find_obj_by_id(objs=users, id=obj['owner_id']) obj['owner'] = owner + industry_types = [] + if 'industry_types' in container: + industry_types = container['industry_types'] + if 'industry_type_id' in obj: + industry_type = APIBase._find_obj_by_id(objs=industry_types, id=obj['industry_type_id']) + obj['industry_type'] = industry_type class Deals(APIBase): diff --git a/setup.py b/setup.py index 27abba6..33d8daf 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='freshsalessdk', - version='0.1.2', + version='0.1.3', author='Siva Narayanan', author_email='siva@fyle.in', description='Python SDK for accessing Freshsales', diff --git a/test/account.json b/test/account.json index 759aa9a..1fbdded 100644 --- a/test/account.json +++ b/test/account.json @@ -46,7 +46,8 @@ "cf_purchase_intent": "xxx", "cf_engagement_level": "xxx", "cf_product_awareness": "xxx", - "cf_import_source": "xxx" + "cf_import_source": "xxx", + "cf_number_of_employees_range": "xxx" }, "created_at": "xxx", "updated_at": "xxx", @@ -71,5 +72,12 @@ "is_active": 0, "work_number": "xxx", "mobile_number": "xxx" + }, + "industry_type_id": 0, + "industry_type": { + "partial": true, + "id": 0, + "name": "xxx", + "position": 0 } } \ No newline at end of file