The Access Control module, found atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Hansel-Pan/sistema-de-informacion-web-para-un-gimnasio/llms.txt
Use this file to discover all available pages before exploring further.
/acceso, is the operational hub for front-desk staff. It shows who is currently in the gym, lets staff register an entry for any member who arrives, and logs their exit when they leave. Every time a member enters, the server deducts one day from their dias_restantes counter, enforcing the membership balance in real time.
Current Occupancy
The top card on the Access Control page is headed Clientes dentro del gimnasio (N), where N is the live count returned byaccesoApi.ocupacion(). The list is loaded on mount and refreshed after every entry or exit event.
The occupancy table displays the following columns for each member currently inside:
| Column | Description |
|---|---|
| Nombre | Full name of the member |
| Identificación | Government ID number |
| Celular | Mobile phone number |
| Días Rest. | Remaining membership days after the most recent entry |
| Acción | Registrar Salida button to log their exit |
Registering an Entry
Below the occupancy card, the Registrar ingreso / salida card contains a live search field. Staff type a member’s name or ID number to filter the full client list in real time — the filter matches againstnombres (case-insensitive) and identificacion simultaneously.
Each result row shows the member’s Nombre, Identificación, Género, Días Rest., and current Estado badge, plus an action button:
- Entrada (blue) — shown when
en_gimnasioisfalse - Salida (amber) — shown when
en_gimnasioistrue
accesoApi.entrada(cliente_id). On success, a confirmation banner appears showing the member’s name and their updated remaining day count. Both the client list and the occupancy card refresh automatically.
Registering an Exit
An exit can be registered from two places:- Occupancy table — click Registrar Salida next to any member currently listed as inside the gym.
- Search results — if a member’s search result shows the Salida button (because
en_gimnasioistrue), click it directly from the search panel.
accesoApi.salida(cliente_id). On success, a confirmation banner displays the member’s name, and both the client list and occupancy table refresh to remove them from the current occupancy view.
Business Rules
The following rules are enforced by GymSys when managing access:- No remaining days → entry blocked. A member with
dias_restantes <= 0cannot be admitted. The Entrada button is rendered but disabled. - Entry deducts a day. Each successful call to
accesoApi.entrada()decrementsdias_restantesby one on the server. The updated value is returned in the response asdias_restantes_actualizados. - Mutual exclusivity of buttons. A member already marked
en_gimnasio = trueshows only the Salida button in search results; the Entrada button is not rendered. This prevents double-entry. - Occupancy is server-authoritative. The occupancy list is always fetched fresh from
GET /api/acceso/ocupacionafter every action, so it reflects the true server state rather than optimistic local updates.