Send aDocumentation 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.
create_alumno message to register a new student in the system. The service validates all fields using class-validator, hashes the plaintext password with bcrypt (10 rounds) via a TypeORM @BeforeInsert() hook, and then persists the record to the alumnos PostgreSQL table. Both dni and email must be unique across all records.
Message pattern
Request payload
First name of the student. Minimum 2 characters, maximum 50 characters.
Paternal surname. Minimum 2 characters, maximum 50 characters.
Maternal surname. Optional. Maximum 50 characters.
National ID number. Must be exactly 8 characters. Must be unique across all student records.
Age of the student. Optional. Must be an integer.
Email address. Must be a valid email format. Maximum 100 characters. Must be unique across all student records.
Phone number. Optional. Maximum 15 characters.
University name. Optional. Maximum 100 characters. Defaults to
'UNMSM' if omitted.Faculty or school name. Optional. Maximum 100 characters.
Profession. Optional. Maximum 50 characters.
Academic degree. Optional. Maximum 50 characters.
Whether the student graduated from a local institution. Optional. Defaults to
true.Password in plaintext. Minimum 6 characters, maximum 60 characters. This value is hashed with bcrypt before storage — the plaintext is never persisted.
Response
The fullAlumno entity is returned after a successful insert.
Auto-generated primary key for the newly created student record.
First name of the student.
Paternal surname.
Maternal surname. May be
null if not provided.National ID number (8 characters).
Age of the student. May be
null if not provided.Email address.
Phone number. May be
null if not provided.University name. Defaults to
'UNMSM'.Faculty or school name. May be
null if not provided.Profession. May be
null if not provided.Academic degree. May be
null if not provided.Whether the student graduated locally. Defaults to
true.The
contrasena field is present in the returned entity object, but its value is the bcrypt hash — not the original plaintext. Callers should discard or ignore this field; never display or forward the hash to end users.Example
Errors
| Status | Cause |
|---|---|
400 | Validation failed — a required field is missing, a field exceeds its length constraint, email is not a valid email address, dni is not exactly 8 characters, or contrasena is shorter than 6 characters. |
400 | Unique constraint violation — the supplied dni or email already exists in the database. |
The
contrasena field is hashed with bcrypt (10 rounds) via a TypeORM @BeforeInsert() hook before the record is saved. The plaintext password is never stored.