aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/services.py
blob: 6e7f37d5d610728319eeab982cb94ccf50568d78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from serenitas.ops.funds import Service
from serenitas.ops.headers import HEADERS


class UMB(Service, service_name="UMB"):
    filepath_pattern = "Serenitas.ALL.{timestamp:%Y%m%d.%H%M%S}.csv"
    credential = "umb"

    @classmethod
    def set_headers(cls, *args):
        cls.headers = HEADERS["bond"] + [
            "DTC",
            "AccruedPayment",
            "PrincipalPayment",
            "CurrentFace",
        ]

    @classmethod
    def push_trade(cls, trade, action):
        cls.staging_queue.append(trade.to_umb(action))


def get_service(account_counterparty):
    match account_counterparty:
        case "UMB":
            return UMB
        case "BONY":
            return Service[account_counterparty]
        case "BBH":
            return Service["BRINKER"]
        case _:
            return None