MambuPy 2.3.0__tar.gz → 2.3.2__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.
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/__init__.py +1 -1
- {mambupy-2.3.0/mambupy → mambupy-2.3.2/MambuPy}/api/connector/rest.py +18 -5
- {mambupy-2.3.0/mambupy → mambupy-2.3.2/MambuPy}/api/entities.py +6 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambuloan.py +28 -30
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy.egg-info/PKG-INFO +1 -1
- {mambupy-2.3.0 → mambupy-2.3.2}/PKG-INFO +1 -1
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/__init__.py +1 -1
- {mambupy-2.3.0/MambuPy → mambupy-2.3.2/mambupy}/api/connector/rest.py +18 -5
- {mambupy-2.3.0/MambuPy → mambupy-2.3.2/mambupy}/api/entities.py +6 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambuloan.py +28 -30
- {mambupy-2.3.0 → mambupy-2.3.2}/LICENSE +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/classes.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/connector/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/connector/mambuconnector.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/interfaces.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambubranch.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambucentre.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambuclient.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambucustomfield.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambugroup.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambuproduct.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mamburole.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambustruct.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambutask.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambutransaction.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/mambuuser.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/api/vos.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/mambuconfig.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/mambugeturl.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/mambuutil.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_activities.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_addresses.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_branches.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_centres.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_clients.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_customfields.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_dummies.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_groups.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_loans.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_mambu.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_orm.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_tasks.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/orm/schema_users.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/rest/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/rest/mambuactivity.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/utils/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/utils/update_user_roles.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy/utils/userdeactivate.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy.egg-info/SOURCES.txt +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy.egg-info/dependency_links.txt +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy.egg-info/requires.txt +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/MambuPy.egg-info/top_level.txt +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/README.md +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/classes.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/connector/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/connector/mambuconnector.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/interfaces.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambubranch.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambucentre.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambuclient.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambucustomfield.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambugroup.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambuproduct.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mamburole.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambustruct.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambutask.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambutransaction.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/mambuuser.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/api/vos.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/mambuconfig.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/mambugeturl.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/mambuutil.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_activities.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_addresses.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_branches.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_centres.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_clients.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_customfields.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_dummies.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_groups.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_loans.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_mambu.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_orm.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_tasks.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/orm/schema_users.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/rest/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/rest/mambuactivity.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/utils/__init__.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/utils/update_user_roles.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/mambupy/utils/userdeactivate.py +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/pyproject.toml +0 -0
- {mambupy-2.3.0 → mambupy-2.3.2}/setup.cfg +0 -0
|
@@ -9,11 +9,14 @@ Currently supports REST.
|
|
|
9
9
|
|
|
10
10
|
import base64
|
|
11
11
|
import copy
|
|
12
|
+
import datetime
|
|
13
|
+
import enum
|
|
12
14
|
import json
|
|
13
15
|
import mimetypes
|
|
14
16
|
import os
|
|
15
17
|
import re
|
|
16
18
|
import uuid
|
|
19
|
+
from decimal import Decimal
|
|
17
20
|
|
|
18
21
|
import requests
|
|
19
22
|
from requests_toolbelt.multipart.encoder import MultipartEncoder
|
|
@@ -43,6 +46,19 @@ from MambuPy.mambuutil import (
|
|
|
43
46
|
logger = setup_logging(__name__)
|
|
44
47
|
|
|
45
48
|
|
|
49
|
+
class _MambuJSONEncoder(json.JSONEncoder):
|
|
50
|
+
"""JSON encoder that handles Python types not natively serializable by json.dumps."""
|
|
51
|
+
|
|
52
|
+
def default(self, obj):
|
|
53
|
+
if isinstance(obj, (datetime.datetime, datetime.date)):
|
|
54
|
+
return obj.isoformat()
|
|
55
|
+
if isinstance(obj, enum.Enum):
|
|
56
|
+
return obj.value
|
|
57
|
+
if isinstance(obj, Decimal):
|
|
58
|
+
return float(obj)
|
|
59
|
+
return super().default(obj)
|
|
60
|
+
|
|
61
|
+
|
|
46
62
|
def _configure_retry_strategy(session, retries=5):
|
|
47
63
|
"""Configure retry strategy for a session.
|
|
48
64
|
|
|
@@ -154,11 +170,8 @@ class MambuConnectorREST(MambuConnector, MambuConnectorReader, MambuConnectorWri
|
|
|
154
170
|
return params
|
|
155
171
|
|
|
156
172
|
def __request_data(self, data):
|
|
157
|
-
if data
|
|
158
|
-
|
|
159
|
-
data = json.dumps(data)
|
|
160
|
-
except TypeError:
|
|
161
|
-
data = data
|
|
173
|
+
if isinstance(data, (dict, list)):
|
|
174
|
+
data = json.dumps(data, cls=_MambuJSONEncoder)
|
|
162
175
|
return data
|
|
163
176
|
|
|
164
177
|
def __request(self, method, url, params=None, data=None, content_type=None):
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import copy
|
|
9
|
+
import datetime
|
|
10
|
+
import enum
|
|
9
11
|
from importlib import import_module
|
|
10
12
|
import json
|
|
11
13
|
import time
|
|
@@ -503,6 +505,10 @@ class MambuEntityWritable(MambuStruct, MambuWritable):
|
|
|
503
505
|
val = attrs[field]["value"]
|
|
504
506
|
except (TypeError, KeyError):
|
|
505
507
|
val = attrs[field]
|
|
508
|
+
if isinstance(val, (datetime.datetime, datetime.date)):
|
|
509
|
+
val = val.isoformat()
|
|
510
|
+
elif isinstance(val, enum.Enum):
|
|
511
|
+
val = val.value
|
|
506
512
|
return (operation, path, val)
|
|
507
513
|
|
|
508
514
|
def __patch_field_op(self, field, original_attrs):
|
|
@@ -9,8 +9,6 @@ import copy
|
|
|
9
9
|
import datetime
|
|
10
10
|
import json
|
|
11
11
|
|
|
12
|
-
from dateutil.tz import tzlocal
|
|
13
|
-
|
|
14
12
|
from .entities import (
|
|
15
13
|
MambuEntity,
|
|
16
14
|
MambuEntityWritable,
|
|
@@ -184,32 +182,24 @@ class MambuLoan(
|
|
|
184
182
|
|
|
185
183
|
if firstRepaymentDate:
|
|
186
184
|
if not firstRepaymentDate.tzinfo:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
)
|
|
194
|
-
firstRepaymentDate = firstRepaymentDate.astimezone(
|
|
195
|
-
timezone_firstRepaymentDate
|
|
196
|
-
)
|
|
185
|
+
tzname = self.disbursementDetails._tzattrs["firstRepaymentDate"]
|
|
186
|
+
offset_str = tzname[3:] or "+00:00"
|
|
187
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
188
|
+
"2000-01-01T00:00:00" + offset_str
|
|
189
|
+
).tzinfo
|
|
190
|
+
firstRepaymentDate = firstRepaymentDate.astimezone(tz_info)
|
|
197
191
|
firstRepaymentDate = firstRepaymentDate.isoformat()
|
|
198
192
|
else:
|
|
199
193
|
firstRepaymentDate = self.disbursementDetails.firstRepaymentDate
|
|
200
194
|
|
|
201
195
|
if disbursementDate:
|
|
202
196
|
if not disbursementDate.tzinfo:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
)
|
|
210
|
-
)
|
|
211
|
-
)
|
|
212
|
-
disbursementDate = disbursementDate.astimezone(timezone_disbursementDate)
|
|
197
|
+
tzname = self.disbursementDetails._tzattrs["expectedDisbursementDate"]
|
|
198
|
+
offset_str = tzname[3:] or "+00:00"
|
|
199
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
200
|
+
"2000-01-01T00:00:00" + offset_str
|
|
201
|
+
).tzinfo
|
|
202
|
+
disbursementDate = disbursementDate.astimezone(tz_info)
|
|
213
203
|
disbursementDate = disbursementDate.isoformat()
|
|
214
204
|
else:
|
|
215
205
|
disbursementDate = self.disbursementDetails.expectedDisbursementDate
|
|
@@ -265,10 +255,14 @@ class MambuLoan(
|
|
|
265
255
|
structure defined at
|
|
266
256
|
:py:obj:`MambuPy.api.vos.MambuLoanTransactionDetailsInput._schema_fields`.
|
|
267
257
|
"""
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
258
|
+
if not valueDate.tzinfo:
|
|
259
|
+
tzname = self.disbursementDetails._tzattrs["firstRepaymentDate"]
|
|
260
|
+
offset_str = tzname[3:] or "+00:00"
|
|
261
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
262
|
+
"2000-01-01T00:00:00" + offset_str
|
|
263
|
+
).tzinfo
|
|
264
|
+
valueDate = valueDate.astimezone(tz_info)
|
|
265
|
+
valueDate = valueDate.isoformat()
|
|
272
266
|
|
|
273
267
|
self._connector.mambu_make_repayment(
|
|
274
268
|
self.id,
|
|
@@ -312,10 +306,14 @@ class MambuLoan(
|
|
|
312
306
|
request. :py:obj:`MambuPy.api.vos.MambuFeeLoanTransactionInput._schema_fields`
|
|
313
307
|
has the allowed fields permitted for this operation
|
|
314
308
|
"""
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
309
|
+
if not valueDate.tzinfo:
|
|
310
|
+
tzname = self.disbursementDetails._tzattrs["firstRepaymentDate"]
|
|
311
|
+
offset_str = tzname[3:] or "+00:00"
|
|
312
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
313
|
+
"2000-01-01T00:00:00" + offset_str
|
|
314
|
+
).tzinfo
|
|
315
|
+
valueDate = valueDate.astimezone(tz_info)
|
|
316
|
+
valueDate = valueDate.isoformat()
|
|
319
317
|
|
|
320
318
|
self._connector.mambu_make_fee(
|
|
321
319
|
self.id,
|
|
@@ -9,11 +9,14 @@ Currently supports REST.
|
|
|
9
9
|
|
|
10
10
|
import base64
|
|
11
11
|
import copy
|
|
12
|
+
import datetime
|
|
13
|
+
import enum
|
|
12
14
|
import json
|
|
13
15
|
import mimetypes
|
|
14
16
|
import os
|
|
15
17
|
import re
|
|
16
18
|
import uuid
|
|
19
|
+
from decimal import Decimal
|
|
17
20
|
|
|
18
21
|
import requests
|
|
19
22
|
from requests_toolbelt.multipart.encoder import MultipartEncoder
|
|
@@ -43,6 +46,19 @@ from MambuPy.mambuutil import (
|
|
|
43
46
|
logger = setup_logging(__name__)
|
|
44
47
|
|
|
45
48
|
|
|
49
|
+
class _MambuJSONEncoder(json.JSONEncoder):
|
|
50
|
+
"""JSON encoder that handles Python types not natively serializable by json.dumps."""
|
|
51
|
+
|
|
52
|
+
def default(self, obj):
|
|
53
|
+
if isinstance(obj, (datetime.datetime, datetime.date)):
|
|
54
|
+
return obj.isoformat()
|
|
55
|
+
if isinstance(obj, enum.Enum):
|
|
56
|
+
return obj.value
|
|
57
|
+
if isinstance(obj, Decimal):
|
|
58
|
+
return float(obj)
|
|
59
|
+
return super().default(obj)
|
|
60
|
+
|
|
61
|
+
|
|
46
62
|
def _configure_retry_strategy(session, retries=5):
|
|
47
63
|
"""Configure retry strategy for a session.
|
|
48
64
|
|
|
@@ -154,11 +170,8 @@ class MambuConnectorREST(MambuConnector, MambuConnectorReader, MambuConnectorWri
|
|
|
154
170
|
return params
|
|
155
171
|
|
|
156
172
|
def __request_data(self, data):
|
|
157
|
-
if data
|
|
158
|
-
|
|
159
|
-
data = json.dumps(data)
|
|
160
|
-
except TypeError:
|
|
161
|
-
data = data
|
|
173
|
+
if isinstance(data, (dict, list)):
|
|
174
|
+
data = json.dumps(data, cls=_MambuJSONEncoder)
|
|
162
175
|
return data
|
|
163
176
|
|
|
164
177
|
def __request(self, method, url, params=None, data=None, content_type=None):
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import copy
|
|
9
|
+
import datetime
|
|
10
|
+
import enum
|
|
9
11
|
from importlib import import_module
|
|
10
12
|
import json
|
|
11
13
|
import time
|
|
@@ -503,6 +505,10 @@ class MambuEntityWritable(MambuStruct, MambuWritable):
|
|
|
503
505
|
val = attrs[field]["value"]
|
|
504
506
|
except (TypeError, KeyError):
|
|
505
507
|
val = attrs[field]
|
|
508
|
+
if isinstance(val, (datetime.datetime, datetime.date)):
|
|
509
|
+
val = val.isoformat()
|
|
510
|
+
elif isinstance(val, enum.Enum):
|
|
511
|
+
val = val.value
|
|
506
512
|
return (operation, path, val)
|
|
507
513
|
|
|
508
514
|
def __patch_field_op(self, field, original_attrs):
|
|
@@ -9,8 +9,6 @@ import copy
|
|
|
9
9
|
import datetime
|
|
10
10
|
import json
|
|
11
11
|
|
|
12
|
-
from dateutil.tz import tzlocal
|
|
13
|
-
|
|
14
12
|
from .entities import (
|
|
15
13
|
MambuEntity,
|
|
16
14
|
MambuEntityWritable,
|
|
@@ -184,32 +182,24 @@ class MambuLoan(
|
|
|
184
182
|
|
|
185
183
|
if firstRepaymentDate:
|
|
186
184
|
if not firstRepaymentDate.tzinfo:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
)
|
|
194
|
-
firstRepaymentDate = firstRepaymentDate.astimezone(
|
|
195
|
-
timezone_firstRepaymentDate
|
|
196
|
-
)
|
|
185
|
+
tzname = self.disbursementDetails._tzattrs["firstRepaymentDate"]
|
|
186
|
+
offset_str = tzname[3:] or "+00:00"
|
|
187
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
188
|
+
"2000-01-01T00:00:00" + offset_str
|
|
189
|
+
).tzinfo
|
|
190
|
+
firstRepaymentDate = firstRepaymentDate.astimezone(tz_info)
|
|
197
191
|
firstRepaymentDate = firstRepaymentDate.isoformat()
|
|
198
192
|
else:
|
|
199
193
|
firstRepaymentDate = self.disbursementDetails.firstRepaymentDate
|
|
200
194
|
|
|
201
195
|
if disbursementDate:
|
|
202
196
|
if not disbursementDate.tzinfo:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
)
|
|
210
|
-
)
|
|
211
|
-
)
|
|
212
|
-
disbursementDate = disbursementDate.astimezone(timezone_disbursementDate)
|
|
197
|
+
tzname = self.disbursementDetails._tzattrs["expectedDisbursementDate"]
|
|
198
|
+
offset_str = tzname[3:] or "+00:00"
|
|
199
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
200
|
+
"2000-01-01T00:00:00" + offset_str
|
|
201
|
+
).tzinfo
|
|
202
|
+
disbursementDate = disbursementDate.astimezone(tz_info)
|
|
213
203
|
disbursementDate = disbursementDate.isoformat()
|
|
214
204
|
else:
|
|
215
205
|
disbursementDate = self.disbursementDetails.expectedDisbursementDate
|
|
@@ -265,10 +255,14 @@ class MambuLoan(
|
|
|
265
255
|
structure defined at
|
|
266
256
|
:py:obj:`MambuPy.api.vos.MambuLoanTransactionDetailsInput._schema_fields`.
|
|
267
257
|
"""
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
258
|
+
if not valueDate.tzinfo:
|
|
259
|
+
tzname = self.disbursementDetails._tzattrs["firstRepaymentDate"]
|
|
260
|
+
offset_str = tzname[3:] or "+00:00"
|
|
261
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
262
|
+
"2000-01-01T00:00:00" + offset_str
|
|
263
|
+
).tzinfo
|
|
264
|
+
valueDate = valueDate.astimezone(tz_info)
|
|
265
|
+
valueDate = valueDate.isoformat()
|
|
272
266
|
|
|
273
267
|
self._connector.mambu_make_repayment(
|
|
274
268
|
self.id,
|
|
@@ -312,10 +306,14 @@ class MambuLoan(
|
|
|
312
306
|
request. :py:obj:`MambuPy.api.vos.MambuFeeLoanTransactionInput._schema_fields`
|
|
313
307
|
has the allowed fields permitted for this operation
|
|
314
308
|
"""
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
309
|
+
if not valueDate.tzinfo:
|
|
310
|
+
tzname = self.disbursementDetails._tzattrs["firstRepaymentDate"]
|
|
311
|
+
offset_str = tzname[3:] or "+00:00"
|
|
312
|
+
tz_info = datetime.datetime.fromisoformat(
|
|
313
|
+
"2000-01-01T00:00:00" + offset_str
|
|
314
|
+
).tzinfo
|
|
315
|
+
valueDate = valueDate.astimezone(tz_info)
|
|
316
|
+
valueDate = valueDate.isoformat()
|
|
319
317
|
|
|
320
318
|
self._connector.mambu_make_fee(
|
|
321
319
|
self.id,
|
|
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
|
|
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
|
|
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
|
|
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
|