Added transaction ID
This commit was merged in pull request #12.
This commit is contained in:
@@ -5,5 +5,6 @@ from .transaction import Transaction
|
||||
from .user import User
|
||||
from .repayment import Repayment
|
||||
from .loan_charge import LoanCharge
|
||||
from .loan_repayment_schedule import LoanRepaymentSchedule
|
||||
|
||||
__all__ = ['Customer', 'Account', 'Loan', 'Transaction', 'User', 'Repayment', 'LoanCharge']
|
||||
__all__ = ['Customer', 'Account', 'Loan', 'Transaction', 'User', 'Repayment', 'LoanCharge', 'LoanRepaymentSchedule']
|
||||
@@ -50,12 +50,13 @@ class Transaction(db.Model):
|
||||
return cls.query.get(transaction_id)
|
||||
|
||||
@classmethod
|
||||
def get_all_transactions(cls, account_id=None, transaction_type=None, channel=None, start_date=None, end_date=None, page=1, limit=20):
|
||||
def get_all_transactions(cls, account_id=None, transaction_id=None, transaction_type=None, channel=None, start_date=None, end_date=None, page=1, limit=20):
|
||||
"""
|
||||
Get all transactions with optional filtering
|
||||
|
||||
Args:
|
||||
account_id (str, optional): Filter by account ID
|
||||
transaction_id (str, optional): Filter by transaction ID
|
||||
transaction_type (str, optional): Filter by transaction type
|
||||
channel (str, optional): Filter by channel
|
||||
start_date (datetime, optional): Filter by start date
|
||||
@@ -70,6 +71,9 @@ class Transaction(db.Model):
|
||||
if account_id:
|
||||
query = query.filter(cls.account_id == account_id)
|
||||
|
||||
if transaction_id:
|
||||
query = query.filter(cls.transaction_id == transaction_id)
|
||||
|
||||
if transaction_type:
|
||||
query = query.filter(cls.type == transaction_type)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user