Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/azahel79/Spartans-gym/llms.txt

Use this file to discover all available pages before exploring further.

The Reception panel is designed to be the first screen staff open each morning and the last they close at night. It provides a single, focused workspace for every task that happens at the front desk: checking members in, processing membership renewals, enrolling new clients, and keeping an eye on who has already come through the door today.

Layout Overview

The panel is divided into two main columns:
  • Left column — the selected client’s profile card, action buttons, and three quick-stat tiles.
  • Right column — the live attendance sidebar showing every check-in from the current day.
A Nuevo Cliente button and the current date are anchored in the page header for constant visibility.

Client Profile Card

When a member is selected from the attendance sidebar, their full profile card renders in the left column with the following information:

Photo

Profile photo loaded from fotoUrl. Falls back to a placeholder gym image if no photo has been uploaded.

Name & Status

Full name (nombre apellidos), coloured status badge (ACTIVO / VENCIDO / PENDIENTE), and the active plan name.

Days Remaining

A large red counter showing the number of days left on the current membership. Turns into a pulsing warning banner when 5 or fewer days remain.

Last Visit & Expiry

Two data tiles: Última visita (time in HH:MM AM/PM) and Vencimiento (expiry date formatted from ISO string).
If no client has been selected yet, the card shows a placeholder with the message “Selecciona un socio” and a gym icon.

Check-In Workflow

1

Select a client

Click any row in the Asistencia Reciente sidebar. The client’s profile card populates immediately in the left column.
2

Verify membership status

Confirm the status badge reads ACTIVO and that the days-remaining counter is greater than zero. If the membership is expired, the attendance button is disabled and labelled MEMBRESÍA VENCIDA.
3

Check for duplicate attendance

If the client has already been checked in today, the button turns green and reads ASISTENCIA REGISTRADA. No further action is needed.
4

Register attendance

Click REGISTRAR ASISTENCIA. The frontend calls POST /api/clients/:id/attendance. On success, the client’s ultimaVisita and attendanceDate fields are updated in real time and the client moves to the top of the sidebar list.

Attendance Validation Rules

The backend enforces two hard blocks before recording attendance:
  1. Expired membership — if vencimiento is earlier than today (date-only comparison, time ignored), the server returns HTTP 403 with the error "Membresía vencida".
  2. Already checked in today — the server checks both the attendances table and the attendanceDate field on the client record. If a match is found for the current calendar date, it returns HTTP 400 with "El cliente ya registró asistencia hoy".
The frontend also validates duplicate attendance before making the API call. However, the backend guard is authoritative — do not rely solely on client-side checks.

Membership Renewal

The Renovar Plan button opens the ModalRenew dialog. It is enabled only when a client is selected and their plan is eligible for renewal. Inside the modal, staff can:
  • Select the new plan from a dropdown populated with active plans from the database.
  • See the total amount to charge, auto-calculated from the plan price.
  • Choose a payment method: Efectivo or Tarjeta.
  • Submit with Confirmar Renovación, which calls POST /api/clients/:id/renew.
The renewal extension date is calculated server-side. If the current expiry date is still in the future, the new period starts from the existing expiry date. If the membership has already lapsed, it starts from today. See the Memberships page for full renewal logic.

Enrolling a New Client

Clicking Nuevo Cliente in the page header opens the ModalInscription dialog. Staff fill in:
  • Personal info — nombre, apellidos, género, teléfono.
  • Plan & payment — plan selection from active plans (price shown inline), payment method toggle (Efectivo / Tarjeta), and a “Total a Pagar” confirmation display.
Submitting the form calls POST /api/clients, creates the client record with status ACTIVO, and calculates the expiry date automatically from the selected plan’s period. The new client appears at the top of the client list immediately.

Quick Stats Row

Three stat tiles below the client card give a real-time pulse on the day’s activity:
TileWhat it counts
Socios hoyNumber of distinct clients whose attendanceDate matches today’s local date.
RenovacionesNumber of membership renewals processed today (from the renovacionesHoyCount value).
Por vencerNumber of active clients with a membership expiring within the next 5 days (expiringSoonCount).

Live Attendance Sidebar

The right-side panel lists every client who has checked in today, sorted by ultimaVisita descending (most recent at top). The list is labelled En vivo with a pulsing green badge. Each row shows:
  • Circular avatar (photo or placeholder).
  • Full name and plan + payment method.
  • Check-in time and a green check_circle icon.
Clicking a row selects that client and loads their profile in the main card. The currently selected row is highlighted with a subtle red tint border.
The sidebar list re-computes from the client store every time a new attendance is registered, so there is no need to manually refresh the page between check-ins.

Build docs developers (and LLMs) love