Split academic year into seasons if the academic year's range is

initialized with a season, i.e. "2024-25 Fall".  Update scapers for
admin data, enrollment and staffing to use the new range standard
correctly.   Update the loaders for admin data, enrollment and staffing
so that it populates all seasons in a given year.  So admin data for
2024-25 gets loaded into "2024-25 Fall" and "2024-25 Spring".  Add tests
for the new range format.  Set the default cutoff for the start of Spring season will be the last Sunday in February
This commit is contained in:
Nelson Jovel 2024-04-18 11:35:56 -07:00
parent 996bb01d0b
commit 33da0859b9
43 changed files with 62404 additions and 28698 deletions

View file

@ -122,16 +122,14 @@ class Seeder
def seed_enrollment(csv_file)
EnrollmentLoader.load_data(filepath: csv_file)
missing_enrollment_for_current_year = Respondent.where(academic_year: AcademicYear.order(:range).last).count.zero?
EnrollmentLoader.clone_previous_year_data if missing_enrollment_for_current_year
EnrollmentLoader.clone_previous_year_data
end
def seed_staffing(csv_file)
StaffingLoader.load_data(filepath: csv_file)
missing_staffing_for_current_year = Respondent.where(academic_year: AcademicYear.order(:range).last).group(:total_teachers).having("total_teachers > 0").count.count.zero?
StaffingLoader.clone_previous_year_data if missing_staffing_for_current_year
StaffingLoader.clone_previous_year_data
end
private