





















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






const Organizations = db.organizations;

const Outlets = db.outlets;

const JobPositions = db.job_positions;

const Employees = db.employees;

const EmployeeContracts = db.employee_contracts;

const AttendanceLogs = db.attendance_logs;

const AttendanceRequests = db.attendance_requests;

const OvertimeLogs = db.overtime_logs;

const DisciplinaryActions = db.disciplinary_actions;

const KpiPeriods = db.kpi_periods;

const KpiScores = db.kpi_scores;

const OutletRevenues = db.outlet_revenues;

const ServiceChargePools = db.service_charge_pools;

const LoanAccounts = db.loan_accounts;

const PayrollPeriods = db.payroll_periods;

const PayrollItems = db.payroll_items;

const PayrollAdjustments = db.payroll_adjustments;

const Payslips = db.payslips;

const NotificationMessages = db.notification_messages;

const AuditLogs = db.audit_logs;







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



const OutletsData = [
    
    {
    
        
        
            
                "code": "HQ",
            
        
    
        
        
            
                "name": "HQ",
            
        
    
        
        
            
                "address": "Jl. Jenderal Sudirman No. 10, Jakarta",
            
        
    
        
        
            
                "gps_lat": -6.21462,
            
        
    
        
        
            
                "gps_lng": 106.82295,
            
        
    
        
        
            
                "gps_radius_m": 120,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "KMG",
            
        
    
        
        
            
                "name": "Outlet Kemang",
            
        
    
        
        
            
                "address": "Jl. Kemang Raya No. 8, Jakarta",
            
        
    
        
        
            
                "gps_lat": -6.26055,
            
        
    
        
        
            
                "gps_lng": 106.81364,
            
        
    
        
        
            
                "gps_radius_m": 100,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "DPK",
            
        
    
        
        
            
                "name": "Outlet Depok",
            
        
    
        
        
            
                "address": "Jl. Margonda Raya No. 55, Depok",
            
        
    
        
        
            
                "gps_lat": -6.3729,
            
        
    
        
        
            
                "gps_lng": 106.8323,
            
        
    
        
        
            
                "gps_radius_m": 110,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "BKS",
            
        
    
        
        
            
                "name": "Outlet Bekasi",
            
        
    
        
        
            
                "address": "Jl. Ahmad Yani No. 21, Bekasi",
            
        
    
        
        
            
                "gps_lat": -6.23827,
            
        
    
        
        
            
                "gps_lng": 106.99233,
            
        
    
        
        
            
                "gps_radius_m": 100,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const JobPositionsData = [
    
    {
    
        
        
            
                "code": "CASH",
            
        
    
        
        
            
                "name": "Cashier",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "payroll_weight": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "BAR",
            
        
    
        
        
            
                "name": "Barista",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "payroll_weight": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "SPV",
            
        
    
        
        
            
                "name": "Shift Supervisor",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "payroll_weight": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "COOK",
            
        
    
        
        
            
                "name": "Cook",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "payroll_weight": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const EmployeesData = [
    
    {
    
        
        
            
                "employee_code": "E-HR-001",
            
        
    
        
        
            
                "full_name": "Nadia Putri",
            
        
    
        
        
            
                "phone": "081210001001",
            
        
    
        
        
            
                "nik": "3174010101900001",
            
        
    
        
        
            
                "npwp": "12.345.678.9-012.345",
            
        
    
        
        
            
                "bank_name": "BCA",
            
        
    
        
        
            
                "bank_account_number": "1234567890",
            
        
    
        
        
            
                "bank_account_name": "Nadia Putri",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employment_status": "contract",
            
        
    
        
        
            
                "join_date": new Date('2023-02-01T00:00:00Z'),
            
        
    
        
        
            
                "resign_date": new Date('2029-12-31T00:00:00Z'),
            
        
    
        
        
            
                "base_salary_monthly": 12000000,
            
        
    
        
        
            
                "position_allowance_fixed": 1500000,
            
        
    
        
        
            
                "meal_allowance_daily": 25000,
            
        
    
        
        
            
                "transport_allowance_daily": 20000,
            
        
    
        
        
            
                "prorate_position_allowance_under_20_days": true,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "employee_code": "E-MGR-001",
            
        
    
        
        
            
                "full_name": "Rizky Ananda",
            
        
    
        
        
            
                "phone": "081210001002",
            
        
    
        
        
            
                "nik": "3174020202900002",
            
        
    
        
        
            
                "npwp": "23.456.789.0-123.456",
            
        
    
        
        
            
                "bank_name": "Mandiri",
            
        
    
        
        
            
                "bank_account_number": "1400012345678",
            
        
    
        
        
            
                "bank_account_name": "Rizky Ananda",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employment_status": "permanent",
            
        
    
        
        
            
                "join_date": new Date('2022-08-15T00:00:00Z'),
            
        
    
        
        
            
                "resign_date": new Date('2029-12-31T00:00:00Z'),
            
        
    
        
        
            
                "base_salary_monthly": 10000000,
            
        
    
        
        
            
                "position_allowance_fixed": 1250000,
            
        
    
        
        
            
                "meal_allowance_daily": 25000,
            
        
    
        
        
            
                "transport_allowance_daily": 20000,
            
        
    
        
        
            
                "prorate_position_allowance_under_20_days": true,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "employee_code": "E-FIN-001",
            
        
    
        
        
            
                "full_name": "Siti Maharan",
            
        
    
        
        
            
                "phone": "081210001003",
            
        
    
        
        
            
                "nik": "3174030303900003",
            
        
    
        
        
            
                "npwp": "34.567.890.1-234.567",
            
        
    
        
        
            
                "bank_name": "BNI",
            
        
    
        
        
            
                "bank_account_number": "0987654321",
            
        
    
        
        
            
                "bank_account_name": "Siti Maharan",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employment_status": "probation",
            
        
    
        
        
            
                "join_date": new Date('2024-01-10T00:00:00Z'),
            
        
    
        
        
            
                "resign_date": new Date('2026-01-09T00:00:00Z'),
            
        
    
        
        
            
                "base_salary_monthly": 7500000,
            
        
    
        
        
            
                "position_allowance_fixed": 500000,
            
        
    
        
        
            
                "meal_allowance_daily": 25000,
            
        
    
        
        
            
                "transport_allowance_daily": 20000,
            
        
    
        
        
            
                "prorate_position_allowance_under_20_days": true,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "employee_code": "E-EMP-001",
            
        
    
        
        
            
                "full_name": "Dimas Prakoso",
            
        
    
        
        
            
                "phone": "081210001004",
            
        
    
        
        
            
                "nik": "3174040404900004",
            
        
    
        
        
            
                "npwp": "45.678.901.2-345.678",
            
        
    
        
        
            
                "bank_name": "BRI",
            
        
    
        
        
            
                "bank_account_number": "5566778899",
            
        
    
        
        
            
                "bank_account_name": "Dimas Prakoso",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employment_status": "contract",
            
        
    
        
        
            
                "join_date": new Date('2025-03-01T00:00:00Z'),
            
        
    
        
        
            
                "resign_date": new Date('2025-08-31T00:00:00Z'),
            
        
    
        
        
            
                "base_salary_monthly": 5200000,
            
        
    
        
        
            
                "position_allowance_fixed": 0,
            
        
    
        
        
            
                "meal_allowance_daily": 25000,
            
        
    
        
        
            
                "transport_allowance_daily": 20000,
            
        
    
        
        
            
                "prorate_position_allowance_under_20_days": true,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const EmployeeContractsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contract_type": "permanent",
            
        
    
        
        
            
                "start_date": new Date('2022-08-15T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2029-12-31T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Permanent employment agreement for outlet leadership role.",
            
        
    
        
        
            
                "status": "ended",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contract_type": "probation",
            
        
    
        
        
            
                "start_date": new Date('2024-01-10T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-01-09T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Two-year fixed-term contract with finance responsibilities at outlet level.",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contract_type": "permanent",
            
        
    
        
        
            
                "start_date": new Date('2025-03-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2025-08-31T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Probation contract with performance review at month 3 and month 6.",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contract_type": "permanent",
            
        
    
        
        
            
                "start_date": new Date('2024-09-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-08-31T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Fixed-term contract for kitchen operations with standard shift rotation.",
            
        
    
        
        
            
                "status": "ended",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AttendanceLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "check_in_at": new Date('2026-04-01T01:02:00Z'),
            
        
    
        
        
            
                "check_out_at": new Date('2026-04-01T09:10:00Z'),
            
        
    
        
        
            
                "check_in_lat": -6.2606,
            
        
    
        
        
            
                "check_in_lng": 106.8137,
            
        
    
        
        
            
                "check_out_lat": -6.2606,
            
        
    
        
        
            
                "check_out_lng": 106.8137,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "izin",
            
        
    
        
        
            
                "late_minutes": 12,
            
        
    
        
        
            
                "gps_valid": true,
            
        
    
        
        
            
                "remarks": "Traffic delay on arrival.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-02T00:00:00Z'),
            
        
    
        
        
            
                "check_in_at": new Date('2026-04-02T00:50:00Z'),
            
        
    
        
        
            
                "check_out_at": new Date('2026-04-02T09:00:00Z'),
            
        
    
        
        
            
                "check_in_lat": -6.26055,
            
        
    
        
        
            
                "check_in_lng": 106.81364,
            
        
    
        
        
            
                "check_out_lat": -6.26055,
            
        
    
        
        
            
                "check_out_lng": 106.81364,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "dinas",
            
        
    
        
        
            
                "late_minutes": 0,
            
        
    
        
        
            
                "gps_valid": true,
            
        
    
        
        
            
                "remarks": "On time.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "check_in_at": new Date('2026-04-01T00:55:00Z'),
            
        
    
        
        
            
                "check_out_at": new Date('2026-04-01T09:05:00Z'),
            
        
    
        
        
            
                "check_in_lat": -6.3729,
            
        
    
        
        
            
                "check_in_lng": 106.8323,
            
        
    
        
        
            
                "check_out_lat": -6.3729,
            
        
    
        
        
            
                "check_out_lng": 106.8323,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "telat",
            
        
    
        
        
            
                "late_minutes": 0,
            
        
    
        
        
            
                "gps_valid": true,
            
        
    
        
        
            
                "remarks": "Normal shift.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-03T00:00:00Z'),
            
        
    
        
        
            
                "check_in_at": new Date('2026-04-03T01:08:00Z'),
            
        
    
        
        
            
                "check_out_at": new Date('2026-04-03T09:20:00Z'),
            
        
    
        
        
            
                "check_in_lat": -6.3732,
            
        
    
        
        
            
                "check_in_lng": 106.832,
            
        
    
        
        
            
                "check_out_lat": -6.3729,
            
        
    
        
        
            
                "check_out_lng": 106.8323,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "sakit",
            
        
    
        
        
            
                "late_minutes": 18,
            
        
    
        
        
            
                "gps_valid": true,
            
        
    
        
        
            
                "remarks": "Late due to public transport.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AttendanceRequestsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "request_type": "dinas",
            
        
    
        
        
            
                "start_at": new Date('2026-04-10T00:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-04-10T23:59:00Z'),
            
        
    
        
        
            
                "reason": "Family event permission request.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "approval_status": "cancelled",
            
        
    
        
        
            
                "submitted_at": new Date('2026-04-07T03:00:00Z'),
            
        
    
        
        
            
                "decided_at": new Date('2026-04-07T06:30:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "request_type": "izin",
            
        
    
        
        
            
                "start_at": new Date('2026-04-05T00:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-04-06T23:59:00Z'),
            
        
    
        
        
            
                "reason": "Fever and rest recommended by clinic.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "approval_status": "submitted",
            
        
    
        
        
            
                "submitted_at": new Date('2026-04-05T02:10:00Z'),
            
        
    
        
        
            
                "decided_at": new Date('2026-04-05T04:15:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "request_type": "dinas",
            
        
    
        
        
            
                "start_at": new Date('2026-04-02T00:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-04-02T00:00:00Z'),
            
        
    
        
        
            
                "reason": "Check-out photo failed to upload; request correction.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "approval_status": "cancelled",
            
        
    
        
        
            
                "submitted_at": new Date('2026-04-02T11:30:00Z'),
            
        
    
        
        
            
                "decided_at": new Date('2026-04-02T11:30:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "request_type": "izin",
            
        
    
        
        
            
                "start_at": new Date('2026-04-12T00:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-04-12T23:59:00Z'),
            
        
    
        
        
            
                "reason": "Bank visit for payroll batch setup.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "approval_status": "rejected",
            
        
    
        
        
            
                "submitted_at": new Date('2026-04-10T02:00:00Z'),
            
        
    
        
        
            
                "decided_at": new Date('2026-04-10T05:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const OvertimeLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-03T00:00:00Z'),
            
        
    
        
        
            
                "hours": 2.5,
            
        
    
        
        
            
                "reason": "Coverage for peak hour orders.",
            
        
    
        
        
            
                "approval_status": "submitted",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date('2026-04-03T12:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-04T00:00:00Z'),
            
        
    
        
        
            
                "hours": 1.5,
            
        
    
        
        
            
                "reason": "Kitchen prep for weekend menu.",
            
        
    
        
        
            
                "approval_status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date('2026-04-04T11:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-25T00:00:00Z'),
            
        
    
        
        
            
                "hours": 3,
            
        
    
        
        
            
                "reason": "Month-end reconciliation and payroll checks.",
            
        
    
        
        
            
                "approval_status": "rejected",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date('2026-04-25T02:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "work_date": new Date('2026-04-12T00:00:00Z'),
            
        
    
        
        
            
                "hours": 2,
            
        
    
        
        
            
                "reason": "Support special event shift.",
            
        
    
        
        
            
                "approval_status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date('2026-04-12T12:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DisciplinaryActionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "sp2",
            
        
    
        
        
            
                "issued_at": new Date('2026-03-15T02:00:00Z'),
            
        
    
        
        
            
                "valid_until": new Date('2026-06-15T02:00:00Z'),
            
        
    
        
        
            
                "description": "Repeated late arrivals within the month; reminder to follow shift schedule.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "sp3",
            
        
    
        
        
            
                "issued_at": new Date('2026-02-10T02:00:00Z'),
            
        
    
        
        
            
                "valid_until": new Date('2026-05-10T02:00:00Z'),
            
        
    
        
        
            
                "description": "Failure to follow closing SOP checklist; coaching provided.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "sp3",
            
        
    
        
        
            
                "issued_at": new Date('2026-04-20T02:00:00Z'),
            
        
    
        
        
            
                "valid_until": new Date('2026-07-20T02:00:00Z'),
            
        
    
        
        
            
                "description": "Late arrivals continued after SP1; escalation per policy.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "sp1",
            
        
    
        
        
            
                "issued_at": new Date('2026-01-05T02:00:00Z'),
            
        
    
        
        
            
                "valid_until": new Date('2026-04-05T02:00:00Z'),
            
        
    
        
        
            
                "description": "Missed reporting deadline; process improvement plan agreed.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const KpiPeriodsData = [
    
    {
    
        
        
            
                "name": "KPI April 2026 - Outlet Kemang",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "KPI April 2026 - Outlet Depok",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "KPI May 2026 - Outlet Kemang",
            
        
    
        
        
            
                "period_start": new Date('2026-05-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-05-31T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "KPI May 2026 - Outlet Depok",
            
        
    
        
        
            
                "period_start": new Date('2026-05-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-05-31T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const KpiScoresData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "absensi_score": 82,
            
        
    
        
        
            
                "disiplin_score": 78,
            
        
    
        
        
            
                "produktif_score": 84,
            
        
    
        
        
            
                "attitude_score": 88,
            
        
    
        
        
            
                "sop_score": 85,
            
        
    
        
        
            
                "final_score": 83.55,
            
        
    
        
        
            
                "notes": "Good customer engagement; improve punctuality.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scored_at": new Date('2026-05-02T03:00:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "absensi_score": 92,
            
        
    
        
        
            
                "disiplin_score": 90,
            
        
    
        
        
            
                "produktif_score": 86,
            
        
    
        
        
            
                "attitude_score": 90,
            
        
    
        
        
            
                "sop_score": 88,
            
        
    
        
        
            
                "final_score": 89.8,
            
        
    
        
        
            
                "notes": "Consistent reporting and strong coordination with HR.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scored_at": new Date('2026-05-02T03:10:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "absensi_score": 88,
            
        
    
        
        
            
                "disiplin_score": 84,
            
        
    
        
        
            
                "produktif_score": 87,
            
        
    
        
        
            
                "attitude_score": 86,
            
        
    
        
        
            
                "sop_score": 82,
            
        
    
        
        
            
                "final_score": 85.7,
            
        
    
        
        
            
                "notes": "Solid performance; focus on closing SOP consistency.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scored_at": new Date('2026-05-02T03:20:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "absensi_score": 95,
            
        
    
        
        
            
                "disiplin_score": 92,
            
        
    
        
        
            
                "produktif_score": 90,
            
        
    
        
        
            
                "attitude_score": 91,
            
        
    
        
        
            
                "sop_score": 93,
            
        
    
        
        
            
                "final_score": 92.45,
            
        
    
        
        
            
                "notes": "Strong team leadership and outlet execution.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scored_at": new Date('2026-05-02T03:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const OutletRevenuesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "revenue_date": new Date('2026-04-30T00:00:00Z'),
            
        
    
        
        
            
                "gross_revenue": 165000000,
            
        
    
        
        
            
                "net_revenue": 158500000,
            
        
    
        
        
            
                "notes": "Month-end revenue input for April.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "revenue_date": new Date('2026-04-30T00:00:00Z'),
            
        
    
        
        
            
                "gross_revenue": 112000000,
            
        
    
        
        
            
                "net_revenue": 107200000,
            
        
    
        
        
            
                "notes": "April closing revenue after adjustments.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "revenue_date": new Date('2026-04-30T00:00:00Z'),
            
        
    
        
        
            
                "gross_revenue": 98000000,
            
        
    
        
        
            
                "net_revenue": 94500000,
            
        
    
        
        
            
                "notes": "April revenue below target due to renovation days.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "revenue_date": new Date('2026-04-30T00:00:00Z'),
            
        
    
        
        
            
                "gross_revenue": 205000000,
            
        
    
        
        
            
                "net_revenue": 196000000,
            
        
    
        
        
            
                "notes": "April revenue exceeded tier threshold.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ServiceChargePoolsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_name": "Service Charge April 2026 - Kemang",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                "total_amount": 24000000,
            
        
    
        
        
            
                "distribution_method": "equal",
            
        
    
        
        
            
                "notes": "Allocated by job position weight per outlet policy.",
            
        
    
        
        
            
                "status": "locked",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_name": "Service Charge April 2026 - Depok",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                "total_amount": 16000000,
            
        
    
        
        
            
                "distribution_method": "weighted_by_position",
            
        
    
        
        
            
                "notes": "Equal split among active employees.",
            
        
    
        
        
            
                "status": "locked",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_name": "Service Charge April 2026 - Tangerang",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                "total_amount": 32000000,
            
        
    
        
        
            
                "distribution_method": "equal",
            
        
    
        
        
            
                "notes": "Peak month due to promotions.",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_name": "Service Charge April 2026 - Bekasi",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                "total_amount": 9000000,
            
        
    
        
        
            
                "distribution_method": "weighted_by_position",
            
        
    
        
        
            
                "notes": "Lower pool due to reduced operating days.",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LoanAccountsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "principal_amount": 2000000,
            
        
    
        
        
            
                "installment_amount": 500000,
            
        
    
        
        
            
                "remaining_amount": 1500000,
            
        
    
        
        
            
                "start_date": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-06-30T00:00:00Z'),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "notes": "Employee loan for emergency needs; deducted monthly.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "principal_amount": 1500000,
            
        
    
        
        
            
                "installment_amount": 300000,
            
        
    
        
        
            
                "remaining_amount": 900000,
            
        
    
        
        
            
                "start_date": new Date('2026-02-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-06-30T00:00:00Z'),
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "notes": "Small loan with fixed installment schedule.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "principal_amount": 0,
            
        
    
        
        
            
                "installment_amount": 0,
            
        
    
        
        
            
                "remaining_amount": 0,
            
        
    
        
        
            
                "start_date": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-01-31T00:00:00Z'),
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "notes": "No active loan; account closed after final settlement.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "principal_amount": 5000000,
            
        
    
        
        
            
                "installment_amount": 1000000,
            
        
    
        
        
            
                "remaining_amount": 2000000,
            
        
    
        
        
            
                "start_date": new Date('2025-12-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-05-31T00:00:00Z'),
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "notes": "Management loan with accelerated payments.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PayrollPeriodsData = [
    
    {
    
        
        
            
                "name": "Payroll April 2026 - Outlet Kemang",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "standard_workdays": 26,
            
        
    
        
        
            
                "status": "finance_approved",
            
        
    
        
        
            
                "generated_at": new Date('2026-05-02T01:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Payroll April 2026 - Outlet Depok",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "standard_workdays": 26,
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "generated_at": new Date('2026-05-02T01:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Payroll April 2026 - Outlet Tangerang",
            
        
    
        
        
            
                "period_start": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "standard_workdays": 26,
            
        
    
        
        
            
                "status": "finance_approved",
            
        
    
        
        
            
                "generated_at": new Date('2026-05-02T01:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Payroll May 2026 - Outlet Kemang",
            
        
    
        
        
            
                "period_start": new Date('2026-05-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-05-31T23:59:59Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "standard_workdays": 26,
            
        
    
        
        
            
                "status": "hr_approved",
            
        
    
        
        
            
                "generated_at": new Date('2026-05-31T23:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PayrollItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "workdays": 24,
            
        
    
        
        
            
                "sick_days": 2,
            
        
    
        
        
            
                "leave_days": 0,
            
        
    
        
        
            
                "absent_days": 0,
            
        
    
        
        
            
                "late_count": 3,
            
        
    
        
        
            
                "late_minutes_total": 45,
            
        
    
        
        
            
                "base_salary_monthly": 5200000,
            
        
    
        
        
            
                "daily_rate": 200000,
            
        
    
        
        
            
                "base_salary_total": 4800000,
            
        
    
        
        
            
                "meal_transport_total": 1080000,
            
        
    
        
        
            
                "position_allowance_total": 0,
            
        
    
        
        
            
                "kpi_score": 83.55,
            
        
    
        
        
            
                "kpi_allowance_total": 835500,
            
        
    
        
        
            
                "overtime_hours_total": 4.5,
            
        
    
        
        
            
                "overtime_rate": 25000,
            
        
    
        
        
            
                "overtime_total": 112500,
            
        
    
        
        
            
                "revenue_bonus_total": 180000,
            
        
    
        
        
            
                "service_charge_total": 650000,
            
        
    
        
        
            
                "deduction_total": 275000,
            
        
    
        
        
            
                "take_home_pay": 7388000,
            
        
    
        
        
            
                "status": "hr_reviewed",
            
        
    
        
        
            
                "adjustment_notes": "Late penalty applied; loan installment deducted.",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "workdays": 25,
            
        
    
        
        
            
                "sick_days": 0,
            
        
    
        
        
            
                "leave_days": 1,
            
        
    
        
        
            
                "absent_days": 0,
            
        
    
        
        
            
                "late_count": 1,
            
        
    
        
        
            
                "late_minutes_total": 18,
            
        
    
        
        
            
                "base_salary_monthly": 5600000,
            
        
    
        
        
            
                "daily_rate": 215384.62,
            
        
    
        
        
            
                "base_salary_total": 5384615.5,
            
        
    
        
        
            
                "meal_transport_total": 1125000,
            
        
    
        
        
            
                "position_allowance_total": 250000,
            
        
    
        
        
            
                "kpi_score": 85.7,
            
        
    
        
        
            
                "kpi_allowance_total": 857000,
            
        
    
        
        
            
                "overtime_hours_total": 1.5,
            
        
    
        
        
            
                "overtime_rate": 26923.08,
            
        
    
        
        
            
                "overtime_total": 40384.62,
            
        
    
        
        
            
                "revenue_bonus_total": 0,
            
        
    
        
        
            
                "service_charge_total": 500000,
            
        
    
        
        
            
                "deduction_total": 300000,
            
        
    
        
        
            
                "take_home_pay": 7857000.12,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "adjustment_notes": "One leave day; installment deducted.",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "workdays": 26,
            
        
    
        
        
            
                "sick_days": 0,
            
        
    
        
        
            
                "leave_days": 0,
            
        
    
        
        
            
                "absent_days": 0,
            
        
    
        
        
            
                "late_count": 0,
            
        
    
        
        
            
                "late_minutes_total": 0,
            
        
    
        
        
            
                "base_salary_monthly": 7500000,
            
        
    
        
        
            
                "daily_rate": 288461.54,
            
        
    
        
        
            
                "base_salary_total": 7500000,
            
        
    
        
        
            
                "meal_transport_total": 1170000,
            
        
    
        
        
            
                "position_allowance_total": 500000,
            
        
    
        
        
            
                "kpi_score": 89.8,
            
        
    
        
        
            
                "kpi_allowance_total": 898000,
            
        
    
        
        
            
                "overtime_hours_total": 0,
            
        
    
        
        
            
                "overtime_rate": 36057.69,
            
        
    
        
        
            
                "overtime_total": 0,
            
        
    
        
        
            
                "revenue_bonus_total": 250000,
            
        
    
        
        
            
                "service_charge_total": 900000,
            
        
    
        
        
            
                "deduction_total": 0,
            
        
    
        
        
            
                "take_home_pay": 11218000,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "adjustment_notes": "No deductions.",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "workdays": 26,
            
        
    
        
        
            
                "sick_days": 0,
            
        
    
        
        
            
                "leave_days": 0,
            
        
    
        
        
            
                "absent_days": 0,
            
        
    
        
        
            
                "late_count": 0,
            
        
    
        
        
            
                "late_minutes_total": 0,
            
        
    
        
        
            
                "base_salary_monthly": 10000000,
            
        
    
        
        
            
                "daily_rate": 384615.38,
            
        
    
        
        
            
                "base_salary_total": 10000000,
            
        
    
        
        
            
                "meal_transport_total": 1170000,
            
        
    
        
        
            
                "position_allowance_total": 1250000,
            
        
    
        
        
            
                "kpi_score": 92.45,
            
        
    
        
        
            
                "kpi_allowance_total": 924500,
            
        
    
        
        
            
                "overtime_hours_total": 2,
            
        
    
        
        
            
                "overtime_rate": 48076.92,
            
        
    
        
        
            
                "overtime_total": 96153.84,
            
        
    
        
        
            
                "revenue_bonus_total": 600000,
            
        
    
        
        
            
                "service_charge_total": 1200000,
            
        
    
        
        
            
                "deduction_total": 1000000,
            
        
    
        
        
            
                "take_home_pay": 14240653.84,
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "adjustment_notes": "Loan installment deducted; bonus included.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PayrollAdjustmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "earning",
            
        
    
        
        
            
                "adjustment_type": "waste",
            
        
    
        
        
            
                "amount": 75000,
            
        
    
        
        
            
                "description": "Late penalty for total 45 minutes.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_at": new Date('2026-05-02T02:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "deduction",
            
        
    
        
        
            
                "adjustment_type": "manual_deduction",
            
        
    
        
        
            
                "amount": 500000,
            
        
    
        
        
            
                "description": "Loan installment deduction for April.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_at": new Date('2026-05-02T02:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "deduction",
            
        
    
        
        
            
                "adjustment_type": "other",
            
        
    
        
        
            
                "amount": 300000,
            
        
    
        
        
            
                "description": "Loan installment deduction for April.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_at": new Date('2026-05-02T02:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "earning",
            
        
    
        
        
            
                "adjustment_type": "telat_denda",
            
        
    
        
        
            
                "amount": 1000000,
            
        
    
        
        
            
                "description": "Management loan installment deduction for April.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_at": new Date('2026-05-02T02:12:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PayslipsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "slip_number": "PS-KMG-2026-04-0001",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "issued_at": new Date('2026-05-02T06:00:00Z'),
            
        
    
        
        
            
                "delivery_status": "not_sent",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-02T06:05:00Z'),
            
        
    
        
        
            
                "delivery_notes": "Delivered via WhatsApp gateway.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "slip_number": "PS-DPK-2026-04-0002",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "issued_at": new Date('2026-05-02T06:00:00Z'),
            
        
    
        
        
            
                "delivery_status": "queued",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-02T06:00:00Z'),
            
        
    
        
        
            
                "delivery_notes": "Queued for delivery after approval.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "slip_number": "PS-KMG-2026-04-0003",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "issued_at": new Date('2026-05-02T06:00:00Z'),
            
        
    
        
        
            
                "delivery_status": "sent",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-02T06:06:00Z'),
            
        
    
        
        
            
                "delivery_notes": "Delivered successfully.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "slip_number": "PS-KMG-2026-04-0004",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "issued_at": new Date('2026-05-02T06:00:00Z'),
            
        
    
        
        
            
                "delivery_status": "sent",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-02T06:07:00Z'),
            
        
    
        
        
            
                "delivery_notes": "Delivered successfully.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const NotificationMessagesData = [
    
    {
    
        
        
            
                "channel": "in_app",
            
        
    
        
        
            
                "message_type": "generic",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient": "081210001004",
            
        
    
        
        
            
                "subject": "Payslip April 2026",
            
        
    
        
        
            
                "body": "Your payslip for April 2026 is available. Please download the PDF from the portal.",
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "queued_at": new Date('2026-05-02T06:01:00Z'),
            
        
    
        
        
            
                "sent_at": new Date('2026-05-02T06:05:00Z'),
            
        
    
        
        
            
                "provider_message_id": "wa_20260502_0001",
            
        
    
        
        
            
                "error_message": "None",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "message_type": "attendance_alert",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient": "081210001005",
            
        
    
        
        
            
                "subject": "Payslip April 2026",
            
        
    
        
        
            
                "body": "Your payslip for April 2026 will be available after final approval.",
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "queued_at": new Date('2026-05-02T06:01:30Z'),
            
        
    
        
        
            
                "sent_at": new Date('2026-05-02T06:01:30Z'),
            
        
    
        
        
            
                "provider_message_id": "wa_20260502_0002",
            
        
    
        
        
            
                "error_message": "None",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "message_type": "payslip",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient": "Dimas Prakoso",
            
        
    
        
        
            
                "subject": "Late Attendance Notice",
            
        
    
        
        
            
                "body": "Late recorded on 01 Apr 2026. Please ensure on-time check-in for upcoming shifts.",
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "queued_at": new Date('2026-04-01T01:10:00Z'),
            
        
    
        
        
            
                "sent_at": new Date('2026-04-01T01:10:05Z'),
            
        
    
        
        
            
                "provider_message_id": "app_20260401_0003",
            
        
    
        
        
            
                "error_message": "None",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "channel": "whatsapp",
            
        
    
        
        
            
                "message_type": "payslip",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recipient": "siti.maharan@fnbhris.example",
            
        
    
        
        
            
                "subject": "Payroll Review Reminder",
            
        
    
        
        
            
                "body": "Please complete payroll validation for Outlet Kemang April 2026 by end of day.",
            
        
    
        
        
            
                "status": "sent",
            
        
    
        
        
            
                "queued_at": new Date('2026-05-02T02:20:00Z'),
            
        
    
        
        
            
                "sent_at": new Date('2026-05-02T02:21:00Z'),
            
        
    
        
        
            
                "provider_message_id": "email_20260502_0004",
            
        
    
        
        
            
                "error_message": "None",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AuditLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "PAYROLL_GENERATE",
            
        
    
        
        
            
                "entity_name": "payroll_periods",
            
        
    
        
        
            
                "entity_key": "Payroll April 2026 - Outlet Kemang",
            
        
    
        
        
            
                "before_data": "status draft",
            
        
    
        
        
            
                "after_data": "status generated",
            
        
    
        
        
            
                "ip_address": "10.10.1.10",
            
        
    
        
        
            
                "user_agent": "Chrome on Windows",
            
        
    
        
        
            
                "logged_at": new Date('2026-05-02T01:00:10Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "PAYROLL_ADJUSTMENT_CREATE",
            
        
    
        
        
            
                "entity_name": "payroll_adjustments",
            
        
    
        
        
            
                "entity_key": "Late penalty April 2026 Dimas",
            
        
    
        
        
            
                "before_data": "none",
            
        
    
        
        
            
                "after_data": "amount 75000 type telat_denda",
            
        
    
        
        
            
                "ip_address": "10.10.2.15",
            
        
    
        
        
            
                "user_agent": "Chrome on MacOS",
            
        
    
        
        
            
                "logged_at": new Date('2026-05-02T02:00:10Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "ATTENDANCE_REQUEST_APPROVE",
            
        
    
        
        
            
                "entity_name": "attendance_requests",
            
        
    
        
        
            
                "entity_key": "Sick request Dimas 2026-04-05",
            
        
    
        
        
            
                "before_data": "status submitted",
            
        
    
        
        
            
                "after_data": "status approved",
            
        
    
        
        
            
                "ip_address": "10.10.3.21",
            
        
    
        
        
            
                "user_agent": "Mobile Safari iOS",
            
        
    
        
        
            
                "logged_at": new Date('2026-04-05T04:15:20Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "KPI_PERIOD_LOCK",
            
        
    
        
        
            
                "entity_name": "kpi_periods",
            
        
    
        
        
            
                "entity_key": "KPI April 2026 - Outlet Kemang",
            
        
    
        
        
            
                "before_data": "status open",
            
        
    
        
        
            
                "after_data": "status locked",
            
        
    
        
        
            
                "ip_address": "10.10.1.10",
            
        
    
        
        
            
                "user_agent": "Chrome on Windows",
            
        
    
        
        
            
                "logged_at": new Date('2026-05-02T03:00:00Z'),
            
        
    
        
        
            
                // 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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User3 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (User3?.setOrganization)
                {
                    await
                    User3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateOutletWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Outlet0 = await Outlets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Outlet0?.setOrganization)
                {
                    await
                    Outlet0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Outlet1 = await Outlets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Outlet1?.setOrganization)
                {
                    await
                    Outlet1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Outlet2 = await Outlets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Outlet2?.setOrganization)
                {
                    await
                    Outlet2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Outlet3 = await Outlets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Outlet3?.setOrganization)
                {
                    await
                    Outlet3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
            
            async function associateJobPositionWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const JobPosition0 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JobPosition0?.setOutlet)
                {
                    await
                    JobPosition0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const JobPosition1 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JobPosition1?.setOutlet)
                {
                    await
                    JobPosition1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const JobPosition2 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JobPosition2?.setOutlet)
                {
                    await
                    JobPosition2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const JobPosition3 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JobPosition3?.setOutlet)
                {
                    await
                    JobPosition3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateJobPositionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JobPosition0 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JobPosition0?.setOrganization)
                {
                    await
                    JobPosition0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JobPosition1 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JobPosition1?.setOrganization)
                {
                    await
                    JobPosition1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JobPosition2 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JobPosition2?.setOrganization)
                {
                    await
                    JobPosition2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JobPosition3 = await JobPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JobPosition3?.setOrganization)
                {
                    await
                    JobPosition3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateEmployeeWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setUser)
                {
                    await
                    Employee0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setUser)
                {
                    await
                    Employee1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setUser)
                {
                    await
                    Employee2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee3 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Employee3?.setUser)
                {
                    await
                    Employee3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setOutlet)
                {
                    await
                    Employee0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setOutlet)
                {
                    await
                    Employee1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setOutlet)
                {
                    await
                    Employee2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const Employee3 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Employee3?.setOutlet)
                {
                    await
                    Employee3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithJob_position() {
            
                const relatedJob_position0 = await JobPositions.findOne({
                    offset: Math.floor(Math.random() * (await JobPositions.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setJob_position)
                {
                    await
                    Employee0.
                    setJob_position(relatedJob_position0);
                }
            
                const relatedJob_position1 = await JobPositions.findOne({
                    offset: Math.floor(Math.random() * (await JobPositions.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setJob_position)
                {
                    await
                    Employee1.
                    setJob_position(relatedJob_position1);
                }
            
                const relatedJob_position2 = await JobPositions.findOne({
                    offset: Math.floor(Math.random() * (await JobPositions.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setJob_position)
                {
                    await
                    Employee2.
                    setJob_position(relatedJob_position2);
                }
            
                const relatedJob_position3 = await JobPositions.findOne({
                    offset: Math.floor(Math.random() * (await JobPositions.count())),
                });
                const Employee3 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Employee3?.setJob_position)
                {
                    await
                    Employee3.
                    setJob_position(relatedJob_position3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Employee3 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Employee3?.setOrganization)
                {
                    await
                    Employee3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateEmployeeContractWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmployeeContract0 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EmployeeContract0?.setEmployee)
                {
                    await
                    EmployeeContract0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmployeeContract1 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EmployeeContract1?.setEmployee)
                {
                    await
                    EmployeeContract1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmployeeContract2 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EmployeeContract2?.setEmployee)
                {
                    await
                    EmployeeContract2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const EmployeeContract3 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (EmployeeContract3?.setEmployee)
                {
                    await
                    EmployeeContract3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateEmployeeContractWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmployeeContract0 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EmployeeContract0?.setOrganization)
                {
                    await
                    EmployeeContract0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmployeeContract1 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EmployeeContract1?.setOrganization)
                {
                    await
                    EmployeeContract1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmployeeContract2 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EmployeeContract2?.setOrganization)
                {
                    await
                    EmployeeContract2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EmployeeContract3 = await EmployeeContracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (EmployeeContract3?.setOrganization)
                {
                    await
                    EmployeeContract3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAttendanceLogWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceLog0 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceLog0?.setEmployee)
                {
                    await
                    AttendanceLog0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceLog1 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceLog1?.setEmployee)
                {
                    await
                    AttendanceLog1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceLog2 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceLog2?.setEmployee)
                {
                    await
                    AttendanceLog2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceLog3 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceLog3?.setEmployee)
                {
                    await
                    AttendanceLog3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
            
            async function associateAttendanceLogWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceLog0 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceLog0?.setOutlet)
                {
                    await
                    AttendanceLog0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceLog1 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceLog1?.setOutlet)
                {
                    await
                    AttendanceLog1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceLog2 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceLog2?.setOutlet)
                {
                    await
                    AttendanceLog2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceLog3 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceLog3?.setOutlet)
                {
                    await
                    AttendanceLog3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAttendanceLogWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceLog0 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceLog0?.setOrganization)
                {
                    await
                    AttendanceLog0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceLog1 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceLog1?.setOrganization)
                {
                    await
                    AttendanceLog1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceLog2 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceLog2?.setOrganization)
                {
                    await
                    AttendanceLog2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceLog3 = await AttendanceLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceLog3?.setOrganization)
                {
                    await
                    AttendanceLog3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAttendanceRequestWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceRequest0 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRequest0?.setEmployee)
                {
                    await
                    AttendanceRequest0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceRequest1 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRequest1?.setEmployee)
                {
                    await
                    AttendanceRequest1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceRequest2 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRequest2?.setEmployee)
                {
                    await
                    AttendanceRequest2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceRequest3 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceRequest3?.setEmployee)
                {
                    await
                    AttendanceRequest3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
            
            async function associateAttendanceRequestWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceRequest0 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRequest0?.setOutlet)
                {
                    await
                    AttendanceRequest0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceRequest1 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRequest1?.setOutlet)
                {
                    await
                    AttendanceRequest1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceRequest2 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRequest2?.setOutlet)
                {
                    await
                    AttendanceRequest2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const AttendanceRequest3 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceRequest3?.setOutlet)
                {
                    await
                    AttendanceRequest3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAttendanceRequestWithDecided_by_user() {
            
                const relatedDecided_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceRequest0 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRequest0?.setDecided_by_user)
                {
                    await
                    AttendanceRequest0.
                    setDecided_by_user(relatedDecided_by_user0);
                }
            
                const relatedDecided_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceRequest1 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRequest1?.setDecided_by_user)
                {
                    await
                    AttendanceRequest1.
                    setDecided_by_user(relatedDecided_by_user1);
                }
            
                const relatedDecided_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceRequest2 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRequest2?.setDecided_by_user)
                {
                    await
                    AttendanceRequest2.
                    setDecided_by_user(relatedDecided_by_user2);
                }
            
                const relatedDecided_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceRequest3 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceRequest3?.setDecided_by_user)
                {
                    await
                    AttendanceRequest3.
                    setDecided_by_user(relatedDecided_by_user3);
                }
            
        }
        
    
        
            
            async function associateAttendanceRequestWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRequest0 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRequest0?.setOrganization)
                {
                    await
                    AttendanceRequest0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRequest1 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRequest1?.setOrganization)
                {
                    await
                    AttendanceRequest1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRequest2 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRequest2?.setOrganization)
                {
                    await
                    AttendanceRequest2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRequest3 = await AttendanceRequests.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceRequest3?.setOrganization)
                {
                    await
                    AttendanceRequest3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateOvertimeLogWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const OvertimeLog0 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OvertimeLog0?.setEmployee)
                {
                    await
                    OvertimeLog0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const OvertimeLog1 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OvertimeLog1?.setEmployee)
                {
                    await
                    OvertimeLog1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const OvertimeLog2 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OvertimeLog2?.setEmployee)
                {
                    await
                    OvertimeLog2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const OvertimeLog3 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OvertimeLog3?.setEmployee)
                {
                    await
                    OvertimeLog3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
            
            async function associateOvertimeLogWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OvertimeLog0 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OvertimeLog0?.setOutlet)
                {
                    await
                    OvertimeLog0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OvertimeLog1 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OvertimeLog1?.setOutlet)
                {
                    await
                    OvertimeLog1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OvertimeLog2 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OvertimeLog2?.setOutlet)
                {
                    await
                    OvertimeLog2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OvertimeLog3 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OvertimeLog3?.setOutlet)
                {
                    await
                    OvertimeLog3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateOvertimeLogWithApproved_by_user() {
            
                const relatedApproved_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OvertimeLog0 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OvertimeLog0?.setApproved_by_user)
                {
                    await
                    OvertimeLog0.
                    setApproved_by_user(relatedApproved_by_user0);
                }
            
                const relatedApproved_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OvertimeLog1 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OvertimeLog1?.setApproved_by_user)
                {
                    await
                    OvertimeLog1.
                    setApproved_by_user(relatedApproved_by_user1);
                }
            
                const relatedApproved_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OvertimeLog2 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OvertimeLog2?.setApproved_by_user)
                {
                    await
                    OvertimeLog2.
                    setApproved_by_user(relatedApproved_by_user2);
                }
            
                const relatedApproved_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OvertimeLog3 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OvertimeLog3?.setApproved_by_user)
                {
                    await
                    OvertimeLog3.
                    setApproved_by_user(relatedApproved_by_user3);
                }
            
        }
        
    
        
    
        
            
            async function associateOvertimeLogWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OvertimeLog0 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OvertimeLog0?.setOrganization)
                {
                    await
                    OvertimeLog0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OvertimeLog1 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OvertimeLog1?.setOrganization)
                {
                    await
                    OvertimeLog1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OvertimeLog2 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OvertimeLog2?.setOrganization)
                {
                    await
                    OvertimeLog2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OvertimeLog3 = await OvertimeLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OvertimeLog3?.setOrganization)
                {
                    await
                    OvertimeLog3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDisciplinaryActionWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const DisciplinaryAction0 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DisciplinaryAction0?.setEmployee)
                {
                    await
                    DisciplinaryAction0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const DisciplinaryAction1 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DisciplinaryAction1?.setEmployee)
                {
                    await
                    DisciplinaryAction1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const DisciplinaryAction2 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DisciplinaryAction2?.setEmployee)
                {
                    await
                    DisciplinaryAction2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const DisciplinaryAction3 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DisciplinaryAction3?.setEmployee)
                {
                    await
                    DisciplinaryAction3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
            
            async function associateDisciplinaryActionWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const DisciplinaryAction0 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DisciplinaryAction0?.setOutlet)
                {
                    await
                    DisciplinaryAction0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const DisciplinaryAction1 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DisciplinaryAction1?.setOutlet)
                {
                    await
                    DisciplinaryAction1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const DisciplinaryAction2 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DisciplinaryAction2?.setOutlet)
                {
                    await
                    DisciplinaryAction2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const DisciplinaryAction3 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DisciplinaryAction3?.setOutlet)
                {
                    await
                    DisciplinaryAction3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDisciplinaryActionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DisciplinaryAction0 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DisciplinaryAction0?.setOrganization)
                {
                    await
                    DisciplinaryAction0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DisciplinaryAction1 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DisciplinaryAction1?.setOrganization)
                {
                    await
                    DisciplinaryAction1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DisciplinaryAction2 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DisciplinaryAction2?.setOrganization)
                {
                    await
                    DisciplinaryAction2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DisciplinaryAction3 = await DisciplinaryActions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DisciplinaryAction3?.setOrganization)
                {
                    await
                    DisciplinaryAction3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateKpiPeriodWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiPeriod0 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KpiPeriod0?.setOutlet)
                {
                    await
                    KpiPeriod0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiPeriod1 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KpiPeriod1?.setOutlet)
                {
                    await
                    KpiPeriod1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiPeriod2 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KpiPeriod2?.setOutlet)
                {
                    await
                    KpiPeriod2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiPeriod3 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KpiPeriod3?.setOutlet)
                {
                    await
                    KpiPeriod3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
            
            async function associateKpiPeriodWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiPeriod0 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KpiPeriod0?.setOrganization)
                {
                    await
                    KpiPeriod0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiPeriod1 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KpiPeriod1?.setOrganization)
                {
                    await
                    KpiPeriod1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiPeriod2 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KpiPeriod2?.setOrganization)
                {
                    await
                    KpiPeriod2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiPeriod3 = await KpiPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KpiPeriod3?.setOrganization)
                {
                    await
                    KpiPeriod3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateKpiScoreWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const KpiScore0 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KpiScore0?.setEmployee)
                {
                    await
                    KpiScore0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const KpiScore1 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KpiScore1?.setEmployee)
                {
                    await
                    KpiScore1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const KpiScore2 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KpiScore2?.setEmployee)
                {
                    await
                    KpiScore2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const KpiScore3 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KpiScore3?.setEmployee)
                {
                    await
                    KpiScore3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
            
            async function associateKpiScoreWithKpi_period() {
            
                const relatedKpi_period0 = await KpiPeriods.findOne({
                    offset: Math.floor(Math.random() * (await KpiPeriods.count())),
                });
                const KpiScore0 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KpiScore0?.setKpi_period)
                {
                    await
                    KpiScore0.
                    setKpi_period(relatedKpi_period0);
                }
            
                const relatedKpi_period1 = await KpiPeriods.findOne({
                    offset: Math.floor(Math.random() * (await KpiPeriods.count())),
                });
                const KpiScore1 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KpiScore1?.setKpi_period)
                {
                    await
                    KpiScore1.
                    setKpi_period(relatedKpi_period1);
                }
            
                const relatedKpi_period2 = await KpiPeriods.findOne({
                    offset: Math.floor(Math.random() * (await KpiPeriods.count())),
                });
                const KpiScore2 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KpiScore2?.setKpi_period)
                {
                    await
                    KpiScore2.
                    setKpi_period(relatedKpi_period2);
                }
            
                const relatedKpi_period3 = await KpiPeriods.findOne({
                    offset: Math.floor(Math.random() * (await KpiPeriods.count())),
                });
                const KpiScore3 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KpiScore3?.setKpi_period)
                {
                    await
                    KpiScore3.
                    setKpi_period(relatedKpi_period3);
                }
            
        }
        
    
        
            
            async function associateKpiScoreWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiScore0 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KpiScore0?.setOutlet)
                {
                    await
                    KpiScore0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiScore1 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KpiScore1?.setOutlet)
                {
                    await
                    KpiScore1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiScore2 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KpiScore2?.setOutlet)
                {
                    await
                    KpiScore2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const KpiScore3 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KpiScore3?.setOutlet)
                {
                    await
                    KpiScore3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateKpiScoreWithScored_by_user() {
            
                const relatedScored_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const KpiScore0 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KpiScore0?.setScored_by_user)
                {
                    await
                    KpiScore0.
                    setScored_by_user(relatedScored_by_user0);
                }
            
                const relatedScored_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const KpiScore1 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KpiScore1?.setScored_by_user)
                {
                    await
                    KpiScore1.
                    setScored_by_user(relatedScored_by_user1);
                }
            
                const relatedScored_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const KpiScore2 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KpiScore2?.setScored_by_user)
                {
                    await
                    KpiScore2.
                    setScored_by_user(relatedScored_by_user2);
                }
            
                const relatedScored_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const KpiScore3 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KpiScore3?.setScored_by_user)
                {
                    await
                    KpiScore3.
                    setScored_by_user(relatedScored_by_user3);
                }
            
        }
        
    
        
    
        
            
            async function associateKpiScoreWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiScore0 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KpiScore0?.setOrganization)
                {
                    await
                    KpiScore0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiScore1 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KpiScore1?.setOrganization)
                {
                    await
                    KpiScore1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiScore2 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KpiScore2?.setOrganization)
                {
                    await
                    KpiScore2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KpiScore3 = await KpiScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KpiScore3?.setOrganization)
                {
                    await
                    KpiScore3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateOutletRevenueWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OutletRevenue0 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OutletRevenue0?.setOutlet)
                {
                    await
                    OutletRevenue0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OutletRevenue1 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OutletRevenue1?.setOutlet)
                {
                    await
                    OutletRevenue1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OutletRevenue2 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OutletRevenue2?.setOutlet)
                {
                    await
                    OutletRevenue2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const OutletRevenue3 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OutletRevenue3?.setOutlet)
                {
                    await
                    OutletRevenue3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateOutletRevenueWithInput_by_user() {
            
                const relatedInput_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OutletRevenue0 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OutletRevenue0?.setInput_by_user)
                {
                    await
                    OutletRevenue0.
                    setInput_by_user(relatedInput_by_user0);
                }
            
                const relatedInput_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OutletRevenue1 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OutletRevenue1?.setInput_by_user)
                {
                    await
                    OutletRevenue1.
                    setInput_by_user(relatedInput_by_user1);
                }
            
                const relatedInput_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OutletRevenue2 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OutletRevenue2?.setInput_by_user)
                {
                    await
                    OutletRevenue2.
                    setInput_by_user(relatedInput_by_user2);
                }
            
                const relatedInput_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OutletRevenue3 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OutletRevenue3?.setInput_by_user)
                {
                    await
                    OutletRevenue3.
                    setInput_by_user(relatedInput_by_user3);
                }
            
        }
        
    
        
            
            async function associateOutletRevenueWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OutletRevenue0 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OutletRevenue0?.setOrganization)
                {
                    await
                    OutletRevenue0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OutletRevenue1 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OutletRevenue1?.setOrganization)
                {
                    await
                    OutletRevenue1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OutletRevenue2 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OutletRevenue2?.setOrganization)
                {
                    await
                    OutletRevenue2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OutletRevenue3 = await OutletRevenues.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OutletRevenue3?.setOrganization)
                {
                    await
                    OutletRevenue3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateServiceChargePoolWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const ServiceChargePool0 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceChargePool0?.setOutlet)
                {
                    await
                    ServiceChargePool0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const ServiceChargePool1 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceChargePool1?.setOutlet)
                {
                    await
                    ServiceChargePool1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const ServiceChargePool2 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceChargePool2?.setOutlet)
                {
                    await
                    ServiceChargePool2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const ServiceChargePool3 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ServiceChargePool3?.setOutlet)
                {
                    await
                    ServiceChargePool3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateServiceChargePoolWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ServiceChargePool0 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceChargePool0?.setOrganization)
                {
                    await
                    ServiceChargePool0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ServiceChargePool1 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceChargePool1?.setOrganization)
                {
                    await
                    ServiceChargePool1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ServiceChargePool2 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceChargePool2?.setOrganization)
                {
                    await
                    ServiceChargePool2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ServiceChargePool3 = await ServiceChargePools.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ServiceChargePool3?.setOrganization)
                {
                    await
                    ServiceChargePool3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateLoanAccountWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LoanAccount0 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LoanAccount0?.setEmployee)
                {
                    await
                    LoanAccount0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LoanAccount1 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LoanAccount1?.setEmployee)
                {
                    await
                    LoanAccount1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LoanAccount2 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LoanAccount2?.setEmployee)
                {
                    await
                    LoanAccount2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const LoanAccount3 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LoanAccount3?.setEmployee)
                {
                    await
                    LoanAccount3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
            
            async function associateLoanAccountWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const LoanAccount0 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LoanAccount0?.setOutlet)
                {
                    await
                    LoanAccount0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const LoanAccount1 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LoanAccount1?.setOutlet)
                {
                    await
                    LoanAccount1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const LoanAccount2 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LoanAccount2?.setOutlet)
                {
                    await
                    LoanAccount2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const LoanAccount3 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LoanAccount3?.setOutlet)
                {
                    await
                    LoanAccount3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateLoanAccountWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LoanAccount0 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LoanAccount0?.setOrganization)
                {
                    await
                    LoanAccount0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LoanAccount1 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LoanAccount1?.setOrganization)
                {
                    await
                    LoanAccount1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LoanAccount2 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LoanAccount2?.setOrganization)
                {
                    await
                    LoanAccount2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LoanAccount3 = await LoanAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LoanAccount3?.setOrganization)
                {
                    await
                    LoanAccount3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associatePayrollPeriodWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollPeriod0 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollPeriod0?.setOutlet)
                {
                    await
                    PayrollPeriod0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollPeriod1 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollPeriod1?.setOutlet)
                {
                    await
                    PayrollPeriod1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollPeriod2 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollPeriod2?.setOutlet)
                {
                    await
                    PayrollPeriod2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollPeriod3 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollPeriod3?.setOutlet)
                {
                    await
                    PayrollPeriod3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associatePayrollPeriodWithGenerated_by_user() {
            
                const relatedGenerated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollPeriod0 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollPeriod0?.setGenerated_by_user)
                {
                    await
                    PayrollPeriod0.
                    setGenerated_by_user(relatedGenerated_by_user0);
                }
            
                const relatedGenerated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollPeriod1 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollPeriod1?.setGenerated_by_user)
                {
                    await
                    PayrollPeriod1.
                    setGenerated_by_user(relatedGenerated_by_user1);
                }
            
                const relatedGenerated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollPeriod2 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollPeriod2?.setGenerated_by_user)
                {
                    await
                    PayrollPeriod2.
                    setGenerated_by_user(relatedGenerated_by_user2);
                }
            
                const relatedGenerated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollPeriod3 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollPeriod3?.setGenerated_by_user)
                {
                    await
                    PayrollPeriod3.
                    setGenerated_by_user(relatedGenerated_by_user3);
                }
            
        }
        
    
        
            
            async function associatePayrollPeriodWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollPeriod0 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollPeriod0?.setOrganization)
                {
                    await
                    PayrollPeriod0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollPeriod1 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollPeriod1?.setOrganization)
                {
                    await
                    PayrollPeriod1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollPeriod2 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollPeriod2?.setOrganization)
                {
                    await
                    PayrollPeriod2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollPeriod3 = await PayrollPeriods.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollPeriod3?.setOrganization)
                {
                    await
                    PayrollPeriod3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePayrollItemWithPayroll_period() {
            
                const relatedPayroll_period0 = await PayrollPeriods.findOne({
                    offset: Math.floor(Math.random() * (await PayrollPeriods.count())),
                });
                const PayrollItem0 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollItem0?.setPayroll_period)
                {
                    await
                    PayrollItem0.
                    setPayroll_period(relatedPayroll_period0);
                }
            
                const relatedPayroll_period1 = await PayrollPeriods.findOne({
                    offset: Math.floor(Math.random() * (await PayrollPeriods.count())),
                });
                const PayrollItem1 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollItem1?.setPayroll_period)
                {
                    await
                    PayrollItem1.
                    setPayroll_period(relatedPayroll_period1);
                }
            
                const relatedPayroll_period2 = await PayrollPeriods.findOne({
                    offset: Math.floor(Math.random() * (await PayrollPeriods.count())),
                });
                const PayrollItem2 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollItem2?.setPayroll_period)
                {
                    await
                    PayrollItem2.
                    setPayroll_period(relatedPayroll_period2);
                }
            
                const relatedPayroll_period3 = await PayrollPeriods.findOne({
                    offset: Math.floor(Math.random() * (await PayrollPeriods.count())),
                });
                const PayrollItem3 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollItem3?.setPayroll_period)
                {
                    await
                    PayrollItem3.
                    setPayroll_period(relatedPayroll_period3);
                }
            
        }
        
    
        
            
            async function associatePayrollItemWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PayrollItem0 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollItem0?.setEmployee)
                {
                    await
                    PayrollItem0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PayrollItem1 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollItem1?.setEmployee)
                {
                    await
                    PayrollItem1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PayrollItem2 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollItem2?.setEmployee)
                {
                    await
                    PayrollItem2.
                    setEmployee(relatedEmployee2);
                }
            
                const relatedEmployee3 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PayrollItem3 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollItem3?.setEmployee)
                {
                    await
                    PayrollItem3.
                    setEmployee(relatedEmployee3);
                }
            
        }
        
    
        
            
            async function associatePayrollItemWithOutlet() {
            
                const relatedOutlet0 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollItem0 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollItem0?.setOutlet)
                {
                    await
                    PayrollItem0.
                    setOutlet(relatedOutlet0);
                }
            
                const relatedOutlet1 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollItem1 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollItem1?.setOutlet)
                {
                    await
                    PayrollItem1.
                    setOutlet(relatedOutlet1);
                }
            
                const relatedOutlet2 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollItem2 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollItem2?.setOutlet)
                {
                    await
                    PayrollItem2.
                    setOutlet(relatedOutlet2);
                }
            
                const relatedOutlet3 = await Outlets.findOne({
                    offset: Math.floor(Math.random() * (await Outlets.count())),
                });
                const PayrollItem3 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollItem3?.setOutlet)
                {
                    await
                    PayrollItem3.
                    setOutlet(relatedOutlet3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePayrollItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollItem0 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollItem0?.setOrganization)
                {
                    await
                    PayrollItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollItem1 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollItem1?.setOrganization)
                {
                    await
                    PayrollItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollItem2 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollItem2?.setOrganization)
                {
                    await
                    PayrollItem2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollItem3 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollItem3?.setOrganization)
                {
                    await
                    PayrollItem3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePayrollAdjustmentWithPayroll_item() {
            
                const relatedPayroll_item0 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const PayrollAdjustment0 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollAdjustment0?.setPayroll_item)
                {
                    await
                    PayrollAdjustment0.
                    setPayroll_item(relatedPayroll_item0);
                }
            
                const relatedPayroll_item1 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const PayrollAdjustment1 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollAdjustment1?.setPayroll_item)
                {
                    await
                    PayrollAdjustment1.
                    setPayroll_item(relatedPayroll_item1);
                }
            
                const relatedPayroll_item2 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const PayrollAdjustment2 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollAdjustment2?.setPayroll_item)
                {
                    await
                    PayrollAdjustment2.
                    setPayroll_item(relatedPayroll_item2);
                }
            
                const relatedPayroll_item3 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const PayrollAdjustment3 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollAdjustment3?.setPayroll_item)
                {
                    await
                    PayrollAdjustment3.
                    setPayroll_item(relatedPayroll_item3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePayrollAdjustmentWithCreated_by_user() {
            
                const relatedCreated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollAdjustment0 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollAdjustment0?.setCreated_by_user)
                {
                    await
                    PayrollAdjustment0.
                    setCreated_by_user(relatedCreated_by_user0);
                }
            
                const relatedCreated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollAdjustment1 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollAdjustment1?.setCreated_by_user)
                {
                    await
                    PayrollAdjustment1.
                    setCreated_by_user(relatedCreated_by_user1);
                }
            
                const relatedCreated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollAdjustment2 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollAdjustment2?.setCreated_by_user)
                {
                    await
                    PayrollAdjustment2.
                    setCreated_by_user(relatedCreated_by_user2);
                }
            
                const relatedCreated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PayrollAdjustment3 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollAdjustment3?.setCreated_by_user)
                {
                    await
                    PayrollAdjustment3.
                    setCreated_by_user(relatedCreated_by_user3);
                }
            
        }
        
    
        
    
        
            
            async function associatePayrollAdjustmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollAdjustment0 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollAdjustment0?.setOrganization)
                {
                    await
                    PayrollAdjustment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollAdjustment1 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollAdjustment1?.setOrganization)
                {
                    await
                    PayrollAdjustment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollAdjustment2 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollAdjustment2?.setOrganization)
                {
                    await
                    PayrollAdjustment2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollAdjustment3 = await PayrollAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PayrollAdjustment3?.setOrganization)
                {
                    await
                    PayrollAdjustment3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePayslipWithPayroll_item() {
            
                const relatedPayroll_item0 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const Payslip0 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payslip0?.setPayroll_item)
                {
                    await
                    Payslip0.
                    setPayroll_item(relatedPayroll_item0);
                }
            
                const relatedPayroll_item1 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const Payslip1 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payslip1?.setPayroll_item)
                {
                    await
                    Payslip1.
                    setPayroll_item(relatedPayroll_item1);
                }
            
                const relatedPayroll_item2 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const Payslip2 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payslip2?.setPayroll_item)
                {
                    await
                    Payslip2.
                    setPayroll_item(relatedPayroll_item2);
                }
            
                const relatedPayroll_item3 = await PayrollItems.findOne({
                    offset: Math.floor(Math.random() * (await PayrollItems.count())),
                });
                const Payslip3 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payslip3?.setPayroll_item)
                {
                    await
                    Payslip3.
                    setPayroll_item(relatedPayroll_item3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePayslipWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payslip0 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payslip0?.setOrganization)
                {
                    await
                    Payslip0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payslip1 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payslip1?.setOrganization)
                {
                    await
                    Payslip1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payslip2 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payslip2?.setOrganization)
                {
                    await
                    Payslip2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payslip3 = await Payslips.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payslip3?.setOrganization)
                {
                    await
                    Payslip3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
            
            async function associateNotificationMessageWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationMessage0 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationMessage0?.setUser)
                {
                    await
                    NotificationMessage0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationMessage1 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationMessage1?.setUser)
                {
                    await
                    NotificationMessage1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationMessage2 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationMessage2?.setUser)
                {
                    await
                    NotificationMessage2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationMessage3 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NotificationMessage3?.setUser)
                {
                    await
                    NotificationMessage3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateNotificationMessageWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationMessage0 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationMessage0?.setOrganization)
                {
                    await
                    NotificationMessage0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationMessage1 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationMessage1?.setOrganization)
                {
                    await
                    NotificationMessage1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationMessage2 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationMessage2?.setOrganization)
                {
                    await
                    NotificationMessage2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationMessage3 = await NotificationMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NotificationMessage3?.setOrganization)
                {
                    await
                    NotificationMessage3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAuditLogWithActor_user() {
            
                const relatedActor_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setActor_user)
                {
                    await
                    AuditLog0.
                    setActor_user(relatedActor_user0);
                }
            
                const relatedActor_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setActor_user)
                {
                    await
                    AuditLog1.
                    setActor_user(relatedActor_user1);
                }
            
                const relatedActor_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setActor_user)
                {
                    await
                    AuditLog2.
                    setActor_user(relatedActor_user2);
                }
            
                const relatedActor_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog3 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditLog3?.setActor_user)
                {
                    await
                    AuditLog3.
                    setActor_user(relatedActor_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditLog3 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditLog3?.setOrganization)
                {
                    await
                    AuditLog3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Outlets.bulkCreate(OutletsData);
                
            
            
                
                await JobPositions.bulkCreate(JobPositionsData);
                
            
            
                
                await Employees.bulkCreate(EmployeesData);
                
            
            
                
                await EmployeeContracts.bulkCreate(EmployeeContractsData);
                
            
            
                
                await AttendanceLogs.bulkCreate(AttendanceLogsData);
                
            
            
                
                await AttendanceRequests.bulkCreate(AttendanceRequestsData);
                
            
            
                
                await OvertimeLogs.bulkCreate(OvertimeLogsData);
                
            
            
                
                await DisciplinaryActions.bulkCreate(DisciplinaryActionsData);
                
            
            
                
                await KpiPeriods.bulkCreate(KpiPeriodsData);
                
            
            
                
                await KpiScores.bulkCreate(KpiScoresData);
                
            
            
                
                await OutletRevenues.bulkCreate(OutletRevenuesData);
                
            
            
                
                await ServiceChargePools.bulkCreate(ServiceChargePoolsData);
                
            
            
                
                await LoanAccounts.bulkCreate(LoanAccountsData);
                
            
            
                
                await PayrollPeriods.bulkCreate(PayrollPeriodsData);
                
            
            
                
                await PayrollItems.bulkCreate(PayrollItemsData);
                
            
            
                
                await PayrollAdjustments.bulkCreate(PayrollAdjustmentsData);
                
            
            
                
                await Payslips.bulkCreate(PayslipsData);
                
            
            
                
                await NotificationMessages.bulkCreate(NotificationMessagesData);
                
            
            
                
                await AuditLogs.bulkCreate(AuditLogsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateOutletWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                        
                        await associateJobPositionWithOutlet(),
                    
                
                    
                
                    
                
                    
                        
                        await associateJobPositionWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEmployeeWithUser(),
                    
                
                    
                        
                        await associateEmployeeWithOutlet(),
                    
                
                    
                        
                        await associateEmployeeWithJob_position(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEmployeeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateEmployeeContractWithEmployee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEmployeeContractWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAttendanceLogWithEmployee(),
                    
                
                    
                        
                        await associateAttendanceLogWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAttendanceLogWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAttendanceRequestWithEmployee(),
                    
                
                    
                        
                        await associateAttendanceRequestWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAttendanceRequestWithDecided_by_user(),
                    
                
                    
                        
                        await associateAttendanceRequestWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateOvertimeLogWithEmployee(),
                    
                
                    
                        
                        await associateOvertimeLogWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateOvertimeLogWithApproved_by_user(),
                    
                
                    
                
                    
                        
                        await associateOvertimeLogWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDisciplinaryActionWithEmployee(),
                    
                
                    
                        
                        await associateDisciplinaryActionWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDisciplinaryActionWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateKpiPeriodWithOutlet(),
                    
                
                    
                
                    
                        
                        await associateKpiPeriodWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateKpiScoreWithEmployee(),
                    
                
                    
                        
                        await associateKpiScoreWithKpi_period(),
                    
                
                    
                        
                        await associateKpiScoreWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateKpiScoreWithScored_by_user(),
                    
                
                    
                
                    
                        
                        await associateKpiScoreWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateOutletRevenueWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateOutletRevenueWithInput_by_user(),
                    
                
                    
                        
                        await associateOutletRevenueWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateServiceChargePoolWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateServiceChargePoolWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateLoanAccountWithEmployee(),
                    
                
                    
                        
                        await associateLoanAccountWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLoanAccountWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePayrollPeriodWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePayrollPeriodWithGenerated_by_user(),
                    
                
                    
                        
                        await associatePayrollPeriodWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePayrollItemWithPayroll_period(),
                    
                
                    
                        
                        await associatePayrollItemWithEmployee(),
                    
                
                    
                        
                        await associatePayrollItemWithOutlet(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePayrollItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePayrollAdjustmentWithPayroll_item(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePayrollAdjustmentWithCreated_by_user(),
                    
                
                    
                
                    
                        
                        await associatePayrollAdjustmentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePayslipWithPayroll_item(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePayslipWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                        
                        await associateNotificationMessageWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNotificationMessageWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAuditLogWithActor_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAuditLogWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('outlets', null, {});
            
            
            await queryInterface.bulkDelete('job_positions', null, {});
            
            
            await queryInterface.bulkDelete('employees', null, {});
            
            
            await queryInterface.bulkDelete('employee_contracts', null, {});
            
            
            await queryInterface.bulkDelete('attendance_logs', null, {});
            
            
            await queryInterface.bulkDelete('attendance_requests', null, {});
            
            
            await queryInterface.bulkDelete('overtime_logs', null, {});
            
            
            await queryInterface.bulkDelete('disciplinary_actions', null, {});
            
            
            await queryInterface.bulkDelete('kpi_periods', null, {});
            
            
            await queryInterface.bulkDelete('kpi_scores', null, {});
            
            
            await queryInterface.bulkDelete('outlet_revenues', null, {});
            
            
            await queryInterface.bulkDelete('service_charge_pools', null, {});
            
            
            await queryInterface.bulkDelete('loan_accounts', null, {});
            
            
            await queryInterface.bulkDelete('payroll_periods', null, {});
            
            
            await queryInterface.bulkDelete('payroll_items', null, {});
            
            
            await queryInterface.bulkDelete('payroll_adjustments', null, {});
            
            
            await queryInterface.bulkDelete('payslips', null, {});
            
            
            await queryInterface.bulkDelete('notification_messages', null, {});
            
            
            await queryInterface.bulkDelete('audit_logs', null, {});
            
        
    },
};