Skip to content

Commit

Permalink
Merge pull request #9 from alex-kn/feature/add_minmax_booking_date_to…
Browse files Browse the repository at this point in the history
…_account_transactions

Add booking date to get_account_transactions
  • Loading branch information
alex-kn authored Jan 21, 2021
2 parents 5937ba0 + 106da66 commit 888bb29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 7 additions & 3 deletions comdirect_api/comdirect_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,24 @@ def get_balance(self, account_uuid):
return self.account_service.get_balance(account_uuid)

def get_account_transactions(self, account_uuid, with_account=False, transaction_state='BOTH', paging_count=20,
paging_first=0):
paging_first=0, min_booking_date=None, max_booking_date=None):
"""
4.1.3. Fetch transactions for a specific account.
4.1.3. Fetch transactions for a specific account. Not setting a min_booking_date currently limits the result to
the last 180 days.
:param account_uuid: Account-ID
:param with_account: Include account information in the response. Defaults to False
:param transaction_state: 'BOOKED' or 'NOTBOOKED'. Defaults to 'BOTH'
:param paging_count: Number of transactions
:param paging_first: Index of first returned transaction. Only possible for booked transactions
(transaction_state='BOOKED').
:param max_booking_date: max booking date in format YYYY-MM-DD
:param min_booking_date: min booking date in format YYYY-MM-DD
:return: Response object
"""
return self.account_service.get_account_transactions(account_uuid, with_account, transaction_state,
paging_count, paging_first)
paging_count, paging_first, min_booking_date,
max_booking_date)

def get_all_depots(self):
"""
Expand Down
9 changes: 7 additions & 2 deletions comdirect_api/service/account_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,28 @@ def get_balance(self, account_uuid):
return response

def get_account_transactions(self, account_uuid, with_account=False, transaction_state='BOTH', paging_count=20,
paging_first=0):
paging_first=0, min_booking_date=None, max_booking_date=None):
"""
4.1.3. Fetch transactions for a specific account.
4.1.3. Fetch transactions for a specific account. Not setting a min_booking_date currently limits the result to
the last 180 days.
:param account_uuid: Account-ID
:param with_account: Include account information in the response. Defaults to False
:param transaction_state: 'BOOKED' or 'NOTBOOKED'. Defaults to 'BOTH'
:param paging_count: Number of transactions
:param paging_first: Index of first returned transaction. Only possible for booked transactions
(transaction_state='BOOKED').
:param max_booking_date: max booking date in format YYYY-MM-DD
:param min_booking_date: min booking date in format YYYY-MM-DD
:return: Response object
"""
url = '{0}/banking/v1/accounts/{1}/transactions'.format(self.api_url, account_uuid)
params = {
'transactionState': transaction_state,
'paging-count': paging_count,
'paging-first': paging_first,
'min-bookingDate': min_booking_date,
'max-bookingDate': max_booking_date,
}
if with_account:
params['with-attr'] = 'account'
Expand Down

0 comments on commit 888bb29

Please sign in to comment.