Skip to main content

Overview

The Instructor model represents teaching staff at the equestrian school. Instructors are assigned to classes and have a unique color for visual identification in the calendar.

Data Model

id
number
required
Unique identifier for the instructor
dni
string
required
National identification number (DNI). Only numbers without dots or dashes.Validation: Must be unique across all instructors. The system validates for duplicates in real-time when entering 9 or more digits.Example: "12345678"
nombre
string
required
Instructor’s first name(s)
apellido
string
required
Instructor’s last name(s)
fechaNacimiento
string
required
Date of birth in ISO format (yyyy-MM-dd)Example: "1985-03-20"
codigoArea
string
required
Phone area code. The system automatically adds the +549 prefix for Argentine numbers.Example: "221"
telefono
string
required
Phone number without the leading 0 or 15Example: "1234567"Note: Combined with codigoArea, the full format becomes +549{codigoArea}{telefono}
email
string
Email address (optional but recommended for communications)
activo
boolean
required
Indicates if the instructor is currently activeDefault: trueOnly active instructors can be assigned to new classes.
color
string
required
Color assigned to the instructor for visual identification in the calendarAvailable colors: 7 predefined colorsUsed to:
  • Distinguish classes in the calendar view
  • Color-code cells in day view
  • Identify instructor assignments at a glance
Example: "#3B82F6" (blue)

Example

{
  "id": 5,
  "dni": "23456789",
  "nombre": "Carlos",
  "apellido": "Rodríguez",
  "fechaNacimiento": "1985-03-20",
  "codigoArea": "221",
  "telefono": "5559876",
  "email": "[email protected]",
  "activo": true,
  "color": "#3B82F6"
}

Visual Identification

Calendar Display

In the calendar views, instructor colors are used to:
  • Background color: Each class cell displays the instructor’s color (lightened for readability)
  • Quick identification: Users can instantly see which instructor is assigned to each class
  • Legends: Color legends show instructor names with their corresponding colors

Available Colors

The system provides 7 predefined colors for instructor assignment:
  1. Blue (#3B82F6)
  2. Green (#10B981)
  3. Red (#EF4444)
  4. Yellow (#F59E0B)
  5. Purple (#8B5CF6)
  6. Pink (#EC4899)
  7. Indigo (#6366F1)

Business Rules

  • DNI must be unique across all instructors (validated in real-time)
  • Phone numbers are automatically formatted with +549 prefix
  • Instructors are automatically set as active upon registration
  • Only active instructors can be assigned to new classes
  • Each instructor must have a unique color for calendar visualization
  • Instructors cannot have overlapping class schedules (schedule conflict validation)
See Validation Rules and Scheduling Rules for more details.

Build docs developers (and LLMs) love