|
9 | 9 | class ConditionalEventType(Enum):
|
10 | 10 | """Events that conditionally map to None or one/multiple PPEventType events"""
|
11 | 11 |
|
12 |
| - FAILED_CARD_TRANSACTION = auto() |
13 | 12 | SAVEBACK = auto()
|
14 | 13 | TRADE_INVOICE = auto()
|
15 | 14 |
|
@@ -50,7 +49,7 @@ class EventType(Enum):
|
50 | 49 | "CREDIT": PPEventType.DIVIDEND,
|
51 | 50 | "ssp_corporate_action_invoice_cash": PPEventType.DIVIDEND,
|
52 | 51 | # Failed card transactions
|
53 |
| - "card_failed_transaction": ConditionalEventType.FAILED_CARD_TRANSACTION, |
| 52 | + "card_failed_transaction": PPEventType.REMOVAL, |
54 | 53 | # Interests
|
55 | 54 | "INTEREST_PAYOUT": PPEventType.INTEREST,
|
56 | 55 | "INTEREST_PAYOUT_CREATED": PPEventType.INTEREST,
|
@@ -116,12 +115,8 @@ def _parse_type(event_dict: Dict[Any, Any]) -> Optional[EventType]:
|
116 | 115 | event_type: Optional[EventType] = tr_event_type_mapping.get(
|
117 | 116 | event_dict.get("eventType", ""), None
|
118 | 117 | )
|
119 |
| - if event_type == ConditionalEventType.FAILED_CARD_TRANSACTION: |
120 |
| - event_type = ( |
121 |
| - PPEventType.REMOVAL |
122 |
| - if event_dict.get("status", "").lower() == "executed" |
123 |
| - else None |
124 |
| - ) |
| 118 | + if event_dict.get("status", "").lower() == "canceled": |
| 119 | + event_type = None |
125 | 120 | return event_type
|
126 | 121 |
|
127 | 122 | @classmethod
|
@@ -210,7 +205,7 @@ def _parse_shares_and_fees(
|
210 | 205 | titles, shares_dicts + fees_dicts, locales
|
211 | 206 | ):
|
212 | 207 | return_vals[key] = cls._parse_float_from_detail(elem_dict, locale)
|
213 |
| - return return_vals["shares"], return_vals.get("fees", None) |
| 208 | + return return_vals.get("shares"), return_vals.get("fees") |
214 | 209 |
|
215 | 210 | @classmethod
|
216 | 211 | def _parse_taxes(cls, event_dict: Dict[Any, Any]) -> Optional[float]:
|
|
0 commit comments