Skip to content

Overview

The school module simplifies and empowers teachers to enhance student learning through comprehensive digital tools. By digitizing various aspects of the school system, it makes teachers more efficient, enabling easier tracking of student progress and maintaining historical learning records. The module manages access permissions, assessments, attendance, and individualized education programs (IEPs). It organizes and tracks student performance, classroom activities, and educational materials. Additionally, it supports the creation and management of reports, case studies, and daily assessments, along with bulk data downloads, school calendar management, and offline records handling. Overall, the school module provides powerful tools to streamline teaching and improve educational outcomes.


School::Access

Summary

The School::Access model represents access permissions for profiles in the school system. It manages roles such as administrator, supervisor, teacher, and specialist, ensuring proper access control within the application.

Fields/Columns

  • role: The role assigned to the profile (e.g., administrator, teacher).
  • profile_id: The ID of the associated profile.
  • classroom_id: The ID of the associated classroom.
  • additional_details: Additional details related to the access permissions.

Relationships

  • belongs_to :classroom, optional: true: Each access can optionally be associated with a classroom.
  • belongs_to :staff, class_name: "School::Profile::Staff", foreign_key: :profile_id: Each access is associated with a staff profile.

School::Assessment

Summary

The School::Assessment model represents individual assessments conducted for students. It manages data related to the evaluation of student performance on specific criteria.

Fields/Columns

  • occurred_on: The date when the assessment was conducted.
  • value: The result of the assessment (e.g., pass, fail).
  • subgoal_type: The type of subgoal being assessed.
  • subgoal_id: The ID of the subgoal being assessed.
  • student_id: The ID of the student being assessed.
  • iep_id: The ID of the associated IEP.
  • assessed_by_id: The ID of the staff member who conducted the assessment.
  • iep_domain_id: The ID of the associated IEP domain.
  • iep_summary_node_id: The ID of the associated IEP summary node.

Relationships

  • belongs_to :subgoal, polymorphic: true: Each assessment is associated with a polymorphic subgoal.
  • belongs_to :student: Each assessment is associated with a student.
  • belongs_to :iep: Each assessment is associated with an IEP.
  • belongs_to :assessed_by, class_name: "School::Profile::Staff": Each assessment is associated with the staff member who conducted it.
  • belongs_to :iep_domain: Each assessment is associated with an IEP domain.
  • belongs_to :iep_summary_node, class_name: "School::IepSummaryNode::Subgoal", optional: true: Each assessment can optionally be associated with an IEP summary node.

School::AssessmentDay

Summary

The School::AssessmentDay model represents specific days on which assessments are conducted. It helps in organizing and tracking assessment schedules for students.

Fields/Columns

  • date: The date of the assessment day.
  • student_id: The ID of the student being assessed.
  • marked_by_id: The ID of the staff member who marked the assessment day.

Relationships

  • belongs_to :student: Each assessment day is associated with a student.
  • belongs_to :marked_by, optional: true: Each assessment day can optionally be associated with the staff member who marked it.

School::Attendance

Summary

The School::Attendance model tracks student attendance records. It ensures accurate recording of student presence or absence on specific dates, which is crucial for performance and compliance tracking.

Fields/Columns

  • occurred_on: The date when the attendance was recorded.
  • status: The attendance status (e.g., present, absent).
  • profile_id: The ID of the staff member who marked the attendance.

Relationships

  • belongs_to :classroom: Each attendance record is associated with a classroom.
  • belongs_to :student: Each attendance record is associated with a student.
  • belongs_to :marked_by, class_name: "School::Profile::Staff", foreign_key: :profile_id: Each attendance record is associated with the staff member who marked it.

School::BulkDownload

Summary

The School::BulkDownload model handles the bulk downloading of data within the school system. It manages the process of generating and providing large datasets for download, ensuring efficient data handling.

Fields/Columns

  • status: The current status of the bulk download (e.g., draft, in_progress, success, failure).
  • progress: The progress of the bulk download as a percentage.
  • output: The output or result of the bulk download process.
  • started_at: The timestamp when the bulk download started.
  • ended_at: The timestamp when the bulk download ended.

Relationships

  • has_one :medium, as: :record: Each bulk download can have one associated medium record.

Concerns Used

  • AASM: Provides state machine functionality for the model.

School::CalendarDay

Summary

The School::CalendarDay model represents specific days in the school calendar, including holidays and special events. It helps in organizing the academic schedule and planning school activities.

Fields/Columns

  • date: The date of the calendar day.
  • is_holiday: A boolean indicating whether the day is a holiday.
  • school_id: The ID of the associated school.

Relationships

  • None

School::Casestudy

Summary

The School::Casestudy model represents case studies conducted for students. It manages detailed records of individual student cases, including assessments, interventions, and outcomes.

Fields/Columns

  • kind: The type of case study (e.g., over_performing, under_performing).
  • status: The current status of the case study (e.g., draft, awaiting_approval, approved, rejected, finalized).
  • student_id: The ID of the student associated with the case study.
  • classroom_id: The ID of the classroom associated with the case study.
  • prepared_by_id: The ID of the staff member who prepared the case study.
  • parent_id: The ID of the parent case study, if any.

