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

The UpdateUserRequest class handles user update requests. More...

#include <UpdateUserRequest.h>

Inheritance diagram for UpdateUserRequest:
Inheritance graph
Collaboration diagram for UpdateUserRequest:
Collaboration graph

Public Member Functions

 UpdateUserRequest ()
 Constructor for the UpdateUserRequest class. More...
 
QJsonObject execute (const QJsonObject &jsonObj, QMutex &m) override
 Executes the user update request. 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 UpdateUserRequest class handles user update requests.

This class processes requests to update user details, including first name, last name, email, and role. It ensures that the requester has the necessary permissions and that the updated email is not already associated with another user.

Constructor & Destructor Documentation

◆ UpdateUserRequest()

UpdateUserRequest::UpdateUserRequest ( )
inline

Constructor for the UpdateUserRequest class.

Initializes the DatabaseManager instance for handling database operations.

Member Function Documentation

◆ execute()

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

Executes the user update request.

This method processes the JSON request to update user details. It validates the requester's role, checks if the email is already associated with another user, and updates the user information in 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: