Skip to main content

Overview

The Clase (Class) model represents scheduled riding lessons at the equestrian school. Classes connect students, instructors, and horses for a specific time slot and specialty.

Data Model

id
number
required
Unique identifier for the class
especialidad
EspecialidadClase
required
Type of riding class specialtyPossible values:
  • "EQUITACION" - Regular riding class
  • "ADIESTRAMIENTO" - Horse training class
  • "EQUINOTERAPIA" - Equine therapy class
  • "MONTA" - Free riding (automatically assigns placeholder student ID 1)
See Specialties for more details.
dia
string
required
Date of the class in ISO format (yyyy-MM-dd)Example: "2024-03-15"
hora
string
required
Start time of the class in 24-hour format (HH:mm)Example: "14:30"Constraint: Classes cannot end after 18:30
duracion
number
required
Duration of the class in minutesValid values: 30 or 60Default: 30
estado
EstadoClase
required
Current state of the classPossible values:
  • "PROGRAMADA" - Scheduled, pending
  • "INICIADA" - In progress
  • "COMPLETADA" - Finished successfully
  • "CANCELADA" - Cancelled
  • "ACA" - Absence with notice (student notified they won’t attend)
  • "ASA" - Absence without notice (student didn’t show up)
Default: "PROGRAMADA"See Class States for more details.
observaciones
string
Optional notes or comments about the class
alumnoId
number | null
required
ID of the student attending the classSet to null for trial classes with new people (uses personaPruebaId instead)Note: For specialty "MONTA", this is automatically set to ID 1 (placeholder student)
personaPruebaId
number | null
ID of the trial person (for trial classes with new individuals)Only used when esPrueba: true and the person is not a registered student
instructorId
number
required
ID of the instructor teaching the class
caballoId
number
required
ID of the horse used in the class
diaHoraCompleto
string
Computed field combining date and timeExample: "2024-03-15T14:30:00"
esPrueba
boolean
Indicates if this is a trial classDefault: falseTrial class rules:
  • Does not count toward the student’s monthly quota
  • Only available for inactive students or new people
  • Cannot be repeated for the same specialty
  • Identified with 🎓 emoji and orange border in calendar
personaPruebaNombre
string | null
First name of trial person (when esPrueba: true and person is not a registered student)
personaPruebaApellido
string | null
Last name of trial person (when esPrueba: true and person is not a registered student)
personaPruebaNombreCompleto
string | null
Computed full name of trial personExample: "María González"

Extended Model: ClaseDetallada

The ClaseDetallada interface extends Clase with populated references:
alumno
Alumno
Full student object (expanded from alumnoId)
personaPrueba
PersonaPrueba
Full trial person object (expanded from personaPruebaId)
instructor
Instructor
Full instructor object (expanded from instructorId)
caballo
Caballo
Full horse object (expanded from caballoId)

Example

Regular Class

{
  "id": 456,
  "especialidad": "EQUITACION",
  "dia": "2024-03-15",
  "hora": "14:30",
  "duracion": 60,
  "estado": "PROGRAMADA",
  "observaciones": "First class of the month",
  "alumnoId": 123,
  "personaPruebaId": null,
  "instructorId": 5,
  "caballoId": 12,
  "diaHoraCompleto": "2024-03-15T14:30:00",
  "esPrueba": false,
  "personaPruebaNombre": null,
  "personaPruebaApellido": null,
  "personaPruebaNombreCompleto": null
}

Trial Class

{
  "id": 457,
  "especialidad": "EQUITACION",
  "dia": "2024-03-16",
  "hora": "10:00",
  "duracion": 30,
  "estado": "PROGRAMADA",
  "observaciones": "Trial class for new person",
  "alumnoId": null,
  "personaPruebaId": 78,
  "instructorId": 5,
  "caballoId": 12,
  "diaHoraCompleto": "2024-03-16T10:00:00",
  "esPrueba": true,
  "personaPruebaNombre": "Laura",
  "personaPruebaApellido": "Martínez",
  "personaPruebaNombreCompleto": "Laura Martínez"
}

Class States and Transitions

StateColorDescriptionCan Edit?
PROGRAMADA🟠 OrangeScheduled, pending✅ Yes
INICIADA🔵 BlueIn progress❌ No
COMPLETADA🟢 GreenFinished successfully❌ No
CANCELADA🔴 RedCancelled❌ No
ACA🟣 PurpleAbsence with notice❌ No
ASA🌸 PinkAbsence without notice❌ No
Important: Classes with states INICIADA, COMPLETADA, or CANCELADA cannot be edited as they represent historical records.

Business Rules

Time Constraints

  • Classes cannot end after 18:30
  • Time slots are in 30-minute increments (09:00 - 18:30)
  • 60-minute classes occupy two consecutive 30-minute slots

Trial Classes

  • Only for inactive students or new people
  • Cannot be repeated for the same specialty
  • Do not count toward monthly quota
  • Student cannot have trial class if they already have classes in that specialty

Editing Restrictions

  • Cannot edit classes with state INICIADA, COMPLETADA, or CANCELADA
  • Delete and edit buttons are disabled for finalized classes

Schedule Conflicts

  • Horse cannot have overlapping classes
  • Instructor cannot have overlapping classes
  • System shows warning indicators (⚠️) for conflicts

Specialty Rules

  • "MONTA" specialty automatically assigns placeholder student (ID 1)
  • Each specialty can have different trial class eligibility
See Validation Rules, Scheduling Rules, and Business Logic for complete details.

Build docs developers (and LLMs) love