Skip to main content

Documentation 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.

The /api/clientes resource manages gym member records. Each client stores personal details, their enrollment date, gender, and a running count of membership days remaining (dias_restantes). The en_gimnasio flag is toggled automatically by the Access API when a member enters or exits the gym.

GET /api/clientes

Returns an array of all registered clients.

Response fields

id
number
Unique identifier for the client, assigned by the database.
nombres
string
Full name of the client.
identificacion
string
National ID or document number of the client.
celular
string
Mobile phone number of the client.
fecha_inscripcion
string
Enrollment date in ISO 8601 format (e.g. 2024-01-15).
genero
string
Gender of the client. One of Masculino, Femenino, or Otro.
dias_restantes
number
Number of membership days the client still has available.
en_gimnasio
boolean
true if the client is currently inside the gym; false otherwise.

Example request

curl http://localhost:3001/api/clientes

Example response

[
  {
    "id": 1,
    "nombres": "Juan Pérez",
    "identificacion": "1234567890",
    "celular": "3001234567",
    "fecha_inscripcion": "2024-01-15",
    "genero": "Masculino",
    "dias_restantes": 22,
    "en_gimnasio": false
  }
]

GET /api/clientes/:id

Returns a single client by their unique ID.

Path parameters

id
number
required
The unique identifier of the client to retrieve.

Response fields

Same fields as the array items returned by GET /api/clientes above.

Example request

curl http://localhost:3001/api/clientes/1

Example response

{
  "id": 1,
  "nombres": "Juan Pérez",
  "identificacion": "1234567890",
  "celular": "3001234567",
  "fecha_inscripcion": "2024-01-15",
  "genero": "Masculino",
  "dias_restantes": 22,
  "en_gimnasio": false
}

POST /api/clientes

Creates a new client record.

Request body

nombres
string
required
Full name of the client (e.g. "Juan Pérez").
identificacion
string
required
National ID or document number (e.g. "1234567890").
celular
string
required
Mobile phone number (e.g. "3001234567").
fecha_inscripcion
string
required
Enrollment date in ISO 8601 format (YYYY-MM-DD).
genero
string
required
Gender of the client. Must be one of Masculino, Femenino, or Otro.

Response fields

The created client object, including the newly assigned id.

Example request

curl -X POST http://localhost:3001/api/clientes \
  -H 'Content-Type: application/json' \
  -d '{
    "nombres": "Juan Pérez",
    "identificacion": "1234567890",
    "celular": "3001234567",
    "fecha_inscripcion": "2024-01-15",
    "genero": "Masculino"
  }'

Example response

{
  "id": 7,
  "nombres": "Juan Pérez",
  "identificacion": "1234567890",
  "celular": "3001234567",
  "fecha_inscripcion": "2024-01-15",
  "genero": "Masculino",
  "dias_restantes": 0,
  "en_gimnasio": false
}

PUT /api/clientes/:id

Updates an existing client record. All body fields are replaced with the supplied values.

Path parameters

id
number
required
The unique identifier of the client to update.

Request body

nombres
string
required
Updated full name of the client.
identificacion
string
required
Updated national ID or document number.
celular
string
required
Updated mobile phone number.
fecha_inscripcion
string
required
Updated enrollment date in ISO 8601 format (YYYY-MM-DD).
genero
string
required
Updated gender. Must be one of Masculino, Femenino, or Otro.

Response fields

The full updated client object reflecting the new values.

Example request

curl -X PUT http://localhost:3001/api/clientes/7 \
  -H 'Content-Type: application/json' \
  -d '{
    "nombres": "Juan Carlos Pérez",
    "identificacion": "1234567890",
    "celular": "3009876543",
    "fecha_inscripcion": "2024-01-15",
    "genero": "Masculino"
  }'

Example response

{
  "id": 7,
  "nombres": "Juan Carlos Pérez",
  "identificacion": "1234567890",
  "celular": "3009876543",
  "fecha_inscripcion": "2024-01-15",
  "genero": "Masculino",
  "dias_restantes": 0,
  "en_gimnasio": false
}

DELETE /api/clientes/:id

Permanently removes a client record from the system.
Deletion is permanent and cannot be undone. All associated payment and access history records for this client may also be removed, depending on the database cascade configuration. Verify this behaviour in your backend before deleting clients in production.

Path parameters

id
number
required
The unique identifier of the client to delete.

Response

Returns HTTP 200 OK on success. Returns an error object (e.g. { "error": "Cliente no encontrado" }) with a non-2xx status code if the client does not exist.

Example request

curl -X DELETE http://localhost:3001/api/clientes/7

Build docs developers (and LLMs) love