Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Elian-D/ORVIAN/llms.txt

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

The Academic module is the organizational backbone of ORVIAN. It handles the core educational entities — students, teachers, courses/sections, and subjects — and enforces the relationships between them. It integrates directly with the Attendance module through TeacherSubjectSection assignments, which determine which sections and subjects appear in each teacher’s classroom roll call.

Module Routes

All routes live under the /app/academic/ prefix and the app.academic.* named route group. They are registered in routes/app/academic.php.
PathRoute NamePermission Required
GET /app/academic/studentsapp.academic.students.indexstudents.view
GET /app/academic/students/createapp.academic.students.createstudents.view + students.create
GET /app/academic/students/importapp.academic.students.importstudents.view + students.import
GET /app/academic/students/print-managerapp.academic.students.print-managerstudents.view + students.import
GET /app/academic/students/print-qr-sheetapp.academic.students.print-qr-sheetstudents.view + students.import
GET /app/academic/students/{student}/editapp.academic.students.editstudents.view + students.edit
GET /app/academic/students/{student}app.academic.students.showstudents.view
GET /app/academic/teachersapp.academic.teachers.indexteachers.view
GET /app/academic/teachers/createapp.academic.teachers.createteachers.view + teachers.create
GET /app/academic/teachers/{teacher}/assignmentsapp.academic.teachers.assignmentsteachers.view + teachers.assign_subjects
GET /app/academic/teachers/{teacher}/editapp.academic.teachers.editteachers.view + teachers.edit
GET /app/academic/teachers/{teacher}app.academic.teachers.showteachers.view
GET /app/academic/coursesapp.academic.courses.indexsettings.view or settings.update
GET /app/academic/courses/createapp.academic.courses.createsettings.view or settings.update
GET /app/academic/courses/{section}app.academic.courses.showsettings.view or settings.update
GET /app/academic/enrollment-hubapp.academic.enrollment-hubstudents.edit
GET /app/academic/biometric-kioskapp.academic.biometric-kioskstudents.edit

Academic Data Model

The Academic module is built around five key entities and the relationships between them.

Student

App\Models\Tenant\Student represents a student enrolled in (or awaiting enrollment at) the school. Key attributes:
  • school_section_id — Foreign key to SchoolSection. null means the student is in the “Sala de Espera” (waiting room), pending assignment.
  • rnc — National ID number (cédula). Unique per school. Used to derive the student’s system email.
  • qr_code — Auto-generated 32-character uppercase token on creation via StudentObserver@creating. Used for QR wristbands and attendance scanning.
  • face_encoding — Optional. Stored as a JSON array of 128 floats produced by the orvian-facial-recognition Python microservice. Enables facial attendance recognition.
  • tutor_name / tutor_phone — Guardian contact data. tutor_phone is stored in E.164 format for WhatsApp alert delivery.
  • metadata — JSON column storing SIGERD-origin data (sigerd_section), section transfer history, and waiting-room assignment timestamps.
The model uses SoftDeletes. The full_name, age, has_face_encoding, has_user_account, and full_section_name attributes are computed via Eloquent accessors.

Teacher

App\Models\Tenant\Teacher represents a teaching staff member as a first-class professional entity, distinct from any system user account. Key attributes:
  • specialization — The teacher’s academic specialization (e.g., “Matemáticas”, “Lengua Española”).
  • employment_typeFull-Time, Part-Time, or Substitute.
  • user_id — Optional FK to User. If set, the teacher has a system login. If null, the teacher exists in the academic record only.
  • employee_code — Auto-generated on creation using the pattern EMP-{year}-SC{schoolId}-{seq}.
  • qr_code — Auto-generated with the prefix TCH- on creation.
Teachers are linked to sections and subjects via the teacher_subject_sections pivot table (TeacherSubjectSection). The assignments() relation exposes these records; the subjects() relation provides the many-to-many shortcut.

SchoolSection

App\Models\Tenant\Academic\SchoolSection models a single classroom section. Its structure follows the Dominican educational hierarchy:
Level  →  Grade  →  SchoolSection
  • grade_id — Links to a Grade, which belongs to a Level (e.g., Primaria, Secundaria).
  • label — The parallel letter (A, B, C, etc.).
  • school_shift_id — Links to a SchoolShift (Matutina, Vespertina, etc.).
  • technical_title_id — Nullable FK. When set, the section belongs to a technical specialization track (bachillerato técnico).
  • is_active — Sections can be deactivated without deletion. Soft-deleted sections are excluded from all public queries.
The computed accessor full_label assembles the human-readable section name (e.g., "3ro Secundaria - A (Informática) [Matutina]"), dynamically showing the shift only when the school has more than one shift registered.

Subject

App\Models\Tenant\Academic\Subject is seeded from the MINERD official catalog via SubjectSeeder. Subjects have a type (basic or technical) and a color used for visual coding in the assignment UI. Subjects are assigned to sections via teachers using TeacherSubjectSection.

AcademicYear

App\Models\Tenant\Academic\AcademicYear defines the active school year for a given school. The active year is resolved by the is_active flag — only one AcademicYear per school can be active at a time. No manual year selection is required in forms or wizards. The TeacherAssignmentService always operates against the currently active AcademicYear.

Automatic Account Generation

When a new student is created — either individually through StudentForm or in bulk through the StudentImportWizard — the StudentObserver@created hook automatically provisions a system user account. The observer:
  1. Derives the email as {rnc_clean}@orvian.com.do (e.g., 40212345678@orvian.com.do), where rnc_clean is the RNC with all hyphens stripped.
  2. Creates a User record with a temporary password of 12345678. The student must change this password on first login.
  3. Sets the user’s status to inactive. The account cannot be used until the school Director manually activates it.
  4. Assigns the tenant-scoped Student role automatically, using a direct pivot insert to avoid dependency on the global setPermissionsTeamId() state (which can be corrupt in queue worker contexts).
  5. Links the new user_id back to the student record via updateQuietly() to avoid re-triggering the observer.
A guard prevents duplicate account creation: if a User with the derived email already exists, the observer exits without action.

Students

Manage student records, bulk import from SIGERD, assign sections, and enroll in biometric facial recognition.

Teachers

Create teacher profiles, link system accounts, and assign subjects and sections with one-click assignments.

Courses

Configure grade levels, sections, shifts, and technical specialization tracks using the CourseForm wizard.

Enrollment Hub

Assign waiting-room students to sections individually or in bulk by their SIGERD section of origin.

Build docs developers (and LLMs) love