diff options
Diffstat (limited to 'python/process_queue.py')
| -rw-r--r-- | python/process_queue.py | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/python/process_queue.py b/python/process_queue.py index af260c45..42819f6b 100644 --- a/python/process_queue.py +++ b/python/process_queue.py @@ -144,10 +144,7 @@ def rename_keys(d, mapping): def build_line(obj, trade_type="bond", fund="SERCGMAST"): - if fund == "SERCGMAST": - obj["Client"] = "Serenitas" - else: - obj["Client"] = "LMCG" + obj["Client"] = client_name[fund] obj["State"] = "Valid" rename_cols = { "fund": "Fund", @@ -189,7 +186,9 @@ def build_line(obj, trade_type="bond", fund="SERCGMAST"): "accrued_payment": "AccruedPayment", "current_face": "CurrentFace", } - rename_cols["curr_notional" if fund == "SERCGMAST" else "notional"] = "Notional" + rename_cols[ + "curr_notional" if fund in ("SERCGMAST", "BOWDST") else "notional" + ] = "Notional" rename_keys(obj, rename_cols) if trade_type in ("bond", "swaption", "future"): obj["Transaction Indicator"] = "Buy" if obj["buysell"] else "Sell" @@ -341,6 +340,12 @@ def build_line(obj, trade_type="bond", fund="SERCGMAST"): "transaction_indicator": "TransactionIndicator", }, ) + if fund == "BOWDST": + obj["Folder"] = "HEDGEMARK_TEST/Strategy-BOS_PAT_BOWDOIN" + obj["Custodian"] = "TEST" + obj["Cash Account"] = "TELHEEACPB" + obj["Counterparty"] = "TESTLN" + return [obj.get(h, None) for h in get_headers(trade_type, fund)] @@ -677,25 +682,27 @@ def upload_buf( ftp.client.cwd("incoming") ftp.put(buf, dest) elif fund == "BOWDST": - sftp = SftpClient.from_creds("bony") - sftp.client.chdir("/inbound/cfe/") - sftp.put(buf, dest, False) - em = ExchangeMessage() - recipients = ( - "caagtradecapture@bnymellon.com", - "hm-operations@bnymellon.com", - "caagprim@bnymellon.com", - "julie.picariello@bnymellon.com", - ) - if trade_type in ("cds", "swaption"): - recipients += ("sa1futures.optionsprocessing@bnymellon.com",) - em.send_email( - "Trade file", - "", - to_recipients=recipients, - cc_recipients=("bowdoin-ops@lmcg.com",), - attach=(FileAttachment(name=dest, content=buf),), - ) + sftp = SftpClient.from_creds("hm_globeop") + sftp.client.chdir("incoming") + sftp.put(buf, dest) + # sftp.client.chdir("/inbound/cfe/") + # sftp.put(buf, dest, False) + # em = ExchangeMessage() + # recipients = ( + # "caagtradecapture@bnymellon.com", + # "hm-operations@bnymellon.com", + # "caagprim@bnymellon.com", + # "julie.picariello@bnymellon.com", + # ) + # if trade_type in ("cds", "swaption"): + # recipients += ("sa1futures.optionsprocessing@bnymellon.com",) + # em.send_email( + # "Trade file", + # "", + # to_recipients=recipients, + # cc_recipients=("bowdoin-ops@lmcg.com",), + # attach=(FileAttachment(name=dest, content=buf),), + # ) else: raise ValueError(f"unknow fund name: {fund}") @@ -757,7 +764,7 @@ def build_termination( "DealId": dealid if globeopid is None else None, "GoTradeId": globeopid if globeopid else None, "Action": "Update", - "Client": "Serenitas" if fund == "SERCGMAST" else "LMCG", + "Client": client_name[fund], "SubAction": "Termination", "PartialTermination": "Y" if partial_termination else "N", "TerminationAmount": termination_amount, @@ -776,6 +783,7 @@ def build_termination( if __name__ == "__main__": + client_name = {"SERCGMAST": "Serenitas", "BOWDST": "HEDGEMARK"} parser = argparse.ArgumentParser() parser.add_argument( "-n", "--no-upload", action="store_true", help="do not upload to Globeop" |
