diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/trade_dataclasses.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py index 5f3bff1b..f99dad2e 100644 --- a/python/trade_dataclasses.py +++ b/python/trade_dataclasses.py @@ -1034,11 +1034,22 @@ class IRSDeal( swap_type: str = field(metadata={"globeop": "SwapType"}) cleared_trade_id: str currency: str + custodian: int = field( + default=None, metadata={"insert": False, "globeop": "Custodian"}, init=False + ) id: int = field(default=None, metadata={"insert": False}) dealid: str = field( default=None, metadata={"insert": False, "mtm": "Swap ID", "globeop": "Deal Id"} ) + def __post_init__(self): + with self._conn.cursor() as c: + c.execute( + "SELECT cp_code from accounts2 where cash_account=%s", + (self.cash_account,), + ) + (self.custodian,) = c.fetchone() + def to_admin(self): obj = self.serialize("globeop") if obj["payreceive"]: @@ -1072,6 +1083,5 @@ class IRSDeal( obj["Action"] = "NEW" # Need to figure this out obj["Client"] = "Serenitas" obj["State"] = "Valid" - obj["Custodian"] = "BOMLCM" obj.update(d) return obj |
