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.

Enrollments (Inscripcion) are the records that formally place a student into a specific course and section for a given academic period. Each enrollment creates a precise four-way relationship: one student + one academic period + one course + one section. This record is the foundation for attendance tracking, grade books, agenda assignments, and parent access — every feature that involves a student in a classroom depends on an enrollment existing first.
An enrollment is always scoped to an active academic period. Before enrolling students, ensure the target academic period has been created and activated. See Academic Periods for details.

Inscripcion Model

class Inscripcion {
  final int?          id;
  final int?          estudianteId;
  final int?          cursoId;
  final int?          paraleloId;
  final int?          academicPeriodId;
  final Estudiante?   estudiante;   // expanded when included
  final Curso?        curso;        // expanded when included
  final Paralelo?     paralelo;     // expanded when included
  final AcademicPeriod? periodo;   // expanded when included

  Inscripcion({
    this.id,
    this.estudianteId,
    this.cursoId,
    this.paraleloId,
    this.academicPeriodId,
    this.estudiante,
    this.curso,
    this.paralelo,
    this.periodo,
  });

  factory Inscripcion.fromJson(Map<String, dynamic> json) {
    return Inscripcion(
      id:               json['id'],
      estudianteId:     json['estudiante_id'],
      cursoId:          json['curso_id'],
      paraleloId:       json['paralelo_id'],
      academicPeriodId: json['academic_period_id'],
      estudiante: json['estudiante'] != null
          ? Estudiante.fromJson(json['estudiante']) : null,
      curso:    json['curso']    != null ? Curso.fromJson(json['curso'])       : null,
      paralelo: json['paralelo'] != null ? Paralelo.fromJson(json['paralelo']) : null,
      periodo:  json['periodo']  != null ? AcademicPeriod.fromJson(json['periodo']) : null,
    );
  }
}
id
int
required
Unique identifier for this enrollment record.
estudianteId
int
required
Foreign key referencing the enrolled Estudiante.
cursoId
int
required
Foreign key referencing the Curso (grade level) the student is enrolled in.
paraleloId
int
required
Foreign key referencing the Paralelo (section) the student belongs to.
academicPeriodId
int
required
Foreign key referencing the AcademicPeriod this enrollment applies to.
estudiante
Estudiante
Expanded student object included when the API returns full relationship data.
curso
Curso
Expanded course object included when the API returns full relationship data.
paralelo
Paralelo
Expanded section object included when the API returns full relationship data.
periodo
AcademicPeriod
Expanded academic period object included when the API returns full relationship data.

InscripcionRepository

class InscripcionRepository {
  final Dio _dio;
  InscripcionRepository(this._dio);
}
Returns all enrollment records for a given academic period. The response may be a bare list or wrapped in a data key — the repository handles both shapes.
Future<List<Inscripcion>> getInscripciones(int periodoId) async {
  final response = await _dio.get(
    '/periodos/$periodoId/inscripciones',
  );
  final List data = response.data is List
      ? response.data
      : response.data['data'] ?? [];
  return data.map((e) => Inscripcion.fromJson(e)).toList();
}
Endpoint: GET /api/periodos/:periodoId/inscripciones
[
  {
    "id": 1,
    "estudiante_id": 10,
    "curso_id": 3,
    "paralelo_id": 5,
    "academic_period_id": 2,
    "estudiante": { "id": 10, "nombre": "Carlos Vega" },
    "curso":      { "id": 3,  "nombre": "Primero de Bachillerato" },
    "paralelo":   { "id": 5,  "nombre": "A" }
  }
]

Students by Class

Teachers and directors can query the list of students enrolled in a specific class (period + course + section combination) using a dedicated endpoint. This powers attendance screens, grade books, and class dashboards. Endpoint: GET /api/periodos/:periodoId/cursos/:cursoId/paralelos/:paraleloId/estudiantes
Future<List<EstudianteClase>> getEstudiantesPorClase({
  required int periodoId,
  required int cursoId,
  required int paraleloId,
}) async {
  final response = await _dio.get(
    '/periodos/$periodoId/cursos/$cursoId/paralelos/$paraleloId/estudiantes',
  );
  final List data = response.data['estudiantes'] ?? [];
  return data.map((e) => EstudianteClase.fromJson(e)).toList();
}

EstudianteClase Model

EstudianteClase is a lightweight projection used when listing students within a classroom context. It contains only the fields needed for display and identification.
class EstudianteClase {
  final int?    id;
  final String? nombre;
  final String? email;

  EstudianteClase({this.id, this.nombre, this.email});

  factory EstudianteClase.fromJson(Map<String, dynamic> json) {
    return EstudianteClase(
      id:     json['id'],
      nombre: json['nombre'],
      email:  json['email'],
    );
  }
}
id
int
required
Student identifier, used to scope attendance, grades, and other per-student operations.
nombre
String
required
Full display name of the student.
email
String
Student’s email address.

Enrollment Relationship

Each enrollment record forms a precise intersection of four entities:
AcademicPeriod (e.g. "Año 2024-2025")

       ├── Curso (e.g. "Primero de Bachillerato")
       │        │
       │        └── Paralelo (e.g. "Paralelo A")

       └── Estudiante (e.g. "Carlos Vega")

          Inscripcion (id: 1)
This means a student can be enrolled in different courses or sections across different academic periods, but cannot be enrolled twice in the same period + course + section combination.

App Routes

/inscripciones

List all enrollments for the active period (InscripcionListScreen).

/inscripciones/create

Create a new enrollment by selecting a student, course, and section (InscripcionCreateScreen).

Build docs developers (and LLMs) love