Conversation
|
|
||
| # STEP 2 : DEPOSIT MONEY IN SAVING | ||
| deposit = WalletTransaction.create( | ||
| wallet_id=saving.id, |
There was a problem hiding this comment.
en este caso si sería wallet_uri
| entries: List[BalanceEntry] = BalanceEntry.all( | ||
| funding_instrument_uri=wallet_uri | ||
| ) |
There was a problem hiding this comment.
hmmm no, no sería funding_instrument_uri, sería wallet_id
There was a problem hiding this comment.
y para el default, sería wallet_id=default
Codecov Report
@@ Coverage Diff @@
## main #181 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 29 +2
Lines 661 726 +65
=========================================
+ Hits 661 726 +65
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
|
||
| if data is not None: | ||
| for key, value in data.items(): | ||
| if isinstance(value, (dt.date, dt.datetime)): |
There was a problem hiding this comment.
this is redundant:
In [19]: isinstance(dt.datetime.now(), dt.date)
Out[19]: True| if data is not None: | ||
| for key, value in data.items(): | ||
| if isinstance(value, (dt.date, dt.datetime)): | ||
| data[key] = value.isoformat() |
There was a problem hiding this comment.
missing the timezone:
In [28]: value = dt.datetime.now()
In [29]: value.isoformat()
Out[29]: '2021-08-13T17:49:16.368700'
In [30]: value.tzinfo is None
Out[30]: True
In [31]: default_tz = dt.timezone.utc
In [32]: if value.tzinfo is None:
...: value = value.astimezone(default_tz)
...:
In [33]: value.isoformat()
Out[33]: '2021-08-13T22:49:16.368700+00:00'not sure what default_tz would be in this case: UTC or America/Mexico_City
There was a problem hiding this comment.
Si es necesario indicar el timezone?
Entiendo que todo se maneja en UTC
| _resource: ClassVar = 'savings' | ||
| name: str | ||
| category: SavingCategory | ||
| goal_amount: int |
|
|
||
| @property | ||
| def wallet(self) -> Optional['Wallet']: | ||
| return cast('Wallet', retrieve_uri(self.wallet_uri)) |
There was a problem hiding this comment.
does this work?
Wallet isn't here:
cuenca-python/cuenca/resources/__init__.py
Lines 45 to 66 in 0a3a040
There was a problem hiding this comment.
Wallet es la clase base, Saving es el resource
|
hay que poner contexto o asignar un issue al PR @rogelioLpz |
| wallet_id: str | ||
|
|
||
| @property # type: ignore | ||
| def related_transaction(self) -> Transaction: |
There was a problem hiding this comment.
tal y como related_transaction y funding_instruments deberíamos poder hacer fetch del wallet desde el balance_entry
There was a problem hiding this comment.
No aplica. Debido a que los balance_entries de la cuenta default van tener el valor default y eso no apunta a ningún recurso
closes #180