All user identity operations in BodegaX flow through theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Edwin950821/BodegaX/llms.txt
Use this file to discover all available pages before exploring further.
/admin/* endpoints. This includes logging in, registering new accounts (both from the public registration page and the admin settings panel), editing existing user records, and deleting users. The term “admin” in the URL path is a legacy naming convention — the endpoints serve all user roles, and a role field on each user record distinguishes admin from user accounts.
POST /admin/login
Authenticates a user against the database and returns their full user object. On success, the Angular frontend stores this object insessionStorage under the key bodegax and navigates to /. On failure, the application surfaces a dialog reading “Credenciales invalidas”.
Request Body
The user’s display name as stored in the database. This is the value of the
nombre field set at registration.The user’s password in plain text. Validated server-side against the stored credential.
Response
A JSON object representing the authenticated user. This object is stored verbatim insessionStorage.
Universally unique identifier for the user. Used in subsequent requests as
uuid_admin or uuid_cliente.The user’s display name.
The user’s role. Either
"admin" (warehouse staff) or "user" (client). Determines which UI views and actions are available.The user’s government-issued document or ID number.
The user’s registered address.
The frontend reads
sessionStorage.getItem('bodegax') on every page load to restore the session. Clearing sessionStorage effectively logs the user out.POST /admin/create
Creates a new user account. This endpoint is called in two places: the public/register page (where new clients self-register) and the admin Settings panel (where staff create client accounts on behalf of users). In both cases, the frontend sets role to "user" automatically.
After a successful registration from the public register page, the frontend immediately calls POST /admin/login with the same credentials to log the new user in.
Request Body
The user’s role. The frontend always sends
"user" for client accounts. Set to "admin" directly via the backend for warehouse staff accounts.The user’s display name. Also serves as the
username field for login.The user’s document or national ID number.
The user’s password. Stored and validated server-side.
The user’s address. Optional — can be left empty or omitted.
Response
The newly created user object, with the same shape as the login response (uuid, nombre, role, id, direccion).
PUT /admin/edit
Updates an existing user’s information. Called from the Settings panel when an admin edits a client’s record via theUserFormDialog. All fields must be provided; the server replaces the existing record.
Request Body
The unique identifier of the user to update. This value is obtained from the user list (
GET /admin/all) and passed into the edit dialog.The user’s role. Pass the existing role value to preserve it (e.g.,
"user").Updated display name for the user.
Updated document or national ID number.
Updated password. The frontend pre-populates this field with the existing password value from the user record.
Updated address.
Response
The updated user object.DELETE /admin/delete
Deletes a user from the system. The Settings page opens a confirmation dialog before sending this request. The full user object is passed as the request body.Request Body
Pass the complete user object as retrieved fromGET /admin/all. The uuid field is used server-side to identify the record to delete.
Response
A confirmation response. After receiving a successful status, the frontend re-fetchesGET /admin/all to update the displayed user table.
GET /admin/all
Returns an array of all registered user accounts. This endpoint is used in several parts of the application:- Settings page — renders the full user management table
- Home page (Despachar Caja dialog) — populates the client dropdown; filtered client-side by
role === 'user' - History page — resolves
uuid_clientefrom each sale record to a human-readable client name - TerminarJornada dialog — loads clients to generate end-of-day PDF reports
Response
An array of user objects.The frontend filters this array by
role === 'user' when building client dropdowns. The full unfiltered array is used when resolving names for the history and report views. Admin accounts appear in the raw response and must be excluded in client-facing contexts.