added return data

This commit is contained in:
2025-04-27 19:25:04 -04:00
parent 56c7e594cb
commit 0238fa6bf0
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -123,6 +123,8 @@ class LoanService:
'id': loan.id, 'id': loan.id,
'customer_id': loan.customer_id, 'customer_id': loan.customer_id,
'account_id': loan.account_id, 'account_id': loan.account_id,
'transaction_id': loan.transaction_id,
'original_transaction': loan.original_transaction,
'offer_id': loan.offer_id, 'offer_id': loan.offer_id,
'initial_loan_amount': loan.initial_loan_amount, 'initial_loan_amount': loan.initial_loan_amount,
'current_loan_amount': loan.current_loan_amount, 'current_loan_amount': loan.current_loan_amount,
@@ -130,6 +132,9 @@ class LoanService:
'product_id': loan.product_id, 'product_id': loan.product_id,
'default_penalty_fee': loan.default_penalty_fee, 'default_penalty_fee': loan.default_penalty_fee,
'continuous_fee': loan.continuous_fee, 'continuous_fee': loan.continuous_fee,
'upfront_fee': self.upfront_fee,
'repayment_amount': self.repayment_amount,
'installment_amount': self.installment_amount,
'due_date': loan.due_date.isoformat() if loan.due_date else None, 'due_date': loan.due_date.isoformat() if loan.due_date else None,
'created_at': loan.created_at.isoformat() if loan.created_at else None, 'created_at': loan.created_at.isoformat() if loan.created_at else None,
'updated_at': loan.updated_at.isoformat() if loan.updated_at else None 'updated_at': loan.updated_at.isoformat() if loan.updated_at else None
+1 -1
View File
@@ -222,6 +222,6 @@ class Loan(db.Model):
'created_at': self.created_at.isoformat() if self.created_at else None, 'created_at': self.created_at.isoformat() if self.created_at else None,
'updated_at': self.updated_at.isoformat() if self.updated_at else None 'updated_at': self.updated_at.isoformat() if self.updated_at else None
} }
def __repr__(self): def __repr__(self):
return f'<Loan {self.id}>' return f'<Loan {self.id}>'