





















const db = require('../models');
const Users = db.users;






const Organizations = db.organizations;

const Campuses = db.campuses;

const AcademicYears = db.academic_years;

const Grades = db.grades;

const Subjects = db.subjects;

const Students = db.students;

const Guardians = db.guardians;

const Staff = db.staff;

const Classes = db.classes;

const ClassEnrollments = db.class_enrollments;

const ClassSubjects = db.class_subjects;

const Timetables = db.timetables;

const TimetablePeriods = db.timetable_periods;

const AttendanceSessions = db.attendance_sessions;

const AttendanceRecords = db.attendance_records;

const FeePlans = db.fee_plans;

const Invoices = db.invoices;

const Payments = db.payments;

const Assessments = db.assessments;

const AssessmentResults = db.assessment_results;

const Messages = db.messages;

const MessageRecipients = db.message_recipients;

const Documents = db.documents;







const OrganizationsData = [
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
    },
    
];



const CampusesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Grace Hopper",
            
        
    
        
        
            
                "address": "Grace Hopper",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "address": "Grace Hopper",
            
        
    
        
        
            
                "phone": "Grace Hopper",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
];



const AcademicYearsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "current": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "current": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "current": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "current": true,
            
        
    
    },
    
];



const GradesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "sort_order": 2,
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Ada Lovelace",
            
        
    
        
        
            
                "sort_order": 9,
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Ada Lovelace",
            
        
    
        
        
            
                "sort_order": 8,
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
    },
    
];



const SubjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "code": "Grace Hopper",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
    },
    
];



const StudentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "student_number": "Grace Hopper",
            
        
    
        
        
            
                "first_name": "Alan Turing",
            
        
    
        
        
            
                "last_name": "Grace Hopper",
            
        
    
        
        
            
                "gender": "prefer_not_to_say",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "enrollment_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "graduated",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "student_number": "Alan Turing",
            
        
    
        
        
            
                "first_name": "Marie Curie",
            
        
    
        
        
            
                "last_name": "Grace Hopper",
            
        
    
        
        
            
                "gender": "male",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "enrollment_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "transferred",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "student_number": "Marie Curie",
            
        
    
        
        
            
                "first_name": "Alan Turing",
            
        
    
        
        
            
                "last_name": "Marie Curie",
            
        
    
        
        
            
                "gender": "prefer_not_to_say",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "enrollment_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "phone": "Grace Hopper",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "student_number": "Alan Turing",
            
        
    
        
        
            
                "first_name": "Ada Lovelace",
            
        
    
        
        
            
                "last_name": "Ada Lovelace",
            
        
    
        
        
            
                "gender": "female",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "enrollment_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "transferred",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "address": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
];



const GuardiansData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Alan Turing",
            
        
    
        
        
            
                "relationship": "guardian",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "primary_contact": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Grace Hopper",
            
        
    
        
        
            
                "relationship": "other",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "primary_contact": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Alan Turing",
            
        
    
        
        
            
                "relationship": "father",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "primary_contact": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Marie Curie",
            
        
    
        
        
            
                "relationship": "guardian",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "primary_contact": true,
            
        
    
    },
    
];



const StaffData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employee_number": "Marie Curie",
            
        
    
        
        
            
                "job_title": "Marie Curie",
            
        
    
        
        
            
                "staff_type": "admin",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "on_leave",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employee_number": "Marie Curie",
            
        
    
        
        
            
                "job_title": "Grace Hopper",
            
        
    
        
        
            
                "staff_type": "support",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "on_leave",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employee_number": "Grace Hopper",
            
        
    
        
        
            
                "job_title": "Grace Hopper",
            
        
    
        
        
            
                "staff_type": "support",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employee_number": "Grace Hopper",
            
        
    
        
        
            
                "job_title": "Marie Curie",
            
        
    
        
        
            
                "staff_type": "admin",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
];



const ClassesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "section": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "capacity": 5,
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "section": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "capacity": 8,
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "section": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "capacity": 5,
            
        
    
        
        
            
                "status": "archived",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "section": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "capacity": 5,
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
];



const ClassEnrollmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "enrolled_on": new Date(Date.now()),
            
        
    
        
        
            
                "ended_on": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "enrolled_on": new Date(Date.now()),
            
        
    
        
        
            
                "ended_on": new Date(Date.now()),
            
        
    
        
        
            
                "status": "dropped",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "enrolled_on": new Date(Date.now()),
            
        
    
        
        
            
                "ended_on": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "enrolled_on": new Date(Date.now()),
            
        
    
        
        
            
                "ended_on": new Date(Date.now()),
            
        
    
        
        
            
                "status": "dropped",
            
        
    
    },
    
];



const ClassSubjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
    },
    
];



const TimetablesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "archived",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
];



const TimetablePeriodsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "day_of_week": "wednesday",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                "room": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "day_of_week": "wednesday",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                "room": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "day_of_week": "saturday",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                "room": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "day_of_week": "wednesday",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                "room": "Marie Curie",
            
        
    
    },
    
];



const AttendanceSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_date": new Date(Date.now()),
            
        
    
        
        
            
                "session_type": "homeroom",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_date": new Date(Date.now()),
            
        
    
        
        
            
                "session_type": "homeroom",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_date": new Date(Date.now()),
            
        
    
        
        
            
                "session_type": "exam",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_date": new Date(Date.now()),
            
        
    
        
        
            
                "session_type": "event",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
    },
    
];



const AttendanceRecordsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "absent",
            
        
    
        
        
            
                "minutes_late": 8,
            
        
    
        
        
            
                "remarks": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "late",
            
        
    
        
        
            
                "minutes_late": 9,
            
        
    
        
        
            
                "remarks": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "excused",
            
        
    
        
        
            
                "minutes_late": 2,
            
        
    
        
        
            
                "remarks": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "absent",
            
        
    
        
        
            
                "minutes_late": 8,
            
        
    
        
        
            
                "remarks": "Grace Hopper",
            
        
    
    },
    
];



const FeePlansData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "billing_cycle": "monthly",
            
        
    
        
        
            
                "total_amount": 1.31,
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "billing_cycle": "one_time",
            
        
    
        
        
            
                "total_amount": 8.92,
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "billing_cycle": "annual",
            
        
    
        
        
            
                "total_amount": 7.36,
            
        
    
        
        
            
                "active": false,
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "billing_cycle": "one_time",
            
        
    
        
        
            
                "total_amount": 5.57,
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
    },
    
];



const InvoicesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Grace Hopper",
            
        
    
        
        
            
                "issue_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 1.42,
            
        
    
        
        
            
                "discount_amount": 7.75,
            
        
    
        
        
            
                "tax_amount": 7.96,
            
        
    
        
        
            
                "total_amount": 6.64,
            
        
    
        
        
            
                "balance_due": 6.13,
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Marie Curie",
            
        
    
        
        
            
                "issue_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 1.01,
            
        
    
        
        
            
                "discount_amount": 1.19,
            
        
    
        
        
            
                "tax_amount": 5.93,
            
        
    
        
        
            
                "total_amount": 5.66,
            
        
    
        
        
            
                "balance_due": 6.53,
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Marie Curie",
            
        
    
        
        
            
                "issue_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 6.33,
            
        
    
        
        
            
                "discount_amount": 5.35,
            
        
    
        
        
            
                "tax_amount": 4.66,
            
        
    
        
        
            
                "total_amount": 9.22,
            
        
    
        
        
            
                "balance_due": 5.79,
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Ada Lovelace",
            
        
    
        
        
            
                "issue_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 5.87,
            
        
    
        
        
            
                "discount_amount": 4.89,
            
        
    
        
        
            
                "tax_amount": 9.28,
            
        
    
        
        
            
                "total_amount": 3.69,
            
        
    
        
        
            
                "balance_due": 2.0,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_number": "Ada Lovelace",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 2.81,
            
        
    
        
        
            
                "method": "other",
            
        
    
        
        
            
                "reference_code": "Alan Turing",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_number": "Ada Lovelace",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 3.29,
            
        
    
        
        
            
                "method": "mobile_money",
            
        
    
        
        
            
                "reference_code": "Alan Turing",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_number": "Alan Turing",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 1.69,
            
        
    
        
        
            
                "method": "card",
            
        
    
        
        
            
                "reference_code": "Grace Hopper",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_number": "Ada Lovelace",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 5.7,
            
        
    
        
        
            
                "method": "card",
            
        
    
        
        
            
                "reference_code": "Marie Curie",
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const AssessmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "assessment_type": "homework",
            
        
    
        
        
            
                "assigned_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "max_score": 2.75,
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                "instructions": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "assessment_type": "final",
            
        
    
        
        
            
                "assigned_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "max_score": 5.24,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "instructions": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "assessment_type": "midterm",
            
        
    
        
        
            
                "assigned_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "max_score": 0.58,
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                "instructions": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "assessment_type": "midterm",
            
        
    
        
        
            
                "assigned_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "max_score": 0.85,
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                "instructions": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const AssessmentResultsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 9.28,
            
        
    
        
        
            
                "grade_letter": "E",
            
        
    
        
        
            
                "remarks": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 7.44,
            
        
    
        
        
            
                "grade_letter": "A",
            
        
    
        
        
            
                "remarks": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 1.43,
            
        
    
        
        
            
                "grade_letter": "F",
            
        
    
        
        
            
                "remarks": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 2.59,
            
        
    
        
        
            
                "grade_letter": "B",
            
        
    
        
        
            
                "remarks": "Ada Lovelace",
            
        
    
    },
    
];



const MessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Marie Curie",
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                "channel": "in_app",
            
        
    
        
        
            
                "audience": "class",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Grace Hopper",
            
        
    
        
        
            
                "body": "Ada Lovelace",
            
        
    
        
        
            
                "channel": "in_app",
            
        
    
        
        
            
                "audience": "class",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Ada Lovelace",
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                "channel": "sms",
            
        
    
        
        
            
                "audience": "campus",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "sent",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Marie Curie",
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                "channel": "sms",
            
        
    
        
        
            
                "audience": "all_org",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const MessageRecipientsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient_type": "user",
            
        
    
        
        
            
                "recipient_label": "Grace Hopper",
            
        
    
        
        
            
                "destination": "Alan Turing",
            
        
    
        
        
            
                "delivery_status": "pending",
            
        
    
        
        
            
                "delivered_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient_type": "guardian",
            
        
    
        
        
            
                "recipient_label": "Alan Turing",
            
        
    
        
        
            
                "destination": "Grace Hopper",
            
        
    
        
        
            
                "delivery_status": "delivered",
            
        
    
        
        
            
                "delivered_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient_type": "student",
            
        
    
        
        
            
                "recipient_label": "Marie Curie",
            
        
    
        
        
            
                "destination": "Marie Curie",
            
        
    
        
        
            
                "delivery_status": "read",
            
        
    
        
        
            
                "delivered_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient_type": "guardian",
            
        
    
        
        
            
                "recipient_label": "Ada Lovelace",
            
        
    
        
        
            
                "destination": "Ada Lovelace",
            
        
    
        
        
            
                "delivery_status": "sent",
            
        
    
        
        
            
                "delivered_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
];



const DocumentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "campus",
            
        
    
        
        
            
                "entity_reference": "Marie Curie",
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "category": "receipt",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "student",
            
        
    
        
        
            
                "entity_reference": "Grace Hopper",
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "category": "id",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "staff",
            
        
    
        
        
            
                "entity_reference": "Ada Lovelace",
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "category": "medical",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "organization",
            
        
    
        
        
            
                "entity_reference": "Alan Turing",
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "category": "receipt",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateUserWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User0 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (User0?.setOrganization)
                {
                    await
                    User0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User1 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (User1?.setOrganization)
                {
                    await
                    User1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User2 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (User2?.setOrganization)
                {
                    await
                    User2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User3 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (User3?.setOrganization)
                {
                    await
                    User3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
    
    
        
    

    
    
    
        
            
            async function associateCampusWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Campus0 = await Campuses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Campus0?.setOrganization)
                {
                    await
                    Campus0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Campus1 = await Campuses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Campus1?.setOrganization)
                {
                    await
                    Campus1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Campus2 = await Campuses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Campus2?.setOrganization)
                {
                    await
                    Campus2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Campus3 = await Campuses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Campus3?.setOrganization)
                {
                    await
                    Campus3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAcademicYearWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AcademicYear0 = await AcademicYears.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AcademicYear0?.setOrganization)
                {
                    await
                    AcademicYear0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AcademicYear1 = await AcademicYears.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AcademicYear1?.setOrganization)
                {
                    await
                    AcademicYear1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AcademicYear2 = await AcademicYears.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AcademicYear2?.setOrganization)
                {
                    await
                    AcademicYear2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AcademicYear3 = await AcademicYears.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AcademicYear3?.setOrganization)
                {
                    await
                    AcademicYear3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateGradeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Grade0 = await Grades.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Grade0?.setOrganization)
                {
                    await
                    Grade0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Grade1 = await Grades.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Grade1?.setOrganization)
                {
                    await
                    Grade1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Grade2 = await Grades.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Grade2?.setOrganization)
                {
                    await
                    Grade2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Grade3 = await Grades.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Grade3?.setOrganization)
                {
                    await
                    Grade3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateSubjectWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Subject0 = await Subjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Subject0?.setOrganization)
                {
                    await
                    Subject0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Subject1 = await Subjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Subject1?.setOrganization)
                {
                    await
                    Subject1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Subject2 = await Subjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Subject2?.setOrganization)
                {
                    await
                    Subject2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Subject3 = await Subjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Subject3?.setOrganization)
                {
                    await
                    Subject3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateStudentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Student0 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Student0?.setOrganization)
                {
                    await
                    Student0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Student1 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Student1?.setOrganization)
                {
                    await
                    Student1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Student2 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Student2?.setOrganization)
                {
                    await
                    Student2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Student3 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Student3?.setOrganization)
                {
                    await
                    Student3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateStudentWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Student0 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Student0?.setCampu)
                {
                    await
                    Student0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Student1 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Student1?.setCampu)
                {
                    await
                    Student1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Student2 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Student2?.setCampu)
                {
                    await
                    Student2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Student3 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Student3?.setCampu)
                {
                    await
                    Student3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateGuardianWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Guardian0 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Guardian0?.setOrganization)
                {
                    await
                    Guardian0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Guardian1 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Guardian1?.setOrganization)
                {
                    await
                    Guardian1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Guardian2 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Guardian2?.setOrganization)
                {
                    await
                    Guardian2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Guardian3 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Guardian3?.setOrganization)
                {
                    await
                    Guardian3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateGuardianWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Guardian0 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Guardian0?.setStudent)
                {
                    await
                    Guardian0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Guardian1 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Guardian1?.setStudent)
                {
                    await
                    Guardian1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Guardian2 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Guardian2?.setStudent)
                {
                    await
                    Guardian2.
                    setStudent(relatedStudent2);
                }
            
                const relatedStudent3 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Guardian3 = await Guardians.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Guardian3?.setStudent)
                {
                    await
                    Guardian3.
                    setStudent(relatedStudent3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateStaffWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Staff0 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Staff0?.setOrganization)
                {
                    await
                    Staff0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Staff1 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Staff1?.setOrganization)
                {
                    await
                    Staff1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Staff2 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Staff2?.setOrganization)
                {
                    await
                    Staff2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Staff3 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Staff3?.setOrganization)
                {
                    await
                    Staff3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateStaffWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Staff0 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Staff0?.setCampu)
                {
                    await
                    Staff0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Staff1 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Staff1?.setCampu)
                {
                    await
                    Staff1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Staff2 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Staff2?.setCampu)
                {
                    await
                    Staff2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Staff3 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Staff3?.setCampu)
                {
                    await
                    Staff3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
            
            async function associateStaffWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Staff0 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Staff0?.setUser)
                {
                    await
                    Staff0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Staff1 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Staff1?.setUser)
                {
                    await
                    Staff1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Staff2 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Staff2?.setUser)
                {
                    await
                    Staff2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Staff3 = await Staff.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Staff3?.setUser)
                {
                    await
                    Staff3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateClassWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setOrganization)
                {
                    await
                    Class0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setOrganization)
                {
                    await
                    Class1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setOrganization)
                {
                    await
                    Class2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Class3 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Class3?.setOrganization)
                {
                    await
                    Class3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateClassWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setCampu)
                {
                    await
                    Class0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setCampu)
                {
                    await
                    Class1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setCampu)
                {
                    await
                    Class2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Class3 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Class3?.setCampu)
                {
                    await
                    Class3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
            
            async function associateClassWithAcademic_year() {
            
                const relatedAcademic_year0 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setAcademic_year)
                {
                    await
                    Class0.
                    setAcademic_year(relatedAcademic_year0);
                }
            
                const relatedAcademic_year1 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setAcademic_year)
                {
                    await
                    Class1.
                    setAcademic_year(relatedAcademic_year1);
                }
            
                const relatedAcademic_year2 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setAcademic_year)
                {
                    await
                    Class2.
                    setAcademic_year(relatedAcademic_year2);
                }
            
                const relatedAcademic_year3 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Class3 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Class3?.setAcademic_year)
                {
                    await
                    Class3.
                    setAcademic_year(relatedAcademic_year3);
                }
            
        }
        
    
        
            
            async function associateClassWithGrade() {
            
                const relatedGrade0 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setGrade)
                {
                    await
                    Class0.
                    setGrade(relatedGrade0);
                }
            
                const relatedGrade1 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setGrade)
                {
                    await
                    Class1.
                    setGrade(relatedGrade1);
                }
            
                const relatedGrade2 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setGrade)
                {
                    await
                    Class2.
                    setGrade(relatedGrade2);
                }
            
                const relatedGrade3 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const Class3 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Class3?.setGrade)
                {
                    await
                    Class3.
                    setGrade(relatedGrade3);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateClassWithHomeroom_teacher() {
            
                const relatedHomeroom_teacher0 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setHomeroom_teacher)
                {
                    await
                    Class0.
                    setHomeroom_teacher(relatedHomeroom_teacher0);
                }
            
                const relatedHomeroom_teacher1 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setHomeroom_teacher)
                {
                    await
                    Class1.
                    setHomeroom_teacher(relatedHomeroom_teacher1);
                }
            
                const relatedHomeroom_teacher2 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setHomeroom_teacher)
                {
                    await
                    Class2.
                    setHomeroom_teacher(relatedHomeroom_teacher2);
                }
            
                const relatedHomeroom_teacher3 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Class3 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Class3?.setHomeroom_teacher)
                {
                    await
                    Class3.
                    setHomeroom_teacher(relatedHomeroom_teacher3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateClassEnrollmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassEnrollment0 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassEnrollment0?.setOrganization)
                {
                    await
                    ClassEnrollment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassEnrollment1 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassEnrollment1?.setOrganization)
                {
                    await
                    ClassEnrollment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassEnrollment2 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassEnrollment2?.setOrganization)
                {
                    await
                    ClassEnrollment2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassEnrollment3 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClassEnrollment3?.setOrganization)
                {
                    await
                    ClassEnrollment3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateClassEnrollmentWithClas() {
            
                const relatedClas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassEnrollment0 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassEnrollment0?.setClas)
                {
                    await
                    ClassEnrollment0.
                    setClas(relatedClas0);
                }
            
                const relatedClas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassEnrollment1 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassEnrollment1?.setClas)
                {
                    await
                    ClassEnrollment1.
                    setClas(relatedClas1);
                }
            
                const relatedClas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassEnrollment2 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassEnrollment2?.setClas)
                {
                    await
                    ClassEnrollment2.
                    setClas(relatedClas2);
                }
            
                const relatedClas3 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassEnrollment3 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClassEnrollment3?.setClas)
                {
                    await
                    ClassEnrollment3.
                    setClas(relatedClas3);
                }
            
        }
        
    
        
            
            async function associateClassEnrollmentWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ClassEnrollment0 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassEnrollment0?.setStudent)
                {
                    await
                    ClassEnrollment0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ClassEnrollment1 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassEnrollment1?.setStudent)
                {
                    await
                    ClassEnrollment1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ClassEnrollment2 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassEnrollment2?.setStudent)
                {
                    await
                    ClassEnrollment2.
                    setStudent(relatedStudent2);
                }
            
                const relatedStudent3 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ClassEnrollment3 = await ClassEnrollments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClassEnrollment3?.setStudent)
                {
                    await
                    ClassEnrollment3.
                    setStudent(relatedStudent3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateClassSubjectWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setOrganization)
                {
                    await
                    ClassSubject0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setOrganization)
                {
                    await
                    ClassSubject1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setOrganization)
                {
                    await
                    ClassSubject2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ClassSubject3 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClassSubject3?.setOrganization)
                {
                    await
                    ClassSubject3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateClassSubjectWithClas() {
            
                const relatedClas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setClas)
                {
                    await
                    ClassSubject0.
                    setClas(relatedClas0);
                }
            
                const relatedClas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setClas)
                {
                    await
                    ClassSubject1.
                    setClas(relatedClas1);
                }
            
                const relatedClas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setClas)
                {
                    await
                    ClassSubject2.
                    setClas(relatedClas2);
                }
            
                const relatedClas3 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassSubject3 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClassSubject3?.setClas)
                {
                    await
                    ClassSubject3.
                    setClas(relatedClas3);
                }
            
        }
        
    
        
            
            async function associateClassSubjectWithSubject() {
            
                const relatedSubject0 = await Subjects.findOne({
                    offset: Math.floor(Math.random() * (await Subjects.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setSubject)
                {
                    await
                    ClassSubject0.
                    setSubject(relatedSubject0);
                }
            
                const relatedSubject1 = await Subjects.findOne({
                    offset: Math.floor(Math.random() * (await Subjects.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setSubject)
                {
                    await
                    ClassSubject1.
                    setSubject(relatedSubject1);
                }
            
                const relatedSubject2 = await Subjects.findOne({
                    offset: Math.floor(Math.random() * (await Subjects.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setSubject)
                {
                    await
                    ClassSubject2.
                    setSubject(relatedSubject2);
                }
            
                const relatedSubject3 = await Subjects.findOne({
                    offset: Math.floor(Math.random() * (await Subjects.count())),
                });
                const ClassSubject3 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClassSubject3?.setSubject)
                {
                    await
                    ClassSubject3.
                    setSubject(relatedSubject3);
                }
            
        }
        
    
        
            
            async function associateClassSubjectWithTeacher() {
            
                const relatedTeacher0 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setTeacher)
                {
                    await
                    ClassSubject0.
                    setTeacher(relatedTeacher0);
                }
            
                const relatedTeacher1 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setTeacher)
                {
                    await
                    ClassSubject1.
                    setTeacher(relatedTeacher1);
                }
            
                const relatedTeacher2 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setTeacher)
                {
                    await
                    ClassSubject2.
                    setTeacher(relatedTeacher2);
                }
            
                const relatedTeacher3 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const ClassSubject3 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClassSubject3?.setTeacher)
                {
                    await
                    ClassSubject3.
                    setTeacher(relatedTeacher3);
                }
            
        }
        
    
        
    

    
    
    
        
            
            async function associateTimetableWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Timetable0 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Timetable0?.setOrganization)
                {
                    await
                    Timetable0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Timetable1 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Timetable1?.setOrganization)
                {
                    await
                    Timetable1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Timetable2 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Timetable2?.setOrganization)
                {
                    await
                    Timetable2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Timetable3 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Timetable3?.setOrganization)
                {
                    await
                    Timetable3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateTimetableWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Timetable0 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Timetable0?.setCampu)
                {
                    await
                    Timetable0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Timetable1 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Timetable1?.setCampu)
                {
                    await
                    Timetable1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Timetable2 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Timetable2?.setCampu)
                {
                    await
                    Timetable2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Timetable3 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Timetable3?.setCampu)
                {
                    await
                    Timetable3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
            
            async function associateTimetableWithAcademic_year() {
            
                const relatedAcademic_year0 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Timetable0 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Timetable0?.setAcademic_year)
                {
                    await
                    Timetable0.
                    setAcademic_year(relatedAcademic_year0);
                }
            
                const relatedAcademic_year1 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Timetable1 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Timetable1?.setAcademic_year)
                {
                    await
                    Timetable1.
                    setAcademic_year(relatedAcademic_year1);
                }
            
                const relatedAcademic_year2 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Timetable2 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Timetable2?.setAcademic_year)
                {
                    await
                    Timetable2.
                    setAcademic_year(relatedAcademic_year2);
                }
            
                const relatedAcademic_year3 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Timetable3 = await Timetables.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Timetable3?.setAcademic_year)
                {
                    await
                    Timetable3.
                    setAcademic_year(relatedAcademic_year3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateTimetablePeriodWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TimetablePeriod0 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimetablePeriod0?.setOrganization)
                {
                    await
                    TimetablePeriod0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TimetablePeriod1 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimetablePeriod1?.setOrganization)
                {
                    await
                    TimetablePeriod1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TimetablePeriod2 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimetablePeriod2?.setOrganization)
                {
                    await
                    TimetablePeriod2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TimetablePeriod3 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (TimetablePeriod3?.setOrganization)
                {
                    await
                    TimetablePeriod3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateTimetablePeriodWithTimetable() {
            
                const relatedTimetable0 = await Timetables.findOne({
                    offset: Math.floor(Math.random() * (await Timetables.count())),
                });
                const TimetablePeriod0 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimetablePeriod0?.setTimetable)
                {
                    await
                    TimetablePeriod0.
                    setTimetable(relatedTimetable0);
                }
            
                const relatedTimetable1 = await Timetables.findOne({
                    offset: Math.floor(Math.random() * (await Timetables.count())),
                });
                const TimetablePeriod1 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimetablePeriod1?.setTimetable)
                {
                    await
                    TimetablePeriod1.
                    setTimetable(relatedTimetable1);
                }
            
                const relatedTimetable2 = await Timetables.findOne({
                    offset: Math.floor(Math.random() * (await Timetables.count())),
                });
                const TimetablePeriod2 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimetablePeriod2?.setTimetable)
                {
                    await
                    TimetablePeriod2.
                    setTimetable(relatedTimetable2);
                }
            
                const relatedTimetable3 = await Timetables.findOne({
                    offset: Math.floor(Math.random() * (await Timetables.count())),
                });
                const TimetablePeriod3 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (TimetablePeriod3?.setTimetable)
                {
                    await
                    TimetablePeriod3.
                    setTimetable(relatedTimetable3);
                }
            
        }
        
    
        
            
            async function associateTimetablePeriodWithClass_subject() {
            
                const relatedClass_subject0 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const TimetablePeriod0 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimetablePeriod0?.setClass_subject)
                {
                    await
                    TimetablePeriod0.
                    setClass_subject(relatedClass_subject0);
                }
            
                const relatedClass_subject1 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const TimetablePeriod1 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimetablePeriod1?.setClass_subject)
                {
                    await
                    TimetablePeriod1.
                    setClass_subject(relatedClass_subject1);
                }
            
                const relatedClass_subject2 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const TimetablePeriod2 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimetablePeriod2?.setClass_subject)
                {
                    await
                    TimetablePeriod2.
                    setClass_subject(relatedClass_subject2);
                }
            
                const relatedClass_subject3 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const TimetablePeriod3 = await TimetablePeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (TimetablePeriod3?.setClass_subject)
                {
                    await
                    TimetablePeriod3.
                    setClass_subject(relatedClass_subject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAttendanceSessionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setOrganization)
                {
                    await
                    AttendanceSession0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setOrganization)
                {
                    await
                    AttendanceSession1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setOrganization)
                {
                    await
                    AttendanceSession2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceSession3 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceSession3?.setOrganization)
                {
                    await
                    AttendanceSession3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateAttendanceSessionWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setCampu)
                {
                    await
                    AttendanceSession0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setCampu)
                {
                    await
                    AttendanceSession1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setCampu)
                {
                    await
                    AttendanceSession2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const AttendanceSession3 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceSession3?.setCampu)
                {
                    await
                    AttendanceSession3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
            
            async function associateAttendanceSessionWithClas() {
            
                const relatedClas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setClas)
                {
                    await
                    AttendanceSession0.
                    setClas(relatedClas0);
                }
            
                const relatedClas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setClas)
                {
                    await
                    AttendanceSession1.
                    setClas(relatedClas1);
                }
            
                const relatedClas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setClas)
                {
                    await
                    AttendanceSession2.
                    setClas(relatedClas2);
                }
            
                const relatedClas3 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const AttendanceSession3 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceSession3?.setClas)
                {
                    await
                    AttendanceSession3.
                    setClas(relatedClas3);
                }
            
        }
        
    
        
            
            async function associateAttendanceSessionWithClass_subject() {
            
                const relatedClass_subject0 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setClass_subject)
                {
                    await
                    AttendanceSession0.
                    setClass_subject(relatedClass_subject0);
                }
            
                const relatedClass_subject1 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setClass_subject)
                {
                    await
                    AttendanceSession1.
                    setClass_subject(relatedClass_subject1);
                }
            
                const relatedClass_subject2 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setClass_subject)
                {
                    await
                    AttendanceSession2.
                    setClass_subject(relatedClass_subject2);
                }
            
                const relatedClass_subject3 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const AttendanceSession3 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceSession3?.setClass_subject)
                {
                    await
                    AttendanceSession3.
                    setClass_subject(relatedClass_subject3);
                }
            
        }
        
    
        
            
            async function associateAttendanceSessionWithTaken_by() {
            
                const relatedTaken_by0 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setTaken_by)
                {
                    await
                    AttendanceSession0.
                    setTaken_by(relatedTaken_by0);
                }
            
                const relatedTaken_by1 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setTaken_by)
                {
                    await
                    AttendanceSession1.
                    setTaken_by(relatedTaken_by1);
                }
            
                const relatedTaken_by2 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setTaken_by)
                {
                    await
                    AttendanceSession2.
                    setTaken_by(relatedTaken_by2);
                }
            
                const relatedTaken_by3 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const AttendanceSession3 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceSession3?.setTaken_by)
                {
                    await
                    AttendanceSession3.
                    setTaken_by(relatedTaken_by3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAttendanceRecordWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setOrganization)
                {
                    await
                    AttendanceRecord0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setOrganization)
                {
                    await
                    AttendanceRecord1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setOrganization)
                {
                    await
                    AttendanceRecord2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRecord3 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceRecord3?.setOrganization)
                {
                    await
                    AttendanceRecord3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateAttendanceRecordWithAttendance_session() {
            
                const relatedAttendance_session0 = await AttendanceSessions.findOne({
                    offset: Math.floor(Math.random() * (await AttendanceSessions.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setAttendance_session)
                {
                    await
                    AttendanceRecord0.
                    setAttendance_session(relatedAttendance_session0);
                }
            
                const relatedAttendance_session1 = await AttendanceSessions.findOne({
                    offset: Math.floor(Math.random() * (await AttendanceSessions.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setAttendance_session)
                {
                    await
                    AttendanceRecord1.
                    setAttendance_session(relatedAttendance_session1);
                }
            
                const relatedAttendance_session2 = await AttendanceSessions.findOne({
                    offset: Math.floor(Math.random() * (await AttendanceSessions.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setAttendance_session)
                {
                    await
                    AttendanceRecord2.
                    setAttendance_session(relatedAttendance_session2);
                }
            
                const relatedAttendance_session3 = await AttendanceSessions.findOne({
                    offset: Math.floor(Math.random() * (await AttendanceSessions.count())),
                });
                const AttendanceRecord3 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceRecord3?.setAttendance_session)
                {
                    await
                    AttendanceRecord3.
                    setAttendance_session(relatedAttendance_session3);
                }
            
        }
        
    
        
            
            async function associateAttendanceRecordWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setStudent)
                {
                    await
                    AttendanceRecord0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setStudent)
                {
                    await
                    AttendanceRecord1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setStudent)
                {
                    await
                    AttendanceRecord2.
                    setStudent(relatedStudent2);
                }
            
                const relatedStudent3 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AttendanceRecord3 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceRecord3?.setStudent)
                {
                    await
                    AttendanceRecord3.
                    setStudent(relatedStudent3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateFeePlanWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FeePlan0 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FeePlan0?.setOrganization)
                {
                    await
                    FeePlan0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FeePlan1 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FeePlan1?.setOrganization)
                {
                    await
                    FeePlan1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FeePlan2 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FeePlan2?.setOrganization)
                {
                    await
                    FeePlan2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FeePlan3 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FeePlan3?.setOrganization)
                {
                    await
                    FeePlan3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateFeePlanWithAcademic_year() {
            
                const relatedAcademic_year0 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const FeePlan0 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FeePlan0?.setAcademic_year)
                {
                    await
                    FeePlan0.
                    setAcademic_year(relatedAcademic_year0);
                }
            
                const relatedAcademic_year1 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const FeePlan1 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FeePlan1?.setAcademic_year)
                {
                    await
                    FeePlan1.
                    setAcademic_year(relatedAcademic_year1);
                }
            
                const relatedAcademic_year2 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const FeePlan2 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FeePlan2?.setAcademic_year)
                {
                    await
                    FeePlan2.
                    setAcademic_year(relatedAcademic_year2);
                }
            
                const relatedAcademic_year3 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const FeePlan3 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FeePlan3?.setAcademic_year)
                {
                    await
                    FeePlan3.
                    setAcademic_year(relatedAcademic_year3);
                }
            
        }
        
    
        
            
            async function associateFeePlanWithGrade() {
            
                const relatedGrade0 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const FeePlan0 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FeePlan0?.setGrade)
                {
                    await
                    FeePlan0.
                    setGrade(relatedGrade0);
                }
            
                const relatedGrade1 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const FeePlan1 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FeePlan1?.setGrade)
                {
                    await
                    FeePlan1.
                    setGrade(relatedGrade1);
                }
            
                const relatedGrade2 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const FeePlan2 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FeePlan2?.setGrade)
                {
                    await
                    FeePlan2.
                    setGrade(relatedGrade2);
                }
            
                const relatedGrade3 = await Grades.findOne({
                    offset: Math.floor(Math.random() * (await Grades.count())),
                });
                const FeePlan3 = await FeePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FeePlan3?.setGrade)
                {
                    await
                    FeePlan3.
                    setGrade(relatedGrade3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateInvoiceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setOrganization)
                {
                    await
                    Invoice0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setOrganization)
                {
                    await
                    Invoice1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setOrganization)
                {
                    await
                    Invoice2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setOrganization)
                {
                    await
                    Invoice3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateInvoiceWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setCampu)
                {
                    await
                    Invoice0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setCampu)
                {
                    await
                    Invoice1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setCampu)
                {
                    await
                    Invoice2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setCampu)
                {
                    await
                    Invoice3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
            
            async function associateInvoiceWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setStudent)
                {
                    await
                    Invoice0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setStudent)
                {
                    await
                    Invoice1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setStudent)
                {
                    await
                    Invoice2.
                    setStudent(relatedStudent2);
                }
            
                const relatedStudent3 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setStudent)
                {
                    await
                    Invoice3.
                    setStudent(relatedStudent3);
                }
            
        }
        
    
        
            
            async function associateInvoiceWithFee_plan() {
            
                const relatedFee_plan0 = await FeePlans.findOne({
                    offset: Math.floor(Math.random() * (await FeePlans.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setFee_plan)
                {
                    await
                    Invoice0.
                    setFee_plan(relatedFee_plan0);
                }
            
                const relatedFee_plan1 = await FeePlans.findOne({
                    offset: Math.floor(Math.random() * (await FeePlans.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setFee_plan)
                {
                    await
                    Invoice1.
                    setFee_plan(relatedFee_plan1);
                }
            
                const relatedFee_plan2 = await FeePlans.findOne({
                    offset: Math.floor(Math.random() * (await FeePlans.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setFee_plan)
                {
                    await
                    Invoice2.
                    setFee_plan(relatedFee_plan2);
                }
            
                const relatedFee_plan3 = await FeePlans.findOne({
                    offset: Math.floor(Math.random() * (await FeePlans.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setFee_plan)
                {
                    await
                    Invoice3.
                    setFee_plan(relatedFee_plan3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaymentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setOrganization)
                {
                    await
                    Payment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setOrganization)
                {
                    await
                    Payment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setOrganization)
                {
                    await
                    Payment2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setOrganization)
                {
                    await
                    Payment3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithInvoice() {
            
                const relatedInvoice0 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setInvoice)
                {
                    await
                    Payment0.
                    setInvoice(relatedInvoice0);
                }
            
                const relatedInvoice1 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setInvoice)
                {
                    await
                    Payment1.
                    setInvoice(relatedInvoice1);
                }
            
                const relatedInvoice2 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setInvoice)
                {
                    await
                    Payment2.
                    setInvoice(relatedInvoice2);
                }
            
                const relatedInvoice3 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setInvoice)
                {
                    await
                    Payment3.
                    setInvoice(relatedInvoice3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithReceived_by() {
            
                const relatedReceived_by0 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setReceived_by)
                {
                    await
                    Payment0.
                    setReceived_by(relatedReceived_by0);
                }
            
                const relatedReceived_by1 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setReceived_by)
                {
                    await
                    Payment1.
                    setReceived_by(relatedReceived_by1);
                }
            
                const relatedReceived_by2 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setReceived_by)
                {
                    await
                    Payment2.
                    setReceived_by(relatedReceived_by2);
                }
            
                const relatedReceived_by3 = await Staff.findOne({
                    offset: Math.floor(Math.random() * (await Staff.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setReceived_by)
                {
                    await
                    Payment3.
                    setReceived_by(relatedReceived_by3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAssessmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Assessment0 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Assessment0?.setOrganization)
                {
                    await
                    Assessment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Assessment1 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Assessment1?.setOrganization)
                {
                    await
                    Assessment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Assessment2 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Assessment2?.setOrganization)
                {
                    await
                    Assessment2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Assessment3 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Assessment3?.setOrganization)
                {
                    await
                    Assessment3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateAssessmentWithClass_subject() {
            
                const relatedClass_subject0 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Assessment0 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Assessment0?.setClass_subject)
                {
                    await
                    Assessment0.
                    setClass_subject(relatedClass_subject0);
                }
            
                const relatedClass_subject1 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Assessment1 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Assessment1?.setClass_subject)
                {
                    await
                    Assessment1.
                    setClass_subject(relatedClass_subject1);
                }
            
                const relatedClass_subject2 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Assessment2 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Assessment2?.setClass_subject)
                {
                    await
                    Assessment2.
                    setClass_subject(relatedClass_subject2);
                }
            
                const relatedClass_subject3 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Assessment3 = await Assessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Assessment3?.setClass_subject)
                {
                    await
                    Assessment3.
                    setClass_subject(relatedClass_subject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAssessmentResultWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AssessmentResult0 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AssessmentResult0?.setOrganization)
                {
                    await
                    AssessmentResult0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AssessmentResult1 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AssessmentResult1?.setOrganization)
                {
                    await
                    AssessmentResult1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AssessmentResult2 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AssessmentResult2?.setOrganization)
                {
                    await
                    AssessmentResult2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AssessmentResult3 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AssessmentResult3?.setOrganization)
                {
                    await
                    AssessmentResult3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateAssessmentResultWithAssessment() {
            
                const relatedAssessment0 = await Assessments.findOne({
                    offset: Math.floor(Math.random() * (await Assessments.count())),
                });
                const AssessmentResult0 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AssessmentResult0?.setAssessment)
                {
                    await
                    AssessmentResult0.
                    setAssessment(relatedAssessment0);
                }
            
                const relatedAssessment1 = await Assessments.findOne({
                    offset: Math.floor(Math.random() * (await Assessments.count())),
                });
                const AssessmentResult1 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AssessmentResult1?.setAssessment)
                {
                    await
                    AssessmentResult1.
                    setAssessment(relatedAssessment1);
                }
            
                const relatedAssessment2 = await Assessments.findOne({
                    offset: Math.floor(Math.random() * (await Assessments.count())),
                });
                const AssessmentResult2 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AssessmentResult2?.setAssessment)
                {
                    await
                    AssessmentResult2.
                    setAssessment(relatedAssessment2);
                }
            
                const relatedAssessment3 = await Assessments.findOne({
                    offset: Math.floor(Math.random() * (await Assessments.count())),
                });
                const AssessmentResult3 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AssessmentResult3?.setAssessment)
                {
                    await
                    AssessmentResult3.
                    setAssessment(relatedAssessment3);
                }
            
        }
        
    
        
            
            async function associateAssessmentResultWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AssessmentResult0 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AssessmentResult0?.setStudent)
                {
                    await
                    AssessmentResult0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AssessmentResult1 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AssessmentResult1?.setStudent)
                {
                    await
                    AssessmentResult1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AssessmentResult2 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AssessmentResult2?.setStudent)
                {
                    await
                    AssessmentResult2.
                    setStudent(relatedStudent2);
                }
            
                const relatedStudent3 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AssessmentResult3 = await AssessmentResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AssessmentResult3?.setStudent)
                {
                    await
                    AssessmentResult3.
                    setStudent(relatedStudent3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateMessageWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setOrganization)
                {
                    await
                    Message0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setOrganization)
                {
                    await
                    Message1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setOrganization)
                {
                    await
                    Message2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Message3 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Message3?.setOrganization)
                {
                    await
                    Message3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateMessageWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setCampu)
                {
                    await
                    Message0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setCampu)
                {
                    await
                    Message1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setCampu)
                {
                    await
                    Message2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Message3 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Message3?.setCampu)
                {
                    await
                    Message3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
            
            async function associateMessageWithSent_by() {
            
                const relatedSent_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setSent_by)
                {
                    await
                    Message0.
                    setSent_by(relatedSent_by0);
                }
            
                const relatedSent_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setSent_by)
                {
                    await
                    Message1.
                    setSent_by(relatedSent_by1);
                }
            
                const relatedSent_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setSent_by)
                {
                    await
                    Message2.
                    setSent_by(relatedSent_by2);
                }
            
                const relatedSent_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message3 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Message3?.setSent_by)
                {
                    await
                    Message3.
                    setSent_by(relatedSent_by3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateMessageRecipientWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageRecipient0 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MessageRecipient0?.setOrganization)
                {
                    await
                    MessageRecipient0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageRecipient1 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MessageRecipient1?.setOrganization)
                {
                    await
                    MessageRecipient1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageRecipient2 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MessageRecipient2?.setOrganization)
                {
                    await
                    MessageRecipient2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageRecipient3 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MessageRecipient3?.setOrganization)
                {
                    await
                    MessageRecipient3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateMessageRecipientWithMessage() {
            
                const relatedMessage0 = await Messages.findOne({
                    offset: Math.floor(Math.random() * (await Messages.count())),
                });
                const MessageRecipient0 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MessageRecipient0?.setMessage)
                {
                    await
                    MessageRecipient0.
                    setMessage(relatedMessage0);
                }
            
                const relatedMessage1 = await Messages.findOne({
                    offset: Math.floor(Math.random() * (await Messages.count())),
                });
                const MessageRecipient1 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MessageRecipient1?.setMessage)
                {
                    await
                    MessageRecipient1.
                    setMessage(relatedMessage1);
                }
            
                const relatedMessage2 = await Messages.findOne({
                    offset: Math.floor(Math.random() * (await Messages.count())),
                });
                const MessageRecipient2 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MessageRecipient2?.setMessage)
                {
                    await
                    MessageRecipient2.
                    setMessage(relatedMessage2);
                }
            
                const relatedMessage3 = await Messages.findOne({
                    offset: Math.floor(Math.random() * (await Messages.count())),
                });
                const MessageRecipient3 = await MessageRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MessageRecipient3?.setMessage)
                {
                    await
                    MessageRecipient3.
                    setMessage(relatedMessage3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateDocumentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setOrganization)
                {
                    await
                    Document0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setOrganization)
                {
                    await
                    Document1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setOrganization)
                {
                    await
                    Document2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setOrganization)
                {
                    await
                    Document3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateDocumentWithCampu() {
            
                const relatedCampu0 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setCampu)
                {
                    await
                    Document0.
                    setCampu(relatedCampu0);
                }
            
                const relatedCampu1 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setCampu)
                {
                    await
                    Document1.
                    setCampu(relatedCampu1);
                }
            
                const relatedCampu2 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setCampu)
                {
                    await
                    Document2.
                    setCampu(relatedCampu2);
                }
            
                const relatedCampu3 = await Campuses.findOne({
                    offset: Math.floor(Math.random() * (await Campuses.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setCampu)
                {
                    await
                    Document3.
                    setCampu(relatedCampu3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Campuses.bulkCreate(CampusesData);
                
            
            
                
                await AcademicYears.bulkCreate(AcademicYearsData);
                
            
            
                
                await Grades.bulkCreate(GradesData);
                
            
            
                
                await Subjects.bulkCreate(SubjectsData);
                
            
            
                
                await Students.bulkCreate(StudentsData);
                
            
            
                
                await Guardians.bulkCreate(GuardiansData);
                
            
            
                
                await Staff.bulkCreate(StaffData);
                
            
            
                
                await Classes.bulkCreate(ClassesData);
                
            
            
                
                await ClassEnrollments.bulkCreate(ClassEnrollmentsData);
                
            
            
                
                await ClassSubjects.bulkCreate(ClassSubjectsData);
                
            
            
                
                await Timetables.bulkCreate(TimetablesData);
                
            
            
                
                await TimetablePeriods.bulkCreate(TimetablePeriodsData);
                
            
            
                
                await AttendanceSessions.bulkCreate(AttendanceSessionsData);
                
            
            
                
                await AttendanceRecords.bulkCreate(AttendanceRecordsData);
                
            
            
                
                await FeePlans.bulkCreate(FeePlansData);
                
            
            
                
                await Invoices.bulkCreate(InvoicesData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await Assessments.bulkCreate(AssessmentsData);
                
            
            
                
                await AssessmentResults.bulkCreate(AssessmentResultsData);
                
            
            
                
                await Messages.bulkCreate(MessagesData);
                
            
            
                
                await MessageRecipients.bulkCreate(MessageRecipientsData);
                
            
            
                
                await Documents.bulkCreate(DocumentsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                        
                        await associateCampusWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAcademicYearWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateGradeWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateSubjectWithOrganization(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateStudentWithOrganization(),
                    
                
                    
                        
                        await associateStudentWithCampu(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateGuardianWithOrganization(),
                    
                
                    
                        
                        await associateGuardianWithStudent(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateStaffWithOrganization(),
                    
                
                    
                        
                        await associateStaffWithCampu(),
                    
                
                    
                        
                        await associateStaffWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateClassWithOrganization(),
                    
                
                    
                        
                        await associateClassWithCampu(),
                    
                
                    
                        
                        await associateClassWithAcademic_year(),
                    
                
                    
                        
                        await associateClassWithGrade(),
                    
                
                    
                
                    
                
                    
                        
                        await associateClassWithHomeroom_teacher(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateClassEnrollmentWithOrganization(),
                    
                
                    
                        
                        await associateClassEnrollmentWithClas(),
                    
                
                    
                        
                        await associateClassEnrollmentWithStudent(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateClassSubjectWithOrganization(),
                    
                
                    
                        
                        await associateClassSubjectWithClas(),
                    
                
                    
                        
                        await associateClassSubjectWithSubject(),
                    
                
                    
                        
                        await associateClassSubjectWithTeacher(),
                    
                
                    
                
            
                
                
                    
                        
                        await associateTimetableWithOrganization(),
                    
                
                    
                        
                        await associateTimetableWithCampu(),
                    
                
                    
                        
                        await associateTimetableWithAcademic_year(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateTimetablePeriodWithOrganization(),
                    
                
                    
                        
                        await associateTimetablePeriodWithTimetable(),
                    
                
                    
                        
                        await associateTimetablePeriodWithClass_subject(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAttendanceSessionWithOrganization(),
                    
                
                    
                        
                        await associateAttendanceSessionWithCampu(),
                    
                
                    
                        
                        await associateAttendanceSessionWithClas(),
                    
                
                    
                        
                        await associateAttendanceSessionWithClass_subject(),
                    
                
                    
                        
                        await associateAttendanceSessionWithTaken_by(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAttendanceRecordWithOrganization(),
                    
                
                    
                        
                        await associateAttendanceRecordWithAttendance_session(),
                    
                
                    
                        
                        await associateAttendanceRecordWithStudent(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateFeePlanWithOrganization(),
                    
                
                    
                        
                        await associateFeePlanWithAcademic_year(),
                    
                
                    
                        
                        await associateFeePlanWithGrade(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateInvoiceWithOrganization(),
                    
                
                    
                        
                        await associateInvoiceWithCampu(),
                    
                
                    
                        
                        await associateInvoiceWithStudent(),
                    
                
                    
                        
                        await associateInvoiceWithFee_plan(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaymentWithOrganization(),
                    
                
                    
                        
                        await associatePaymentWithInvoice(),
                    
                
                    
                        
                        await associatePaymentWithReceived_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAssessmentWithOrganization(),
                    
                
                    
                        
                        await associateAssessmentWithClass_subject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAssessmentResultWithOrganization(),
                    
                
                    
                        
                        await associateAssessmentResultWithAssessment(),
                    
                
                    
                        
                        await associateAssessmentResultWithStudent(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMessageWithOrganization(),
                    
                
                    
                        
                        await associateMessageWithCampu(),
                    
                
                    
                        
                        await associateMessageWithSent_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMessageRecipientWithOrganization(),
                    
                
                    
                        
                        await associateMessageRecipientWithMessage(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateDocumentWithOrganization(),
                    
                
                    
                        
                        await associateDocumentWithCampu(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('campuses', null, {});
            
            
            await queryInterface.bulkDelete('academic_years', null, {});
            
            
            await queryInterface.bulkDelete('grades', null, {});
            
            
            await queryInterface.bulkDelete('subjects', null, {});
            
            
            await queryInterface.bulkDelete('students', null, {});
            
            
            await queryInterface.bulkDelete('guardians', null, {});
            
            
            await queryInterface.bulkDelete('staff', null, {});
            
            
            await queryInterface.bulkDelete('classes', null, {});
            
            
            await queryInterface.bulkDelete('class_enrollments', null, {});
            
            
            await queryInterface.bulkDelete('class_subjects', null, {});
            
            
            await queryInterface.bulkDelete('timetables', null, {});
            
            
            await queryInterface.bulkDelete('timetable_periods', null, {});
            
            
            await queryInterface.bulkDelete('attendance_sessions', null, {});
            
            
            await queryInterface.bulkDelete('attendance_records', null, {});
            
            
            await queryInterface.bulkDelete('fee_plans', null, {});
            
            
            await queryInterface.bulkDelete('invoices', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('assessments', null, {});
            
            
            await queryInterface.bulkDelete('assessment_results', null, {});
            
            
            await queryInterface.bulkDelete('messages', null, {});
            
            
            await queryInterface.bulkDelete('message_recipients', null, {});
            
            
            await queryInterface.bulkDelete('documents', null, {});
            
        
    },
};