





















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






const Organizations = db.organizations;

const Companies = db.companies;

const RolePermissions = db.role_permissions;

const UserRoles = db.user_roles;

const Departments = db.departments;

const JobTitles = db.job_titles;

const WorkLocations = db.work_locations;

const Employees = db.employees;

const EmploymentContracts = db.employment_contracts;

const LeaveTypes = db.leave_types;

const LeaveRequests = db.leave_requests;

const AttendancePolicies = db.attendance_policies;

const WorkSchedules = db.work_schedules;

const EmployeeScheduleAssignments = db.employee_schedule_assignments;

const TimeEntries = db.time_entries;

const Holidays = db.holidays;

const ExpenseCategories = db.expense_categories;

const ExpenseClaims = db.expense_claims;

const Documents = db.documents;

const Announcements = db.announcements;

const ApiConfigs = db.api_configs;

const AuditLogs = db.audit_logs;







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



const CompaniesData = [
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "tax_id": "Alan Turing",
            
        
    
        
        
            
                "registration_number": "Alan Turing",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "phone": "Grace Hopper",
            
        
    
        
        
            
                "website": "Ada Lovelace",
            
        
    
        
        
            
                "address_line1": "Ada Lovelace",
            
        
    
        
        
            
                "address_line2": "Grace Hopper",
            
        
    
        
        
            
                "city": "Grace Hopper",
            
        
    
        
        
            
                "state": "Marie Curie",
            
        
    
        
        
            
                "postal_code": "Grace Hopper",
            
        
    
        
        
            
                "country": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "tax_id": "Ada Lovelace",
            
        
    
        
        
            
                "registration_number": "Grace Hopper",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "website": "Alan Turing",
            
        
    
        
        
            
                "address_line1": "Grace Hopper",
            
        
    
        
        
            
                "address_line2": "Grace Hopper",
            
        
    
        
        
            
                "city": "Marie Curie",
            
        
    
        
        
            
                "state": "Alan Turing",
            
        
    
        
        
            
                "postal_code": "Ada Lovelace",
            
        
    
        
        
            
                "country": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "tax_id": "Ada Lovelace",
            
        
    
        
        
            
                "registration_number": "Alan Turing",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "website": "Alan Turing",
            
        
    
        
        
            
                "address_line1": "Grace Hopper",
            
        
    
        
        
            
                "address_line2": "Alan Turing",
            
        
    
        
        
            
                "city": "Marie Curie",
            
        
    
        
        
            
                "state": "Alan Turing",
            
        
    
        
        
            
                "postal_code": "Ada Lovelace",
            
        
    
        
        
            
                "country": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RolePermissionsData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                // 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
            
        
    
    },
    
];



const UserRolesData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                // 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
            
        
    
    },
    
];