Relationships

  • belongs_to :student: Each case study is associated with a student.
  • belongs_to :classroom: Each case study is associated with a classroom.
  • belongs_to :prepared_by, class_name: "School::Profile::Staff": Each case study is associated with the staff member who prepared it.
  • belongs_to :parent, class_name: School::Casestudy.name, optional: true, counter_cache: :children_count: Each case study can optionally be associated with a parent case study.
  • has_many :children, -> { order("created_at desc") }, class_name: School::Casestudy.name, foreign_key: :parent_id, dependent: :destroy: Each case study can have many child case studies.
  • has_many :participants, class_name: "School::CasestudyParticipant", dependent: :destroy: Each case study can have many participants.
  • has_many :subgoals, class_name: "School::CasestudySubgoal", dependent: :destroy: Each case study can have many subgoals.
  • has_many :notes, as: :noteable: Each case study can have many notes.
  • has_one :filing, -> { order("created_at desc") }, class_name: "School::CasestudyFiling", foreign_key: "casestudy_id": Each case study can have one filing.
  • has_many :tasks, as: :taskable, class_name: School::Task::Casestudy.name: Each case study can have many tasks.
  • has_many :attachments, -> { order("created_at desc") }, class_name: "Medium", as: :record, dependent: :destroy: Each case study can have many attachments.

Concerns Used

  • AASM: Provides state machine functionality for the model.

School::CasestudyAmendment

Summary

The School::CasestudyAmendment model tracks amendments made to case studies. It ensures that any changes to case study records are accurately recorded and traceable.

Fields/Columns

  • kind: The type of amendment (e.g., addition, deletion).
  • filing_id: The ID of the associated filing.
  • iep_subgoal_id: The ID of the associated IEP subgoal.

Relationships

  • belongs_to :filing, class_name: "School::CasestudyFiling": Each amendment is associated with a filing.
  • belongs_to :iep_subgoal, class_name: "School::IepSubgoal": Each amendment is associated with an IEP subgoal.

School::CasestudyFiling

Summary

The School::CasestudyFiling model manages the filing of case studies. It helps in organizing and storing case study documents and records for easy retrieval and reference.

Fields/Columns

  • casestudy_id: The ID of the associated case study.
  • iep_id: The ID of the associated IEP.

Relationships

  • belongs_to :casestudy, class_name: "School::Casestudy": Each filing is associated with a case study.
  • belongs_to :iep, class_name: "School::Iep": Each filing is associated with an IEP.
  • has_many :amendments, class_name: "School::CasestudyAmendment", foreign_key: "filing_id": Each filing can have many amendments.

School::CasestudyParticipant

Summary

The School::CasestudyParticipant model represents participants involved in a case study. It tracks the roles and contributions of different individuals in the case study process.

Fields/Columns

  • relationship_id: The ID of the associated relationship.
  • casestudy_id: The ID of the associated case study.

Relationships

  • belongs_to :relationship: Each participant is associated with a relationship.
  • belongs_to :casestudy: Each participant is associated with a case study.

School::CasestudySubgoal

Summary

The School::CasestudySubgoal model represents subgoals within a case study. It helps in breaking down the main goals of a case study into smaller, manageable objectives.

Fields/Columns

  • subgoal_id: The ID of the associated subgoal.
  • subgoal_type: The type of the associated subgoal.
  • casestudy_id: The ID of the associated case study.

Relationships

  • belongs_to :subgoal, polymorphic: true: Each case study subgoal is associated with a polymorphic subgoal.
  • belongs_to :casestudy: Each case study subgoal is associated with a case study.

School::Classroom

Summary

The School::Classroom model represents classrooms within the school system. It manages data related to classroom assignments, student enrollments, and classroom-specific activities.

Fields/Columns

  • grade: The grade level of the classroom.
  • section: The section of the classroom.
  • school_curriculum_id: The ID of the associated school curriculum.

Relationships

  • has_many :student_classrooms, dependent: :destroy: Each classroom can have many student classrooms.
  • has_many :students, through: :student_classrooms: Each classroom can have many students through student classrooms.
  • has_many :current_students, -> { where("school_student_classrooms.current": true) }, through: :student_classrooms, source: :student, class_name: "School::Student": Each classroom can have many current students.
  • has_many :accesses, class_name: "School::Access": Each classroom can have many accesses.
  • has_many :reports, class_name: School::ClassroomReport.name, foreign_key: :classroom_id: Each classroom can have many reports.
  • belongs_to :school_curriculum, optional: true, class_name: SchoolCurriculum.name: Each classroom can optionally be associated with a school curriculum.

Concerns Used

  • None

School::ClassroomReport

Summary

The School::ClassroomReport model represents reports generated for classrooms. It tracks performance metrics, attendance, and other relevant data for classroom-level analysis.

Fields/Columns

  • status: The current status of the classroom report (e.g., draft, report_generated, awaiting_approval, approved, rejected, finalized).
  • start_date: The start date of the report period.
  • end_date: The end date of the report period.
  • classroom_id: The ID of the associated classroom.
  • prepared_by_id: The ID of the staff member who prepared the report.

Relationships

  • belongs_to :classroom, class_name: School::Classroom.name: Each classroom report is associated with a classroom.
  • belongs_to :prepared_by, optional: true, class_name: "School::Profile::Staff": Each classroom report can optionally be associated with the staff member who prepared it.
  • has_one :overall_summary, -> { order("created_at desc") }, class_name: School::ClassroomReportItem::OverallSummary.name, foreign_key: :report_id, dependent: :destroy: Each classroom report can have one overall summary.
  • has_many :domain_details, -> { order("position asc") }, class_name: School::ClassroomReportItem::DomainDetail.name, foreign_key: :report_id, dependent: :destroy: Each classroom report can have many domain details.
  • has_many :notes, as: :noteable: Each classroom report can have many notes.
  • has_many :tasks, as: :taskable, class_name: School::Task::ClassroomReport.name: Each classroom report can have many tasks.

Concerns Used

  • AASM: Provides state machine functionality for the model.

School::ClassroomReportItem

Summary

The School::ClassroomReportItem model represents individual items within a classroom report. It helps in organizing and detailing specific aspects of classroom performance and activities.

