예제 #1
0
    def round_account_balances(self, msg_json):
        """
        Iterates through all active accounts, except the savings account
        and rounds the account's balance down to either x.00 or x.50, depending
        on the _ROUNDING_FACTOR

        Parameters
        ----------
        msg_json    : dict, HTTP request body from Callback

        """
        category = msg_json['NotificationUrl']['category']
        logger.info(f'Received Callback - {category}')

        accounts = util.get_active_accounts()
        savings_IBAN = util.get_iban(self.savings_account)
        for acc in accounts:
            if util.get_iban(acc) != savings_IBAN:
                self._round_balance(acc)
예제 #2
0
 def get_active_accounts():
     return util.get_active_accounts()
예제 #3
0
 def calc_budgets(self):
     accounts = util.get_active_accounts()
     results = [b.calc_budget(accounts) for b in self.budgets]
     return results