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