Transaction Id on repayment

This commit is contained in:
2025-04-15 17:16:30 -04:00
parent a2399a2eae
commit 9df8e31fdd
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -19,9 +19,10 @@ class Repayment(db.Model):
product_id = db.Column(db.String(20), nullable=True)
created_at = db.Column(db.DateTime, default=datetime.now(timezone.utc))
updated_at = db.Column(db.DateTime, default=datetime.now(timezone.utc), onupdate=datetime.now(timezone.utc))
transaction_id = db.Column(db.String(50), nullable=True)
@classmethod
def create_repayment(cls, customer_id, loan_id, product_id):
def create_repayment(cls, customer_id, loan_id, product_id, transaction_id):
# Check customer exists
@@ -40,6 +41,7 @@ class Repayment(db.Model):
customer_id=customer_id,
loan_id=loan_id,
product_id=product_id,
transaction_id = transaction_id
)
try: