"""Logic for Account Tax Info History.""" from owsresponse import response from abacus_account import models from abacus_account.schemas.account_tax_info_history import AccountTaxInfoHistorySchema def get_account_tax_info_history(account_id): """Retrieve tax info history for the specified account.""" account_obj = models.Account.get_by_id_or_error(account_id) history_list = AccountTaxInfoHistorySchema(many=True).dump( account_obj.account_tax_info_history ) history_list.reverse() return response.Response(message=history_list, status=200)