diff options
| -rw-r--r-- | python/Dawn/models.py | 3 | ||||
| -rw-r--r-- | python/process_queue.py | 5 | ||||
| -rw-r--r-- | sql/dawn.sql | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/python/Dawn/models.py b/python/Dawn/models.py index bf4511d4..1a718665 100644 --- a/python/Dawn/models.py +++ b/python/Dawn/models.py @@ -679,6 +679,9 @@ class Termination(db.Model): counterparty = db.relationship(Counterparties, foreign_keys=[termination_cp]) termination_amount = db.Column(db.Float) termination_fee = db.Column(db.Float, nullable=False) + fee_payment_date = db.Column( + db.Date, nullable=False, default=lambda: datetime.date.today() + 3 * bus_day + ) partial_termination = db.Column(db.Boolean, nullable=False, default=False) diff --git a/python/process_queue.py b/python/process_queue.py index 4ec33469..c00ae7bb 100644 --- a/python/process_queue.py +++ b/python/process_queue.py @@ -902,7 +902,8 @@ def build_termination( base_dir: pathlib.Path, *, dealid, - termination_fee, + termination_fee: float, + fee_payment_date: datetime.date, termination_date=datetime.date.today(), termination_amount=None, termination_cp=None, @@ -986,7 +987,7 @@ def build_termination( "TerminationDate": termination_date, "FeesPaid": -termination_fee if termination_fee < 0 else None, "FeesReceived": termination_fee if termination_fee > 0 else None, - "FeePaymentDate": (termination_date + 3 * bus_day).date(), + "FeePaymentDate": fee_payment_date, } if "FeeCurrency" in headers: d["FeeCurrency"] = ccy diff --git a/sql/dawn.sql b/sql/dawn.sql index 3c8f0f63..3ae12fbc 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -356,7 +356,9 @@ CREATE TABLE terminations ( termination_cp varchar(12) REFERENCES counterparties(code), termination_amount float8, termination_fee float8 NOT NULL, - partial_termination bool NOT null default false + partial_termination bool NOT null default false, + new_gtid int, + fee_payment_date date NOT NULL, ); create |
