Skip to content

Commit 0cf0f1d

Browse files
committed
new: description for txn type = ASSET_MOVEMENT
Fixes #28
1 parent db4410e commit 0cf0f1d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

ws_api/wealthsimple_api.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def filter_fn(activity):
543543
def _activity_add_description(self, act):
544544
act['description'] = f"{act['type']}: {act['subType']}"
545545

546-
if act['type'] == 'INTERNAL_TRANSFER':
546+
if act['type'] == 'INTERNAL_TRANSFER' or act['type'] == 'ASSET_MOVEMENT':
547547
accounts = self.get_accounts(False)
548548
matching = [acc for acc in accounts if acc['id'] == act['opposingAccountId']]
549549
target_account = matching.pop() if matching else None
@@ -552,10 +552,8 @@ def _activity_add_description(self, act):
552552
if target_account else
553553
act['opposingAccountId']
554554
)
555-
if act['subType'] == 'SOURCE':
556-
act['description'] = f"Transfer out: Transfer to Wealthsimple {account_description}"
557-
else:
558-
act['description'] = f"Transfer in: Transfer from Wealthsimple {account_description}"
555+
direction = 'to' if act['subType'] == 'SOURCE' else 'from'
556+
act['description'] = f"Money transfer: {direction} Wealthsimple {account_description}"
559557

560558
elif act['type'] in ['DIY_BUY', 'DIY_SELL']:
561559
verb = act['subType'].replace('_', ' ').capitalize()

0 commit comments

Comments
 (0)