feat(cbacsv): Add stripped_target record field
This commit is contained in:
@@ -41,17 +41,24 @@ class RecordDirection(Enum):
|
||||
class CBARecord(Record):
|
||||
description: str
|
||||
direction: RecordDirection
|
||||
stripped_target: str
|
||||
|
||||
_display_fields = [
|
||||
("date", "Date"),
|
||||
("source_account", "Source Account"),
|
||||
("target_account", "Target Account"),
|
||||
("stripped_target", "Stripped Target Account"),
|
||||
("from_source", "From Source"),
|
||||
("to_target", "To Target"),
|
||||
("description", "Description"),
|
||||
]
|
||||
|
||||
_match_fields = ["source_account", "target_account", "description"]
|
||||
_match_fields = [
|
||||
"source_account",
|
||||
"target_account",
|
||||
"stripped_target",
|
||||
"description",
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def sample_record(cls):
|
||||
@@ -59,6 +66,7 @@ class CBARecord(Record):
|
||||
date=dt.date.today(),
|
||||
source_account="John Doe",
|
||||
target_account="Jane Austen",
|
||||
stripped_target="Jane Austen",
|
||||
from_source=Amount(314, "USD"),
|
||||
to_target=Amount(314, "USD"),
|
||||
fees=(),
|
||||
@@ -171,6 +179,7 @@ class CBAConverter(Converter[CBARecord, CBAConfig]):
|
||||
date=created_on,
|
||||
source_account="ACCOUNT",
|
||||
target_account=desc.split(" ")[0].strip(),
|
||||
stripped_target=desc.split(" ")[0].split("*")[0].strip(),
|
||||
from_source=asset_amount,
|
||||
to_target=other_amount,
|
||||
raw=",".join(row),
|
||||
@@ -181,6 +190,7 @@ class CBAConverter(Converter[CBARecord, CBAConfig]):
|
||||
record = CBARecord(
|
||||
date=created_on,
|
||||
target_account="ACCOUNT",
|
||||
stripped_target="ACCOUNT",
|
||||
source_account=desc.split(" ")[0].strip(),
|
||||
to_target=asset_amount,
|
||||
from_source=other_amount,
|
||||
|
||||
Reference in New Issue
Block a user