const DepartmentsData = [
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "description": "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",
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



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



const WorkLocationsData = [
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "timezone": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "location_type": "office",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "address": "Marie Curie",
            
        
    
        
        
            
                "timezone": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "location_type": "remote",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "code": "Grace Hopper",
            
        
    
        
        
            
                "address": "Marie Curie",
            
        
    
        
        
            
                "timezone": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "location_type": "remote",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const EmployeesData = [
    
    {
    
        
        
            
                "employee_number": "Marie Curie",
            
        
    
        
        
            
                "first_name": "Marie Curie",
            
        
    
        
        
            
                "last_name": "Ada Lovelace",
            
        
    
        
        
            
                "preferred_name": "Grace Hopper",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "phone": "Grace Hopper",
            
        
    
        
        
            
                "national_id": "Marie Curie",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "gender": "female",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "termination_date": new Date(Date.now()),
            
        
    
        
        
            
                "employment_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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "employment_type": "intern",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "employee_number": "Marie Curie",
            
        
    
        
        
            
                "first_name": "Grace Hopper",
            
        
    
        
        
            
                "last_name": "Grace Hopper",
            
        
    
        
        
            
                "preferred_name": "Grace Hopper",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "phone": "Grace Hopper",
            
        
    
        
        
            
                "national_id": "Alan Turing",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "gender": "prefer_not_to_say",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "termination_date": new Date(Date.now()),
            
        
    
        
        
            
                "employment_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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "employment_type": "contractor",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "employee_number": "Marie Curie",
            
        
    
        
        
            
                "first_name": "Grace Hopper",
            
        
    
        
        
            
                "last_name": "Alan Turing",
            
        
    
        
        
            
                "preferred_name": "Marie Curie",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "national_id": "Ada Lovelace",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "gender": "prefer_not_to_say",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "termination_date": new Date(Date.now()),
            
        
    
        
        
            
                "employment_status": "on_leave",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "employment_type": "part_time",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const EmploymentContractsData = [
    
    {
    
        
        
            
                "contract_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "contract_type": "probation",
            
        
    
        
        
            
                "base_salary": 1.5,
            
        
    
        
        
            
                "salary_period": "monthly",
            
        
    
        
        
            
                "currency": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "terminated",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "contract_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "contract_type": "fixed_term",
            
        
    
        
        
            
                "base_salary": 9.01,
            
        
    
        
        
            
                "salary_period": "monthly",
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "terminated",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "contract_number": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "contract_type": "fixed_term",
            
        
    
        
        
            
                "base_salary": 2.8,
            
        
    
        
        
            
                "salary_period": "daily",
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "expired",
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LeaveTypesData = [
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requires_approval": true,
            
        
    
        
        
            
                "requires_attachment": true,
            
        
    
        
        
            
                "default_allowance_days": 0.07,
            
        
    
        
        
            
                "unit": "hour",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requires_approval": true,
            
        
    
        
        
            
                "requires_attachment": true,
            
        
    
        
        
            
                "default_allowance_days": 3.58,
            
        
    
        
        
            
                "unit": "hour",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requires_approval": false,
            
        
    
        
        
            
                "requires_attachment": true,
            
        
    
        
        
            
                "default_allowance_days": 4.63,
            
        
    
        
        
            
                "unit": "hour",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LeaveRequestsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "duration": 3.39,
            
        
    
        
        
            
                "duration_unit": "day",
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "reason": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_comment": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "duration": 3.86,
            
        
    
        
        
            
                "duration_unit": "hour",
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "reason": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_comment": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "duration": 0.26,
            
        
    
        
        
            
                "duration_unit": "hour",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "reason": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_comment": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AttendancePoliciesData = [
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "grace_minutes_late": 5,
            
        
    
        
        
            
                "grace_minutes_early_leave": 1,
            
        
    
        
        
            
                "require_location": false,
            
        
    
        
        
            
                "require_note_on_missing_punch": true,
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "grace_minutes_late": 5,
            
        
    
        
        
            
                "grace_minutes_early_leave": 3,
            
        
    
        
        
            
                "require_location": true,
            
        
    
        
        
            
                "require_note_on_missing_punch": false,
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "grace_minutes_late": 7,
            
        
    
        
        
            
                "grace_minutes_early_leave": 2,
            
        
    
        
        
            
                "require_location": true,
            
        
    
        
        
            
                "require_note_on_missing_punch": true,
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WorkSchedulesData = [
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "schedule_type": "fixed",
            
        
    
        
        
            
                "work_minutes_per_day": 7,
            
        
    
        
        
            
                "break_minutes_per_day": 9,
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "schedule_type": "shift",
            
        
    
        
        
            
                "work_minutes_per_day": 2,
            
        
    
        
        
            
                "break_minutes_per_day": 1,
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "schedule_type": "flexible",
            
        
    
        
        
            
                "work_minutes_per_day": 8,
            
        
    
        
        
            
                "break_minutes_per_day": 4,
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const EmployeeScheduleAssignmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "ended",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": 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
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "ended",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TimeEntriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "clock_in_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_out_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_in_source": "Grace Hopper",
            
        
    
        
        
            
                "clock_out_source": "Ada Lovelace",
            
        
    
        
        
            
                "worked_hours": 3.94,
            
        
    
        
        
            
                "break_hours": 2.64,
            
        
    
        
        
            
                "status": "corrected",
            
        
    
        
        
            
                "note": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "clock_in_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_out_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_in_source": "Marie Curie",
            
        
    
        
        
            
                "clock_out_source": "Alan Turing",
            
        
    
        
        
            
                "worked_hours": 0.43,
            
        
    
        
        
            
                "break_hours": 4.96,
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "note": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "clock_in_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_out_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_in_source": "Ada Lovelace",
            
        
    
        
        
            
                "clock_out_source": "Alan Turing",
            
        
    
        
        
            
                "worked_hours": 5.68,
            
        
    
        
        
            
                "break_hours": 0.63,
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "note": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const HolidaysData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "holiday_type": "special",
            
        
    
        
        
            
                "is_paid": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "holiday_type": "company",
            
        
    
        
        
            
                "is_paid": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "holiday_type": "public",
            
        
    
        
        
            
                "is_paid": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExpenseCategoriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExpenseClaimsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 8.95,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "merchant": "Marie Curie",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_comment": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 3.26,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "merchant": "Marie Curie",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_comment": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 9.11,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "merchant": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_comment": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DocumentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "document_type": "certificate",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "revoked",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "document_type": "other",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "valid",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "document_type": "certificate",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "expired",
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AnnouncementsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "publish_at": new Date(Date.now()),
            
        
    
        
        
            
                "expire_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "all",
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "publish_at": new Date(Date.now()),
            
        
    
        
        
            
                "expire_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "all",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "publish_at": new Date(Date.now()),
            
        
    
        
        
            
                "expire_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "managers",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ApiConfigsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "service_name": "Grace Hopper",
            
        
    
        
        
            
                "base_url": "Marie Curie",
            
        
    
        
        
            
                "api_key_name": "Alan Turing",
            
        
    
        
        
            
                "api_key_value": "Ada Lovelace",
            
        
    
        
        
            
                "is_enabled": true,
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "service_name": "Ada Lovelace",
            
        
    
        
        
            
                "base_url": "Alan Turing",
            
        
    
        
        
            
                "api_key_name": "Ada Lovelace",
            
        
    
        
        
            
                "api_key_value": "Alan Turing",
            
        
    
        
        
            
                "is_enabled": false,
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "service_name": "Alan Turing",
            
        
    
        
        
            
                "base_url": "Alan Turing",
            
        
    
        
        
            
                "api_key_name": "Alan Turing",
            
        
    
        
        
            
                "api_key_value": "Alan Turing",
            
        
    
        
        
            
                "is_enabled": false,
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AuditLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Grace Hopper",
            
        
    
        
        
            
                "entity_name": "Grace Hopper",
            
        
    
        
        
            
                "entity_key": "Grace Hopper",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "ip_address": "Ada Lovelace",
            
        
    
        
        
            
                "user_agent": "Ada Lovelace",
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Grace Hopper",
            
        
    
        
        
            
                "entity_name": "Alan Turing",
            
        
    
        
        
            
                "entity_key": "Alan Turing",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "ip_address": "Ada Lovelace",
            
        
    
        
        
            
                "user_agent": "Ada Lovelace",
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Grace Hopper",
            
        
    
        
        
            
                "entity_name": "Ada Lovelace",
            
        
    
        
        
            
                "entity_key": "Marie Curie",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "ip_address": "Alan Turing",
            
        
    
        
        
            
                "user_agent": "Alan Turing",
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // 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);
                }
            
        }
        
    

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCompanyWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company0 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Company0?.setOrganization)
                {
                    await
                    Company0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company1 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Company1?.setOrganization)
                {
                    await
                    Company1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company2 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Company2?.setOrganization)
                {
                    await
                    Company2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateRolePermissionWithPermission() {
            
                const relatedPermission0 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermission0 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RolePermission0?.setPermission)
                {
                    await
                    RolePermission0.
                    setPermission(relatedPermission0);
                }
            
                const relatedPermission1 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermission1 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RolePermission1?.setPermission)
                {
                    await
                    RolePermission1.
                    setPermission(relatedPermission1);
                }
            
                const relatedPermission2 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermission2 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RolePermission2?.setPermission)
                {
                    await
                    RolePermission2.
                    setPermission(relatedPermission2);
                }
            
        }
        
    
        
            
            async function associateRolePermissionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermission0 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RolePermission0?.setOrganization)
                {
                    await
                    RolePermission0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermission1 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RolePermission1?.setOrganization)
                {
                    await
                    RolePermission1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermission2 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RolePermission2?.setOrganization)
                {
                    await
                    RolePermission2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateUserRoleWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRole0 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRole0?.setUser)
                {
                    await
                    UserRole0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRole1 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRole1?.setUser)
                {
                    await
                    UserRole1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRole2 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRole2?.setUser)
                {
                    await
                    UserRole2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
            
            async function associateUserRoleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRole0 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRole0?.setOrganization)
                {
                    await
                    UserRole0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRole1 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRole1?.setOrganization)
                {
                    await
                    UserRole1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRole2 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRole2?.setOrganization)
                {
                    await
                    UserRole2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateDepartmentWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department0 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Department0?.setCompany)
                {
                    await
                    Department0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department1 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Department1?.setCompany)
                {
                    await
                    Department1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department2 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Department2?.setCompany)
                {
                    await
                    Department2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateDepartmentWithParent_department() {
            
                const relatedParent_department0 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Department0 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Department0?.setParent_department)
                {
                    await
                    Department0.
                    setParent_department(relatedParent_department0);
                }
            
                const relatedParent_department1 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Department1 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Department1?.setParent_department)
                {
                    await
                    Department1.
                    setParent_department(relatedParent_department1);
                }
            
                const relatedParent_department2 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Department2 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Department2?.setParent_department)
                {
                    await
                    Department2.
                    setParent_department(relatedParent_department2);
                }
            
        }
        
    
        
            
            async function associateDepartmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department0 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Department0?.setOrganization)
                {
                    await
                    Department0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department1 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Department1?.setOrganization)
                {
                    await
                    Department1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department2 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Department2?.setOrganization)
                {
                    await
                    Department2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateJobTitleWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const JobTitle0 = await JobTitles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JobTitle0?.setCompany)
                {
                    await
                    JobTitle0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const JobTitle1 = await JobTitles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JobTitle1?.setCompany)
                {
                    await
                    JobTitle1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const JobTitle2 = await JobTitles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JobTitle2?.setCompany)
                {
                    await
                    JobTitle2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateJobTitleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JobTitle0 = await JobTitles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JobTitle0?.setOrganization)
                {
                    await
                    JobTitle0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JobTitle1 = await JobTitles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JobTitle1?.setOrganization)
                {
                    await
                    JobTitle1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JobTitle2 = await JobTitles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JobTitle2?.setOrganization)
                {
                    await
                    JobTitle2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
            
            async function associateWorkLocationWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const WorkLocation0 = await WorkLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkLocation0?.setCompany)
                {
                    await
                    WorkLocation0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const WorkLocation1 = await WorkLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkLocation1?.setCompany)
                {
                    await
                    WorkLocation1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const WorkLocation2 = await WorkLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkLocation2?.setCompany)
                {
                    await
                    WorkLocation2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
            
            async function associateWorkLocationWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkLocation0 = await WorkLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkLocation0?.setOrganization)
                {
                    await
                    WorkLocation0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkLocation1 = await WorkLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkLocation1?.setOrganization)
                {
                    await
                    WorkLocation1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkLocation2 = await WorkLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkLocation2?.setOrganization)
                {
                    await
                    WorkLocation2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateEmployeeWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setCompany)
                {
                    await
                    Employee0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setCompany)
                {
                    await
                    Employee1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setCompany)
                {
                    await
                    Employee2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithDepartment() {
            
                const relatedDepartment0 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setDepartment)
                {
                    await
                    Employee0.
                    setDepartment(relatedDepartment0);
                }
            
                const relatedDepartment1 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setDepartment)
                {
                    await
                    Employee1.
                    setDepartment(relatedDepartment1);
                }
            
                const relatedDepartment2 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setDepartment)
                {
                    await
                    Employee2.
                    setDepartment(relatedDepartment2);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithJob_title() {
            
                const relatedJob_title0 = await JobTitles.findOne({
                    offset: Math.floor(Math.random() * (await JobTitles.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setJob_title)
                {
                    await
                    Employee0.
                    setJob_title(relatedJob_title0);
                }
            
                const relatedJob_title1 = await JobTitles.findOne({
                    offset: Math.floor(Math.random() * (await JobTitles.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setJob_title)
                {
                    await
                    Employee1.
                    setJob_title(relatedJob_title1);
                }
            
                const relatedJob_title2 = await JobTitles.findOne({
                    offset: Math.floor(Math.random() * (await JobTitles.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setJob_title)
                {
                    await
                    Employee2.
                    setJob_title(relatedJob_title2);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithWork_location() {
            
                const relatedWork_location0 = await WorkLocations.findOne({
                    offset: Math.floor(Math.random() * (await WorkLocations.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setWork_location)
                {
                    await
                    Employee0.
                    setWork_location(relatedWork_location0);
                }
            
                const relatedWork_location1 = await WorkLocations.findOne({
                    offset: Math.floor(Math.random() * (await WorkLocations.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setWork_location)
                {
                    await
                    Employee1.
                    setWork_location(relatedWork_location1);
                }
            
                const relatedWork_location2 = await WorkLocations.findOne({
                    offset: Math.floor(Math.random() * (await WorkLocations.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setWork_location)
                {
                    await
                    Employee2.
                    setWork_location(relatedWork_location2);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithManager() {
            
                const relatedManager0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setManager)
                {
                    await
                    Employee0.
                    setManager(relatedManager0);
                }
            
                const relatedManager1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setManager)
                {
                    await
                    Employee1.
                    setManager(relatedManager1);
                }
            
                const relatedManager2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setManager)
                {
                    await
                    Employee2.
                    setManager(relatedManager2);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithUser_account() {
            
                const relatedUser_account0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setUser_account)
                {
                    await
                    Employee0.
                    setUser_account(relatedUser_account0);
                }
            
                const relatedUser_account1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setUser_account)
                {
                    await
                    Employee1.
                    setUser_account(relatedUser_account1);
                }
            
                const relatedUser_account2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setUser_account)
                {
                    await
                    Employee2.
                    setUser_account(relatedUser_account2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateEmployeeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setOrganization)
                {
                    await
                    Employee0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setOrganization)
                {
                    await
                    Employee1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setOrganization)
                {
                    await
                    Employee2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateEmploymentContractWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmploymentContract0 = await EmploymentContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EmploymentContract0?.setEmployee)
                {
                    await
                    EmploymentContract0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmploymentContract1 = await EmploymentContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EmploymentContract1?.setEmployee)
                {
                    await
                    EmploymentContract1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmploymentContract2 = await EmploymentContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EmploymentContract2?.setEmployee)
                {
                    await
                    EmploymentContract2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateEmploymentContractWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmploymentContract0 = await EmploymentContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EmploymentContract0?.setOrganization)
                {
                    await
                    EmploymentContract0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmploymentContract1 = await EmploymentContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EmploymentContract1?.setOrganization)
                {
                    await
                    EmploymentContract1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmploymentContract2 = await EmploymentContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EmploymentContract2?.setOrganization)
                {
                    await
                    EmploymentContract2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
            
            async function associateLeaveTypeWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const LeaveType0 = await LeaveTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaveType0?.setCompany)
                {
                    await
                    LeaveType0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const LeaveType1 = await LeaveTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaveType1?.setCompany)
                {
                    await
                    LeaveType1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const LeaveType2 = await LeaveTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaveType2?.setCompany)
                {
                    await
                    LeaveType2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateLeaveTypeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LeaveType0 = await LeaveTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaveType0?.setOrganization)
                {
                    await
                    LeaveType0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LeaveType1 = await LeaveTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaveType1?.setOrganization)
                {
                    await
                    LeaveType1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LeaveType2 = await LeaveTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaveType2?.setOrganization)
                {
                    await
                    LeaveType2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateLeaveRequestWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LeaveRequest0 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaveRequest0?.setEmployee)
                {
                    await
                    LeaveRequest0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LeaveRequest1 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaveRequest1?.setEmployee)
                {
                    await
                    LeaveRequest1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LeaveRequest2 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaveRequest2?.setEmployee)
                {
                    await
                    LeaveRequest2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
            
            async function associateLeaveRequestWithLeave_type() {
            
                const relatedLeave_type0 = await LeaveTypes.findOne({
                    offset: Math.floor(Math.random() * (await LeaveTypes.count())),
                });
                const LeaveRequest0 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaveRequest0?.setLeave_type)
                {
                    await
                    LeaveRequest0.
                    setLeave_type(relatedLeave_type0);
                }
            
                const relatedLeave_type1 = await LeaveTypes.findOne({
                    offset: Math.floor(Math.random() * (await LeaveTypes.count())),
                });
                const LeaveRequest1 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaveRequest1?.setLeave_type)
                {
                    await
                    LeaveRequest1.
                    setLeave_type(relatedLeave_type1);
                }
            
                const relatedLeave_type2 = await LeaveTypes.findOne({
                    offset: Math.floor(Math.random() * (await LeaveTypes.count())),
                });
                const LeaveRequest2 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaveRequest2?.setLeave_type)
                {
                    await
                    LeaveRequest2.
                    setLeave_type(relatedLeave_type2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateLeaveRequestWithApprover() {
            
                const relatedApprover0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LeaveRequest0 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaveRequest0?.setApprover)
                {
                    await
                    LeaveRequest0.
                    setApprover(relatedApprover0);
                }
            
                const relatedApprover1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LeaveRequest1 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaveRequest1?.setApprover)
                {
                    await
                    LeaveRequest1.
                    setApprover(relatedApprover1);
                }
            
                const relatedApprover2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LeaveRequest2 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaveRequest2?.setApprover)
                {
                    await
                    LeaveRequest2.
                    setApprover(relatedApprover2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateLeaveRequestWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LeaveRequest0 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaveRequest0?.setOrganization)
                {
                    await
                    LeaveRequest0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LeaveRequest1 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaveRequest1?.setOrganization)
                {
                    await
                    LeaveRequest1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LeaveRequest2 = await LeaveRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaveRequest2?.setOrganization)
                {
                    await
                    LeaveRequest2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateAttendancePolicyWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AttendancePolicy0 = await AttendancePolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendancePolicy0?.setCompany)
                {
                    await
                    AttendancePolicy0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AttendancePolicy1 = await AttendancePolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendancePolicy1?.setCompany)
                {
                    await
                    AttendancePolicy1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AttendancePolicy2 = await AttendancePolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendancePolicy2?.setCompany)
                {
                    await
                    AttendancePolicy2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAttendancePolicyWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendancePolicy0 = await AttendancePolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendancePolicy0?.setOrganization)
                {
                    await
                    AttendancePolicy0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendancePolicy1 = await AttendancePolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendancePolicy1?.setOrganization)
                {
                    await
                    AttendancePolicy1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendancePolicy2 = await AttendancePolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendancePolicy2?.setOrganization)
                {
                    await
                    AttendancePolicy2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateWorkScheduleWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const WorkSchedule0 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkSchedule0?.setCompany)
                {
                    await
                    WorkSchedule0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const WorkSchedule1 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkSchedule1?.setCompany)
                {
                    await
                    WorkSchedule1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const WorkSchedule2 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkSchedule2?.setCompany)
                {
                    await
                    WorkSchedule2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateWorkScheduleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkSchedule0 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkSchedule0?.setOrganization)
                {
                    await
                    WorkSchedule0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkSchedule1 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkSchedule1?.setOrganization)
                {
                    await
                    WorkSchedule1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkSchedule2 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkSchedule2?.setOrganization)
                {
                    await
                    WorkSchedule2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateEmployeeScheduleAssignmentWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmployeeScheduleAssignment0 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EmployeeScheduleAssignment0?.setEmployee)
                {
                    await
                    EmployeeScheduleAssignment0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmployeeScheduleAssignment1 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EmployeeScheduleAssignment1?.setEmployee)
                {
                    await
                    EmployeeScheduleAssignment1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmployeeScheduleAssignment2 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EmployeeScheduleAssignment2?.setEmployee)
                {
                    await
                    EmployeeScheduleAssignment2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
            
            async function associateEmployeeScheduleAssignmentWithWork_schedule() {
            
                const relatedWork_schedule0 = await WorkSchedules.findOne({
                    offset: Math.floor(Math.random() * (await WorkSchedules.count())),
                });
                const EmployeeScheduleAssignment0 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EmployeeScheduleAssignment0?.setWork_schedule)
                {
                    await
                    EmployeeScheduleAssignment0.
                    setWork_schedule(relatedWork_schedule0);
                }
            
                const relatedWork_schedule1 = await WorkSchedules.findOne({
                    offset: Math.floor(Math.random() * (await WorkSchedules.count())),
                });
                const EmployeeScheduleAssignment1 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EmployeeScheduleAssignment1?.setWork_schedule)
                {
                    await
                    EmployeeScheduleAssignment1.
                    setWork_schedule(relatedWork_schedule1);
                }
            
                const relatedWork_schedule2 = await WorkSchedules.findOne({
                    offset: Math.floor(Math.random() * (await WorkSchedules.count())),
                });
                const EmployeeScheduleAssignment2 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EmployeeScheduleAssignment2?.setWork_schedule)
                {
                    await
                    EmployeeScheduleAssignment2.
                    setWork_schedule(relatedWork_schedule2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateEmployeeScheduleAssignmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmployeeScheduleAssignment0 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EmployeeScheduleAssignment0?.setOrganization)
                {
                    await
                    EmployeeScheduleAssignment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmployeeScheduleAssignment1 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EmployeeScheduleAssignment1?.setOrganization)
                {
                    await
                    EmployeeScheduleAssignment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmployeeScheduleAssignment2 = await EmployeeScheduleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EmployeeScheduleAssignment2?.setOrganization)
                {
                    await
                    EmployeeScheduleAssignment2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTimeEntryWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const TimeEntry0 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimeEntry0?.setEmployee)
                {
                    await
                    TimeEntry0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const TimeEntry1 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimeEntry1?.setEmployee)
                {
                    await
                    TimeEntry1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const TimeEntry2 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimeEntry2?.setEmployee)
                {
                    await
                    TimeEntry2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateTimeEntryWithApproved_by() {
            
                const relatedApproved_by0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const TimeEntry0 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimeEntry0?.setApproved_by)
                {
                    await
                    TimeEntry0.
                    setApproved_by(relatedApproved_by0);
                }
            
                const relatedApproved_by1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const TimeEntry1 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimeEntry1?.setApproved_by)
                {
                    await
                    TimeEntry1.
                    setApproved_by(relatedApproved_by1);
                }
            
                const relatedApproved_by2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const TimeEntry2 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimeEntry2?.setApproved_by)
                {
                    await
                    TimeEntry2.
                    setApproved_by(relatedApproved_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateTimeEntryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TimeEntry0 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimeEntry0?.setOrganization)
                {
                    await
                    TimeEntry0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TimeEntry1 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimeEntry1?.setOrganization)
                {
                    await
                    TimeEntry1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TimeEntry2 = await TimeEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimeEntry2?.setOrganization)
                {
                    await
                    TimeEntry2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateHolidayWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Holiday0 = await Holidays.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Holiday0?.setCompany)
                {
                    await
                    Holiday0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Holiday1 = await Holidays.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Holiday1?.setCompany)
                {
                    await
                    Holiday1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Holiday2 = await Holidays.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Holiday2?.setCompany)
                {
                    await
                    Holiday2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateHolidayWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Holiday0 = await Holidays.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Holiday0?.setOrganization)
                {
                    await
                    Holiday0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Holiday1 = await Holidays.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Holiday1?.setOrganization)
                {
                    await
                    Holiday1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Holiday2 = await Holidays.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Holiday2?.setOrganization)
                {
                    await
                    Holiday2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExpenseCategoryWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ExpenseCategory0 = await ExpenseCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExpenseCategory0?.setCompany)
                {
                    await
                    ExpenseCategory0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ExpenseCategory1 = await ExpenseCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExpenseCategory1?.setCompany)
                {
                    await
                    ExpenseCategory1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ExpenseCategory2 = await ExpenseCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExpenseCategory2?.setCompany)
                {
                    await
                    ExpenseCategory2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExpenseCategoryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExpenseCategory0 = await ExpenseCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExpenseCategory0?.setOrganization)
                {
                    await
                    ExpenseCategory0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExpenseCategory1 = await ExpenseCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExpenseCategory1?.setOrganization)
                {
                    await
                    ExpenseCategory1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExpenseCategory2 = await ExpenseCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExpenseCategory2?.setOrganization)
                {
                    await
                    ExpenseCategory2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExpenseClaimWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ExpenseClaim0 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExpenseClaim0?.setEmployee)
                {
                    await
                    ExpenseClaim0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ExpenseClaim1 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExpenseClaim1?.setEmployee)
                {
                    await
                    ExpenseClaim1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ExpenseClaim2 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExpenseClaim2?.setEmployee)
                {
                    await
                    ExpenseClaim2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
            
            async function associateExpenseClaimWithExpense_category() {
            
                const relatedExpense_category0 = await ExpenseCategories.findOne({
                    offset: Math.floor(Math.random() * (await ExpenseCategories.count())),
                });
                const ExpenseClaim0 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExpenseClaim0?.setExpense_category)
                {
                    await
                    ExpenseClaim0.
                    setExpense_category(relatedExpense_category0);
                }
            
                const relatedExpense_category1 = await ExpenseCategories.findOne({
                    offset: Math.floor(Math.random() * (await ExpenseCategories.count())),
                });
                const ExpenseClaim1 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExpenseClaim1?.setExpense_category)
                {
                    await
                    ExpenseClaim1.
                    setExpense_category(relatedExpense_category1);
                }
            
                const relatedExpense_category2 = await ExpenseCategories.findOne({
                    offset: Math.floor(Math.random() * (await ExpenseCategories.count())),
                });
                const ExpenseClaim2 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExpenseClaim2?.setExpense_category)
                {
                    await
                    ExpenseClaim2.
                    setExpense_category(relatedExpense_category2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExpenseClaimWithApprover() {
            
                const relatedApprover0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ExpenseClaim0 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExpenseClaim0?.setApprover)
                {
                    await
                    ExpenseClaim0.
                    setApprover(relatedApprover0);
                }
            
                const relatedApprover1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ExpenseClaim1 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExpenseClaim1?.setApprover)
                {
                    await
                    ExpenseClaim1.
                    setApprover(relatedApprover1);
                }
            
                const relatedApprover2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ExpenseClaim2 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExpenseClaim2?.setApprover)
                {
                    await
                    ExpenseClaim2.
                    setApprover(relatedApprover2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateExpenseClaimWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExpenseClaim0 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExpenseClaim0?.setOrganization)
                {
                    await
                    ExpenseClaim0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExpenseClaim1 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExpenseClaim1?.setOrganization)
                {
                    await
                    ExpenseClaim1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExpenseClaim2 = await ExpenseClaims.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExpenseClaim2?.setOrganization)
                {
                    await
                    ExpenseClaim2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDocumentWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setEmployee)
                {
                    await
                    Document0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setEmployee)
                {
                    await
                    Document1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setEmployee)
                {
                    await
                    Document2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAnnouncementWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Announcement0 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Announcement0?.setCompany)
                {
                    await
                    Announcement0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Announcement1 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Announcement1?.setCompany)
                {
                    await
                    Announcement1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Announcement2 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Announcement2?.setCompany)
                {
                    await
                    Announcement2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAnnouncementWithAuthor() {
            
                const relatedAuthor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Announcement0 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Announcement0?.setAuthor)
                {
                    await
                    Announcement0.
                    setAuthor(relatedAuthor0);
                }
            
                const relatedAuthor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Announcement1 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Announcement1?.setAuthor)
                {
                    await
                    Announcement1.
                    setAuthor(relatedAuthor1);
                }
            
                const relatedAuthor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Announcement2 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Announcement2?.setAuthor)
                {
                    await
                    Announcement2.
                    setAuthor(relatedAuthor2);
                }
            
        }
        
    
        
            
            async function associateAnnouncementWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Announcement0 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Announcement0?.setOrganization)
                {
                    await
                    Announcement0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Announcement1 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Announcement1?.setOrganization)
                {
                    await
                    Announcement1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Announcement2 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Announcement2?.setOrganization)
                {
                    await
                    Announcement2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateApiConfigWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApiConfig0 = await ApiConfigs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApiConfig0?.setCompany)
                {
                    await
                    ApiConfig0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApiConfig1 = await ApiConfigs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApiConfig1?.setCompany)
                {
                    await
                    ApiConfig1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApiConfig2 = await ApiConfigs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApiConfig2?.setCompany)
                {
                    await
                    ApiConfig2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateApiConfigWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApiConfig0 = await ApiConfigs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApiConfig0?.setOrganization)
                {
                    await
                    ApiConfig0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApiConfig1 = await ApiConfigs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApiConfig1?.setOrganization)
                {
                    await
                    ApiConfig1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApiConfig2 = await ApiConfigs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApiConfig2?.setOrganization)
                {
                    await
                    ApiConfig2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAuditLogWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setCompany)
                {
                    await
                    AuditLog0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setCompany)
                {
                    await
                    AuditLog1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setCompany)
                {
                    await
                    AuditLog2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateAuditLogWithActor() {
            
                const relatedActor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setActor)
                {
                    await
                    AuditLog0.
                    setActor(relatedActor0);
                }
            
                const relatedActor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setActor)
                {
                    await
                    AuditLog1.
                    setActor(relatedActor1);
                }
            
                const relatedActor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setActor)
                {
                    await
                    AuditLog2.
                    setActor(relatedActor2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAuditLogWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setOrganization)
                {
                    await
                    AuditLog0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setOrganization)
                {
                    await
                    AuditLog1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setOrganization)
                {
                    await
                    AuditLog2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Companies.bulkCreate(CompaniesData);
                
            
            
                
                await RolePermissions.bulkCreate(RolePermissionsData);
                
            
            
                
                await UserRoles.bulkCreate(UserRolesData);
                
            
            
                
                await Departments.bulkCreate(DepartmentsData);
                
            
            
                
                await JobTitles.bulkCreate(JobTitlesData);
                
            
            
                
                await WorkLocations.bulkCreate(WorkLocationsData);
                
            
            
                
                await Employees.bulkCreate(EmployeesData);
                
            
            
                
                await EmploymentContracts.bulkCreate(EmploymentContractsData);
                
            
            
                
                await LeaveTypes.bulkCreate(LeaveTypesData);
                
            
            
                
                await LeaveRequests.bulkCreate(LeaveRequestsData);
                
            
            
                
                await AttendancePolicies.bulkCreate(AttendancePoliciesData);
                
            
            
                
                await WorkSchedules.bulkCreate(WorkSchedulesData);
                
            
            
                
                await EmployeeScheduleAssignments.bulkCreate(EmployeeScheduleAssignmentsData);
                
            
            
                
                await TimeEntries.bulkCreate(TimeEntriesData);
                
            
            
                
                await Holidays.bulkCreate(HolidaysData);
                
            
            
                
                await ExpenseCategories.bulkCreate(ExpenseCategoriesData);
                
            
            
                
                await ExpenseClaims.bulkCreate(ExpenseClaimsData);
                
            
            
                
                await Documents.bulkCreate(DocumentsData);
                
            
            
                
                await Announcements.bulkCreate(AnnouncementsData);
                
            
            
                
                await ApiConfigs.bulkCreate(ApiConfigsData);
                
            
            
                
                await AuditLogs.bulkCreate(AuditLogsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCompanyWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateRolePermissionWithPermission(),
                    
                
                    
                        
                        await associateRolePermissionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateUserRoleWithUser(),
                    
                
                    
                
                    
                        
                        await associateUserRoleWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDepartmentWithCompany(),
                    
                
                    
                        
                        await associateDepartmentWithParent_department(),
                    
                
                    
                        
                        await associateDepartmentWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateJobTitleWithCompany(),
                    
                
                    
                        
                        await associateJobTitleWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWorkLocationWithCompany(),
                    
                
                    
                
                    
                        
                        await associateWorkLocationWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEmployeeWithCompany(),
                    
                
                    
                        
                        await associateEmployeeWithDepartment(),
                    
                
                    
                        
                        await associateEmployeeWithJob_title(),
                    
                
                    
                        
                        await associateEmployeeWithWork_location(),
                    
                
                    
                        
                        await associateEmployeeWithManager(),
                    
                
                    
                        
                        await associateEmployeeWithUser_account(),
                    
                
                    
                
                    
                
                    
                        
                        await associateEmployeeWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateEmploymentContractWithEmployee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEmploymentContractWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                        
                        await associateLeaveTypeWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLeaveTypeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateLeaveRequestWithEmployee(),
                    
                
                    
                        
                        await associateLeaveRequestWithLeave_type(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLeaveRequestWithApprover(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLeaveRequestWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateAttendancePolicyWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAttendancePolicyWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateWorkScheduleWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWorkScheduleWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateEmployeeScheduleAssignmentWithEmployee(),
                    
                
                    
                        
                        await associateEmployeeScheduleAssignmentWithWork_schedule(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEmployeeScheduleAssignmentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTimeEntryWithEmployee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateTimeEntryWithApproved_by(),
                    
                
                    
                
                    
                        
                        await associateTimeEntryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateHolidayWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateHolidayWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateExpenseCategoryWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExpenseCategoryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateExpenseClaimWithEmployee(),
                    
                
                    
                        
                        await associateExpenseClaimWithExpense_category(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExpenseClaimWithApprover(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExpenseClaimWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDocumentWithEmployee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDocumentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAnnouncementWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAnnouncementWithAuthor(),
                    
                
                    
                        
                        await associateAnnouncementWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateApiConfigWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateApiConfigWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAuditLogWithCompany(),
                    
                
                    
                        
                        await associateAuditLogWithActor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAuditLogWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('companies', null, {});
            
            
            await queryInterface.bulkDelete('role_permissions', null, {});
            
            
            await queryInterface.bulkDelete('user_roles', null, {});
            
            
            await queryInterface.bulkDelete('departments', null, {});
            
            
            await queryInterface.bulkDelete('job_titles', null, {});
            
            
            await queryInterface.bulkDelete('work_locations', null, {});
            
            
            await queryInterface.bulkDelete('employees', null, {});
            
            
            await queryInterface.bulkDelete('employment_contracts', null, {});
            
            
            await queryInterface.bulkDelete('leave_types', null, {});
            
            
            await queryInterface.bulkDelete('leave_requests', null, {});
            
            
            await queryInterface.bulkDelete('attendance_policies', null, {});
            
            
            await queryInterface.bulkDelete('work_schedules', null, {});
            
            
            await queryInterface.bulkDelete('employee_schedule_assignments', null, {});
            
            
            await queryInterface.bulkDelete('time_entries', null, {});
            
            
            await queryInterface.bulkDelete('holidays', null, {});
            
            
            await queryInterface.bulkDelete('expense_categories', null, {});
            
            
            await queryInterface.bulkDelete('expense_claims', null, {});
            
            
            await queryInterface.bulkDelete('documents', null, {});
            
            
            await queryInterface.bulkDelete('announcements', null, {});
            
            
            await queryInterface.bulkDelete('api_configs', null, {});
            
            
            await queryInterface.bulkDelete('audit_logs', null, {});
            
        
    },
};