Every financial event in Spartans Gym creates a transaction record — whether a client renews their membership or a product is sold at the counter. The History screen surfaces these records in a filterable, paginated list and lets you export the current view to a CSV file for external reporting. Two distinct transaction types keep membership income and retail revenue clearly separated.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.
Transaction Types
MEMBRESIA
Recorded when a client pays for a membership plan — either on registration or at renewal. The transaction is linked to the client via
clienteId and uses the client’s name and surname.PRODUCTO
Recorded when a sale is finalized from the Point of Sale screen. The
concepto field is built automatically from the purchased product names and quantities.MEMBRESIA transactions are created automatically by the system when a new client is registered or an existing client renews their plan. You do not need to create them manually from the History view.
Transaction Data Model
| Field | Type | Description |
|---|---|---|
id | Int | Auto-incremented primary key |
fecha | String | Formatted date string, e.g. "15 ene. 2025" |
hora | String | Time in 12-hour format, e.g. "10:30 AM" |
nombre | String | First name of the client or "Venta" for POS sales with no linked client |
apellidos | String | Last name or "Mostrador" for POS sales |
clienteId | String? | UUID of the linked client, or null for product sales |
concepto | String | Description — product names for PRODUCTO, plan name for MEMBRESIA |
monto | Decimal(10,2) | Amount charged in MXN |
metodo | PaymentMethod | Efectivo, Tarjeta, or Transferencia |
tipo | TransactionType | MEMBRESIA or PRODUCTO |
createdAt | DateTime | UTC timestamp used for date filtering |
Viewing Transactions
The History view is split into three tabs: PLANES (MEMBRESIA transactions), PUNTO DE VENTA (PRODUCTO transactions), and ASISTENCIAS (attendance records). Only the first two tabs display transaction data; the Asistencias tab is separate. Transactions are paginated at 10 items per page. Each row shows the date, time, client name (PLANES only), concept, payment method, and amount. An individual receipt can be reprinted by clicking the ticket icon on any row.Fetching Transactions
The frontend fetchesGET /api/transactions and passes filters as query parameters:
| Parameter | Format | Description |
|---|---|---|
tipo | MEMBRESIA | PRODUCTO | Filter by transaction type |
metodo | Efectivo | Tarjeta | Transferencia | Filter by payment method |
fechaInicio | YYYY-MM-DD | Start of the date range (inclusive) |
fechaFin | YYYY-MM-DD | End of the date range (inclusive) |
GET /api/transactions/history returns the last 100 records with no filters applied — useful for a quick audit of recent activity.
Date filtering uses the Mexico City timezone (UTC−6). When
fechaInicio=2025-01-15 is provided, the backend converts it to 2025-01-15T06:00:00Z – 2025-01-16T05:59:59.999Z in UTC before querying createdAt. This ensures that transactions recorded during Mexican business hours always fall on the correct calendar day.Filters and Date Presets
The filter bar above the transaction table includes quick-select date presets and granular controls:Date Presets
Date Presets
- Hoy — current calendar day
- Ayer — previous calendar day
- 7 días — last seven days including today
- Mes — from the first of the current month to today
- Todos — clears date filters and loads all available transactions
Payment Method Filter
Payment Method Filter
A dropdown with options Todos, Efectivo, Tarjeta, and Transferencia. Filtering is applied client-side after the transactions are fetched from the API.
Category / Plan Filter
Category / Plan Filter
In the PLANES tab this dropdown lets you narrow results to a specific plan type: Mensual, Trimestral, Semestral, or Anual. In the PUNTO DE VENTA tab it filters by product category keyword found in the
concepto field: Suplementos, Bebidas, Snacks, Merchandising, or Accesorios.Search
Search
A free-text field that matches against the client’s
nombre, apellidos, and concepto fields simultaneously (case-insensitive).Creating a Transaction
SendPOST /api/transactions with a JSON body. The required fields differ by type:
- PRODUCTO (POS sale)
- MEMBRESIA (membership payment)
stock for each item, and builds the concepto string automatically — e.g., "Whey Protein, Agua 600ml (x2)". The nombre and apellidos fields are set to "Venta" and "Mostrador" respectively since no client is linked.CSV Export
Clicking Exportar CSV downloads a file containing every transaction currently visible after filters are applied. The exported file respects whatever date range, payment method, category, and search term are active at the time of the click. The CSV columns for transaction exports are:historial_planes_2025-01-01_2025-01-31.csv
or
historial_punto_de_venta_2025-01-15_2025-01-15.csv
The file is UTF-8 encoded with a BOM so it opens correctly in Excel and Google Sheets without garbled special characters.
Summary Bar
Below the transaction table a summary bar shows:- Filtered record count — number of transactions matching the current filters
- Total loaded — total number of transactions returned by the last API call
- Ingresos del Filtro — sum of
montoacross all filtered transactions (not just the current page), displayed prominently so staff can quickly total revenue for any period