added salary table

This commit was merged in pull request #25.
This commit is contained in:
Chinenye Nmoh
2025-06-18 22:25:45 +01:00
parent 36cddd9327
commit ad25be1856
9 changed files with 124 additions and 21 deletions
+8
View File
@@ -161,6 +161,14 @@ class Repayment(db.Model):
return cls.query.filter(
cls.repay_date.is_(None)
).order_by(cls.created_at.desc()).first()
@classmethod
def get_latest_repayment_with_loanId(cls, loan_id):
"""
Get the latest repayment with loan Id.
"""
return cls.query.filter(
cls.loan_id == loan_id
).order_by(cls.created_at.desc()).first()
@classmethod
def get_latest_loan_with_repay_date(cls):