From 195d21133cc55f7f1435ded7cbf051b927e766f3 Mon Sep 17 00:00:00 2001 From: pinzutu <170082460+pinzutu@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:19:06 +0000 Subject: [PATCH] Update event.py (#121) Adds OUTGOING_TRANSFER_DELEGATION type Groups the mapping per pp type and sorts the events according to their ASCII codes --- pytr/event.py | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/pytr/event.py b/pytr/event.py index 46252f5..882143d 100644 --- a/pytr/event.py +++ b/pytr/event.py @@ -1,27 +1,30 @@ from datetime import datetime import re - tr_eventType_to_pp_type = { - "CREDIT": "DIVIDENDS", - "ssp_corporate_action_invoice_cash": "DIVIDENDS", - "TRADE_INVOICE": "TRADE_INVOICE", - "SAVINGS_PLAN_EXECUTED": "TRADE_INVOICE", - "SAVINGS_PLAN_INVOICE_CREATED": "TRADE_INVOICE", - "ORDER_EXECUTED": "TRADE_INVOICE", - "PAYMENT_INBOUND": "DEPOSIT", - "PAYMENT_INBOUND_SEPA_DIRECT_DEBIT": "DEPOSIT", - "INCOMING_TRANSFER": "DEPOSIT", - "PAYMENT_INBOUND_GOOGLE_PAY": "DEPOSIT", - "PAYMENT_OUTBOUND": "REMOVAL", - "INTEREST_PAYOUT_CREATED": "INTEREST", - "card_successful_transaction": "REMOVAL", - "card_successful_atm_withdrawal": "REMOVAL", - "card_order_billed": "REMOVAL", - "card_refund": "DEPOSIT", - "card_failed_transaction": "REMOVAL", -} + 'INCOMING_TRANSFER': 'DEPOSIT', + 'PAYMENT_INBOUND': 'DEPOSIT', + 'PAYMENT_INBOUND_GOOGLE_PAY': 'DEPOSIT', + 'PAYMENT_INBOUND_SEPA_DIRECT_DEBIT': 'DEPOSIT', + 'card_refund': 'DEPOSIT', + + 'CREDIT': 'DIVIDENDS', + 'ssp_corporate_action_invoice_cash': 'DIVIDENDS', + 'INTEREST_PAYOUT_CREATED': 'INTEREST', + + 'OUTGOING_TRANSFER_DELEGATION': 'REMOVAL', + 'PAYMENT_OUTBOUND': 'REMOVAL', + 'card_failed_transaction': 'REMOVAL', + 'card_order_billed': 'REMOVAL', + 'card_successful_atm_withdrawal': 'REMOVAL', + 'card_successful_transaction': 'REMOVAL', + + 'ORDER_EXECUTED': 'TRADE_INVOICE', + 'SAVINGS_PLAN_EXECUTED': 'TRADE_INVOICE', + 'SAVINGS_PLAN_INVOICE_CREATED': 'TRADE_INVOICE', + 'TRADE_INVOICE': 'TRADE_INVOICE' +} class Event: def __init__(self, event_json):