78 lines
2.4 KiB
Python
78 lines
2.4 KiB
Python
from app.models import Repayment
|
|
|
|
class RepaymentService:
|
|
|
|
@staticmethod
|
|
def get_repayment_by_transaction_id(transaction_id):
|
|
"""
|
|
Get the repayment by transaction ID
|
|
"""
|
|
return Repayment.get_repayment_by_transaction_id(transaction_id)
|
|
@staticmethod
|
|
def get_repayment_by_id(id):
|
|
"""
|
|
Get the repayment by ID
|
|
"""
|
|
return Repayment.get_repayment_by_id(id)
|
|
|
|
@classmethod
|
|
def set_repay_date(cls, repayment_id, customer_id):
|
|
"""
|
|
Update the repay status of the repayment with the given repayment_id.
|
|
"""
|
|
return Repayment.set_repay_date(repayment_id, customer_id)
|
|
|
|
@classmethod
|
|
def set_repay_verify_date(cls, repayment_id, customer_id):
|
|
"""
|
|
Update the verify date of the repayment with the given repayment_id.
|
|
"""
|
|
return Repayment.set_repay_verify_date(repayment_id, customer_id)
|
|
|
|
@classmethod
|
|
def set_repay_result(cls, repayment_id, result, description):
|
|
"""
|
|
Update the repay result of the repayment with the given repayment_id.
|
|
"""
|
|
return Repayment.set_repay_result(repayment_id, result, description)
|
|
|
|
@classmethod
|
|
def set_verify_date_result(cls, repayment_id, result, description):
|
|
"""
|
|
Update the verify result of the repayment with the given repayment_id.
|
|
"""
|
|
return Repayment.set_verify_date_result(repayment_id, result, description)
|
|
|
|
@classmethod
|
|
def get_latest_repayment_without_repay_date(cls):
|
|
"""
|
|
Get the latest repayment without a repay date.
|
|
"""
|
|
return Repayment.get_latest_repayment_without_repay_date()
|
|
@classmethod
|
|
def get_latest_repayment_with_loanId(cls,loan_id):
|
|
"""
|
|
Get the latest repayment with loan id.
|
|
"""
|
|
return Repayment.get_latest_repayment_with_loanId(loan_id)
|
|
|
|
@classmethod
|
|
def get_latest_loan_with_repay_date(cls):
|
|
"""
|
|
Get the latest repayment with a repay date and no verification date.
|
|
"""
|
|
return Repayment.get_latest_loan_with_repay_date()
|
|
|
|
@classmethod
|
|
def add_repayment(cls, data):
|
|
"""
|
|
Add a new repayment entry.
|
|
"""
|
|
return Repayment.add_repayment(data)
|
|
|
|
@classmethod
|
|
def create_repayment(cls, repayment_data):
|
|
"""
|
|
Add a new repayment entry.
|
|
"""
|
|
return Repayment.create_repayment(repayment_data) |