Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/andrespaul123/micole-flutter/llms.txt

Use this file to discover all available pages before exploring further.

Teachers (profesores) are the teaching staff managed by the school director. Each teacher has a unique teacher code (codigo_profesor) and an optional specialty field that describes their area of expertise. Once created, a teacher can be assigned to one or more subjects and then given schedule slots that define when and where each class takes place during an academic period.

The Profesor Model

Every teacher record is returned from the API nested under a user object for the identity fields (name, email) and a top-level profesor object for the school-specific fields.
FieldTypeDescription
idintPrimary key, auto-assigned
namestringFull name (from the linked user account)
emailstringLogin e-mail (from the linked user account)
codigo_profesorstringUnique teacher code used in timetables and reports
especialidadstring?Optional specialty or subject area
{
  "id": 12,
  "codigo_profesor": "PROF-001",
  "especialidad": "Matemáticas",
  "user": {
    "name": "María García",
    "email": "mgarcia@escuela.edu"
  }
}

Repository Methods

The ProfesorRepository class handles all HTTP communication with the API. Every method uses the injected Dio client and the /profesores resource path.

List Teachers

GET /api/profesoresReturns the full list of teachers for the current tenant.

Create Teacher

POST /api/profesoresCreates a new teacher and their linked user account in a single request.

Get Teacher

GET /api/profesores/:idFetches a single teacher record by its numeric ID.

Update Teacher

PUT /api/profesores/:idUpdates the teacher’s profile. Omit password to keep the existing one.

Delete Teacher

DELETE /api/profesores/:idPermanently removes the teacher and their user account.

Assign Subject

POST /api/profesores/asignar-materiaLinks a subject to a teacher so the subject appears in schedule assignment screens.

Get Teacher Subjects

GET /api/profesores/:id/subjectsReturns the list of subjects currently assigned to a teacher.

createProfesor

name
string
required
Full name of the teacher.
email
string
required
Login e-mail address. Must be unique across the tenant.
password
string
required
Initial password for the teacher’s user account. Only required on creation.
codigo_profesor
string
required
Unique teacher code used to identify the teacher in timetables and reports.
especialidad
string
Optional specialty or subject area (e.g. “Matemáticas”, “Ciencias Naturales”).
Future<Profesor> createProfesor({
  required String name,
  required String email,
  required String password,
  required String codigo,
  String? especialidad,
}) async {

  final response = await _dio.post(
    '/profesores',
    data: {
      'name': name,
      'email': email,
      'password': password,
      'codigo_profesor': codigo,
      'especialidad': especialidad,
    },
  );

  return Profesor.fromJson(
    response.data['data'],
  );
}

updateProfesor

id
int
required
Numeric ID of the teacher record to update.
name
string
required
Updated full name of the teacher.
email
string
required
Updated login e-mail address.
codigo_profesor
string
required
Updated unique teacher code.
password
string
New password. Pass null to leave the existing password unchanged.
especialidad
string
Updated specialty or subject area. Pass null to clear the field.
Future<Profesor> updateProfesor({
  required int id,
  required String name,
  required String email,
  String? password,
  required String codigo,
  String? especialidad,
}) async {

  final response = await _dio.put(
    '/profesores/$id',
    data: {
      'name': name,
      'email': email,
      'password': password,
      'codigo_profesor': codigo,
      'especialidad': especialidad,
    },
  );

  return Profesor.fromJson(
    response.data,
  );
}

asignarMateria

profesor_id
int
required
ID of the teacher to assign the subject to.
subject_id
int
required
ID of the subject to assign.
Future<void> asignarMateria({
  required int profesorId,
  required int subjectId,
}) async {

  await _dio.post(
    '/profesores/asignar-materia',
    data: {
      'profesor_id': profesorId,
      'subject_id': subjectId,
    },
  );
}

Schedule Assignment Flow

Scheduling a teacher involves two distinct steps. The first step links the teacher to a subject; the second step places that linked class into a specific time slot within an academic period.
1

Assign a subject to the teacher

Navigate to the teacher’s profile and tap the Assign Subject action. Select the subject from the list of available subjects for the tenant and confirm. This calls POST /api/profesores/asignar-materia.
2

Create a schedule assignment

Navigate to the teacher’s schedule screen (/profesores/:id/horario) and fill in the period, course, section, day, start time, and end time. This calls POST /api/periodos/:periodoId/asignaciones with a horarios array.
3

Verify in Mis Clases

The teacher can open the Mis Clases screen to see their assigned classes grouped by course and section for each academic period. Each card lists the subjects and provides an Entrar button to open the class dashboard.
A teacher must be assigned to a subject before that subject can appear in the schedule assignment drop-down. Always complete step 1 first.

Application Routes

RouteScreenDescription
/profesoresProfesorListScreenPaginated list of all teachers
/profesores/createProfesorCreateScreenForm to create a new teacher
/profesores/:id/editProfesorEditScreenForm to edit an existing teacher
/profesores/:id/materiaAsignarMateriaScreenAssign a subject to the teacher
/profesores/:id/horarioAsignarHorarioScreenAdd schedule slots for the teacher
/profesores/:id/ver-horarioHorarioProfesorScreenRead-only weekly timetable view
/profesores/:id/materias-asignadasMateriasAsignadasScreenList of subjects currently assigned
/mis-clasesMisClasesScreenTeacher’s own view of all assigned classes by period
Deleting a teacher is irreversible. The associated user account and all schedule assignments linked to that teacher are removed from the tenant. Back up the data or reassign schedule slots before confirming deletion.

Build docs developers (and LLMs) love