Fields/Columns

  • position: The position of the report item within the report.
  • reportable_id: The ID of the associated reportable entity.
  • reportable_type: The type of the associated reportable entity.
  • report_id: The ID of the associated classroom report.

Relationships

  • belongs_to :reportable, optional: true, polymorphic: true: Each classroom report item can be associated with a polymorphic reportable entity.
  • belongs_to :report, class_name: School::ClassroomReport.name: Each classroom report item is associated with a classroom report.

School::DailyAssessment

Summary

The School::DailyAssessment model tracks daily assessments conducted for students. It ensures continuous monitoring of student performance and progress on a daily basis.

Fields/Columns

  • occurred_on: The date when the assessment was conducted.
  • value: The result of the assessment (e.g., pass, fail).
  • success: A boolean indicating whether the assessment was successful.
  • qualifiers: An array of qualifiers associated with the assessment.
  • measurement_value_id: The ID of the associated measurement value.
  • iep_id: The ID of the associated IEP.

Relationships

  • belongs_to :iep: Each daily assessment is associated with an IEP.
  • belongs_to :measurement_value, class_name: Library::MeasurementValue.name, optional: true: Each daily assessment can optionally be associated with a measurement value.

School::Iep

Summary

The School::Iep model represents Individualized Education Programs (IEPs) for students. It manages the creation, tracking, and evaluation of personalized education plans for students with special needs.

Fields/Columns

  • status: The current status of the IEP (e.g., draft, finalized).
  • student_id: The ID of the student associated with the IEP.
  • semester_id: The ID of the associated semester.
  • prepared_by_id: The ID of the staff member who prepared the IEP.
  • previous_iep_id: The ID of the previous IEP, if any.
  • next_iep_id: The ID of the next IEP, if any.

Relationships

  • belongs_to :student: Each IEP is associated with a student.
  • belongs_to :semester: Each IEP is associated with a semester.
  • belongs_to :prepared_by, class_name: "School::Profile::Staff": Each IEP is associated with the staff member who prepared it.
  • has_many :iep_subgoals, dependent: :destroy, class_name: "School::IepSubgoal": Each IEP can have many subgoals.
  • has_many :main_subgoals, through: :iep_subgoals, source: :subgoal, source_type: "Library::Subgoal": Each IEP can have many main subgoals.
  • has_many :custom_subgoals, through: :iep_subgoals, source: :subgoal, source_type: "School::Subgoal": Each IEP can have many custom subgoals.
  • has_many :iep_materials, dependent: :destroy, class_name: "School::IepMaterial": Each IEP can have many materials.
  • has_many :worksheets, dependent: :destroy, class_name: "School::Worksheet": Each IEP can have many worksheets.
  • has_many :iep_domains, dependent: :destroy, class_name: "School::IepDomain", foreign_key: :iep_id, inverse_of: :school_iep: Each IEP can have many domains.
  • has_many :daily_assessments, class_name: "School::DailyAssessment", dependent: :destroy: Each IEP can have many daily assessments.
  • has_many :onboarding_assessments, -> { where(type: School::OnboardingAssessment.name) }, class_name: "School::OnboardingAssessment", dependent: :destroy: Each IEP can have many onboarding assessments.
  • has_many :iep_assessments, -> { where(type: School::IepAssessment.name) }, class_name: "School::IepAssessment", dependent: :destroy: Each IEP can have many IEP assessments.
  • has_many :assessments, class_name: "School::Assessment", dependent: :destroy: Each IEP can have many assessments.
  • has_many :summary_nodes, dependent: :destroy, class_name: "School::IepSummaryNode": Each IEP can have many summary nodes.
  • has_one :next_iep, foreign_key: "previous_iep_id", class_name: "School::Iep", dependent: :nullify: Each IEP can have one next IEP.
  • has_one :previous_iep, foreign_key: "next_iep_id", class_name: "School::Iep", dependent: :nullify: Each IEP can have one previous IEP.

Concerns Used

  • School::Iep::Transitions: Provides state transition methods for the IEP.
  • School::Iep::SubgoalSelectionHelper: Provides helper methods for selecting subgoals in the IEP.

School::IepAssessment

Summary

The School::IepAssessment model represents assessments conducted as part of an IEP. It tracks the evaluation of student performance against the goals and objectives outlined in the IEP.

Fields/Columns

  • value: The result of the assessment (e.g., pass, fail, unassessed).
  • iep_id: The ID of the associated IEP.

Relationships

  • belongs_to :onboarding_iep, -> { where(type: "School::Iep::Onboarding") }, class_name: "School::Iep::Onboarding", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each IEP assessment can optionally be associated with an onboarding IEP.
  • belongs_to :offboarding_iep, -> { where(type: "School::Iep::Offboarding") }, class_name: "School::Iep::Offboarding", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each IEP assessment can optionally be associated with an offboarding IEP.
  • belongs_to :school_iep, -> { where(type: "School::Iep") }, class_name: "School::Iep", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each IEP assessment can optionally be associated with a school IEP.

School::IepDomain

Summary

The School::IepDomain model represents domains within an IEP. It helps in organizing and categorizing the different areas of focus within a student's IEP.

Fields/Columns

  • selected: A boolean indicating whether the domain is selected.
  • performance_summary: A JSON field summarizing the performance within the domain.
  • iep_id: The ID of the associated IEP.
  • domain_id: The ID of the associated domain.

