MambuPy 2.3.0__tar.gz → 2.3.1__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.
Files changed (96) hide show
  1. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/__init__.py +1 -1
  2. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambuloan.py +28 -30
  3. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy.egg-info/PKG-INFO +1 -1
  4. {mambupy-2.3.0 → mambupy-2.3.1}/PKG-INFO +1 -1
  5. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/__init__.py +1 -1
  6. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambuloan.py +28 -30
  7. {mambupy-2.3.0 → mambupy-2.3.1}/LICENSE +0 -0
  8. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/__init__.py +0 -0
  9. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/classes.py +0 -0
  10. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/connector/__init__.py +0 -0
  11. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/connector/mambuconnector.py +0 -0
  12. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/connector/rest.py +0 -0
  13. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/entities.py +0 -0
  14. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/interfaces.py +0 -0
  15. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambubranch.py +0 -0
  16. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambucentre.py +0 -0
  17. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambuclient.py +0 -0
  18. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambucustomfield.py +0 -0
  19. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambugroup.py +0 -0
  20. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambuproduct.py +0 -0
  21. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mamburole.py +0 -0
  22. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambustruct.py +0 -0
  23. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambutask.py +0 -0
  24. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambutransaction.py +0 -0
  25. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/mambuuser.py +0 -0
  26. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/api/vos.py +0 -0
  27. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/mambuconfig.py +0 -0
  28. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/mambugeturl.py +0 -0
  29. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/mambuutil.py +0 -0
  30. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/__init__.py +0 -0
  31. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_activities.py +0 -0
  32. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_addresses.py +0 -0
  33. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_branches.py +0 -0
  34. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_centres.py +0 -0
  35. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_clients.py +0 -0
  36. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_customfields.py +0 -0
  37. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_dummies.py +0 -0
  38. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_groups.py +0 -0
  39. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_loans.py +0 -0
  40. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_mambu.py +0 -0
  41. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_orm.py +0 -0
  42. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_tasks.py +0 -0
  43. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/orm/schema_users.py +0 -0
  44. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/rest/__init__.py +0 -0
  45. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/rest/mambuactivity.py +0 -0
  46. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/utils/__init__.py +0 -0
  47. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/utils/update_user_roles.py +0 -0
  48. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy/utils/userdeactivate.py +0 -0
  49. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy.egg-info/SOURCES.txt +0 -0
  50. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy.egg-info/dependency_links.txt +0 -0
  51. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy.egg-info/requires.txt +0 -0
  52. {mambupy-2.3.0 → mambupy-2.3.1}/MambuPy.egg-info/top_level.txt +0 -0
  53. {mambupy-2.3.0 → mambupy-2.3.1}/README.md +0 -0
  54. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/__init__.py +0 -0
  55. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/classes.py +0 -0
  56. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/connector/__init__.py +0 -0
  57. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/connector/mambuconnector.py +0 -0
  58. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/connector/rest.py +0 -0
  59. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/entities.py +0 -0
  60. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/interfaces.py +0 -0
  61. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambubranch.py +0 -0
  62. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambucentre.py +0 -0
  63. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambuclient.py +0 -0
  64. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambucustomfield.py +0 -0
  65. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambugroup.py +0 -0
  66. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambuproduct.py +0 -0
  67. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mamburole.py +0 -0
  68. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambustruct.py +0 -0
  69. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambutask.py +0 -0
  70. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambutransaction.py +0 -0
  71. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/mambuuser.py +0 -0
  72. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/api/vos.py +0 -0
  73. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/mambuconfig.py +0 -0
  74. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/mambugeturl.py +0 -0
  75. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/mambuutil.py +0 -0
  76. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/__init__.py +0 -0
  77. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_activities.py +0 -0
  78. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_addresses.py +0 -0
  79. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_branches.py +0 -0
  80. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_centres.py +0 -0
  81. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_clients.py +0 -0
  82. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_customfields.py +0 -0
  83. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_dummies.py +0 -0
  84. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_groups.py +0 -0
  85. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_loans.py +0 -0
  86. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_mambu.py +0 -0
  87. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_orm.py +0 -0
  88. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_tasks.py +0 -0
  89. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/orm/schema_users.py +0 -0
  90. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/rest/__init__.py +0 -0
  91. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/rest/mambuactivity.py +0 -0
  92. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/utils/__init__.py +0 -0
  93. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/utils/update_user_roles.py +0 -0
  94. {mambupy-2.3.0 → mambupy-2.3.1}/mambupy/utils/userdeactivate.py +0 -0
  95. {mambupy-2.3.0 → mambupy-2.3.1}/pyproject.toml +0 -0
  96. {mambupy-2.3.0 → mambupy-2.3.1}/setup.cfg +0 -0
@@ -37,7 +37,7 @@ import sys
37
37
  from importlib.abc import MetaPathFinder
38
38
  from importlib.util import spec_from_file_location
39
39
 
40
- __version__ = "2.3.0"
40
+ __version__ = "2.3.1"
41
41
  """The version of this module."""
42
42
 
43
43
 
@@ -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
- timezone_firstRepaymentDate = datetime.timezone(
188
- datetime.timedelta(
189
- hours=int(
190
- self.disbursementDetails._tzattrs["firstRepaymentDate"][-6:-3]
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
- timezone_disbursementDate = datetime.timezone(
204
- datetime.timedelta(
205
- hours=int(
206
- self.disbursementDetails._tzattrs["expectedDisbursementDate"][
207
- -6:-3
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
- valueDate = datetime.datetime.strptime(
269
- valueDate.strftime("%Y-%m-%d %H%M%S"), "%Y-%m-%d %H%M%S"
270
- )
271
- valueDate = valueDate.astimezone(tzlocal()).isoformat()
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
- valueDate = datetime.datetime.strptime(
316
- valueDate.strftime("%Y-%m-%d %H%M%S"), "%Y-%m-%d %H%M%S"
317
- )
318
- valueDate = valueDate.astimezone(tzlocal()).isoformat()
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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MambuPy
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: A python library for using Mambu APIs.
5
5
  Author-email: "Javier Novoa C." <jstitch@gmail.com>
6
6
  License: LICENSE
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MambuPy
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: A python library for using Mambu APIs.
5
5
  Author-email: "Javier Novoa C." <jstitch@gmail.com>
6
6
  License: LICENSE
@@ -37,7 +37,7 @@ import sys
37
37
  from importlib.abc import MetaPathFinder
38
38
  from importlib.util import spec_from_file_location
39
39
 
40
- __version__ = "2.3.0"
40
+ __version__ = "2.3.1"
41
41
  """The version of this module."""
42
42
 
43
43
 
@@ -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
- timezone_firstRepaymentDate = datetime.timezone(
188
- datetime.timedelta(
189
- hours=int(
190
- self.disbursementDetails._tzattrs["firstRepaymentDate"][-6:-3]
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
- timezone_disbursementDate = datetime.timezone(
204
- datetime.timedelta(
205
- hours=int(
206
- self.disbursementDetails._tzattrs["expectedDisbursementDate"][
207
- -6:-3
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
- valueDate = datetime.datetime.strptime(
269
- valueDate.strftime("%Y-%m-%d %H%M%S"), "%Y-%m-%d %H%M%S"
270
- )
271
- valueDate = valueDate.astimezone(tzlocal()).isoformat()
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
- valueDate = datetime.datetime.strptime(
316
- valueDate.strftime("%Y-%m-%d %H%M%S"), "%Y-%m-%d %H%M%S"
317
- )
318
- valueDate = valueDate.astimezone(tzlocal()).isoformat()
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