setup services to talk to models
This commit is contained in:
@@ -3,7 +3,7 @@ from app.config import settings
|
||||
from app.utils.auth import get_headers
|
||||
from app.utils.logger import logger
|
||||
from flask import jsonify, current_app
|
||||
from app.models.transactions import Transaction
|
||||
from app.services.transactions import TransactionService
|
||||
|
||||
|
||||
class SimbrellaClient:
|
||||
@@ -17,7 +17,7 @@ class SimbrellaClient:
|
||||
|
||||
# Check if the transaction exists
|
||||
logger.info(f"Checking if transaction exists")
|
||||
transaction = Transaction.get_transaction_by_id(transaction_id=data['transactionId'])
|
||||
transaction = TransactionService.get_transaction_by_id(transaction_id=data['transactionId'])
|
||||
logger.info(f"Response from database: {transaction}")
|
||||
|
||||
disbursement_data ={
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from .transactions import TransactionService
|
||||
@@ -0,0 +1,10 @@
|
||||
from app.models import Transaction
|
||||
|
||||
class TransactionService:
|
||||
|
||||
@staticmethod
|
||||
def get_transaction_by_id(transaction_id):
|
||||
"""
|
||||
Get the transaction by ID
|
||||
"""
|
||||
return Transaction.get_transaction_by_id(transaction_id)
|
||||
Reference in New Issue
Block a user