Relationships

  • belongs_to :iep, class_name: School::Iep.name, optional: true: Each IEP domain can optionally be associated with an IEP.
  • belongs_to :onboarding_iep, class_name: "School::Iep::Onboarding", foreign_key: :iep_id, inverse_of: :iep_domains, optional: true: Each IEP domain can optionally be associated with an onboarding IEP.
  • belongs_to :offboarding_iep, class_name: "School::Iep::Offboarding", foreign_key: :iep_id, inverse_of: :iep_domains, optional: true: Each IEP domain can optionally be associated with an offboarding IEP.
  • belongs_to :school_iep, class_name: "School::Iep", foreign_key: :iep_id, inverse_of: :iep_domains, optional: true: Each IEP domain can optionally be associated with a school IEP.
  • belongs_to :domain, class_name: "Library::Domain": Each IEP domain is associated with a domain.

School::IepMaterial

Summary

The School::IepMaterial model represents materials used in an IEP. It tracks the resources and materials provided to support the student's educational goals.

Fields/Columns

  • material_id: The ID of the associated material.
  • material_type: The type of the associated material.
  • iep_id: The ID of the associated IEP.
  • iep_subgoal_id: The ID of the associated IEP subgoal.

Relationships

  • belongs_to :material, polymorphic: true: Each IEP material is associated with a polymorphic material.
  • belongs_to :iep: Each IEP material is associated with an IEP.
  • belongs_to :iep_subgoal: Each IEP material is associated with an IEP subgoal.

School::IepSubgoal

Summary

The School::IepSubgoal model represents subgoals within an IEP. It helps in breaking down the main goals of an IEP into smaller, manageable objectives.

Fields/Columns

  • position: The position of the subgoal within the IEP.
  • selected: A boolean indicating whether the subgoal is selected.
  • iep_id: The ID of the associated IEP.
  • subgoal_id: The ID of the associated subgoal.
  • subgoal_type: The type of the associated subgoal.

Relationships

  • belongs_to :iep, class_name: "School::Iep": Each IEP subgoal is associated with an IEP.
  • belongs_to :subgoal, polymorphic: true: Each IEP subgoal is associated with a polymorphic subgoal.
  • has_many :iep_materials, dependent: :destroy, class_name: "School::IepMaterial": Each IEP subgoal can have many materials.

School::IepSummaryNode

Summary

The School::IepSummaryNode model represents summary nodes within an IEP. It helps in organizing and summarizing the different components and progress of an IEP.

Fields/Columns

  • record_id: The ID of the associated record.
  • record_type: The type of the associated record.
  • iep_id: The ID of the associated IEP.

Relationships

  • belongs_to :record, polymorphic: true: Each summary node is associated with a polymorphic record.
  • belongs_to :iep: Each summary node is associated with an IEP.

Concerns Used

  • has_ancestry: Provides hierarchical relationships for the summary nodes.

School::Material

Summary

The School::Material model represents educational materials used within the school system. It manages the creation, organization, and usage of various educational resources.

Fields/Columns

  • text: The text content of the material.
  • description: A description of the material.
  • created_by_id: The ID of the staff member who created the material.

Relationships

  • has_one_attached :image: Each material can have one attached image.
  • has_one :medium, as: :record, dependent: :destroy: Each material can have one associated medium record.
  • has_many :taggings, as: :taggable, dependent: :destroy, class_name: "School::Tagging": Each material can have many taggings.
  • has_many :tags, through: :taggings, class_name: "School::Tag": Each material can have many tags through taggings.
  • belongs_to :created_by, class_name: "School::Profile::Staff": Each material is associated with the staff member who created it.
  • has_many :iep_materials, dependent: :destroy, class_name: "School::IepMaterial", as: :material: Each material can have many IEP materials.

School::Note

Summary

The School::Note model represents notes taken within the school system. It manages the creation, organization, and association of notes with various entities.

Fields/Columns

  • content: The content of the note.
  • noteable_id: The ID of the associated noteable entity.
  • noteable_type: The type of the associated noteable entity.
  • subnoteable_id: The ID of the associated subnoteable entity.
  • subnoteable_type: The type of the associated subnoteable entity.
  • noted_by_id: The ID of the staff member who created the note.

Relationships

  • belongs_to :noteable, polymorphic: true: Each note is associated with a polymorphic noteable entity.
  • belongs_to :subnoteable, polymorphic: true, optional: true: Each note can optionally be associated with a polymorphic subnoteable entity.
  • belongs_to :noted_by, class_name: "School::Profile::Staff": Each note is associated with the staff member who created it.

School::OffboardingAssessment

Summary

The School::OffboardingAssessment model represents assessments conducted as part of an offboarding IEP. It tracks the evaluation of student performance against the goals and objectives outlined in the offboarding IEP.

Fields/Columns

  • value: The result of the assessment (e.g., pass, fail, unassessed).
  • iep_id: The ID of the associated IEP.

Relationships

  • belongs_to :onboarding_iep, -> { where(type: "School::Iep::Onboarding") }, class_name: "School::Iep::Onboarding", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each offboarding assessment can optionally be associated with an onboarding IEP.
  • belongs_to :offboarding_iep, -> { where(type: "School::Iep::Offboarding") }, class_name: "School::Iep::Offboarding", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each offboarding assessment can optionally be associated with an offboarding IEP.
  • belongs_to :school_iep, -> { where(type: "School::Iep") }, class_name: "School::Iep", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each offboarding assessment can optionally be associated with a school IEP.

School::OfflineRecord

Summary

The School::OfflineRecord model manages offline records within the school system. It handles the creation, processing, and deletion of records that are not immediately available online.

Fields/Columns

  • owner_id: The ID of the associated owner.
  • owner_type: The type of the associated owner.
  • delete_at: The timestamp when the record should be deleted.

Relationships

  • belongs_to :owner, polymorphic: true, optional: true: Each offline record can optionally be associated with a polymorphic owner.

