





















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






const Admins = db.admins;

const CityDoctors = db.city_doctors;

const RuralDoctors = db.rural_doctors;

const Patients = db.patients;

const MedicalReports = db.medical_reports;

const Medicines = db.medicines;

const InventoryUpdates = db.inventory_updates;

const MedicineDispatches = db.medicine_dispatches;

const DispatchItems = db.dispatch_items;

const MedicalCamps = db.medical_camps;

const Appointments = db.appointments;

const ChatThreads = db.chat_threads;

const Messages = db.messages;

const Notifications = db.notifications;

const Trucks = db.trucks;

const TruckTrackingEvents = db.truck_tracking_events;

const VaccinationReminders = db.vaccination_reminders;

const MedicineReminders = db.medicine_reminders;

const AiChatSessions = db.ai_chat_sessions;

const AiChatMessages = db.ai_chat_messages;

const AuditLogs = db.audit_logs;







const AdminsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Asha Menon",
            
        
    
        
        
            
                "gmail_address": "ops.lead@swa-jiva.org",
            
        
    
        
        
            
                "access_level": "viewer",
            
        
    
        
        
            
                "department": "Operations",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Rakesh Iyer",
            
        
    
        
        
            
                "gmail_address": "rakesh.iyer@swa-jiva.org",
            
        
    
        
        
            
                "access_level": "admin",
            
        
    
        
        
            
                "department": "Supply Chain",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Farah Khan",
            
        
    
        
        
            
                "gmail_address": "farah.khan@swa-jiva.org",
            
        
    
        
        
            
                "access_level": "admin",
            
        
    
        
        
            
                "department": "Analytics",
            
        
    
    },
    
];



const CityDoctorsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Dr Meera Kapoor",
            
        
    
        
        
            
                "hospital_code": "HOSP-CITY-1021",
            
        
    
        
        
            
                "doctor_registration_no": "TSMC-2011-45890",
            
        
    
        
        
            
                "specialization": "Internal Medicine",
            
        
    
        
        
            
                "years_experience": 12,
            
        
    
        
        
            
                "qualification": "MD Medicine",
            
        
    
        
        
            
                "availability_status": "on_call",
            
        
    
        
        
            
                "consultation_fee": 600,
            
        
    
        
        
            
                "clinic_address": "CityCare Hospital, Banjara Hills",
            
        
    
        
        
            
                "clinic_latitude": 17.4123,
            
        
    
        
        
            
                "clinic_longitude": 78.4482,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Dr Arjun Nair",
            
        
    
        
        
            
                "hospital_code": "HOSP-CITY-1450",
            
        
    
        
        
            
                "doctor_registration_no": "TSMC-2014-51220",
            
        
    
        
        
            
                "specialization": "Pediatrics",
            
        
    
        
        
            
                "years_experience": 10,
            
        
    
        
        
            
                "qualification": "MD Pediatrics",
            
        
    
        
        
            
                "availability_status": "on_call",
            
        
    
        
        
            
                "consultation_fee": 700,
            
        
    
        
        
            
                "clinic_address": "Medanta Clinic, Jubilee Hills",
            
        
    
        
        
            
                "clinic_latitude": 17.4322,
            
        
    
        
        
            
                "clinic_longitude": 78.4072,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Dr Sana Qureshi",
            
        
    
        
        
            
                "hospital_code": "HOSP-CITY-1188",
            
        
    
        
        
            
                "doctor_registration_no": "TSMC-2016-62311",
            
        
    
        
        
            
                "specialization": "Gynecology",
            
        
    
        
        
            
                "years_experience": 8,
            
        
    
        
        
            
                "qualification": "MS OBG",
            
        
    
        
        
            
                "availability_status": "busy",
            
        
    
        
        
            
                "consultation_fee": 800,
            
        
    
        
        
            
                "clinic_address": "Apollo Clinic, Kondapur",
            
        
    
        
        
            
                "clinic_latitude": 17.4702,
            
        
    
        
        
            
                "clinic_longitude": 78.3577,
            
        
    
    },
    
];



const RuralDoctorsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Dr Suresh Naik",
            
        
    
        
        
            
                "dho_code": "DHO-TG-NPT-009",
            
        
    
        
        
            
                "doctor_registration_no": "TSMC-2009-33102",
            
        
    
        
        
            
                "assigned_region": "Narayanpet",
            
        
    
        
        
            
                "subcenter_name": "PHC Narayanpet",
            
        
    
        
        
            
                "subcenter_latitude": 16.7478,
            
        
    
        
        
            
                "subcenter_longitude": 77.4959,
            
        
    
        
        
            
                "availability_status": "busy",
            
        
    
        
        
            
                "can_register_patients": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Dr Kavya Rao",
            
        
    
        
        
            
                "dho_code": "DHO-TG-MBNR-014",
            
        
    
        
        
            
                "doctor_registration_no": "TSMC-2013-48977",
            
        
    
        
        
            
                "assigned_region": "Mahabubnagar",
            
        
    
        
        
            
                "subcenter_name": "PHC Mahabubnagar Rural",
            
        
    
        
        
            
                "subcenter_latitude": 16.7489,
            
        
    
        
        
            
                "subcenter_longitude": 78.0022,
            
        
    
        
        
            
                "availability_status": "online",
            
        
    
        
        
            
                "can_register_patients": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Dr Imran Ali",
            
        
    
        
        
            
                "dho_code": "DHO-TG-WGL-021",
            
        
    
        
        
            
                "doctor_registration_no": "TSMC-2015-56190",
            
        
    
        
        
            
                "assigned_region": "Warangal Rural",
            
        
    
        
        
            
                "subcenter_name": "PHC Narsampet",
            
        
    
        
        
            
                "subcenter_latitude": 17.9286,
            
        
    
        
        
            
                "subcenter_longitude": 79.8947,
            
        
    
        
        
            
                "availability_status": "in_field",
            
        
    
        
        
            
                "can_register_patients": true,
            
        
    
    },
    
];



const PatientsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "patient_uid": "SJ-PAT-000482",
            
        
    
        
        
            
                "full_name": "Anita Reddy",
            
        
    
        
        
            
                "gender": "prefer_not_to_say",
            
        
    
        
        
            
                "date_of_birth": new Date('1991-08-12T00:00:00Z'),
            
        
    
        
        
            
                "blood_group": "B+",
            
        
    
        
        
            
                "allergies": "No known allergies",
            
        
    
        
        
            
                "chronic_conditions": "Hypothyroidism",
            
        
    
        
        
            
                "emergency_contact_name": "Suresh Reddy",
            
        
    
        
        
            
                "emergency_contact_phone": "+919701112233",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "registered_at": new Date('2026-04-11T09:25:00Z'),
            
        
    
        
        
            
                "account_status": "blocked",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "patient_uid": "SJ-PAT-000483",
            
        
    
        
        
            
                "full_name": "Rahul Verma",
            
        
    
        
        
            
                "gender": "female",
            
        
    
        
        
            
                "date_of_birth": new Date('1987-02-03T00:00:00Z'),
            
        
    
        
        
            
                "blood_group": "O+",
            
        
    
        
        
            
                "allergies": "Peanut allergy",
            
        
    
        
        
            
                "chronic_conditions": "Mild asthma",
            
        
    
        
        
            
                "emergency_contact_name": "Pooja Verma",
            
        
    
        
        
            
                "emergency_contact_phone": "+919709998877",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "registered_at": new Date('2026-04-12T11:10:00Z'),
            
        
    
        
        
            
                "account_status": "inactive",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "patient_uid": "SJ-PAT-000484",
            
        
    
        
        
            
                "full_name": "Lakshmi Devi",
            
        
    
        
        
            
                "gender": "female",
            
        
    
        
        
            
                "date_of_birth": new Date('1972-11-21T00:00:00Z'),
            
        
    
        
        
            
                "blood_group": "A+",
            
        
    
        
        
            
                "allergies": "Allergy to penicillin",
            
        
    
        
        
            
                "chronic_conditions": "Type 2 diabetes",
            
        
    
        
        
            
                "emergency_contact_name": "Ramesh Kumar",
            
        
    
        
        
            
                "emergency_contact_phone": "+919708887766",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "registered_at": new Date('2026-04-15T08:45:00Z'),
            
        
    
        
        
            
                "account_status": "blocked",
            
        
    
    },
    
];



const MedicalReportsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "report_date": new Date('2026-05-10T09:00:00Z'),
            
        
    
        
        
            
                "report_type": "follow_up",
            
        
    
        
        
            
                "chief_complaint": "Persistent fatigue and weight gain",
            
        
    
        
        
            
                "symptoms": "Tiredness, cold intolerance",
            
        
    
        
        
            
                "diagnosis": "Hypothyroidism follow up",
            
        
    
        
        
            
                "clinical_notes": "TSH elevated on prior labs; counselled on adherence",
            
        
    
        
        
            
                "prescription_notes": "Continue levothyroxine; recheck labs in 6 weeks",
            
        
    
        
        
            
                "recommended_tests": "TSH, Free T4",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_finalized": true,
            
        
    
        
        
            
                "finalized_at": new Date('2026-05-10T09:40:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "report_date": new Date('2026-05-08T11:20:00Z'),
            
        
    
        
        
            
                "report_type": "imaging",
            
        
    
        
        
            
                "chief_complaint": "Wheezing episodes during night",
            
        
    
        
        
            
                "symptoms": "Shortness of breath, cough",
            
        
    
        
        
            
                "diagnosis": "Asthma mild intermittent",
            
        
    
        
        
            
                "clinical_notes": "Trigger avoidance discussed; inhaler technique reviewed",
            
        
    
        
        
            
                "prescription_notes": "Salbutamol inhaler as needed; consider controller if frequent",
            
        
    
        
        
            
                "recommended_tests": "Peak flow monitoring",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_finalized": true,
            
        
    
        
        
            
                "finalized_at": new Date('2026-05-08T12:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "report_date": new Date('2026-05-05T10:15:00Z'),
            
        
    
        
        
            
                "report_type": "camp_visit",
            
        
    
        
        
            
                "chief_complaint": "High sugar readings last week",
            
        
    
        
        
            
                "symptoms": "Increased thirst",
            
        
    
        
        
            
                "diagnosis": "Type 2 diabetes suboptimal control",
            
        
    
        
        
            
                "clinical_notes": "Dietary counseling and exercise plan provided",
            
        
    
        
        
            
                "prescription_notes": "Adjust metformin dose; add follow up in 2 weeks",
            
        
    
        
        
            
                "recommended_tests": "HbA1c, Fasting glucose",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_finalized": true,
            
        
    
        
        
            
                "finalized_at": new Date('2026-05-05T10:55:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const MedicinesData = [
    
    {
    
        
        
            
                "medicine_name": "Paracetamol",
            
        
    
        
        
            
                "generic_name": "Acetaminophen",
            
        
    
        
        
            
                "category": "device",
            
        
    
        
        
            
                "strength": "500 mg",
            
        
    
        
        
            
                "unit": "tablet",
            
        
    
        
        
            
                "manufacturer": "HealthGen Pharma",
            
        
    
        
        
            
                "unit_price": 1.5,
            
        
    
        
        
            
                "requires_prescription": true,
            
        
    
        
        
            
                "reorder_level": 500,
            
        
    
        
        
            
                "storage_instructions": "Store below 30C, keep dry",
            
        
    
    },
    
    {
    
        
        
            
                "medicine_name": "Amoxicillin",
            
        
    
        
        
            
                "generic_name": "Amoxicillin",
            
        
    
        
        
            
                "category": "syrup",
            
        
    
        
        
            
                "strength": "500 mg",
            
        
    
        
        
            
                "unit": "capsule",
            
        
    
        
        
            
                "manufacturer": "CureWell Labs",
            
        
    
        
        
            
                "unit_price": 4.2,
            
        
    
        
        
            
                "requires_prescription": true,
            
        
    
        
        
            
                "reorder_level": 200,
            
        
    
        
        
            
                "storage_instructions": "Store in a cool place away from moisture",
            
        
    
    },
    
    {
    
        
        
            
                "medicine_name": "Metformin",
            
        
    
        
        
            
                "generic_name": "Metformin HCl",
            
        
    
        
        
            
                "category": "drops",
            
        
    
        
        
            
                "strength": "500 mg",
            
        
    
        
        
            
                "unit": "tablet",
            
        
    
        
        
            
                "manufacturer": "MedCore Pharmaceuticals",
            
        
    
        
        
            
                "unit_price": 3.8,
            
        
    
        
        
            
                "requires_prescription": true,
            
        
    
        
        
            
                "reorder_level": 300,
            
        
    
        
        
            
                "storage_instructions": "Store below 25C, protect from light",
            
        
    
    },
    
];



const InventoryUpdatesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "update_type": "adjustment",
            
        
    
        
        
            
                "quantity_change": 0,
            
        
    
        
        
            
                "quantity_after": 820,
            
        
    
        
        
            
                "reason": "Monthly stock audit completed",
            
        
    
        
        
            
                "updated_on": new Date('2026-05-15T08:30:00Z'),
            
        
    
        
        
            
                "is_shortage_alert": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "update_type": "stock_out",
            
        
    
        
        
            
                "quantity_change": -30,
            
        
    
        
        
            
                "quantity_after": 110,
            
        
    
        
        
            
                "reason": "Dispensed to chronic care patients",
            
        
    
        
        
            
                "updated_on": new Date('2026-05-16T10:05:00Z'),
            
        
    
        
        
            
                "is_shortage_alert": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "update_type": "stock_in",
            
        
    
        
        
            
                "quantity_change": -20,
            
        
    
        
        
            
                "quantity_after": 75,
            
        
    
        
        
            
                "reason": "Used for acute infections cases",
            
        
    
        
        
            
                "updated_on": new Date('2026-05-16T12:20:00Z'),
            
        
    
        
        
            
                "is_shortage_alert": true,
            
        
    
    },
    
];



const MedicineDispatchesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_at": new Date('2026-05-16T10:20:00Z'),
            
        
    
        
        
            
                "approved_at": new Date('2026-05-16T13:00:00Z'),
            
        
    
        
        
            
                "dispatched_at": new Date('2026-05-17T06:30:00Z'),
            
        
    
        
        
            
                "delivered_at": new Date('2026-05-17T14:20:00Z'),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "dispatch_note": "Priority refill for chronic medicines",
            
        
    
        
        
            
                "destination_address": "PHC Mahabubnagar Rural, Telangana",
            
        
    
        
        
            
                "destination_latitude": 16.7489,
            
        
    
        
        
            
                "destination_longitude": 78.0022,
            
        
    
        
        
            
                "tracking_reference": "SJ-DISP-2026-0517-001",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_at": new Date('2026-05-15T09:05:00Z'),
            
        
    
        
        
            
                "approved_at": new Date('2026-05-15T11:45:00Z'),
            
        
    
        
        
            
                "dispatched_at": new Date('2026-05-16T07:10:00Z'),
            
        
    
        
        
            
                "delivered_at": new Date('2026-05-16T16:40:00Z'),
            
        
    
        
        
            
                "status": "requested",
            
        
    
        
        
            
                "dispatch_note": "General OPD medicines replenishment",
            
        
    
        
        
            
                "destination_address": "PHC Narayanpet, Telangana",
            
        
    
        
        
            
                "destination_latitude": 16.7478,
            
        
    
        
        
            
                "destination_longitude": 77.4959,
            
        
    
        
        
            
                "tracking_reference": "SJ-DISP-2026-0516-002",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_at": new Date('2026-05-17T08:00:00Z'),
            
        
    
        
        
            
                "approved_at": new Date('2026-05-17T10:30:00Z'),
            
        
    
        
        
            
                "dispatched_at": new Date('2026-05-18T06:15:00Z'),
            
        
    
        
        
            
                "delivered_at": new Date('2026-05-18T18:05:00Z'),
            
        
    
        
        
            
                "status": "delivered",
            
        
    
        
        
            
                "dispatch_note": "Antibiotic stock top-up for seasonal infections",
            
        
    
        
        
            
                "destination_address": "PHC Narsampet, Warangal Rural",
            
        
    
        
        
            
                "destination_latitude": 17.9286,
            
        
    
        
        
            
                "destination_longitude": 79.8947,
            
        
    
        
        
            
                "tracking_reference": "SJ-DISP-2026-0518-003",
            
        
    
    },
    
];



const DispatchItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 200,
            
        
    
        
        
            
                "dosage_instructions": "Take after meals as prescribed",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 1000,
            
        
    
        
        
            
                "dosage_instructions": "For fever or pain as advised",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 300,
            
        
    
        
        
            
                "dosage_instructions": "Complete full course as prescribed",
            
        
    
    },
    
];



const MedicalCampsData = [
    
    {
    
        
        
            
                "camp_name": "Narayanpet Wellness Camp May 2026",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date('2026-05-25T04:30:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-05-25T11:30:00Z'),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "location_name": "Community Hall Narayanpet",
            
        
    
        
        
            
                "address": "Community Hall, Narayanpet, Telangana",
            
        
    
        
        
            
                "latitude": 16.7475,
            
        
    
        
        
            
                "longitude": 77.4962,
            
        
    
        
        
            
                "expected_attendees": 350,
            
        
    
        
        
            
                "actual_attendees": 0,
            
        
    
        
        
            
                "services_offered": "General medicine, diabetes screening, BP check",
            
        
    
        
        
            
                "notes": "Bring BP apparatus, glucometers and forms",
            
        
    
    },
    
    {
    
        
        
            
                "camp_name": "Mahabubnagar Child Health Drive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date('2026-06-02T04:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-06-02T10:30:00Z'),
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "location_name": "ZPHS Ground",
            
        
    
        
        
            
                "address": "ZPHS Ground, Mahabubnagar, Telangana",
            
        
    
        
        
            
                "latitude": 16.7482,
            
        
    
        
        
            
                "longitude": 78.0031,
            
        
    
        
        
            
                "expected_attendees": 250,
            
        
    
        
        
            
                "actual_attendees": 0,
            
        
    
        
        
            
                "services_offered": "Pediatrics consult, vaccination counseling, nutrition checks",
            
        
    
        
        
            
                "notes": "Coordinate with school administration",
            
        
    
    },
    
    {
    
        
        
            
                "camp_name": "Warangal Respiratory Awareness Camp",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date('2026-06-10T04:30:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-06-10T11:00:00Z'),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "location_name": "PHC Narsampet Campus",
            
        
    
        
        
            
                "address": "PHC Narsampet, Warangal Rural",
            
        
    
        
        
            
                "latitude": 17.9282,
            
        
    
        
        
            
                "longitude": 79.8953,
            
        
    
        
        
            
                "expected_attendees": 300,
            
        
    
        
        
            
                "actual_attendees": 0,
            
        
    
        
        
            
                "services_offered": "Asthma education, mental wellness screening, referrals",
            
        
    
        
        
            
                "notes": "Prepare IEC material and referral slips",
            
        
    
    },
    
];



const AppointmentsData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "scheduled_start_at": new Date('2026-05-25T06:10:00Z'),
            
        
    
        
        
            
                "scheduled_end_at": new Date('2026-05-25T06:25:00Z'),
            
        
    
        
        
            
                "appointment_type": "camp_visit",
            
        
    
        
        
            
                "status": "confirmed",
            
        
    
        
        
            
                "reason_for_visit": "Thyroid follow up and lab planning",
            
        
    
        
        
            
                "meeting_link": "https://meet.swa-jiva.org/room/camp-npt-01",
            
        
    
        
        
            
                "meeting_room": "camp-npt-01",
            
        
    
    },
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "scheduled_start_at": new Date('2026-06-02T07:00:00Z'),
            
        
    
        
        
            
                "scheduled_end_at": new Date('2026-06-02T07:15:00Z'),
            
        
    
        
        
            
                "appointment_type": "telemedicine",
            
        
    
        
        
            
                "status": "in_progress",
            
        
    
        
        
            
                "reason_for_visit": "Asthma review and inhaler technique",
            
        
    
        
        
            
                "meeting_link": "https://meet.swa-jiva.org/room/camp-mbnr-02",
            
        
    
        
        
            
                "meeting_room": "camp-mbnr-02",
            
        
    
    },
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "scheduled_start_at": new Date('2026-06-10T06:40:00Z'),
            
        
    
        
        
            
                "scheduled_end_at": new Date('2026-06-10T06:55:00Z'),
            
        
    
        
        
            
                "appointment_type": "in_person",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "reason_for_visit": "Diabetes follow up and medication adjustment",
            
        
    
        
        
            
                "meeting_link": "https://meet.swa-jiva.org/room/camp-wgl-03",
            
        
    
        
        
            
                "meeting_room": "camp-wgl-03",
            
        
    
    },
    
];



const ChatThreadsData = [
    
    {
    
        
        
            
                "thread_type": "support",
            
        
    
        
        
            
                "thread_title": "Anita and Dr Suresh",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                "last_message_at": new Date('2026-05-20T08:10:00Z'),
            
        
    
        
        
            
                "is_archived": true,
            
        
    
    },
    
    {
    
        
        
            
                "thread_type": "group",
            
        
    
        
        
            
                "thread_title": "Rahul and Dr Meera",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                "last_message_at": new Date('2026-05-19T14:30:00Z'),
            
        
    
        
        
            
                "is_archived": false,
            
        
    
    },
    
    {
    
        
        
            
                "thread_type": "direct",
            
        
    
        
        
            
                "thread_title": "Narayanpet Camp Coordination",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                "last_message_at": new Date('2026-05-20T09:05:00Z'),
            
        
    
        
        
            
                "is_archived": true,
            
        
    
    },
    
];



const MessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "message_type": "image",
            
        
    
        
        
            
                "message_text": "Camp schedule confirmed. Please ensure triage desk is ready by 9 AM local.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "sent_at": new Date('2026-05-20T09:05:00Z'),
            
        
    
        
        
            
                "is_read": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "message_type": "file",
            
        
    
        
        
            
                "message_text": "Triage team assigned and equipment list shared with staff.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "sent_at": new Date('2026-05-20T09:07:00Z'),
            
        
    
        
        
            
                "is_read": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "message_type": "system",
            
        
    
        
        
            
                "message_text": "I had mild wheeze last night. Used inhaler once. Feeling better now.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "sent_at": new Date('2026-05-19T14:30:00Z'),
            
        
    
        
        
            
                "is_read": true,
            
        
    
    },
    
];



const NotificationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notification_type": "camp",
            
        
    
        
        
            
                "title_text": "Low stock alert: Metformin",
            
        
    
        
        
            
                "body_text": "Metformin stock is near reorder level. Consider raising a dispatch request.",
            
        
    
        
        
            
                "priority": "low",
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                "sent_at": new Date('2026-05-16T10:06:00Z'),
            
        
    
        
        
            
                "action_url": "/inventory",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notification_type": "report",
            
        
    
        
        
            
                "title_text": "Dispatch delivered",
            
        
    
        
        
            
                "body_text": "SJ-DISP-2026-0517-001 marked delivered at PHC Mahabubnagar Rural.",
            
        
    
        
        
            
                "priority": "high",
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                "sent_at": new Date('2026-05-17T14:25:00Z'),
            
        
    
        
        
            
                "action_url": "/dispatches",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notification_type": "report",
            
        
    
        
        
            
                "title_text": "Upcoming camp appointment",
            
        
    
        
        
            
                "body_text": "Your camp visit is scheduled on May 25. Please arrive 15 minutes early.",
            
        
    
        
        
            
                "priority": "normal",
            
        
    
        
        
            
                "is_read": false,
            
        
    
        
        
            
                "sent_at": new Date('2026-05-20T07:30:00Z'),
            
        
    
        
        
            
                "action_url": "/appointments",
            
        
    
    },
    
];



