Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt

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

Removes a user’s enrollment from a course by deleting the matching CursoUsuario junction record from the cursos_usuarios table. The service confirms the user exists in msvc-usuarios via OpenFeign (GET /{id}), then removes the corresponding CursoUsuario entry and saves the updated course. The Usuario record in msvc-usuarios is never affected — only the enrollment link is removed. This page also covers the companion endpoint DELETE /eliminar-curso-usuario/{id}, which deletes a CursoUsuario record directly by its own primary key and is intended for use by msvc-usuarios when a user account is deleted. No authentication is required for either endpoint.

Endpoint

DELETE http://localhost:8002/eliminar-usuario/{cursoId}
Via API Gateway:
DELETE http://localhost:8090/api/cursos/eliminar-usuario/{cursoId}

Path Parameters

cursoId
number
required
The primary key of the course from which the user will be unenrolled.

Request Body

Content-Type: application/json
id
number
required
The primary key of the user in msvc-usuarios whose enrollment should be removed.

Response

201 Created — The Usuario object returned by msvc-usuarios for the unenrolled user.
id
number
Primary key of the user in msvc-usuarios.
nombre
string
Full name of the unenrolled user.
email
string
Email address of the unenrolled user.
password
string
Hashed password as stored in msvc-usuarios.

404 Not Found — Returned when the Feign call to msvc-usuarios throws a FeignException (user not found or service unreachable), or when no course with cursoId exists.
mensaje
string
Error message prefixed with "No se pudo eliminar el usuarioo error en la comunicacion: " followed by the Feign exception message. Note: the string is produced by concatenating "No se pudo eliminar el usuario" and "o error en la comunicacion: " in the controller, resulting in a double-o and no space between usuario and o.

Examples

Request

curl -X DELETE http://localhost:8002/eliminar-usuario/1 \
  -H "Content-Type: application/json" \
  -d '{"id": 2}'

Response — 201 Created

{
  "id": 2,
  "nombre": "Carlos López",
  "email": "carlos@example.com",
  "password": "$2a$10$hashed..."
}

Response — 404 Not Found

{
  "mensaje": "No se pudo eliminar el usuarioo error en la comunicacion: [404 Not Found] during [GET] to [http://msvc-usuarios/2]"
}

Companion Endpoint — DELETE /eliminar-curso-usuario/{id} \

DELETE http://localhost:8002/eliminar-curso-usuario/{id}
Via API Gateway:
DELETE http://localhost:8090/api/cursos/eliminar-curso-usuario/{id}
Deletes a CursoUsuario record by its own junction table primary key (the id column in cursos_usuarios), rather than by user ID. This endpoint is designed for internal service-to-service use: when a user account is deleted in msvc-usuarios, that service calls this endpoint to clean up the corresponding enrollment record so no orphaned CursoUsuario rows remain.

Path Parameters

id
number
required
The primary key of the CursoUsuario record in the cursos_usuarios table.

Response

204 No Content — The junction record was deleted. No response body is returned.

Example

curl -X DELETE http://localhost:8002/eliminar-curso-usuario/5

The DELETE /eliminar-usuario/{cursoId} endpoint removes the enrollment using the user’s ID (sent in the request body), while DELETE /eliminar-curso-usuario/{id} removes a specific junction record using the CursoUsuario record’s own ID. Use the former when unenrolling a user through a UI flow; use the latter for internal cleanup triggered by user deletion in msvc-usuarios.

Build docs developers (and LLMs) love