School::OnboardingAssessment

Summary

The School::OnboardingAssessment model represents assessments conducted as part of an onboarding IEP. It tracks the evaluation of student performance against the goals and objectives outlined in the onboarding IEP.

Fields/Columns

  • value: The result of the assessment (e.g., pass, fail, unassessed).
  • iep_id: The ID of the associated IEP.

Relationships

  • belongs_to :onboarding_iep, -> { where(type: "School::Iep::Onboarding") }, class_name: "School::Iep::Onboarding", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each onboarding assessment can optionally be associated with an onboarding IEP.
  • belongs_to :offboarding_iep, -> { where(type: "School::Iep::Offboarding") }, class_name: "School::Iep::Offboarding", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each onboarding assessment can optionally be associated with an offboarding IEP.
  • belongs_to :school_iep, -> { where(type: "School::Iep") }, class_name: "School::Iep", foreign_key: :iep_id, inverse_of: :iep_assessments, optional: true: Each onboarding assessment can optionally be associated with a school IEP.

Concerns Used

  • FirebaseEntity: Provides integration with Firebase for the model.

School::ParentReport

Summary

The School::ParentReport model represents reports generated for parents. It tracks performance metrics, attendance, and other relevant data for parent-level analysis.

Fields/Columns

  • status: The current status of the parent report (e.g., draft, awaiting_approval, approved, rejected).
  • iep_id: The ID of the associated IEP.
  • prepared_by_id: The ID of the staff member who prepared the report.
  • classroom_id: The ID of the associated classroom.
  • student_id: The ID of the associated student.

Relationships

  • belongs_to :iep, class_name: School::Iep.name: Each parent report is associated with an IEP.
  • belongs_to :prepared_by, class_name: "School::Profile::Staff": Each parent report is associated with the staff member who prepared it.
  • belongs_to :classroom, class_name: School::Classroom.name: Each parent report is associated with a classroom.
  • belongs_to :student, class_name: School::Student.name: Each parent report is associated with a student.
  • has_many :subgoals, class_name: School::ParentReportSubgoal.name, foreign_key: :parent_report_id: Each parent report can have many subgoals.
  • has_one :report_pdf, -> { order("created_at desc") }, class_name: "Medium", as: :record, dependent: :destroy: Each parent report can have one associated PDF document.
  • has_many :tasks, as: :taskable, class_name: School::Task::ParentReport.name: Each parent report can have many tasks.

Concerns Used

  • AASM: Provides state machine functionality for the model.

School::ParentReportSubgoal

Summary

The School::ParentReportSubgoal model represents subgoals within a parent report. It helps in breaking down the main goals of a parent report into smaller, manageable objectives.

Fields/Columns

  • subgoal_id: The ID of the associated subgoal.
  • subgoal_type: The type of the associated subgoal.
  • parent_report_id: The ID of the associated parent report.

Relationships

  • belongs_to :subgoal, polymorphic: true: Each parent report subgoal is associated with a polymorphic subgoal.
  • belongs_to :parent_report: Each parent report subgoal is associated with a parent report.

School::Profile

Summary

The School::Profile model represents user profiles in the school system, managing access permissions and user-specific settings.

Fields/Columns

  • user_id: The ID of the associated user.

Relationships

  • has_many :accesses, class_name: "School::Access", dependent: :destroy: Each profile can have many accesses.

School::Relationship

Summary

The School::Relationship model represents relationships between students and their guardians or family members. It manages the association and type of relationship within the school system.

Fields/Columns

  • relationship_type: The type of relationship (e.g., guardian, father, mother).
  • student_id: The ID of the associated student.
  • profile_id: The ID of the associated guardian profile.

Relationships

  • belongs_to :student: Each relationship is associated with a student.
  • belongs_to :guardian, class_name: "Profile::Guardian", foreign_key: :profile_id, optional: true: Each relationship can optionally be associated with a guardian profile.

School::Report

Summary

The School::Report model represents comprehensive reports in the school system. It manages data related to the generation, approval, and finalization of school-wide reports.

Fields/Columns

  • status: The current status of the report (e.g., draft, report_generated, awaiting_approval, approved, rejected, finalized).
  • start_date: The start date for the report period.
  • end_date: The end date for the report period.
  • kind: The type of report (e.g., active_iep, offboarding_iep).
  • iep_id: The ID of the associated IEP.
  • classroom_id: The ID of the associated classroom.
  • student_id: The ID of the associated student.
  • prepared_by_id: The ID of the staff member who prepared the report.

Relationships

  • belongs_to :iep, optional: true: Each report can optionally be associated with an IEP.
  • belongs_to :classroom, optional: true, class_name: "School::Classroom": Each report can optionally be associated with a classroom.
  • belongs_to :student: Each report is associated with a student.
  • belongs_to :prepared_by, optional: true, class_name: "School::Profile::Staff": Each report can optionally be associated with the staff member who prepared it.
  • has_many :report_items, class_name: School::ReportItem.name: Each report can have many report items.
  • has_one :overall_subgoal_achievement, -> { order("created_at desc") }, class_name: School::ReportItem::OverallSubgoalAchievement.name, foreign_key: :report_id, dependent: :destroy: Each report can have one overall subgoal achievement.
  • has_many :domain_achievements, class_name: School::ReportItem::DomainAchievement.name, foreign_key: :report_id, dependent: :destroy: Each report can have many domain achievements.
  • has_one :attendance_achievement, -> { order("created_at desc") }, class_name: School::ReportItem::AttendanceAchievement.name, foreign_key: :report_id, dependent: :destroy: Each report can have one attendance achievement.
  • has_one :word_achievement, -> { order("created_at desc") }, class_name: School::ReportItem::WordAchievement.name, foreign_key: :report_id, dependent: :destroy: Each report can have one word achievement.
  • has_many :domain_details, class_name: School::ReportItem::DomainDetail.name, foreign_key: :report_id, dependent: :destroy: Each report can have many domain details.
  • has_many :notes, as: :noteable: Each report can have many notes.
  • has_many :tasks, as: :taskable, class_name: School::Task::Report.name: Each report can have many tasks.
  • has_one :pdf_document, -> { order("created_at desc") }, class_name: "Medium", as: :record, dependent: :destroy: Each report can have one associated PDF document.

