File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,4 @@ class TransactionType(Enum):
3232 SEGREGATION = auto ()
3333 MISC = auto ()
3434 UNKNOWN = auto ()
35+ REVERSAL = auto ()
Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ def get_transaction_type(
5656 else :
5757 txn_type = TransactionType .PURCHASE
5858 elif units < 0 :
59- if "switch" in description :
59+ if re .search ("reversal|rejection|dishonoured" , description , re .I ):
60+ txn_type = TransactionType .REVERSAL
61+ elif "switch" in description :
6062 if "merger" in description :
6163 txn_type = TransactionType .SWITCH_OUT_MERGER
6264 else :
Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ def test_transaction_type(self):
5555 None ,
5656 )
5757
58+ assert get_transaction_type (
59+ "Purchase SIPCheque Dishonoured - Instalment No 108" , Decimal (- 1.0 )
60+ ) == (TransactionType .REVERSAL , None )
61+
5862 def test_isin_search (self ):
5963 isin , amfi = isin_search (
6064 "Axis Long Term Equity Fund - Direct Growth" , "KFINTECH" , "128TSDGG"
You can’t perform that action at this time.
0 commit comments