aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/admin_cls_upload.py9
-rw-r--r--python/report_ops/services.py12
2 files changed, 15 insertions, 6 deletions
diff --git a/python/admin_cls_upload.py b/python/admin_cls_upload.py
index 4fa9b206..171b9709 100644
--- a/python/admin_cls_upload.py
+++ b/python/admin_cls_upload.py
@@ -5,7 +5,7 @@ from serenitas.ops.trade_dataclasses import SpotDeal
from report_ops.services import get_service
fund = "BOWDST"
-trade_date = datetime.date(2023, 3, 14)
+trade_date = datetime.date(2023, 6, 8)
conn = SpotDeal._conn
with conn.cursor() as c:
@@ -28,4 +28,9 @@ with conn.cursor() as c:
)
trade = SpotDeal.from_dict(**t)
service.push_trade(trade, "NEW")
- service.build_buffer("spot")
+ buf, dest = service.build_buffer("spot")
+ service.upload(
+ buf,
+ dest.name,
+ "CLS",
+ )
diff --git a/python/report_ops/services.py b/python/report_ops/services.py
index 20c39d9d..d451d40d 100644
--- a/python/report_ops/services.py
+++ b/python/report_ops/services.py
@@ -1,5 +1,6 @@
from serenitas.ops.funds import Service
from serenitas.ops.headers import HEADERS
+from serenitas.utils.exchange import ExchangeMessage, FileAttachment
from .headers import get_bny_headers
@@ -17,13 +18,16 @@ class BNY(Service, service_name="BNY"):
cls.staging_queue.append(trade.to_bny(action))
@classmethod
- def upload(cls, buf, dest):
- super().upload(buf, dest)
+ def upload(cls, buf, dest, upload_type):
+ super().upload(buf, dest, confirm=False)
em = ExchangeMessage()
em.send_email(
- "BNY Upload Receipt",
+ f"BNY Upload Receipt {upload_type}",
"",
- to_recipients="NYOPs@lmcg.com",
+ to_recipients=(
+ "NYOPs@lmcg.com",
+ "Prim-ops@lmcg.com",
+ ),
attach=(FileAttachment(name=dest, content=buf),),
)