Concerns Used

  • AASM: Provides state machine functionality for the model.

School::SchoolReport

Summary

The School::SchoolReport model represents comprehensive reports in the school system. It manages data related to the generation, approval, and finalization of school-wide reports.

Fields/Columns

  • status: The current status of the school report (e.g., draft, awaiting_report_generation, report_generated, awaiting_approval, approved, rejected, finalized).
  • start_date: The start date for the report period.
  • end_date: The end date for the report period.
  • prepared_by_id: The ID of the staff member who prepared the report.

Relationships

  • belongs_to :prepared_by, optional: true, class_name: "School::Profile::Staff": Each school report can optionally be associated with the staff member who prepared it.
  • has_one :overall_summary, -> { order("created_at desc") }, class_name: School::SchoolReportItem::OverallSummary.name, foreign_key: :report_id, dependent: :destroy: Each school report can have one overall summary.
  • has_many :domain_details, -> { order("position asc") }, class_name: School::SchoolReportItem::DomainDetail.name, foreign_key: :report_id, dependent: :destroy: Each school report can have many domain details.
  • has_many :notes, as: :noteable: Each school report can have many notes.
  • has_one :iep_csv, -> { where(kind: "iep_csv") }, class_name: Medium.name, as: :record, dependent: :destroy: Each school report can have one associated CSV document.

Concerns Used

  • AASM: Provides state machine functionality for the model.

School::SchoolReportItem

Summary

The School::SchoolReportItem model represents individual items within a school report. It helps in organizing and detailing specific aspects of school performance and activities.

Fields/Columns

  • position: The position of the report item within the report.
  • reportable_id: The ID of the associated reportable entity.
  • reportable_type: The type of the associated reportable entity.
  • report_id: The ID of the associated school report.

Relationships

  • belongs_to :reportable, optional: true, polymorphic: true: Each school report item can be associated with a polymorphic reportable entity.
  • belongs_to :report, class_name: School::SchoolReport.name: Each school report item is associated with a school report.

School::Semester

Summary

The School::Semester model represents academic semesters within the school system. It manages the start and end dates of semesters and ensures the correct sequencing of semesters.

Fields/Columns

  • start_date: The start date of the semester.
  • end_date: The end date of the semester.
  • current: A boolean indicating whether the semester is the current semester.
  • next_semester_id: The ID of the next semester.
  • previous_semester_id: The ID of the previous semester.

Relationships

  • belongs_to :next_semester, class_name: "School::Semester", optional: true: Each semester can optionally be associated with the next semester.
  • belongs_to :previous_semester, class_name: "School::Semester", optional: true: Each semester can optionally be associated with the previous semester.

School::Settings

Summary

The School::Settings module provides configuration settings for the school system. It manages preferences related to semesters, email providers, import settings, and time zones.

Fields/Columns

  • settings: A JSON field storing various configuration settings.
  • semesters: A JSON field storing semester-related settings.

Relationships

  • None

Concerns Used

  • Preferenceable: Provides methods for managing preferences and settings.

School::SharedEntity

Summary

The School::SharedEntity model manages shared entities within the school system. It handles the sharing of reports, IEPs, and parent reports, including the generation of share tokens.

Fields/Columns

  • entity_id: The ID of the associated entity.
  • entity_type: The type of the associated entity.
  • expires_on: The expiration date of the share token.

Relationships

  • belongs_to :entity, polymorphic: true: Each shared entity is associated with a polymorphic entity.
  • has_many :entity_actions, -> { order("created_at desc") }, class_name: School::SharedEntityAction.name, foreign_key: :shared_entity_id, dependent: :destroy: Each shared entity can have many entity actions.
  • has_many :attachments, -> { order("created_at desc") }, class_name: "Medium", as: :record, dependent: :destroy: Each shared entity can have many attachments.

School::SharedEntityAction

Summary

The School::SharedEntityAction model represents actions taken on shared entities within the school system. It tracks the actions performed on shared reports, IEPs, and parent reports.

Fields/Columns

  • shared_entity_id: The ID of the associated shared entity.
  • action: The action performed on the shared entity.

Relationships

  • belongs_to :shared_entity, class_name: School::SharedEntity.name: Each shared entity action is associated with a shared entity.

School::StudentClassroom

Summary

The School::StudentClassroom model represents the association between students and classrooms. It tracks the enrollment of students in classrooms and ensures that a student is enrolled in only one current classroom at a time.

Fields/Columns

  • student_id: The ID of the associated student.
  • classroom_id: The ID of the associated classroom.
  • current: A boolean indicating whether the student is currently enrolled in the classroom.

Relationships

  • belongs_to :student: Each student classroom is associated with a student.
  • belongs_to :classroom: Each student classroom is associated with a classroom.

School::StudentOverride

Summary

The School::StudentOverride model manages overrides for student records within the school system. It tracks fields that have been overridden for specific students and ensures that each field is overridden only once per student and record.

