Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Distribuidos-Org/ms-alumnos/llms.txt

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

Send a find_one_alumno message to retrieve a single student record by its primary key. The controller extracts the id field from the payload using NestJS ParseIntPipe, then delegates to the service which queries by alumnoId. If no matching record exists, the service throws an RpcException with HTTP status 404.

Message pattern

{ "cmd": "find_one_alumno" }

Request payload

id
number
required
The numeric alumnoId of the student to retrieve. Must be a positive integer.

Response

The full Alumno entity for the matching record.
alumnoId
number
Primary key of the student record.
nombre
string
First name of the student.
apellidoPaterno
string
Paternal surname.
apellidoMaterno
string
Maternal surname. May be null if not provided at creation.
dni
string
National ID number (8 characters).
edad
number
Age of the student. May be null if not provided.
email
string
Email address.
celular
string
Phone number. May be null if not provided.
universidad
string
University name.
facultad
string
Faculty or school name. May be null if not provided.
profesion
string
Profession. May be null if not provided.
grado
string
Academic degree. May be null if not provided.
egresadoLocal
boolean
Whether the student graduated locally.
The response includes a contrasena field containing the bcrypt hash of the student’s password. Callers should discard or ignore this field; never display or forward the hash to end users.

Example

import { connect, JSONCodec } from 'nats';

const nc = await connect({ servers: 'nats://localhost:4222' });
const jc = JSONCodec();

const res = await nc.request(
  'find_one_alumno',
  jc.encode({ id: 1 }),
  { timeout: 5000 }
);

console.log(jc.decode(res.data));
await nc.drain();

Errors

StatusCause
404No alumno exists with the given id. The exception payload is { "status": 404, "message": "Alumno #1 not found" } (where 1 is the requested ID).
400The id field is missing or cannot be parsed as a valid integer by ParseIntPipe.

Build docs developers (and LLMs) love