Skip to main content
The app uses simple, immutable data classes to represent domain entities. All models are located in the data/model/ package and use Kotlin data classes for automatic equals, hashCode, and copy implementations.

Student Model

Represents a student enrolled in the TecNM institution.
Student.kt
package com.example.appcontrolescolar.data.model

data class Student(
    val id: Int,
    val controlNumber: String,
    val name: String,
    val career: String,
    val semester: Int,
    val average: Double
)

Fields

id
Int
required
Unique identifier for the student in the database
controlNumber
String
required
Student’s control number (matrícula) - unique identifier assigned by TecNM. Format: 226W0487
name
String
required
Full name of the student
career
String
required
Academic program the student is enrolled in (e.g., “Ingeniería en Sistemas Computacionales”)
semester
Int
required
Current semester number (1-12 typically)
average
Double
required
Overall GPA/average grade (0.0-100.0 scale)

Usage Example

val student = Student(
    id = 1,
    controlNumber = "226W0487",
    name = "Arlyn Alfaro",
    career = "Ingeniería en Sistemas Computacionales",
    semester = 8,
    average = 92.5
)

ClassSession Model

Represents a single class session in a student’s schedule.
ClassSession.kt
package com.example.appcontrolescolar.data.model

data class ClassSession(
    val id: Int,
    val subject: String,
    val teacher: String,
    val classroom: String,
    val day: String,
    val startHour: String,
    val endHour: String,
    val isCurrent: Boolean = false
)

Fields

id
Int
required
Unique identifier for the class session
subject
String
required
Name of the course/subject (e.g., “Programación Orientada a Objetos”)
teacher
String
required
Name of the professor teaching the class
classroom
String
required
Location where the class takes place (e.g., “Lab 3”, “Aula A2”)
day
String
required
Day of the week the class occurs (e.g., “Martes”)
startHour
String
required
Class start time in 24-hour format (e.g., “10:00”)
endHour
String
required
Class end time in 24-hour format (e.g., “12:00”)
isCurrent
Boolean
default:"false"
Flag indicating if this is the currently active class session

Usage Example

val currentClass = ClassSession(
    id = 2,
    subject = "Programación Orientada a Objetos",
    teacher = "Prof. G. Hopper",
    classroom = "Lab 3",
    day = "Martes",
    startHour = "10:00",
    endHour = "12:00",
    isCurrent = true
)

Building Model

Represents a building or location on the campus.
Building.kt
package com.example.appcontrolescolar.data.model

data class Building(
    val id: Int,
    val name: String,
    val description: String,
    val category: String,
    val distance: String
)

Fields

id
Int
required
Unique identifier for the building
name
String
required
Name of the building (e.g., “Edificio A”, “Laboratorio 3”)
description
String
required
Brief description of the building’s purpose (e.g., “Aulas generales”)
category
String
required
Type or category of building (e.g., “Aulas”, “Labs”, “Cafetería”)
distance
String
required
Distance from current location as a formatted string (e.g., “120 m”)

Usage Example

val building = Building(
    id = 2,
    name = "Laboratorio 3",
    description = "Prácticas de computación",
    category = "Labs",
    distance = "180 m"
)

FakeData Provider

For development and testing, the app uses FakeData.kt to provide mock data instances:
FakeData.kt
package com.example.appcontrolescolar.data

import com.example.appcontrolescolar.data.model.Building
import com.example.appcontrolescolar.data.model.ClassSession
import com.example.appcontrolescolar.data.model.Student

object FakeData {

    val student = Student(
        id = 1,
        controlNumber = "226W0487",
        name = "Arlyn Alfaro",
        career = "Ingeniería en Sistemas Computacionales",
        semester = 8,
        average = 92.5
    )

    val todayClasses = listOf(
        ClassSession(
            id = 1,
            subject = "Física I",
            teacher = "Prof. A. Einstein",
            classroom = "Aula A2",
            day = "Martes",
            startHour = "08:00",
            endHour = "09:00",
            isCurrent = false
        ),
        ClassSession(
            id = 2,
            subject = "Programación Orientada a Objetos",
            teacher = "Prof. G. Hopper",
            classroom = "Lab 3",
            day = "Martes",
            startHour = "10:00",
            endHour = "12:00",
            isCurrent = true
        ),
        // ... more classes
    )

    val buildings = listOf(
        Building(
            id = 1,
            name = "Edificio A",
            description = "Aulas generales",
            category = "Aulas",
            distance = "120 m"
        ),
        // ... more buildings
    )
}

Usage in Screens

Screens import and use FakeData directly:
import com.example.appcontrolescolar.data.FakeData

@Composable
fun HomeScreen() {
    val student = FakeData.student
    val classes = FakeData.todayClasses
    // Use the data...
}
FakeData is temporary and will be replaced with a proper repository layer connected to Supabase in the future.

Best Practices

Kotlin data classes automatically generate equals(), hashCode(), toString(), and copy() methods, reducing boilerplate code and ensuring consistency.
Using val for all properties makes models immutable, which is essential for proper state management in Compose. Immutable data prevents accidental mutations and makes state changes explicit.
The isCurrent parameter in ClassSession has a default value of false, making it optional and improving API ergonomics.