StockManager does not grant access immediately on self-registration. When a new user creates an account through theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/InnoDev69/StockManager/llms.txt
Use this file to discover all available pages before exploring further.
/register page or the POST /api/register endpoint, the account is created in a pending state with status=0. No login is possible until an administrator or root user reviews the request and explicitly approves it. This approval workflow ensures that only verified individuals gain access to inventory and sales data.
Registration Flow
User Self-Registers
The user submits their username, email, and password via the Response:Status codes:
/register page or directly through the API.201 on success, 400 for missing fields or a password shorter than 6 characters, 409 if the username or email already exists.Account Created with Pending Status
The database record is inserted with
status=0 (disabled) and application="pending". The new user’s role is automatically set to vendedor. They cannot log in until their application is reviewed.Admin Reviews Pending Applications
Administrators open the Applications panel or call
GET /api/applications to see all accounts still awaiting a decision.Application Status Values
Theapplication column on the users table is a string controlled by the Var class in data/variables.py:
| Value | Constant | Meaning |
|---|---|---|
"pending" | Var.USER_APPLICATION_PENDING | Awaiting admin review |
"accepted" | Var.USER_APPLICATION_ACCEPTED | Approved; account is active |
"rejected" | Var.USER_APPLICATION_REJECTED | Denied; account remains disabled |
Endpoints
List Pending Applications
application value is "pending". Requires admin or root role.
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 10 | Records per page |
Approve an Application
application="accepted" and status=1 for the specified user. The user can now log in. Requires admin or root role. The action is recorded in the audit log under entity_type="application" with action="approve".
200 on success, 500 if a database error occurs.
Reject an Application
application="rejected" for the specified user. The status column remains 0, so the account stays disabled. Requires admin or root role. The action is recorded in the audit log under entity_type="application" with action="reject".
Rejected users cannot log in. Their
status remains 0 and the application field is set to "rejected". If a previously rejected user should be granted access, an administrator must manually update their record via PUT /api/users/<id> to set both status=1 and the desired application value.