Skip to content

Commit

Permalink
Update event.py (#121)
Browse files Browse the repository at this point in the history
Adds OUTGOING_TRANSFER_DELEGATION type
Groups the mapping per pp type and sorts the events according to their ASCII codes
  • Loading branch information
pinzutu authored Sep 23, 2024
1 parent 3b9e1a2 commit 195d211
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions pytr/event.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit 195d211

Please sign in to comment.