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.

Subjects (Subject / materias) are the academic disciplines offered by a school—such as Mathematics, Language Arts, or Natural Sciences. They live at the tenant level and are independent of any particular academic period or course. Once created, subjects can be assigned to teachers so that each teacher is linked to the disciplines they will instruct, enabling grade books, schedules, and class dashboards to be scoped correctly.

Subject Model

class Subject {
  final int?    id;
  final String? name;
  final int?    tenantId;

  Subject({this.id, this.name, this.tenantId});

  factory Subject.fromJson(Map<String, dynamic> json) {
    return Subject(
      id:       json['id'],
      name:     json['name'],
      tenantId: json['tenant_id'],
    );
  }
}
id
int
required
Unique identifier for the subject.
name
String
required
Display name of the subject, e.g. "Matemáticas" or "Lengua y Literatura".
tenantId
int
Tenant-scoping identifier. Populated server-side; subjects are isolated per school.

SubjectRepository

All four CRUD operations plus a single-record fetch are available in SubjectRepository.
class SubjectRepository {
  final Dio _dio;
  SubjectRepository(this._dio);
}
Returns all subjects belonging to the current tenant.
Future<List<Subject>> getSubjects() async {
  final response = await _dio.get('/subjects');
  return (response.data as List)
      .map((e) => Subject.fromJson(e))
      .toList();
}
Endpoint: GET /api/subjects
[
  { "id": 1, "name": "Matemáticas",        "tenant_id": 3 },
  { "id": 2, "name": "Lengua y Literatura", "tenant_id": 3 },
  { "id": 3, "name": "Ciencias Naturales",  "tenant_id": 3 }
]

Assigning Subjects to Teachers

Subjects become actionable when they are assigned to a teacher. This links a Profesor to a Subject and optionally to a specific Paralelo, forming the basis for class dashboards, grade books, and schedule entries. Endpoint: POST /api/profesores/asignar-materia Directors navigate to /profesores/:id/materia to open AsignarMateriaScreen, where they select a subject and (optionally) a section to complete the assignment. After assignment, the teacher’s assigned subjects are visible at /profesores/:id/materias-asignadas.
1

Open the teacher profile

Navigate to /profesores and select the teacher you want to assign a subject to.
2

Go to subject assignment

Tap Asignar materia to navigate to /profesores/:id/materia, which opens AsignarMateriaScreen.
3

Choose the subject

The screen lists all subjects returned by GET /api/subjects. Select the desired subject from the dropdown or list.
4

Save the assignment

Confirm to call POST /api/profesores/asignar-materia. The assignment is now visible under the teacher’s assigned-subjects view and enables grade book and schedule features.

App Routes

/materias

List all subjects for the school (SubjectListScreen).

/materias/create

Create a new subject (SubjectScreen).

/materias/:id/edit

Edit an existing subject’s name (SubjectEditScreen).

/profesores/:id/materia

Assign a subject to a specific teacher (AsignarMateriaScreen).

/profesores/:id/materias-asignadas

View all subjects assigned to a teacher (MateriasAsignadasScreen).

Build docs developers (and LLMs) love