Fixed search_global_company_profiles_id method
New response and fixed query parameter
This commit is contained in:
@@ -67,24 +67,33 @@ class FocusCompliance(Request):
|
|||||||
|
|
||||||
return fal_data
|
return fal_data
|
||||||
|
|
||||||
def search_global_company_profiles_id(self) -> list:
|
def search_global_company_profiles_id(self, company_name: str = None) -> list:
|
||||||
"""Поиск сводной информации по санкционным профилям ЮЛ
|
"""Поиск сводной информации по санкционным профилям ЮЛ
|
||||||
|
|
||||||
|
:param company_name: Наименование компании
|
||||||
|
:type company_name: str
|
||||||
:return: Список идентификаторов профилей
|
:return: Список идентификаторов профилей
|
||||||
:rtype: list
|
:rtype: list
|
||||||
"""
|
"""
|
||||||
|
if self.inn:
|
||||||
|
query = self.inn
|
||||||
|
elif company_name:
|
||||||
|
query = company_name
|
||||||
|
else:
|
||||||
|
return {'success': False, 'result': 'Не указан ИНН или наименование контрагента'}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = self.get(f'{self._focus_base_url}/companies/profiles/search', query=self.inn)
|
response = self.get(f'{self._focus_base_url}/companies/profiles/search', query=query)
|
||||||
profiles = response['legalEntityProfiles']
|
profiles = response['legalEntityProfiles']
|
||||||
|
|
||||||
if not profiles:
|
if not profiles:
|
||||||
return profiles
|
return {'success': True, 'result': profiles}
|
||||||
elif len(profiles) > 1:
|
elif len(profiles) > 1:
|
||||||
return [profile['id'] for profile in profiles]
|
return {'success': True, 'result': [profile['id'] for profile in profiles]}
|
||||||
else:
|
else:
|
||||||
return [profiles[0]['id']]
|
return {'success': True, 'result': [profiles[0]['id']]}
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return None
|
return {'success': False, 'result': 'Key Error'}
|
||||||
|
|
||||||
def legal_entity_profile_report(self, profile_id_list: list, path: str = None) -> dict:
|
def legal_entity_profile_report(self, profile_id_list: list, path: str = None) -> dict:
|
||||||
"""Получение печатного отчета по профилю ЮЛ
|
"""Получение печатного отчета по профилю ЮЛ
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="kontur_focus",
|
name="kontur_focus",
|
||||||
version="2025.9.0",
|
version="2025.10.0",
|
||||||
author="Ilya Sapunov",
|
author="Ilya Sapunov",
|
||||||
author_email="sapunov@selectel.ru",
|
author_email="sapunov@selectel.ru",
|
||||||
description="Библиотека-обертка для взаимодействия с REST API Контур.Фокус и Фокус.Комплаенс",
|
description="Библиотека-обертка для взаимодействия с REST API Контур.Фокус и Фокус.Комплаенс",
|
||||||
|
|||||||
Reference in New Issue
Block a user