Skip to content

Data Models

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.
  • token is used for confirmation and password reset flows.

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 timestams misspelled, so no timestamps are created.