Fields/Columns

  • student_id: The ID of the associated student.
  • record_id: The ID of the associated record.
  • record_type: The type of the associated record.
  • field_name: The name of the overridden field.
  • value: The overridden value.

Relationships

  • belongs_to :student: Each student override is associated with a student.
  • belongs_to :record, polymorphic: true: Each student override is associated with a polymorphic record.

School::StudentSummaryNode

Summary

The School::StudentSummaryNode model represents summary nodes for students within the school system. It helps in organizing and summarizing the different components and progress of a student's educational journey.

Fields/Columns

  • record_id: The ID of the associated record.
  • record_type: The type of the associated record.
  • student_id: The ID of the associated student.

Relationships

  • belongs_to :record, polymorphic: true: Each student summary node is associated with a polymorphic record.
  • belongs_to :student: Each student summary node is associated with a student.

Concerns Used

  • has_ancestry: Provides hierarchical relationships for the summary nodes.

School::Student

Summary

The School::Student model represents students within the school system. It manages student information, relationships, enrollments, assessments, and individualized education programs (IEPs).

Fields/Columns

  • first_name: The first name of the student.
  • last_name: The last name of the student.
  • date_of_birth: The date of birth of the student.
  • gender: The gender of the student.
  • joined_at: The date when the student joined the school.
  • sys_id_number: The system identification number of the student.

Relationships

  • has_many :relationships, dependent: :destroy: Each student can have many relationships.
  • has_many :guardians, through: :relationships: Each student can have many guardians through relationships.
  • has_many :student_classrooms, dependent: :destroy: Each student can have many student classrooms.
  • has_many :attended_classrooms, -> { distinct }, through: :student_classrooms, source: :classroom, class_name: "Classroom": Each student can have many attended classrooms.
  • has_many :ieps, class_name: "School::Iep", dependent: :destroy: Each student can have many IEPs.
  • has_many :onboarding_ieps, -> { order("created_at desc") }, class_name: "School::Iep::Onboarding", dependent: :destroy: Each student can have many onboarding IEPs.
  • has_one :onboarding_iep, -> { order("created_at desc") }, class_name: "School::Iep::Onboarding", dependent: :destroy: Each student can have one onboarding IEP.
  • has_one :active_iep, -> { where(status: "finalized").order("created_at desc") }, class_name: "School::Iep", dependent: :destroy: Each student can have one active IEP.
  • has_one :offboarding_iep, -> { order("created_at desc") }, class_name: "School::Iep::Offboarding", dependent: :destroy: Each student can have one offboarding IEP.
  • has_one :daily_iep, -> { where(type: [nil, School::Iep.name]).order("created_at desc") }, class_name: "School::Iep", dependent: :destroy: Each student can have one daily IEP.
  • has_many :assessments, class_name: "School::Assessment", dependent: :destroy: Each student can have many assessments.
  • has_many :assessment_days, class_name: "School::AssessmentDay", dependent: :destroy: Each student can have many assessment days.
  • has_many :iep_assessments, class_name: "School::IepAssessment", dependent: :destroy: Each student can have many IEP assessments.
  • has_many :onboarding_assessments, class_name: "School::OnboardingAssessment", dependent: :destroy: Each student can have many onboarding assessments.
  • has_many :daily_assessments, class_name: "School::DailyAssessment", dependent: :destroy: Each student can have many daily assessments.
  • has_many :subgoals, class_name: "School::Subgoal", dependent: :destroy: Each student can have many subgoals.
  • has_many :attendances, class_name: "School::Attendance", dependent: :destroy: Each student can have many attendances.
  • has_many :words, class_name: "School::Word", dependent: :destroy: Each student can have many words.
  • has_many :overrides, class_name: "School::StudentOverride", dependent: :destroy: Each student can have many overrides.
  • has_many :casestudies, class_name: "School::Casestudy", dependent: :destroy: Each student can have many case studies.
  • has_many :reports, class_name: "School::Report", dependent: :destroy: Each student can have many reports.
  • has_one :summary_node, class_name: "School::StudentSummaryNode::Student", dependent: :destroy: Each student can have one summary node.
  • has_one :active_classroom_student, -> { where(current: true) }, class_name: "School::StudentClassroom": Each student can have one active classroom student.
  • has_one :active_classroom, through: :active_classroom_student, source: :classroom, class_name: "School::Classroom": Each student can have one active classroom.

Concerns Used

  • ProfileImage: Provides methods for managing profile images.
  • School::Students::Transitions: Provides state transition methods for students.
  • FirebaseEntity: Provides integration with Firebase for the model.
  • School::Students::ImportAssessments: Provides methods for importing assessments.
  • School::Students::SummaryNodeHelper: Provides helper methods for managing summary nodes.

School::Subgoal

Summary

The School::Subgoal model represents subgoals within the school system. It helps in breaking down the main goals into smaller, manageable objectives and tracks their progress.

Fields/Columns

  • title: The title of the subgoal.
  • position: The position of the subgoal within the goal.
  • goal_id: The ID of the associated goal.
  • student_id: The ID of the associated student.
  • archived_at: The timestamp when the subgoal was archived.

Relationships

  • belongs_to :goal, class_name: "Library::Goal": Each subgoal is associated with a goal.
  • belongs_to :student: Each subgoal is associated with a student.
  • has_one_attached :instruction_image: Each subgoal can have one attached instruction image.
  • has_many :summary_nodes, class_name: "School::IepSummaryNode", as: :record: Each subgoal can have many summary nodes.
  • has_many :iep_subgoals, as: :subgoal, class_name: "School::IepSubgoal": Each subgoal can have many IEP subgoals.
  • has_many :casestudy_subgoals, as: :subgoal, class_name: "School::CasestudySubgoal": Each subgoal can have many case study subgoals.

