aboutsummaryrefslogtreecommitdiffstats
path: root/python/process_queue.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/process_queue.py')
-rw-r--r--python/process_queue.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/python/process_queue.py b/python/process_queue.py
index 51427d17..1c3ca590 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -871,6 +871,7 @@ def build_termination(
termination_cp=None,
globeopid=None,
partial_termination: bool = False,
+ is_assignment: bool = False,
ccy: str = "USD",
**kwargs,
):
@@ -905,11 +906,11 @@ def build_termination(
headers += ["Reserved"] * 3
headers += ["FeePaymentDate", "SpecialInstructions"]
- if termination_cp is not None:
+ if is_assignment:
headers += ["AssignedCounterparty"]
else:
headers += ["Reserved"]
- if deal_type == "CreditDefaultSwapDeal" and termination_cp is not None:
+ if deal_type == "CreditDefaultSwapDeal" and is_assignment:
headers += [
"AssignmentFee",
"AssignedFeeTradeDate",
@@ -930,16 +931,16 @@ def build_termination(
if deal_type == "SwaptionDeal":
headers += ["Reserved"] * 2 + ["InMoney", "FeeCurrency"]
elif deal_type == "CreditDefaultSwapDeal":
- if termination_cp is None:
+ if is_assignment:
headers += ["Reserved"] * 3
else:
headers += ["AssignedDealFunction"] + ["Reserved"] * 2
headers += ["InitialMargin", "InitialMarginCurrency"]
- if termination_cp is None:
+ if not is_assignment:
headers += ["Reserved"] * 4 + ["CreditEventOccured"]
d = {
"DealType": deal_type,
- "GoTradeId": int(globeopid[3:9]),
+ "GoTradeId": int(globeopid[3:9]) if globeopid else None,
"Action": "Update",
"Client": "Serenitas",
"SubAction": "Termination",
@@ -952,7 +953,7 @@ def build_termination(
}
if "FeeCurrency" in headers:
d["FeeCurrency"] = ccy
- if termination_cp is not None:
+ if is_assignment:
d["AssignedCounterparty"] = termination_cp
buf = StringIO()
csvwriter = csv.DictWriter(buf, headers)