The announcements module gives each community a news board (tablón de noticias) where ADMINs can post updates, notices, and important information for all residents. Every post is scoped to a single community, stored as aDocumentation 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.
Publicacion record, and presented in reverse-chronological order in the frontend’s NoticePage. Residents (USER role) can read all posts but cannot create, edit, or delete them.
Post Types
TheTipoPublicacion enum currently defines two values:
| Value | Status | Description |
|---|---|---|
NOTICIA | Active | General news and announcements. This is the type used by all current API endpoints under /api/publicaciones/noticias. |
INCIDENCIA | Reserved | Incident / maintenance request type. Defined in the enum but not yet exposed through dedicated endpoints in the current version. |
All endpoints described in this page operate exclusively on publications of type
NOTICIA. The tipo field is set automatically by the backend and does not need to be included in the request body.The Publicacion Entity
| Field | Column | Type | Description |
|---|---|---|---|
id | id_publicacion | Long (auto) | Primary key |
tipo | tipo | TipoPublicacion enum | NOTICIA or INCIDENCIA |
titulo | titulo | String | Post headline |
descripcion | descripcion | String | Post body / content |
imagen | imagen | String | Optional image filename (stored relative path) |
usuario | id_usuario (FK) | Usuario | Author — set automatically from the JWT, never from the request body |
comunidad | id_comunidad (FK) | Comunidad | The community this post belongs to — set from the JWT |
documento | id_documento (FK, nullable) | Documento | Optional attached community document |
fechaCreacion | fecha_creacion | LocalDateTime | Auto-set by the database on insert; not updatable |
fechaFin | fecha_completado | LocalDateTime | Optional end/resolution date |
estado | estado | boolean | true = active, false = archived |
moderado | moderado | boolean | Moderation flag (default false) |
Creating a News Post
usuario (author) and comunidad fields are resolved automatically from the JWT and set by the backend. Do not include them in the request body. The tipo is also hardcoded to NOTICIA by the service layer.
Request body:
Reading News Posts
NOTICIA publications for the authenticated user’s community, scoped automatically by the JWT’s community claim. Available to both USER and ADMIN. The frontend sorts the list by fechaCreacion descending so the newest post always appears first.
Updating a Post
ADMIN. Replaces the updatable fields of the post. Returns the updated Publicacion object, or 404 if the ID does not exist.
Deleting a Post
200 OK with "eliminado" on success, or 404 if not found. Restricted to ADMIN.
Workflow Summary
ADMIN composes the post
The ADMIN writes the
titulo and descripcion in the Nueva Noticia modal on the NoticePage. An optional document attachment and image can also be linked.Backend resolves author and community
On
POST api/publicaciones/noticias, the controller extracts idComunidad and idUsuario from the JWT and sets them on the Publicacion entity. The request body only needs to contain the content fields.Post appears on the news board
The new post is immediately returned in
GET api/publicaciones/noticias for all community members. The frontend renders each post using the AnuncioCard component, showing title, description, author name, creation date, and any attached document.Access Control Summary
| Action | USER | ADMIN | SUPER_ADMIN |
|---|---|---|---|
| Read news posts | ✅ | ✅ | — |
| Create a news post | — | ✅ | — |
| Update a news post | — | ✅ | — |
| Delete a news post | — | ✅ | — |
The data model also includes a
Comentario entity mapped to a comentarios table. It links a Publicacion to a Usuario and stores a texto, imagen, fecha, and a moderado flag. Comment thread functionality is not yet exposed through any API endpoint in the current version — it is reserved for a future feature release.