diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/citco_ops/bowdst.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/python/citco_ops/bowdst.py b/python/citco_ops/bowdst.py index bd0ea52b..527a35a8 100644 --- a/python/citco_ops/bowdst.py +++ b/python/citco_ops/bowdst.py @@ -1,12 +1,13 @@ from dataclasses import dataclass import datetime from serenitas.ops.trade_dataclasses import Deal, Ccy +from typing import ClassVar @dataclass class Wire(Deal, table_name="custodian_wires", deal_type="custodian_wires"): date: datetime.date - fund: str + fund: ClassVar[str] entry_date: datetime.date value_date: datetime.date pay_date: datetime.date @@ -15,8 +16,9 @@ class Wire(Deal, table_name="custodian_wires", deal_type="custodian_wires"): wire_details: str unique_ref: str - def __init_subclass__(cls, **kwargs): + def __init_subclass__(cls, fund, **kwargs): cls._sql_insert += " ON CONFLICT (unique_ref) DO NOTHING" + cls.fund = fund def __post_init__(self): self.amount = self.amount.replace(",", "") @@ -26,7 +28,7 @@ class Wire(Deal, table_name="custodian_wires", deal_type="custodian_wires"): self.amount = float(self.amount) -class BowdstWire(Wire): +class BowdstWire(Wire, fund="BOWDST"): @classmethod def from_nexen_line(cls, line: dict): return cls( @@ -40,5 +42,4 @@ class BowdstWire(Wire): if line["Transaction Type Code"] == "CW" else line["Transaction Description 2"], unique_ref=line["Reference Number"], - fund="BOWDST", ) |
