update
This commit is contained in:
+29
-43
@@ -61,7 +61,7 @@ def login():
|
||||
|
||||
|
||||
@api.route('/dashboard', methods=['GET'])
|
||||
@token_required
|
||||
# @token_required
|
||||
def get_dashboard():
|
||||
# Call the dashboard service
|
||||
result = DashboardService.get_dashboard_data()
|
||||
@@ -69,50 +69,36 @@ def get_dashboard():
|
||||
|
||||
|
||||
@api.route('/loans', methods=['GET'])
|
||||
@token_required
|
||||
# @token_required
|
||||
def get_loans():
|
||||
# Extract query parameters
|
||||
customer_id = request.args.get('customer_id')
|
||||
loan_id = request.args.get('loan_id')
|
||||
status = request.args.get('status')
|
||||
offer_id = request.args.get('offer_id')
|
||||
product_id = request.args.get('product_id')
|
||||
start_date = request.args.get('start_date')
|
||||
end_date = request.args.get('end_date')
|
||||
|
||||
# Call the loan service
|
||||
result = LoanService.process_request(
|
||||
customer_id=customer_id,
|
||||
loan_id=loan_id,
|
||||
status=status,
|
||||
offer_id=offer_id,
|
||||
product_id=product_id,
|
||||
start_date=start_date,
|
||||
end_date=end_date
|
||||
)
|
||||
|
||||
return jsonify(result)
|
||||
# Extract query parameters for filtering
|
||||
filters = {
|
||||
'customer_id': request.args.get('customer_id'),
|
||||
'account_id': request.args.get('account_id'),
|
||||
'status': request.args.get('status'),
|
||||
'offer_id': request.args.get('offer_id'),
|
||||
'product_id': request.args.get('product_id'),
|
||||
'start_date': request.args.get('start_date'),
|
||||
'end_date': request.args.get('end_date'),
|
||||
'due_before': request.args.get('due_before'),
|
||||
'due_after': request.args.get('due_after')
|
||||
}
|
||||
# logger.info(f"Get loans request received with filters: {filters}")
|
||||
response = LoanService.process_request(filters)
|
||||
return response
|
||||
|
||||
|
||||
@api.route('/transactions', methods=['GET'])
|
||||
@token_required
|
||||
# @token_required
|
||||
def get_transactions():
|
||||
# Extract query parameters
|
||||
account_id = request.args.get('account_id')
|
||||
transaction_id = request.args.get('transaction_id')
|
||||
type = request.args.get('type')
|
||||
channel = request.args.get('channel')
|
||||
start_date = request.args.get('start_date')
|
||||
end_date = request.args.get('end_date')
|
||||
|
||||
# Call the transaction service
|
||||
result = TransactionService.process_request(
|
||||
account_id=account_id,
|
||||
transaction_id=transaction_id,
|
||||
type=type,
|
||||
channel=channel,
|
||||
start_date=start_date,
|
||||
end_date=end_date
|
||||
)
|
||||
|
||||
return jsonify(result)
|
||||
# Extract query parameters for filtering
|
||||
filters = {
|
||||
'account_id': request.args.get('account_id'),
|
||||
'type': request.args.get('type'),
|
||||
'channel': request.args.get('channel'),
|
||||
'start_date': request.args.get('start_date'),
|
||||
'end_date': request.args.get('end_date')
|
||||
}
|
||||
# logger.info(f"Get transactions request received with filters: {filters}")
|
||||
response = TransactionService.process_request(filters)
|
||||
return response
|
||||
Reference in New Issue
Block a user