Minor changes and added descriptions to all funcitons

This commit is contained in:
Lucas Mathews
2024-05-28 11:03:44 +02:00
parent 0732b26af3
commit 7b6ebbd0d2
12 changed files with 132 additions and 87 deletions

View File

@@ -16,6 +16,7 @@ class Transaction(Base):
recipient_account_id = Column(String, ForeignKey('accounts.account_id'))
def __init__(self, transaction_id, transaction_type, amount, timestamp, description, account_id, recipient_account_id = None):
"""Initialises the Transaction object."""
self.transaction_id = transaction_id
self.transaction_type = transaction_type
self.amount = amount
@@ -25,6 +26,7 @@ class Transaction(Base):
self.recipient_account_id = recipient_account_id
def to_dict(self):
"""Converts the Transaction object to a dictionary."""
return {
"transaction_id": self.transaction_id,
"transaction_type": self.transaction_type,