Source code for q2_cores.Users.models.open_account_models

from typing import Union

from dateutil import parser

from ...models import BaseSubAccountDetails


[docs] class UsersSubAccountDetails(BaseSubAccountDetails): def __init__( self, account_id: str, account_desc: str, apy: str, maturity_date: Union[str, None], div_rate: Union[str, None], opening_amount: str, ): super().__init__(account_id, account_desc) self.apy = apy self.maturity_date = None if maturity_date: self.maturity_date = parser.parse(maturity_date).date().strftime("%m/%d/%Y") self.div_rate = None if div_rate: self.div_rate = div_rate self.opening_amount = None if opening_amount: self.funding_amount = "${:,.2f}".format( float(opening_amount.replace("$", "").replace(",", "")) )