Data Models
Veterinario
Section titled “Veterinario”Mongoose model: models/Veterinario.js.
{ "nombre": "string (required)", "password": "string (required, hashed with bcrypt on save)", "email": "string (required, unique, trimmed)", "telefono": "string (optional, default null)", "web": "string (optional, default null)", "token": "string (default generarID())", "confirmado": "boolean (default false)"}Notes:
- Passwords are hashed with bcrypt before save.
tokenis used for confirmation and password reset flows.
Paciente
Section titled “Paciente”Mongoose model: models/Paciente.js.
{ "nombre": "string (required)", "propietario": "string (required)", "email": "string (required)", "fecha": "date (required, default Date.now())", "sintomas": "string (required)", "veterinario": "ObjectId (ref Veterinario)"}Notes:
- Paciente documents are always associated with the authenticated veterinarian.
- The schema has
timestamsmisspelled, so no timestamps are created.