Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CristianRR94/springCommunity/llms.txt
Use this file to discover all available pages before exploring further.
Evento is the gravitational centre of the Spring Community platform — it is the resource around which participants gather, administer, and communicate. Every feature in the system, from real-time chat to friend discovery, ultimately connects back to an event. This page covers the full lifecycle of an event: what data it holds, how privacy and visibility work, the distinction between participants and administrators, and exactly how to create, update, and delete events through the REST API.
Event Fields
The table below documents every field available on anEvento entity and its corresponding EventoDTO representation. When creating or updating an event, you supply these fields in the evento part of a multipart/form-data request body as a JSON object.
| Field | Type | Validation | Description |
|---|---|---|---|
id | Long | Read-only | Auto-generated primary key; present in responses, ignored on write. |
nombreEvento | String | Required, max 255 chars | The display name of the event. |
tipoEvento | String | Optional, max 255 chars | A category or type label (e.g., “Meetup”, “Workshop”, “Hackathon”). |
fechaEvento | LocalDate | Optional; must not be in the past | The date the event takes place. Validated by validarFecha() — a past date throws EventoValidatorException. |
informacion | String | Optional | Free-text description, agenda, or notes for the event. |
chat | String | Optional | An optional free-text channel identifier stored alongside the event. |
imagenEvento | String | Read-only (set by server) | The filename of the uploaded event image. Populated after a successful image upload; clients should not send this field. |
privado | boolean | Optional, default false | When true, the event is private — only invited/added participants can see or join it. |
oculto | boolean | Optional, default false | When true, the event is hidden from public listings. |
maxNumParticipantes | int | 0–255, default 255 | The maximum number of participants allowed. 0 means no participants beyond the creator; 255 is effectively unlimited. |
participantesEvento | List<Long> | Read-only in responses | IDs of all participants currently joined to the event. |
administradores | List<Long> | Read-only in responses | IDs of all participants who hold admin rights for this event. |
fechaEvento is validated on both create and update. Submitting a date that falls before today will result in an error response from the validarFecha() domain method. Omitting the field entirely is allowed — the event will have no scheduled date.Privacy and Visibility
Spring Community provides two independent boolean flags to control how an event appears to other users:privado
A private event is not open to the public. Non-participants cannot request to join by browsing, and the event will not appear in open discovery feeds. Participants can only be added explicitly by an administrator.
oculto
A hidden event does not appear in the public event listing (
GET /api/eventos) at all. It is invisible to users who are not already participants. This is stronger than privado — useful for internal or invite-only gatherings.privado | oculto | Behaviour |
|---|---|---|
false | false | Public — listed and joinable by anyone. |
true | false | Listed but restricted — visible in search, join requires admin approval. |
false | true | Hidden — does not appear in listings; existing participants can still access it. |
true | true | Fully private and hidden — only reachable if you already know the event ID. |
Roles: Participants and Administrators
Every event has two distinct membership tiers managed through separate join tables.Participant
A participant is any community member who has joined the event. They can view event details, access the event chat, and interact with other participants. Participants are tracked in the
evento_participantes join table.Administrator
An administrator is a participant who also has management rights over the event. Admins can update event details, manage the participant list, and promote other participants to admin. Administrators are tracked in the
evento_administradores join table.-
Creator is auto-admin: When an event is created, the authenticated participant is automatically added to both sets via
addCreadorComoAdmin(). This means the creator is simultaneously a participant and an administrator from the moment the event is persisted. -
Only participants can become admins: The
addAdministrador()domain method first checks that the target participant is already inparticipantesEvento. If the participant has not joined the event, aParticipanteExceptionis thrown and the promotion is rejected.
Creating an Event
Events are created with aPOST to /api/eventos. The request must use multipart/form-data with two named parts:
evento(required) — a JSON-encodedEventoDTObody.image(optional) — a binary image file. If omitted, the event will have no cover image.
Compose the event JSON
Build the
EventoDTO payload with at minimum nombreEvento. All other fields are optional.Send the multipart request
Attach the JSON as the
evento part and optionally include an image file as the image part.Updating an Event
To update an existing event send aPUT to /api/eventos/modificar/{id} using the same multipart/form-data structure as creation. The service layer calls the domain method actualizarEvento(), which replaces the following fields atomically and re-runs validarFecha() to ensure the updated date is not in the past:
nombreEventotipoEventofechaEventoinformacionprivadoocultomaxNumParticipantes
Image Uploads
Event images are stored on the server’s filesystem under theimages/eventos/ directory. The following rules apply:
- The
imagepart is optional on bothPOST(create) andPUT(update). - Spring Boot’s default multipart upload limit is 5 MB per request. Attempting to upload a file larger than this will be rejected.
- The server determines the stored filename and writes it back to
imagenEventoin the response. Clients should not hard-code or assume filenames. - To serve the image to a browser, request it from the static resource path:
GET /images/eventos/{imagenEvento}.
Deleting an Event
Send aDELETE to /api/eventos/delete/{id} to remove an event. This is a hard delete — the event record and its join-table entries are removed from the database.
Listing Events
GET /api/eventos
Returns all events as a list of
EventoPrincipalDTO — the lightweight summary projection containing only id, nombreEvento, tipoEvento, fechaEvento, and imagenEvento. Use this endpoint to build dashboard feeds and event browsers.GET /api/eventos/mis-eventos
Returns only the events the authenticated user’s participant has joined, also as a list of
EventoPrincipalDTO. Requires a valid Authorization header.GET /api/eventos/{id}, which returns a complete EventoDTO.