Doctors in MELIKA do not self-register. An administrator creates each doctor account and the platform delivers an invitation email containing a one-time activation token. Once activated, the doctor gains access to a dedicated dashboard where they can configure their weekly availability, track their daily agenda, and build a longitudinal clinical record for every patient they treat.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Imjuanisss/proyecto-melika/llms.txt
Use this file to discover all available pages before exploring further.
Account Activation
Admin creates the doctor
An administrator fills in the doctor’s profile and submits a
POST /medicos request. MELIKA stores the record and immediately dispatches an invitation email to the doctor’s address containing a unique activation token. The account is created in an inactive (activo = FALSE, verificado = FALSE) state.Doctor clicks the activation link
The invitation email contains a link that embeds the activation token. Clicking it opens the MELIKA password-setup screen at
/activar-cuenta?token=<token> in the browser. The token expires after 72 hours. If the doctor does not activate in time, an administrator must issue a new invitation.Doctor sets their password
The activation form sends a The body field is
POST to /medicos/activar with the token and the chosen password:nueva_password (not password). The password must be at least 6 characters long. On success, the account is set to activo = TRUE and verificado = TRUE, the token is marked as used, and the doctor can log in.Activation tokens are single-use. Once the token has been consumed or has expired, it cannot be reused. An administrator must create a new invitation from the admin panel.
Doctor Profile
Each doctor’s profile is accessible viaGET /medico/perfil. The response joins the medicos record with the linked usuario and especialidad rows, exposing the following fields:
| Field | Type | Description |
|---|---|---|
id_especialidad | integer | Linked medical specialty |
numero_registro | string | Professional registration number |
tarifa | decimal | Consultation fee |
calificacion | decimal | Average rating from patients |
acepta_teleconsulta | boolean | Whether remote consultations are offered |
acepta_presencial | boolean | Whether in-person consultations are offered |
biografia | text | Short professional biography |
anos_experiencia | integer | Years of clinical experience |
Schedule Management
Doctors control their own availability by creating and managing time slots (franjas). Each slot is exactly 40 minutes long. Patients can only book appointments into slots that are marked as available (disponible = true).
Creating Slots
ThePOST /medico/franjas endpoint generates all 40-minute slots for a given date range automatically, with an optional break window:
id_medico field should be included in the body. MELIKA generates consecutive 40-minute windows from hora_inicio to hora_fin, skipping any window that overlaps the inicio_descanso–fin_descanso range. Duplicate slots (same doctor, date, and hora_inicio) are silently skipped.
The response includes insertadas (slots newly created) and duplicadas (slots that already existed):
Listing Slots by Date
disponible status and any linked appointment ID (cita_id).
Editing a Slot
Only slots without an active appointment (disponible = true) can be edited. The request body must include fecha, hora_inicio, and hora_fin:
Deleting a Slot
disponible = true (i.e., the slot is free). Slots with a confirmed or pending appointment return a 400 error and cannot be removed.
Daily and Range Agenda
- Daily Agenda
- Range Agenda
Retrieves every appointment for a single date — ideal for the doctor’s daily schedule view.The response lists appointments in chronological order with patient name and surname, appointment status, consultation type (
presencial / teleconsulta), and a reference to the linked clinical history record (historia_id) if one exists.Managing Appointment Outcomes
After a scheduled appointment time passes, the doctor records its outcome via:estado field accepts exactly two values:
| Value | Meaning |
|---|---|
completada | The patient attended and the consultation was carried out |
no_asistio | The patient did not attend |
notas_medicas field is optional. Cancelled appointments (estado = 'cancelada') cannot be managed through this endpoint and return a 400 error. Setting the outcome to completada unlocks the clinical record creation form for that appointment.
Clinical Records
Doctors create and maintain structured clinical histories linked to specific appointments.- Create Record
- Update Record
- Add Clarification
Once an appointment is marked
completada, the doctor can create the initial clinical record:Dashboard and Route Guard
The doctor dashboard is served at/dashboard-medico. The RutaMedico guard in App.jsx verifies that the JWT rol claim equals medico before rendering any nested route. Patients or administrators hitting a doctor-only route are redirected to their respective dashboards.