Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/GuillermoNavarro/Proyecto_comunidades/llms.txt

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

The Movements API provides a complete ledger of all financial activity within a community. Each entry is classified as either an income (INGRESO) or an expense (GASTO). Movements linked to a paid receipt are generated automatically by the system when a fee is settled; manual movements are created by admins to record community expenses such as maintenance or repairs.

Data model

id
Long
Auto-generated primary key for the movement record.
nombre
String
A human-readable label describing the movement (e.g. "Reparacion ascensor").
comunidad
Comunidad object
The community this movement belongs to. Auto-populated from the JWT — do not send this field manually when creating a movement.
usuario
Usuario object | null
The resident linked to this movement. Present on income entries generated from fee receipts; null for manual expense movements.
fecha
String (YYYY-MM-DD)
The date the movement occurred, in ISO-8601 date format.
importe
BigDecimal
The monetary amount of the movement. Always a positive value regardless of type.
tipo
TipoMovimiento enum
The direction of the movement. Must be one of:
ValueMeaning
GASTOAn outgoing expense (e.g. repairs, services)
INGRESOAn incoming payment (e.g. fee receipt paid by a resident)
recibo
Recibo object | null
The receipt that triggered this movement. Only present on automatically generated income entries; null for manually created movements.

Endpoints

GET /api/movimientos

Returns every movement stored in the database, across all communities.
Required role: SUPER_ADMIN
This endpoint is intended for platform-level oversight only. The response is an unfiltered list of all Movimiento records. Response
body
List<Movimiento>
A flat array of all movement objects in the system.
curl -X GET http://localhost:8081/api/movimientos \
  -H 'Authorization: Bearer <token>'

GET /api/movimientos/comunidad

Returns all movements that belong to the authenticated user’s community, as encoded in the JWT.
Required role: USER or ADMIN
The community is resolved automatically from the bearer token — no query parameter is needed. Response
body
List<Movimiento>
All movement records scoped to the caller’s community.
curl -X GET http://localhost:8081/api/movimientos/comunidad \
  -H 'Authorization: Bearer <token>'

GET /api/movimientos/me

Returns only the movements associated with the authenticated user’s own account.
Required role: USER or ADMIN
Useful for residents who want to review their own payment history. The user ID is extracted from the JWT — no path or query parameter is required. Response
body
List<Movimiento>
Movements where the usuario field matches the authenticated user’s ID.
curl -X GET http://localhost:8081/api/movimientos/me \
  -H 'Authorization: Bearer <token>'

GET /api/movimientos/{idMovimiento}

Returns a single movement by its ID, enforcing a community ownership check.
Required role: ADMIN
If the requested movement exists but belongs to a different community than the one encoded in the admin’s JWT, the API returns 403 Forbidden. This prevents cross-community data leakage at the admin level. Path parameters
idMovimiento
Long
required
The numeric ID of the movement to retrieve.
Response codes
CodeMeaning
200 OKMovement found and belongs to the admin’s community
403 ForbiddenMovement exists but belongs to a different community
404 Not FoundNo movement found with the given ID
curl -X GET http://localhost:8081/api/movimientos/9 \
  -H 'Authorization: Bearer <token>'

POST /api/movimientos

Creates a new manual movement record for the admin’s community.
Required role: ADMIN or SUPER_ADMIN
The comunidad field is automatically set from the JWT token and must not be included in the request body. Only provide nombre, fecha, importe, and tipo.
Use this endpoint to record outgoing expenses such as maintenance contracts, repairs, or utility bills. Income movements linked to fee receipts are created automatically by the system when a resident pays their fee — you do not need to create those manually.
Request bodyapplication/json
nombre
String
required
A descriptive label for the movement, e.g. "Reparacion ascensor".
fecha
String
required
The movement date in YYYY-MM-DD format.
importe
Number
required
The monetary amount. Use a positive decimal value.
tipo
String
required
The movement type. Must be exactly GASTO or INGRESO.
usuario
Object
Optional. An object containing id (Long) if the movement should be linked to a specific resident. Omit for community-wide expenses.
Response
body
Movimiento
The full persisted movement object, including the auto-assigned id and resolved comunidad.
curl -X POST http://localhost:8081/api/movimientos \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"nombre":"Reparacion ascensor","fecha":"2025-03-15","importe":450.00,"tipo":"GASTO"}'

Build docs developers (and LLMs) love