fetching and writing rates
This commit is contained in:
parent
7012cbec97
commit
41eae45f68
5 changed files with 140 additions and 43 deletions
|
|
@ -6,20 +6,7 @@ from money.currency import Currency
|
|||
from money.money import Money
|
||||
from xecd_rates_client import XecdClient
|
||||
|
||||
|
||||
class ExchangeRate:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
from_currency: Currency,
|
||||
to_currency: Currency,
|
||||
rate: Money,
|
||||
rate_date: datetime.date = None,
|
||||
) -> None:
|
||||
self.from_currency
|
||||
self.to_currency
|
||||
self.rate
|
||||
self.rate_date
|
||||
from xexe.exchange_rates import ExchangeRate
|
||||
|
||||
|
||||
class RateFetcher(ABC):
|
||||
|
|
@ -42,7 +29,7 @@ class MockRateFetcher(RateFetcher):
|
|||
return ExchangeRate(
|
||||
from_currency=from_currency,
|
||||
to_currency=to_currency,
|
||||
rate=Money("42.0", to_currency),
|
||||
rate=Money(42, to_currency),
|
||||
rate_date=rate_date,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue