Banking_System_Server  1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
GetBalanceRequest Class Reference

The GetBalanceRequest class handles the retrieval of account balances. More...

#include <GetBalanceRequest.h>

Inheritance diagram for GetBalanceRequest:
Inheritance graph
Collaboration diagram for GetBalanceRequest:
Collaboration graph

Public Member Functions

 GetBalanceRequest ()
 Constructor for the GetBalanceRequest class. More...
 
QJsonObject execute (const QJsonObject &jsonObj, QMutex &m) override
 Executes the request to get the account balance. More...
 
- Public Member Functions inherited from Request
virtual ~Request ()
 Virtual destructor for the Request class. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Request
bool isDBConnectionValid (DB::DatabaseManager *dbManager)
 Checks if the database connection is valid. More...
 
QJsonObject CreateDBConnectionError (QJsonObject &response, QJsonObject &dataObj)
 Creates a JSON response indicating a database connection error. More...
 
QJsonObject CreateErrorResponse (QJsonObject &response, QJsonObject &dataObj, QString message)
 Creates a generic error JSON response. More...
 

Detailed Description

The GetBalanceRequest class handles the retrieval of account balances.

This class processes requests to retrieve the balance associated with an account number. It performs database operations to fetch the balance and returns the result.

Constructor & Destructor Documentation

◆ GetBalanceRequest()

GetBalanceRequest::GetBalanceRequest ( )
inline

Constructor for the GetBalanceRequest class.

Initializes the DatabaseManager instance for handling database operations.

Member Function Documentation

◆ execute()

QJsonObject GetBalanceRequest::execute ( const QJsonObject &  jsonObj,
QMutex &  m 
)
inlineoverridevirtual

Executes the request to get the account balance.

This method processes the JSON request to retrieve the balance associated with an account number. It validates the input data, checks the database connection, and fetches the balance from the database.

Parameters
jsonObjThe JSON object containing the request data.
mThe mutex to lock during the execution.
Returns
A JSON object containing the response data.

Implements Request.

Here is the call graph for this function:

The documentation for this class was generated from the following file: