diff options
| -rw-r--r-- | python/report_ops/headers.py | 47 | ||||
| -rw-r--r-- | python/report_ops/sma.py | 7 |
2 files changed, 51 insertions, 3 deletions
diff --git a/python/report_ops/headers.py b/python/report_ops/headers.py index b563e1d6..94e941d3 100644 --- a/python/report_ops/headers.py +++ b/python/report_ops/headers.py @@ -34,3 +34,50 @@ POSITION_HEADERS = [ "COB Date", "Clearing House Name", ] + + +BOWDST_POSITION_HEADERS = [ + "Client Name", + "Fund Name", + "Counterparty", + "Product Type", + "Unique Deal ID", + "TransactionIndicator (Buy/Sell)", + "PutCall Indicator (Call/Put)", + "CapFloorIndicator", + "CurrencyPair", + "DealCurrencyA", + "DealCurrencyB", + "NotionalA", + "NotionalB", + "OriginalPrice", + "Strike", + "FixedRate", + "Quantity", + "Start Date", + "Effective Date", + "Maturity Date", + "Underlying Maturity", + "RecPayFixed", + "Underlying (ISIN / CUSP / RED CODES)", + "Underlying Desc", + "Exercise Type", + "MTM Currency", + "MTM Valuation", + "COB Date", + "Clearing House Name", + "MarketPrice", + "AccountNumber", + "COB Date", + "SecurityDescription", + "Prime Broker", +] + + +def get_position_headers(fund): + match fund: + case "BOWDST": + return BOWDST_POSITION_HEADERS + + case _: + return POSITION_HEADERS diff --git a/python/report_ops/sma.py b/python/report_ops/sma.py index c147ee4c..caadba85 100644 --- a/python/report_ops/sma.py +++ b/python/report_ops/sma.py @@ -9,7 +9,7 @@ from exchangelib import FileAttachment import pandas as pd from io import StringIO from typing import ClassVar -from .headers import POSITION_HEADERS +from .headers import get_position_headers import csv @@ -220,9 +220,10 @@ class PositionReport(Deal, deal_type=None, table_name=None): def build_buffer(cls, cob, fund): buf = StringIO() csvwriter = csv.writer(buf) - csvwriter.writerow(POSITION_HEADERS) + headers = get_position_headers(fund) + csvwriter.writerow(headers) csvwriter.writerows( - [[obj.get(h) for h in POSITION_HEADERS] for obj in cls.staging_queue] + [[obj.get(h) for h in headers] for obj in cls.staging_queue] ) buf = buf.getvalue().encode() dest = get_path(cob, fund) |
