@@ -212,7 +212,10 @@ def format_activity_description(act: dict, api_context) -> None:
212212 """
213213 act ["description" ] = f"{ act ['type' ]} : { act ['subType' ]} "
214214
215- if act ["type" ] == "INTERNAL_TRANSFER" or act ["type" ] == "ASSET_MOVEMENT" :
215+ if _format_corporate_action_subdivision (act , api_context ) or _format_institutional_transfer (act , api_context ) or _format_credit_card_description (act ):
216+ pass # Handled by helper function
217+
218+ elif act ["type" ] == "INTERNAL_TRANSFER" or act ["type" ] == "ASSET_MOVEMENT" :
216219 accounts = api_context .get_accounts (False )
217220 matching = [acc for acc in accounts if acc ["id" ] == act ["opposingAccountId" ]]
218221 target_account = matching .pop () if matching else None
@@ -245,9 +248,6 @@ def format_activity_description(act: dict, api_context) -> None:
245248 f"{ security } @ { float (act ['amount' ]) / float (act ['assetQuantity' ])} "
246249 )
247250
248- elif _format_corporate_action_subdivision (act , api_context ):
249- pass # Handled by helper function
250-
251251 elif act ["type" ] in ["DEPOSIT" , "WITHDRAWAL" ] and act ["subType" ] in [
252252 "E_TRANSFER" ,
253253 "E_TRANSFER_FUNDING" ,
@@ -281,8 +281,6 @@ def format_activity_description(act: dict, api_context) -> None:
281281 elif act ["type" ] == "REFUND" and act ["subType" ] == "TRANSFER_FEE_REFUND" :
282282 act ["description" ] = "Reimbursement: account transfer fee"
283283
284- elif _format_institutional_transfer (act , api_context ):
285- pass # Handled by helper function
286284 elif act ["type" ] == "INTEREST" :
287285 if act ["subType" ] == "FPL_INTEREST" :
288286 act ["description" ] = "Stock Lending Earnings"
@@ -340,9 +338,6 @@ def format_activity_description(act: dict, api_context) -> None:
340338 type_ = act ["type" ].capitalize ()
341339 act ["description" ] = f"{ type_ } "
342340
343- elif _format_credit_card_description (act ):
344- pass # Handled by helper function
345-
346341 elif act ["type" ] == "REIMBURSEMENT" and act ["subType" ] == "CASHBACK" :
347342 program = (
348343 "- Visa Infinite"
0 commit comments