School::Tag

Summary

The School::Tag model represents tags in the school system, managing the categorization and organization of various entities.

Fields/Columns

  • name: The name of the tag.

Relationships

  • has_many :taggings, dependent: :destroy, class_name: "School::Tagging": Each tag can have many taggings.

Concerns Used

  • FirebaseEntity: Provides integration with Firebase for the model.

School::Tagging

Summary

The School::Tagging model represents the association between tags and taggable entities in the school system.

Fields/Columns

  • tag_id: The ID of the associated tag.

Relationships

  • belongs_to :tag, class_name: "School::Tag": Each tagging is associated with a tag.

School::Task

Summary

The School::Task model represents tasks assigned within the school system. It manages the creation, assignment, and tracking of tasks related to various entities such as reports, classroom reports, case studies, IEPs, and parent reports.

Fields/Columns

  • title: The title of the task.
  • description: The description of the task.
  • due_date: The due date of the task.
  • status: The current status of the task (e.g., pending, completed).
  • staff_id: The ID of the staff member assigned to the task.
  • taskable_id: The ID of the associated taskable entity.
  • taskable_type: The type of the associated taskable entity.
  • classroom_id: The ID of the associated classroom.

Relationships

  • belongs_to :staff, optional: true, class_name: "School::Profile::Staff": Each task can optionally be associated with a staff member.
  • belongs_to :taskable, polymorphic: true: Each task is associated with a polymorphic taskable entity.
  • belongs_to :classroom, optional: true, class_name: "School::Classroom": Each task can optionally be associated with a classroom.

School::Template

Summary

The School::Template model represents templates in the school system, managing reusable content for various purposes.

Fields/Columns

  • content: The content of the template.

School::Word

Summary

The School::Word model represents vocabulary words tracked for students in the school system. It manages the learning and forgetting status of words for individual students.

Fields/Columns

  • name: The name of the word.
  • student_id: The ID of the associated student.
  • learned_at: The timestamp when the word was learned.
  • forgotten_at: The timestamp when the word was forgotten.

Relationships

  • belongs_to :student: Each word is associated with a student.

School::Worksheet

Summary

The School::Worksheet model represents worksheets in the school system, managing educational activities and associated metadata.

Fields/Columns

  • title: The title of the worksheet.
  • status: The current status of the worksheet (e.g., draft, published).
  • goal_id: The ID of the associated goal.
  • template_id: The ID of the associated template.
  • iep_id: The ID of the associated IEP.
  • classroom_id: The ID of the associated classroom.
  • created_by_id: The ID of the profile that created the worksheet.
  • duplicated_from_id: The ID of the original worksheet from which this worksheet was duplicated.

Relationships

  • belongs_to :goal, class_name: "Library::Goal", optional: true: Each worksheet can optionally be associated with a goal.
  • belongs_to :template, optional: true: Each worksheet can optionally be associated with a template.
  • belongs_to :iep, optional: true: Each worksheet can optionally be associated with an IEP.
  • belongs_to :classroom, class_name: "School::Classroom", optional: true: Each worksheet can optionally be associated with a classroom.
  • belongs_to :created_by, class_name: "Profile": Each worksheet is associated with the profile that created it.
  • has_many :notes, as: :noteable, dependent: :destroy: Each worksheet can have many notes.
  • has_many :worksheet_materials, class_name: "School::WorksheetMaterial", foreign_key: "worksheet_id", dependent: :destroy: Each worksheet can have many worksheet materials.
  • has_many :materials, through: :worksheet_materials: Each worksheet can have many materials through worksheet materials.
  • has_many :custom_images, -> { where(kind: "custom_image").order("created_at desc") }, class_name: "Medium", as: :record, dependent: :destroy: Each worksheet can have many custom images.
  • has_one :preview_image, -> { where(kind: "preview_image").order("created_at desc") }, class_name: "Medium", as: :record, dependent: :destroy: Each worksheet can have one preview image.
  • has_one :pdf_document, -> { where(kind: "pdf_document").order("created_at desc") }, class_name: "Medium", as: :record, dependent: :destroy: Each worksheet can have one PDF document.
  • has_many :duplicated_sheets, class_name: School::Worksheet.name, foreign_key: :duplicated_from_id, dependent: :nullify: Each worksheet can have many duplicated sheets.
  • belongs_to :original_sheet, foreign_key: :duplicated_from_id, optional: true, polymorphic: true: Each worksheet can optionally be associated with an original sheet.
  • has_many :worksheet_domains, class_name: School::WorksheetDomain.name, dependent: :destroy: Each worksheet can have many worksheet domains.

Concerns Used

  • AASM: Provides state machine functionality for the model.

School::WorksheetDomain

Summary

The School::WorksheetDomain model represents the association between worksheets and domains in the school system.

Fields/Columns

  • worksheet_id: The ID of the associated worksheet.
  • domain_id: The ID of the associated domain.

Relationships

  • belongs_to :worksheet, class_name: School::Worksheet.name, foreign_key: :worksheet_id: Each worksheet domain is associated with a worksheet.
  • belongs_to :domain, class_name: Library::Domain.name, foreign_key: :domain_id: Each worksheet domain is associated with a domain.

School::WorksheetMaterial

Summary

The School::WorksheetMaterial model represents the association between worksheets and materials in the school system.

Fields/Columns

  • material_id: The ID of the associated material.
  • worksheet_id: The ID of the associated worksheet.

Relationships

  • belongs_to :material, class_name: "Library::Material": Each worksheet material is associated with a material.
  • belongs_to :worksheet, class_name: "School::Worksheet": Each worksheet material is associated with a worksheet.