![]() |
Banking_System_Server
1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
|
The DeleteUserRequest class handles the deletion of users. More...
#include <DeleteUserRequest.h>
Public Member Functions | |
DeleteUserRequest () | |
Constructor for the DeleteUserRequest class. More... | |
QJsonObject | execute (const QJsonObject &jsonObj, QMutex &m) override |
Executes the request to delete a user. More... | |
![]() | |
virtual | ~Request () |
Virtual destructor for the Request class. More... | |
Additional Inherited Members | |
![]() | |
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... | |
The DeleteUserRequest class handles the deletion of users.
This class processes requests to delete users, ensuring that the request originates from an admin and that the account number provided is valid. It performs database operations to remove the user and their associated account.
|
inline |
Constructor for the DeleteUserRequest class.
Initializes the DatabaseManager instance for handling database operations.
|
inlineoverridevirtual |
Executes the request to delete a user.
This method processes the JSON request to delete a user. It validates the input data, checks the database connection, and ensures that the request is made by an admin. If all validations pass, it deletes the user and their account from the database.
jsonObj | The JSON object containing the request data. |
m | The mutex to lock during the execution. |
Implements Request.