const TrucksData = [
    
    {
    
        
        
            
                "truck_code": "SJ-TRK-01",
            
        
    
        
        
            
                "registration_number": "TS09AB2481",
            
        
    
        
        
            
                "driver_name": "Manoj Kumar",
            
        
    
        
        
            
                "driver_phone": "+919702223344",
            
        
    
        
        
            
                "status": "offline",
            
        
    
        
        
            
                "last_latitude": 17.1023,
            
        
    
        
        
            
                "last_longitude": 78.2511,
            
        
    
        
        
            
                "last_ping_at": new Date('2026-05-20T08:55:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "truck_code": "SJ-TRK-02",
            
        
    
        
        
            
                "registration_number": "TS10CD7812",
            
        
    
        
        
            
                "driver_name": "Srinath Raju",
            
        
    
        
        
            
                "driver_phone": "+919703334455",
            
        
    
        
        
            
                "status": "offline",
            
        
    
        
        
            
                "last_latitude": 17.385,
            
        
    
        
        
            
                "last_longitude": 78.4867,
            
        
    
        
        
            
                "last_ping_at": new Date('2026-05-20T08:30:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "truck_code": "SJ-TRK-03",
            
        
    
        
        
            
                "registration_number": "TS11EF9920",
            
        
    
        
        
            
                "driver_name": "Ajay Singh",
            
        
    
        
        
            
                "driver_phone": "+919704445566",
            
        
    
        
        
            
                "status": "offline",
            
        
    
        
        
            
                "last_latitude": 17.2154,
            
        
    
        
        
            
                "last_longitude": 78.4062,
            
        
    
        
        
            
                "last_ping_at": new Date('2026-05-20T08:40:00Z'),
            
        
    
    },
    
];



const TruckTrackingEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_at": new Date('2026-05-20T07:10:00Z'),
            
        
    
        
        
            
                "latitude": 17.2951,
            
        
    
        
        
            
                "longitude": 78.4122,
            
        
    
        
        
            
                "speed_kph": 52.4,
            
        
    
        
        
            
                "heading": "South",
            
        
    
        
        
            
                "event_note": "Departed central warehouse",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_at": new Date('2026-05-20T08:05:00Z'),
            
        
    
        
        
            
                "latitude": 17.1402,
            
        
    
        
        
            
                "longitude": 78.3299,
            
        
    
        
        
            
                "speed_kph": 48.1,
            
        
    
        
        
            
                "heading": "South",
            
        
    
        
        
            
                "event_note": "On route via highway checkpoint",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_at": new Date('2026-05-19T08:00:00Z'),
            
        
    
        
        
            
                "latitude": 17.2021,
            
        
    
        
        
            
                "longitude": 78.5144,
            
        
    
        
        
            
                "speed_kph": 45.2,
            
        
    
        
        
            
                "heading": "East",
            
        
    
        
        
            
                "event_note": "Route stable, ETA as planned",
            
        
    
    },
    
];



const VaccinationRemindersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vaccine_name": "Tetanus Booster",
            
        
    
        
        
            
                "dose_number": "dose_2",
            
        
    
        
        
            
                "due_at": new Date('2026-06-01T03:30:00Z'),
            
        
    
        
        
            
                "sent_at": new Date('2026-05-20T07:25:00Z'),
            
        
    
        
        
            
                "status": "sent",
            
        
    
        
        
            
                "notes": "Confirm at nearest PHC",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vaccine_name": "Influenza Vaccine",
            
        
    
        
        
            
                "dose_number": "other",
            
        
    
        
        
            
                "due_at": new Date('2026-06-05T03:30:00Z'),
            
        
    
        
        
            
                "sent_at": new Date('2026-05-20T07:25:00Z'),
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                "notes": "Recommended for asthma patients",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vaccine_name": "Pneumococcal Vaccine",
            
        
    
        
        
            
                "dose_number": "dose_1",
            
        
    
        
        
            
                "due_at": new Date('2026-06-12T03:30:00Z'),
            
        
    
        
        
            
                "sent_at": new Date('2026-05-20T07:25:00Z'),
            
        
    
        
        
            
                "status": "missed",
            
        
    
        
        
            
                "notes": "Discuss eligibility during camp visit",
            
        
    
    },
    
];



const MedicineRemindersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medicine_label": "Levothyroxine",
            
        
    
        
        
            
                "dosage": "50 mcg",
            
        
    
        
        
            
                "frequency": "thrice_daily",
            
        
    
        
        
            
                "start_at": new Date('2026-05-10T00:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-06-21T00:00:00Z'),
            
        
    
        
        
            
                "next_due_at": new Date('2026-05-21T02:30:00Z'),
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "instructions": "Take on empty stomach in morning",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medicine_label": "Salbutamol Inhaler",
            
        
    
        
        
            
                "dosage": "2 puffs",
            
        
    
        
        
            
                "frequency": "weekly",
            
        
    
        
        
            
                "start_at": new Date('2026-05-08T00:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-07-01T00:00:00Z'),
            
        
    
        
        
            
                "next_due_at": new Date('2026-05-21T00:00:00Z'),
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "instructions": "Use when wheeze occurs; seek care if frequent",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medicine_label": "Metformin",
            
        
    
        
        
            
                "dosage": "500 mg",
            
        
    
        
        
            
                "frequency": "thrice_daily",
            
        
    
        
        
            
                "start_at": new Date('2026-05-05T00:00:00Z'),
            
        
    
        
        
            
                "end_at": new Date('2026-06-30T00:00:00Z'),
            
        
    
        
        
            
                "next_due_at": new Date('2026-05-21T07:00:00Z'),
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "instructions": "Take after breakfast and dinner",
            
        
    
    },
    
];



const AiChatSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "dashboard",
            
        
    
        
        
            
                "started_at": new Date('2026-05-19T06:20:00Z'),
            
        
    
        
        
            
                "ended_at": new Date('2026-05-19T06:35:00Z'),
            
        
    
        
        
            
                "risk_level": "medium",
            
        
    
        
        
            
                "summary": "Guidance on fatigue and when to check thyroid labs",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "mobile_web",
            
        
    
        
        
            
                "started_at": new Date('2026-05-18T15:10:00Z'),
            
        
    
        
        
            
                "ended_at": new Date('2026-05-18T15:25:00Z'),
            
        
    
        
        
            
                "risk_level": "emergency",
            
        
    
        
        
            
                "summary": "Advice on wheezing triggers and when to seek urgent care",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "mobile_web",
            
        
    
        
        
            
                "started_at": new Date('2026-05-16T09:00:00Z'),
            
        
    
        
        
            
                "ended_at": new Date('2026-05-16T09:12:00Z'),
            
        
    
        
        
            
                "risk_level": "high",
            
        
    
        
        
            
                "summary": "Diet tips for diabetes and reminder to take medicines",
            
        
    
    },
    
];



const AiChatMessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "speaker": "user",
            
        
    
        
        
            
                "message_text": "I feel tired most days. What should I do?",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-19T06:20:30Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "speaker": "assistant",
            
        
    
        
        
            
                "message_text": "Track sleep, hydration, and medication timing. If symptoms persist, discuss TSH testing with your doctor.",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-19T06:21:10Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "speaker": "user",
            
        
    
        
        
            
                "message_text": "I had wheezing at night. Is it serious?",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-18T15:10:20Z'),
            
        
    
    },
    
];



const AuditLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "dispatch",
            
        
    
        
        
            
                "entity_name": "medicine_dispatches",
            
        
    
        
        
            
                "entity_reference": "SJ-DISP-2026-0517-001",
            
        
    
        
        
            
                "acted_at": new Date('2026-05-16T13:00:00Z'),
            
        
    
        
        
            
                "ip_address": "103.21.124.10",
            
        
    
        
        
            
                "user_agent": "Chrome 124 Windows",
            
        
    
        
        
            
                "details": "Approved dispatch request for Mahabubnagar PHC",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "update",
            
        
    
        
        
            
                "entity_name": "medicine_dispatches",
            
        
    
        
        
            
                "entity_reference": "SJ-DISP-2026-0520-005",
            
        
    
        
        
            
                "acted_at": new Date('2026-05-20T06:50:00Z'),
            
        
    
        
        
            
                "ip_address": "103.21.124.10",
            
        
    
        
        
            
                "user_agent": "Chrome 124 Windows",
            
        
    
        
        
            
                "details": "Marked dispatch as dispatched and assigned truck SJ-TRK-01",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "dispatch",
            
        
    
        
        
            
                "entity_name": "medical_reports",
            
        
    
        
        
            
                "entity_reference": "SJ-PAT-000486",
            
        
    
        
        
            
                "acted_at": new Date('2026-05-01T10:05:00Z'),
            
        
    
        
        
            
                "ip_address": "49.204.18.55",
            
        
    
        
        
            
                "user_agent": "Chrome 124 Mac",
            
        
    
        
        
            
                "details": "Finalized report and prepared PDF export",
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
    
    
        
            
            async function associateAdminWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Admin0 = await Admins.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Admin0?.setUser)
                {
                    await
                    Admin0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Admin1 = await Admins.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Admin1?.setUser)
                {
                    await
                    Admin1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Admin2 = await Admins.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Admin2?.setUser)
                {
                    await
                    Admin2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateCityDoctorWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CityDoctor0 = await CityDoctors.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CityDoctor0?.setUser)
                {
                    await
                    CityDoctor0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CityDoctor1 = await CityDoctors.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CityDoctor1?.setUser)
                {
                    await
                    CityDoctor1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CityDoctor2 = await CityDoctors.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CityDoctor2?.setUser)
                {
                    await
                    CityDoctor2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateRuralDoctorWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const RuralDoctor0 = await RuralDoctors.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RuralDoctor0?.setUser)
                {
                    await
                    RuralDoctor0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const RuralDoctor1 = await RuralDoctors.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RuralDoctor1?.setUser)
                {
                    await
                    RuralDoctor1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const RuralDoctor2 = await RuralDoctors.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RuralDoctor2?.setUser)
                {
                    await
                    RuralDoctor2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePatientWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient0 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Patient0?.setUser)
                {
                    await
                    Patient0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient1 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Patient1?.setUser)
                {
                    await
                    Patient1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient2 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Patient2?.setUser)
                {
                    await
                    Patient2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePatientWithRegistered_by_rural_doctor() {
            
                const relatedRegistered_by_rural_doctor0 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const Patient0 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Patient0?.setRegistered_by_rural_doctor)
                {
                    await
                    Patient0.
                    setRegistered_by_rural_doctor(relatedRegistered_by_rural_doctor0);
                }
            
                const relatedRegistered_by_rural_doctor1 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const Patient1 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Patient1?.setRegistered_by_rural_doctor)
                {
                    await
                    Patient1.
                    setRegistered_by_rural_doctor(relatedRegistered_by_rural_doctor1);
                }
            
                const relatedRegistered_by_rural_doctor2 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const Patient2 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Patient2?.setRegistered_by_rural_doctor)
                {
                    await
                    Patient2.
                    setRegistered_by_rural_doctor(relatedRegistered_by_rural_doctor2);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateMedicalReportWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicalReport0 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicalReport0?.setPatient)
                {
                    await
                    MedicalReport0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicalReport1 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicalReport1?.setPatient)
                {
                    await
                    MedicalReport1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicalReport2 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicalReport2?.setPatient)
                {
                    await
                    MedicalReport2.
                    setPatient(relatedPatient2);
                }
            
        }
        
    
        
            
            async function associateMedicalReportWithAuthor_city_doctor() {
            
                const relatedAuthor_city_doctor0 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicalReport0 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicalReport0?.setAuthor_city_doctor)
                {
                    await
                    MedicalReport0.
                    setAuthor_city_doctor(relatedAuthor_city_doctor0);
                }
            
                const relatedAuthor_city_doctor1 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicalReport1 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicalReport1?.setAuthor_city_doctor)
                {
                    await
                    MedicalReport1.
                    setAuthor_city_doctor(relatedAuthor_city_doctor1);
                }
            
                const relatedAuthor_city_doctor2 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicalReport2 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicalReport2?.setAuthor_city_doctor)
                {
                    await
                    MedicalReport2.
                    setAuthor_city_doctor(relatedAuthor_city_doctor2);
                }
            
        }
        
    
        
            
            async function associateMedicalReportWithAuthor_rural_doctor() {
            
                const relatedAuthor_rural_doctor0 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicalReport0 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicalReport0?.setAuthor_rural_doctor)
                {
                    await
                    MedicalReport0.
                    setAuthor_rural_doctor(relatedAuthor_rural_doctor0);
                }
            
                const relatedAuthor_rural_doctor1 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicalReport1 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicalReport1?.setAuthor_rural_doctor)
                {
                    await
                    MedicalReport1.
                    setAuthor_rural_doctor(relatedAuthor_rural_doctor1);
                }
            
                const relatedAuthor_rural_doctor2 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicalReport2 = await MedicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicalReport2?.setAuthor_rural_doctor)
                {
                    await
                    MedicalReport2.
                    setAuthor_rural_doctor(relatedAuthor_rural_doctor2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateInventoryUpdateWithRural_doctor() {
            
                const relatedRural_doctor0 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const InventoryUpdate0 = await InventoryUpdates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryUpdate0?.setRural_doctor)
                {
                    await
                    InventoryUpdate0.
                    setRural_doctor(relatedRural_doctor0);
                }
            
                const relatedRural_doctor1 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const InventoryUpdate1 = await InventoryUpdates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryUpdate1?.setRural_doctor)
                {
                    await
                    InventoryUpdate1.
                    setRural_doctor(relatedRural_doctor1);
                }
            
                const relatedRural_doctor2 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const InventoryUpdate2 = await InventoryUpdates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryUpdate2?.setRural_doctor)
                {
                    await
                    InventoryUpdate2.
                    setRural_doctor(relatedRural_doctor2);
                }
            
        }
        
    
        
            
            async function associateInventoryUpdateWithMedicine() {
            
                const relatedMedicine0 = await Medicines.findOne({
                    offset: Math.floor(Math.random() * (await Medicines.count())),
                });
                const InventoryUpdate0 = await InventoryUpdates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryUpdate0?.setMedicine)
                {
                    await
                    InventoryUpdate0.
                    setMedicine(relatedMedicine0);
                }
            
                const relatedMedicine1 = await Medicines.findOne({
                    offset: Math.floor(Math.random() * (await Medicines.count())),
                });
                const InventoryUpdate1 = await InventoryUpdates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryUpdate1?.setMedicine)
                {
                    await
                    InventoryUpdate1.
                    setMedicine(relatedMedicine1);
                }
            
                const relatedMedicine2 = await Medicines.findOne({
                    offset: Math.floor(Math.random() * (await Medicines.count())),
                });
                const InventoryUpdate2 = await InventoryUpdates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryUpdate2?.setMedicine)
                {
                    await
                    InventoryUpdate2.
                    setMedicine(relatedMedicine2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateMedicineDispatcheWithRequested_by_rural_doctor() {
            
                const relatedRequested_by_rural_doctor0 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicineDispatche0 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicineDispatche0?.setRequested_by_rural_doctor)
                {
                    await
                    MedicineDispatche0.
                    setRequested_by_rural_doctor(relatedRequested_by_rural_doctor0);
                }
            
                const relatedRequested_by_rural_doctor1 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicineDispatche1 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicineDispatche1?.setRequested_by_rural_doctor)
                {
                    await
                    MedicineDispatche1.
                    setRequested_by_rural_doctor(relatedRequested_by_rural_doctor1);
                }
            
                const relatedRequested_by_rural_doctor2 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicineDispatche2 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicineDispatche2?.setRequested_by_rural_doctor)
                {
                    await
                    MedicineDispatche2.
                    setRequested_by_rural_doctor(relatedRequested_by_rural_doctor2);
                }
            
        }
        
    
        
            
            async function associateMedicineDispatcheWithApproved_by_admin() {
            
                const relatedApproved_by_admin0 = await Admins.findOne({
                    offset: Math.floor(Math.random() * (await Admins.count())),
                });
                const MedicineDispatche0 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicineDispatche0?.setApproved_by_admin)
                {
                    await
                    MedicineDispatche0.
                    setApproved_by_admin(relatedApproved_by_admin0);
                }
            
                const relatedApproved_by_admin1 = await Admins.findOne({
                    offset: Math.floor(Math.random() * (await Admins.count())),
                });
                const MedicineDispatche1 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicineDispatche1?.setApproved_by_admin)
                {
                    await
                    MedicineDispatche1.
                    setApproved_by_admin(relatedApproved_by_admin1);
                }
            
                const relatedApproved_by_admin2 = await Admins.findOne({
                    offset: Math.floor(Math.random() * (await Admins.count())),
                });
                const MedicineDispatche2 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicineDispatche2?.setApproved_by_admin)
                {
                    await
                    MedicineDispatche2.
                    setApproved_by_admin(relatedApproved_by_admin2);
                }
            
        }
        
    
        
            
            async function associateMedicineDispatcheWithCoordinated_by_city_doctor() {
            
                const relatedCoordinated_by_city_doctor0 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicineDispatche0 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicineDispatche0?.setCoordinated_by_city_doctor)
                {
                    await
                    MedicineDispatche0.
                    setCoordinated_by_city_doctor(relatedCoordinated_by_city_doctor0);
                }
            
                const relatedCoordinated_by_city_doctor1 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicineDispatche1 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicineDispatche1?.setCoordinated_by_city_doctor)
                {
                    await
                    MedicineDispatche1.
                    setCoordinated_by_city_doctor(relatedCoordinated_by_city_doctor1);
                }
            
                const relatedCoordinated_by_city_doctor2 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicineDispatche2 = await MedicineDispatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicineDispatche2?.setCoordinated_by_city_doctor)
                {
                    await
                    MedicineDispatche2.
                    setCoordinated_by_city_doctor(relatedCoordinated_by_city_doctor2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateDispatchItemWithMedicine_dispatch() {
            
                const relatedMedicine_dispatch0 = await MedicineDispatches.findOne({
                    offset: Math.floor(Math.random() * (await MedicineDispatches.count())),
                });
                const DispatchItem0 = await DispatchItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DispatchItem0?.setMedicine_dispatch)
                {
                    await
                    DispatchItem0.
                    setMedicine_dispatch(relatedMedicine_dispatch0);
                }
            
                const relatedMedicine_dispatch1 = await MedicineDispatches.findOne({
                    offset: Math.floor(Math.random() * (await MedicineDispatches.count())),
                });
                const DispatchItem1 = await DispatchItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DispatchItem1?.setMedicine_dispatch)
                {
                    await
                    DispatchItem1.
                    setMedicine_dispatch(relatedMedicine_dispatch1);
                }
            
                const relatedMedicine_dispatch2 = await MedicineDispatches.findOne({
                    offset: Math.floor(Math.random() * (await MedicineDispatches.count())),
                });
                const DispatchItem2 = await DispatchItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DispatchItem2?.setMedicine_dispatch)
                {
                    await
                    DispatchItem2.
                    setMedicine_dispatch(relatedMedicine_dispatch2);
                }
            
        }
        
    
        
            
            async function associateDispatchItemWithMedicine() {
            
                const relatedMedicine0 = await Medicines.findOne({
                    offset: Math.floor(Math.random() * (await Medicines.count())),
                });
                const DispatchItem0 = await DispatchItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DispatchItem0?.setMedicine)
                {
                    await
                    DispatchItem0.
                    setMedicine(relatedMedicine0);
                }
            
                const relatedMedicine1 = await Medicines.findOne({
                    offset: Math.floor(Math.random() * (await Medicines.count())),
                });
                const DispatchItem1 = await DispatchItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DispatchItem1?.setMedicine)
                {
                    await
                    DispatchItem1.
                    setMedicine(relatedMedicine1);
                }
            
                const relatedMedicine2 = await Medicines.findOne({
                    offset: Math.floor(Math.random() * (await Medicines.count())),
                });
                const DispatchItem2 = await DispatchItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DispatchItem2?.setMedicine)
                {
                    await
                    DispatchItem2.
                    setMedicine(relatedMedicine2);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
    
        
            
            async function associateMedicalCampWithCreated_by_admin() {
            
                const relatedCreated_by_admin0 = await Admins.findOne({
                    offset: Math.floor(Math.random() * (await Admins.count())),
                });
                const MedicalCamp0 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicalCamp0?.setCreated_by_admin)
                {
                    await
                    MedicalCamp0.
                    setCreated_by_admin(relatedCreated_by_admin0);
                }
            
                const relatedCreated_by_admin1 = await Admins.findOne({
                    offset: Math.floor(Math.random() * (await Admins.count())),
                });
                const MedicalCamp1 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicalCamp1?.setCreated_by_admin)
                {
                    await
                    MedicalCamp1.
                    setCreated_by_admin(relatedCreated_by_admin1);
                }
            
                const relatedCreated_by_admin2 = await Admins.findOne({
                    offset: Math.floor(Math.random() * (await Admins.count())),
                });
                const MedicalCamp2 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicalCamp2?.setCreated_by_admin)
                {
                    await
                    MedicalCamp2.
                    setCreated_by_admin(relatedCreated_by_admin2);
                }
            
        }
        
    
        
            
            async function associateMedicalCampWithLead_city_doctor() {
            
                const relatedLead_city_doctor0 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicalCamp0 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicalCamp0?.setLead_city_doctor)
                {
                    await
                    MedicalCamp0.
                    setLead_city_doctor(relatedLead_city_doctor0);
                }
            
                const relatedLead_city_doctor1 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicalCamp1 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicalCamp1?.setLead_city_doctor)
                {
                    await
                    MedicalCamp1.
                    setLead_city_doctor(relatedLead_city_doctor1);
                }
            
                const relatedLead_city_doctor2 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const MedicalCamp2 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicalCamp2?.setLead_city_doctor)
                {
                    await
                    MedicalCamp2.
                    setLead_city_doctor(relatedLead_city_doctor2);
                }
            
        }
        
    
        
            
            async function associateMedicalCampWithLead_rural_doctor() {
            
                const relatedLead_rural_doctor0 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicalCamp0 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicalCamp0?.setLead_rural_doctor)
                {
                    await
                    MedicalCamp0.
                    setLead_rural_doctor(relatedLead_rural_doctor0);
                }
            
                const relatedLead_rural_doctor1 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicalCamp1 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicalCamp1?.setLead_rural_doctor)
                {
                    await
                    MedicalCamp1.
                    setLead_rural_doctor(relatedLead_rural_doctor1);
                }
            
                const relatedLead_rural_doctor2 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const MedicalCamp2 = await MedicalCamps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicalCamp2?.setLead_rural_doctor)
                {
                    await
                    MedicalCamp2.
                    setLead_rural_doctor(relatedLead_rural_doctor2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAppointmentWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Appointment0 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Appointment0?.setPatient)
                {
                    await
                    Appointment0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Appointment1 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Appointment1?.setPatient)
                {
                    await
                    Appointment1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Appointment2 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Appointment2?.setPatient)
                {
                    await
                    Appointment2.
                    setPatient(relatedPatient2);
                }
            
        }
        
    
        
            
            async function associateAppointmentWithCity_doctor() {
            
                const relatedCity_doctor0 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const Appointment0 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Appointment0?.setCity_doctor)
                {
                    await
                    Appointment0.
                    setCity_doctor(relatedCity_doctor0);
                }
            
                const relatedCity_doctor1 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const Appointment1 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Appointment1?.setCity_doctor)
                {
                    await
                    Appointment1.
                    setCity_doctor(relatedCity_doctor1);
                }
            
                const relatedCity_doctor2 = await CityDoctors.findOne({
                    offset: Math.floor(Math.random() * (await CityDoctors.count())),
                });
                const Appointment2 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Appointment2?.setCity_doctor)
                {
                    await
                    Appointment2.
                    setCity_doctor(relatedCity_doctor2);
                }
            
        }
        
    
        
            
            async function associateAppointmentWithRural_doctor() {
            
                const relatedRural_doctor0 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const Appointment0 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Appointment0?.setRural_doctor)
                {
                    await
                    Appointment0.
                    setRural_doctor(relatedRural_doctor0);
                }
            
                const relatedRural_doctor1 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const Appointment1 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Appointment1?.setRural_doctor)
                {
                    await
                    Appointment1.
                    setRural_doctor(relatedRural_doctor1);
                }
            
                const relatedRural_doctor2 = await RuralDoctors.findOne({
                    offset: Math.floor(Math.random() * (await RuralDoctors.count())),
                });
                const Appointment2 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Appointment2?.setRural_doctor)
                {
                    await
                    Appointment2.
                    setRural_doctor(relatedRural_doctor2);
                }
            
        }
        
    
        
            
            async function associateAppointmentWithMedical_camp() {
            
                const relatedMedical_camp0 = await MedicalCamps.findOne({
                    offset: Math.floor(Math.random() * (await MedicalCamps.count())),
                });
                const Appointment0 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Appointment0?.setMedical_camp)
                {
                    await
                    Appointment0.
                    setMedical_camp(relatedMedical_camp0);
                }
            
                const relatedMedical_camp1 = await MedicalCamps.findOne({
                    offset: Math.floor(Math.random() * (await MedicalCamps.count())),
                });
                const Appointment1 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Appointment1?.setMedical_camp)
                {
                    await
                    Appointment1.
                    setMedical_camp(relatedMedical_camp1);
                }
            
                const relatedMedical_camp2 = await MedicalCamps.findOne({
                    offset: Math.floor(Math.random() * (await MedicalCamps.count())),
                });
                const Appointment2 = await Appointments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Appointment2?.setMedical_camp)
                {
                    await
                    Appointment2.
                    setMedical_camp(relatedMedical_camp2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
    
        
    

    
    
    
        
            
            async function associateMessageWithChat_thread() {
            
                const relatedChat_thread0 = await ChatThreads.findOne({
                    offset: Math.floor(Math.random() * (await ChatThreads.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setChat_thread)
                {
                    await
                    Message0.
                    setChat_thread(relatedChat_thread0);
                }
            
                const relatedChat_thread1 = await ChatThreads.findOne({
                    offset: Math.floor(Math.random() * (await ChatThreads.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setChat_thread)
                {
                    await
                    Message1.
                    setChat_thread(relatedChat_thread1);
                }
            
                const relatedChat_thread2 = await ChatThreads.findOne({
                    offset: Math.floor(Math.random() * (await ChatThreads.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setChat_thread)
                {
                    await
                    Message2.
                    setChat_thread(relatedChat_thread2);
                }
            
        }
        
    
        
            
            async function associateMessageWithSender_user() {
            
                const relatedSender_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setSender_user)
                {
                    await
                    Message0.
                    setSender_user(relatedSender_user0);
                }
            
                const relatedSender_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setSender_user)
                {
                    await
                    Message1.
                    setSender_user(relatedSender_user1);
                }
            
                const relatedSender_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setSender_user)
                {
                    await
                    Message2.
                    setSender_user(relatedSender_user2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateNotificationWithRecipient_user() {
            
                const relatedRecipient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setRecipient_user)
                {
                    await
                    Notification0.
                    setRecipient_user(relatedRecipient_user0);
                }
            
                const relatedRecipient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setRecipient_user)
                {
                    await
                    Notification1.
                    setRecipient_user(relatedRecipient_user1);
                }
            
                const relatedRecipient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setRecipient_user)
                {
                    await
                    Notification2.
                    setRecipient_user(relatedRecipient_user2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateTruckTrackingEventWithTruck() {
            
                const relatedTruck0 = await Trucks.findOne({
                    offset: Math.floor(Math.random() * (await Trucks.count())),
                });
                const TruckTrackingEvent0 = await TruckTrackingEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TruckTrackingEvent0?.setTruck)
                {
                    await
                    TruckTrackingEvent0.
                    setTruck(relatedTruck0);
                }
            
                const relatedTruck1 = await Trucks.findOne({
                    offset: Math.floor(Math.random() * (await Trucks.count())),
                });
                const TruckTrackingEvent1 = await TruckTrackingEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TruckTrackingEvent1?.setTruck)
                {
                    await
                    TruckTrackingEvent1.
                    setTruck(relatedTruck1);
                }
            
                const relatedTruck2 = await Trucks.findOne({
                    offset: Math.floor(Math.random() * (await Trucks.count())),
                });
                const TruckTrackingEvent2 = await TruckTrackingEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TruckTrackingEvent2?.setTruck)
                {
                    await
                    TruckTrackingEvent2.
                    setTruck(relatedTruck2);
                }
            
        }
        
    
        
            
            async function associateTruckTrackingEventWithMedicine_dispatch() {
            
                const relatedMedicine_dispatch0 = await MedicineDispatches.findOne({
                    offset: Math.floor(Math.random() * (await MedicineDispatches.count())),
                });
                const TruckTrackingEvent0 = await TruckTrackingEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TruckTrackingEvent0?.setMedicine_dispatch)
                {
                    await
                    TruckTrackingEvent0.
                    setMedicine_dispatch(relatedMedicine_dispatch0);
                }
            
                const relatedMedicine_dispatch1 = await MedicineDispatches.findOne({
                    offset: Math.floor(Math.random() * (await MedicineDispatches.count())),
                });
                const TruckTrackingEvent1 = await TruckTrackingEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TruckTrackingEvent1?.setMedicine_dispatch)
                {
                    await
                    TruckTrackingEvent1.
                    setMedicine_dispatch(relatedMedicine_dispatch1);
                }
            
                const relatedMedicine_dispatch2 = await MedicineDispatches.findOne({
                    offset: Math.floor(Math.random() * (await MedicineDispatches.count())),
                });
                const TruckTrackingEvent2 = await TruckTrackingEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TruckTrackingEvent2?.setMedicine_dispatch)
                {
                    await
                    TruckTrackingEvent2.
                    setMedicine_dispatch(relatedMedicine_dispatch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateVaccinationReminderWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VaccinationReminder0 = await VaccinationReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VaccinationReminder0?.setPatient)
                {
                    await
                    VaccinationReminder0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VaccinationReminder1 = await VaccinationReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VaccinationReminder1?.setPatient)
                {
                    await
                    VaccinationReminder1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VaccinationReminder2 = await VaccinationReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VaccinationReminder2?.setPatient)
                {
                    await
                    VaccinationReminder2.
                    setPatient(relatedPatient2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateMedicineReminderWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicineReminder0 = await MedicineReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicineReminder0?.setPatient)
                {
                    await
                    MedicineReminder0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicineReminder1 = await MedicineReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicineReminder1?.setPatient)
                {
                    await
                    MedicineReminder1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicineReminder2 = await MedicineReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicineReminder2?.setPatient)
                {
                    await
                    MedicineReminder2.
                    setPatient(relatedPatient2);
                }
            
        }
        
    
        
            
            async function associateMedicineReminderWithMedical_report() {
            
                const relatedMedical_report0 = await MedicalReports.findOne({
                    offset: Math.floor(Math.random() * (await MedicalReports.count())),
                });
                const MedicineReminder0 = await MedicineReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicineReminder0?.setMedical_report)
                {
                    await
                    MedicineReminder0.
                    setMedical_report(relatedMedical_report0);
                }
            
                const relatedMedical_report1 = await MedicalReports.findOne({
                    offset: Math.floor(Math.random() * (await MedicalReports.count())),
                });
                const MedicineReminder1 = await MedicineReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicineReminder1?.setMedical_report)
                {
                    await
                    MedicineReminder1.
                    setMedical_report(relatedMedical_report1);
                }
            
                const relatedMedical_report2 = await MedicalReports.findOne({
                    offset: Math.floor(Math.random() * (await MedicalReports.count())),
                });
                const MedicineReminder2 = await MedicineReminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicineReminder2?.setMedical_report)
                {
                    await
                    MedicineReminder2.
                    setMedical_report(relatedMedical_report2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAiChatSessionWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const AiChatSession0 = await AiChatSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiChatSession0?.setPatient)
                {
                    await
                    AiChatSession0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const AiChatSession1 = await AiChatSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiChatSession1?.setPatient)
                {
                    await
                    AiChatSession1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const AiChatSession2 = await AiChatSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiChatSession2?.setPatient)
                {
                    await
                    AiChatSession2.
                    setPatient(relatedPatient2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAiChatMessageWithAi_chat_session() {
            
                const relatedAi_chat_session0 = await AiChatSessions.findOne({
                    offset: Math.floor(Math.random() * (await AiChatSessions.count())),
                });
                const AiChatMessage0 = await AiChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiChatMessage0?.setAi_chat_session)
                {
                    await
                    AiChatMessage0.
                    setAi_chat_session(relatedAi_chat_session0);
                }
            
                const relatedAi_chat_session1 = await AiChatSessions.findOne({
                    offset: Math.floor(Math.random() * (await AiChatSessions.count())),
                });
                const AiChatMessage1 = await AiChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiChatMessage1?.setAi_chat_session)
                {
                    await
                    AiChatMessage1.
                    setAi_chat_session(relatedAi_chat_session1);
                }
            
                const relatedAi_chat_session2 = await AiChatSessions.findOne({
                    offset: Math.floor(Math.random() * (await AiChatSessions.count())),
                });
                const AiChatMessage2 = await AiChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiChatMessage2?.setAi_chat_session)
                {
                    await
                    AiChatMessage2.
                    setAi_chat_session(relatedAi_chat_session2);
                }
            
        }
        
    
        
    
        
    
        
    

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


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Admins.bulkCreate(AdminsData);
                
            
            
                
                await CityDoctors.bulkCreate(CityDoctorsData);
                
            
            
                
                await RuralDoctors.bulkCreate(RuralDoctorsData);
                
            
            
                
                await Patients.bulkCreate(PatientsData);
                
            
            
                
                await MedicalReports.bulkCreate(MedicalReportsData);
                
            
            
                
                await Medicines.bulkCreate(MedicinesData);
                
            
            
                
                await InventoryUpdates.bulkCreate(InventoryUpdatesData);
                
            
            
                
                await MedicineDispatches.bulkCreate(MedicineDispatchesData);
                
            
            
                
                await DispatchItems.bulkCreate(DispatchItemsData);
                
            
            
                
                await MedicalCamps.bulkCreate(MedicalCampsData);
                
            
            
                
                await Appointments.bulkCreate(AppointmentsData);
                
            
            
                
                await ChatThreads.bulkCreate(ChatThreadsData);
                
            
            
                
                await Messages.bulkCreate(MessagesData);
                
            
            
                
                await Notifications.bulkCreate(NotificationsData);
                
            
            
                
                await Trucks.bulkCreate(TrucksData);
                
            
            
                
                await TruckTrackingEvents.bulkCreate(TruckTrackingEventsData);
                
            
            
                
                await VaccinationReminders.bulkCreate(VaccinationRemindersData);
                
            
            
                
                await MedicineReminders.bulkCreate(MedicineRemindersData);
                
            
            
                
                await AiChatSessions.bulkCreate(AiChatSessionsData);
                
            
            
                
                await AiChatMessages.bulkCreate(AiChatMessagesData);
                
            
            
                
                await AuditLogs.bulkCreate(AuditLogsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                
                
                    
                        
                        await associateAdminWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateCityDoctorWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateRuralDoctorWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePatientWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePatientWithRegistered_by_rural_doctor(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMedicalReportWithPatient(),
                    
                
                    
                        
                        await associateMedicalReportWithAuthor_city_doctor(),
                    
                
                    
                        
                        await associateMedicalReportWithAuthor_rural_doctor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateInventoryUpdateWithRural_doctor(),
                    
                
                    
                        
                        await associateInventoryUpdateWithMedicine(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMedicineDispatcheWithRequested_by_rural_doctor(),
                    
                
                    
                        
                        await associateMedicineDispatcheWithApproved_by_admin(),
                    
                
                    
                        
                        await associateMedicineDispatcheWithCoordinated_by_city_doctor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateDispatchItemWithMedicine_dispatch(),
                    
                
                    
                        
                        await associateDispatchItemWithMedicine(),
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                        
                        await associateMedicalCampWithCreated_by_admin(),
                    
                
                    
                        
                        await associateMedicalCampWithLead_city_doctor(),
                    
                
                    
                        
                        await associateMedicalCampWithLead_rural_doctor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAppointmentWithPatient(),
                    
                
                    
                        
                        await associateAppointmentWithCity_doctor(),
                    
                
                    
                        
                        await associateAppointmentWithRural_doctor(),
                    
                
                    
                        
                        await associateAppointmentWithMedical_camp(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMessageWithChat_thread(),
                    
                
                    
                        
                        await associateMessageWithSender_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateNotificationWithRecipient_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateTruckTrackingEventWithTruck(),
                    
                
                    
                        
                        await associateTruckTrackingEventWithMedicine_dispatch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateVaccinationReminderWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMedicineReminderWithPatient(),
                    
                
                    
                        
                        await associateMedicineReminderWithMedical_report(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAiChatSessionWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAiChatMessageWithAi_chat_session(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAuditLogWithActor_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('admins', null, {});
            
            
            await queryInterface.bulkDelete('city_doctors', null, {});
            
            
            await queryInterface.bulkDelete('rural_doctors', null, {});
            
            
            await queryInterface.bulkDelete('patients', null, {});
            
            
            await queryInterface.bulkDelete('medical_reports', null, {});
            
            
            await queryInterface.bulkDelete('medicines', null, {});
            
            
            await queryInterface.bulkDelete('inventory_updates', null, {});
            
            
            await queryInterface.bulkDelete('medicine_dispatches', null, {});
            
            
            await queryInterface.bulkDelete('dispatch_items', null, {});
            
            
            await queryInterface.bulkDelete('medical_camps', null, {});
            
            
            await queryInterface.bulkDelete('appointments', null, {});
            
            
            await queryInterface.bulkDelete('chat_threads', null, {});
            
            
            await queryInterface.bulkDelete('messages', null, {});
            
            
            await queryInterface.bulkDelete('notifications', null, {});
            
            
            await queryInterface.bulkDelete('trucks', null, {});
            
            
            await queryInterface.bulkDelete('truck_tracking_events', null, {});
            
            
            await queryInterface.bulkDelete('vaccination_reminders', null, {});
            
            
            await queryInterface.bulkDelete('medicine_reminders', null, {});
            
            
            await queryInterface.bulkDelete('ai_chat_sessions', null, {});
            
            
            await queryInterface.bulkDelete('ai_chat_messages', null, {});
            
            
            await queryInterface.bulkDelete('audit_logs', null, {});
            
        
    },
};