fiuai-sdk-python 0.8.9__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/PKG-INFO +1 -1
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/pyproject.toml +1 -1
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/bank.py +24 -18
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/company.py +3 -2
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/.gitignore +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/CHANGELOG.md +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/LICENSE +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/README.md +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/__init__.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/auth/__init__.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/auth/context_mgr.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/auth/header.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/auth/helper.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/auth/type.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/client.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/config.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/const.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/context.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/datatype.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/doctype.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/error.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/examples/fastapi_integration.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/http/__init__.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/http/client.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/item.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/perm.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/__init__.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/cache_client.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/circuit_breaker.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/decorator.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/redis_manager.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/types.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/profile.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/resp.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/setup.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/type.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/util.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/utils/__init__.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/utils/ids.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/utils/logger.py +0 -0
- {fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/utils/text.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fiuai_sdk_python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: FiuAI Python SDK - 企业级AI服务集成开发工具包
|
|
5
5
|
Project-URL: Homepage, https://github.com/fiuai/fiuai-sdk-python
|
|
6
6
|
Project-URL: Documentation, https://github.com/fiuai/fiuai-sdk-python#readme
|
|
@@ -101,13 +101,13 @@ def get_bank_account(client: FiuaiSDK, bank_account_no: str) -> Optional[Company
|
|
|
101
101
|
)
|
|
102
102
|
|
|
103
103
|
|
|
104
|
-
def
|
|
104
|
+
def get_bank_account_by_account_no(client: FiuaiSDK, account_no: str) -> BankAccount|None:
|
|
105
105
|
"""
|
|
106
106
|
根据银行账号id获取银行账号信息
|
|
107
107
|
"""
|
|
108
108
|
resp_response = client.internal_get_list(
|
|
109
109
|
doctype="Bank Account",
|
|
110
|
-
filters=[["
|
|
110
|
+
filters=[["bank_account_no", "=", account_no]],
|
|
111
111
|
fields=[
|
|
112
112
|
"name",
|
|
113
113
|
"account_name",
|
|
@@ -118,52 +118,58 @@ def get_bank_account_by_bank_id(client: FiuaiSDK, bank_id: str) -> BankAccount|N
|
|
|
118
118
|
)
|
|
119
119
|
|
|
120
120
|
if not resp_response.is_success():
|
|
121
|
+
logger.warning(f"bank account is not found by account no {account_no}")
|
|
121
122
|
return None
|
|
122
123
|
|
|
123
124
|
resp = resp_response.data
|
|
124
125
|
if not resp:
|
|
126
|
+
logger.warning(f"bank account is not found by account no {account_no}")
|
|
125
127
|
return None
|
|
126
128
|
|
|
127
129
|
resp = resp[0]
|
|
128
130
|
|
|
129
131
|
# 获取支行信息
|
|
130
|
-
bank_branch = ""
|
|
131
132
|
if resp["opening_bank_branch"] != "":
|
|
132
|
-
_bank_branch_response = client.
|
|
133
|
+
_bank_branch_response = client.internal_get_list(
|
|
133
134
|
doctype="Bank Branch",
|
|
134
|
-
|
|
135
|
-
fields=["
|
|
135
|
+
filters=[["bank_branch_name", "=", resp["opening_bank_branch"]]],
|
|
136
|
+
fields=["parent_bank", "bank_branch_name"]
|
|
136
137
|
)
|
|
137
138
|
if not _bank_branch_response.is_success():
|
|
139
|
+
logger.warning(f"bank branch is not found by id {resp["opening_bank_branch"]}")
|
|
138
140
|
return None
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
logger.error(f"bank branch is not found by id {resp["opening_bank_branch"]}")
|
|
142
|
+
if not _bank_branch_response.data:
|
|
143
|
+
logger.warning(f"bank branch is not found by id {resp["opening_bank_branch"]}")
|
|
143
144
|
return None
|
|
144
|
-
else:
|
|
145
|
-
bank_branch = _bank_branch["bank_branch_name"]
|
|
146
145
|
|
|
146
|
+
|
|
147
|
+
_parent_bank_id = _bank_branch_response.data[0]["parent_bank"]
|
|
148
|
+
if not _parent_bank_id:
|
|
149
|
+
logger.warning(f"parent bank is not found by id {resp["opening_bank_branch"]}")
|
|
150
|
+
return None
|
|
151
|
+
|
|
152
|
+
|
|
147
153
|
# 获取银行信息
|
|
148
154
|
_bank_detail_response = client.internal_get(
|
|
149
155
|
doctype="Bank",
|
|
150
|
-
name=
|
|
156
|
+
name=_parent_bank_id,
|
|
151
157
|
fields=["name", "bank_name"]
|
|
152
158
|
)
|
|
153
159
|
|
|
154
160
|
if not _bank_detail_response.is_success():
|
|
161
|
+
logger.warning(f"bank is not found by id {_parent_bank_id}")
|
|
155
162
|
return None
|
|
156
163
|
|
|
157
164
|
_bank_detail = _bank_detail_response.data
|
|
158
165
|
if not _bank_detail:
|
|
159
|
-
logger.
|
|
166
|
+
logger.warning(f"bank is not found by id {_parent_bank_id}")
|
|
160
167
|
return None
|
|
161
168
|
|
|
162
|
-
_bank_account = resp
|
|
163
169
|
return BankAccount(
|
|
164
|
-
name=
|
|
165
|
-
account_name=
|
|
170
|
+
name=resp["name"],
|
|
171
|
+
account_name=resp["account_name"],
|
|
166
172
|
bank=_bank_detail["bank_name"],
|
|
167
|
-
bank_account_no=
|
|
168
|
-
bank_branch=
|
|
173
|
+
bank_account_no=account_no,
|
|
174
|
+
bank_branch=resp["opening_bank_branch"],
|
|
169
175
|
)
|
|
@@ -10,7 +10,7 @@ from .client import FiuaiSDK
|
|
|
10
10
|
from logging import getLogger
|
|
11
11
|
from typing import Literal
|
|
12
12
|
from .type import CompanyProfile
|
|
13
|
-
from .bank import
|
|
13
|
+
from .bank import get_bank_account_by_account_no
|
|
14
14
|
|
|
15
15
|
logger = getLogger(__name__)
|
|
16
16
|
|
|
@@ -111,7 +111,7 @@ def get_company_profile(client: FiuaiSDK, auth_company_id: str)-> CompanyProfile
|
|
|
111
111
|
|
|
112
112
|
default_bank_account = None
|
|
113
113
|
if r["default_bank_account"]:
|
|
114
|
-
rr_response =
|
|
114
|
+
rr_response = get_bank_account_by_account_no(client, r["default_bank_account"])
|
|
115
115
|
if not rr_response:
|
|
116
116
|
logger.warning(f"get_company_profile: default_bank_account {r['default_bank_account']} not found")
|
|
117
117
|
else:
|
|
@@ -132,4 +132,5 @@ def get_company_profile(client: FiuaiSDK, auth_company_id: str)-> CompanyProfile
|
|
|
132
132
|
email=r.get("email", "") if r.get("email", "") else "",
|
|
133
133
|
address=r.get("address", "") if r.get("address", "") else "",
|
|
134
134
|
default_bank_account=default_bank_account,
|
|
135
|
+
bank_accounts=[default_bank_account] if default_bank_account else [],
|
|
135
136
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/__init__.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/cache_client.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/circuit_breaker.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/decorator.py
RENAMED
|
File without changes
|
{fiuai_sdk_python-0.8.9 → fiuai_sdk_python-0.9.0}/src/fiuai_sdk_python/pkg/cache/redis_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|