





















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






const Organizations = db.organizations;

const Workspaces = db.workspaces;

const WorkspaceMemberships = db.workspace_memberships;

const DataConnections = db.data_connections;

const FinancialAccounts = db.financial_accounts;

const Vendors = db.vendors;

const Customers = db.customers;

const Transactions = db.transactions;

const Budgets = db.budgets;

const BudgetLines = db.budget_lines;

const Forecasts = db.forecasts;

const ForecastScenarios = db.forecast_scenarios;

const MetricsSnapshots = db.metrics_snapshots;

const Anomalies = db.anomalies;

const Alerts = db.alerts;

const Recommendations = db.recommendations;

const ChatThreads = db.chat_threads;

const ChatMessages = db.chat_messages;

const MessageCitations = db.message_citations;

const FilesLibrary = db.files_library;

const SyncJobs = db.sync_jobs;







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



const WorkspacesData = [
    
    {
    
        
        
            
                "name": "Northpeak Labs",
            
        
    
        
        
            
                "legal_name": "Northpeak Labs Inc",
            
        
    
        
        
            
                "website": "https://northpeak.io",
            
        
    
        
        
            
                "industry": "SaaS",
            
        
    
        
        
            
                "country": "United States",
            
        
    
        
        
            
                "base_currency": "USD",
            
        
    
        
        
            
                "onboarded_at": new Date('2026-02-10T16:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Harborfield Studio",
            
        
    
        
        
            
                "legal_name": "Harborfield Studio LLC",
            
        
    
        
        
            
                "website": "https://harborfield.studio",
            
        
    
        
        
            
                "industry": "Creative Services",
            
        
    
        
        
            
                "country": "United States",
            
        
    
        
        
            
                "base_currency": "USD",
            
        
    
        
        
            
                "onboarded_at": new Date('2026-02-12T11:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Cedarline Logistics",
            
        
    
        
        
            
                "legal_name": "Cedarline Logistics GmbH",
            
        
    
        
        
            
                "website": "https://cedarline-logistics.com",
            
        
    
        
        
            
                "industry": "Logistics",
            
        
    
        
        
            
                "country": "Germany",
            
        
    
        
        
            
                "base_currency": "EUR",
            
        
    
        
        
            
                "onboarded_at": new Date('2026-02-14T09:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Sunstone Retail",
            
        
    
        
        
            
                "legal_name": "Sunstone Retail Ltd",
            
        
    
        
        
            
                "website": "https://sunstone-retail.co.uk",
            
        
    
        
        
            
                "industry": "Ecommerce",
            
        
    
        
        
            
                "country": "United Kingdom",
            
        
    
        
        
            
                "base_currency": "GBP",
            
        
    
        
        
            
                "onboarded_at": new Date('2026-02-15T13:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WorkspaceMembershipsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "owner",
            
        
    
        
        
            
                "invite_status": "revoked",
            
        
    
        
        
            
                "invited_at": new Date('2026-02-10T15:00:00Z'),
            
        
    
        
        
            
                "accepted_at": new Date('2026-02-10T15:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "viewer",
            
        
    
        
        
            
                "invite_status": "invited",
            
        
    
        
        
            
                "invited_at": new Date('2026-02-11T12:00:00Z'),
            
        
    
        
        
            
                "accepted_at": new Date('2026-02-11T12:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "member",
            
        
    
        
        
            
                "invite_status": "revoked",
            
        
    
        
        
            
                "invited_at": new Date('2026-02-12T09:10:00Z'),
            
        
    
        
        
            
                "accepted_at": new Date('2026-02-12T09:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "viewer",
            
        
    
        
        
            
                "invite_status": "invited",
            
        
    
        
        
            
                "invited_at": new Date('2026-02-13T14:00:00Z'),
            
        
    
        
        
            
                "accepted_at": new Date('2026-02-13T14:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DataConnectionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider_type": "csv_upload",
            
        
    
        
        
            
                "provider_name": "Plaid Bank Feed",
            
        
    
        
        
            
                "connection_status": "connected",
            
        
    
        
        
            
                "connected_at": new Date('2026-02-10T16:10:00Z'),
            
        
    
        
        
            
                "last_sync_at": new Date('2026-02-26T08:55:00Z'),
            
        
    
        
        
            
                "external_reference": "plaid_conn_np_001",
            
        
    
        
        
            
                "error_message": "No errors",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider_type": "accounting",
            
        
    
        
        
            
                "provider_name": "QuickBooks Online",
            
        
    
        
        
            
                "connection_status": "disabled",
            
        
    
        
        
            
                "connected_at": new Date('2026-02-10T16:20:00Z'),
            
        
    
        
        
            
                "last_sync_at": new Date('2026-02-26T08:40:00Z'),
            
        
    
        
        
            
                "external_reference": "qbo_np_001",
            
        
    
        
        
            
                "error_message": "No errors",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider_type": "accounting",
            
        
    
        
        
            
                "provider_name": "Monthly Expenses CSV",
            
        
    
        
        
            
                "connection_status": "connected",
            
        
    
        
        
            
                "connected_at": new Date('2026-02-15T10:00:00Z'),
            
        
    
        
        
            
                "last_sync_at": new Date('2026-02-25T10:00:00Z'),
            
        
    
        
        
            
                "external_reference": "csv_np_2026_02",
            
        
    
        
        
            
                "error_message": "No errors",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider_type": "accounting",
            
        
    
        
        
            
                "provider_name": "Bank Feed",
            
        
    
        
        
            
                "connection_status": "connected",
            
        
    
        
        
            
                "connected_at": new Date('2026-02-12T11:40:00Z'),
            
        
    
        
        
            
                "last_sync_at": new Date('2026-02-20T08:30:00Z'),
            
        
    
        
        
            
                "external_reference": "bank_hs_001",
            
        
    
        
        
            
                "error_message": "Authentication expired",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const FinancialAccountsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "account_type": "asset",
            
        
    
        
        
            
                "account_name": "Operating Checking",
            
        
    
        
        
            
                "account_number_masked": "XXXX1234",
            
        
    
        
        
            
                "institution_name": "Silverbird Bank",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "current_balance": 184250.75,
            
        
    
        
        
            
                "balance_as_of": new Date('2026-02-26T08:50:00Z'),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "account_type": "revenue",
            
        
    
        
        
            
                "account_name": "Corporate Card",
            
        
    
        
        
            
                "account_number_masked": "XXXX9876",
            
        
    
        
        
            
                "institution_name": "Silverbird Bank",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "current_balance": -12430.2,
            
        
    
        
        
            
                "balance_as_of": new Date('2026-02-26T08:50:00Z'),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "account_type": "cash",
            
        
    
        
        
            
                "account_name": "Subscription Revenue",
            
        
    
        
        
            
                "account_number_masked": "REV100",
            
        
    
        
        
            
                "institution_name": "QuickBooks",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "current_balance": 0,
            
        
    
        
        
            
                "balance_as_of": new Date('2026-02-26T00:00:00Z'),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "account_type": "cash",
            
        
    
        
        
            
                "account_name": "Main Checking",
            
        
    
        
        
            
                "account_number_masked": "XXXX4455",
            
        
    
        
        
            
                "institution_name": "Harbor Bank",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "current_balance": 42110.1,
            
        
    
        
        
            
                "balance_as_of": new Date('2026-02-20T08:25:00Z'),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const VendorsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Nimbus Cloud Hosting",
            
        
    
        
        
            
                "tax_id": "US-88-1029384",
            
        
    
        
        
            
                "website": "https://nimbuscloud.example",
            
        
    
        
        
            
                "notes": "Primary cloud provider for production workloads",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "BrightHire Recruiting",
            
        
    
        
        
            
                "tax_id": "US-11-4938201",
            
        
    
        
        
            
                "website": "https://brighthire.example",
            
        
    
        
        
            
                "notes": "Recruiting agency for engineering roles",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Orbit Travel",
            
        
    
        
        
            
                "tax_id": "US-55-0192837",
            
        
    
        
        
            
                "website": "https://orbittravel.example",
            
        
    
        
        
            
                "notes": "Corporate travel booking partner",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Canvas Supplies Co",
            
        
    
        
        
            
                "tax_id": "US-22-1203948",
            
        
    
        
        
            
                "website": "https://canvassupplies.example",
            
        
    
        
        
            
                "notes": "Art materials and printing supplies",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CustomersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "customer_name": "Mapleworks Inc",
            
        
    
        
        
            
                "website": "https://mapleworks.example",
            
        
    
        
        
            
                "notes": "Annual contract for analytics module",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "customer_name": "Stonebridge Partners",
            
        
    
        
        
            
                "website": "https://stonebridge.example",
            
        
    
        
        
            
                "notes": "Monthly subscription with 25 seats",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "customer_name": "Kiteview Health",
            
        
    
        
        
            
                "website": "https://kiteviewhealth.example",
            
        
    
        
        
            
                "notes": "Pilot program converting to annual",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "customer_name": "Blue Harbor Cafe",
            
        
    
        
        
            
                "website": "https://blueharborcafe.example",
            
        
    
        
        
            
                "notes": "Brand refresh project retainer",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TransactionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "posted_at": new Date('2026-02-24T00:00:00Z'),
            
        
    
        
        
            
                "effective_at": new Date('2026-02-24T00:00:00Z'),
            
        
    
        
        
            
                "amount": 18500,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "description": "Invoice payment Mapleworks Inc Jan subscription",
            
        
    
        
        
            
                "merchant_name": "Mapleworks Inc",
            
        
    
        
        
            
                "direction": "outflow",
            
        
    
        
        
            
                "category": "software",
            
        
    
        
        
            
                "classification_status": "unreviewed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "external_reference": "txn_np_0001",
            
        
    
        
        
            
                "is_recurring_candidate": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "posted_at": new Date('2026-02-22T00:00:00Z'),
            
        
    
        
        
            
                "effective_at": new Date('2026-02-22T00:00:00Z'),
            
        
    
        
        
            
                "amount": -4820.55,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "description": "Cloud hosting monthly bill",
            
        
    
        
        
            
                "merchant_name": "Nimbus Cloud Hosting",
            
        
    
        
        
            
                "direction": "outflow",
            
        
    
        
        
            
                "category": "other_expense",
            
        
    
        
        
            
                "classification_status": "auto_classified",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "external_reference": "txn_np_0002",
            
        
    
        
        
            
                "is_recurring_candidate": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "posted_at": new Date('2026-02-21T00:00:00Z'),
            
        
    
        
        
            
                "effective_at": new Date('2026-02-21T00:00:00Z'),
            
        
    
        
        
            
                "amount": -7350,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "description": "Recruiting retainer February",
            
        
    
        
        
            
                "merchant_name": "BrightHire Recruiting",
            
        
    
        
        
            
                "direction": "outflow",
            
        
    
        
        
            
                "category": "interest",
            
        
    
        
        
            
                "classification_status": "needs_attention",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "external_reference": "txn_np_0003",
            
        
    
        
        
            
                "is_recurring_candidate": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "posted_at": new Date('2026-02-19T00:00:00Z'),
            
        
    
        
        
            
                "effective_at": new Date('2026-02-19T00:00:00Z'),
            
        
    
        
        
            
                "amount": -1120.3,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "description": "Materials purchase for client deliverables",
            
        
    
        
        
            
                "merchant_name": "Canvas Supplies Co",
            
        
    
        
        
            
                "direction": "inflow",
            
        
    
        
        
            
                "category": "revenue",
            
        
    
        
        
            
                "classification_status": "unreviewed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "external_reference": "txn_hs_0001",
            
        
    
        
        
            
                "is_recurring_candidate": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BudgetsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "budget_name": "Northpeak Q1 Operating Budget",
            
        
    
        
        
            
                "period_start": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-03-31T00:00:00Z'),
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "total_amount": 420000,
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "notes": "Focus on controlled burn and predictable runway",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "budget_name": "Harborfield 2026 H1 Budget",
            
        
    
        
        
            
                "period_start": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-06-30T00:00:00Z'),
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "total_amount": 180000,
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "notes": "Seasonal revenue variability expected",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "budget_name": "Cedarline Fleet Maintenance Budget",
            
        
    
        
        
            
                "period_start": new Date('2026-02-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-04-30T00:00:00Z'),
            
        
    
        
        
            
                "currency": "EUR",
            
        
    
        
        
            
                "total_amount": 95000,
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "notes": "Includes planned depot and tire replacements",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "budget_name": "Sunstone Spring Marketing Budget",
            
        
    
        
        
            
                "period_start": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-05-31T00:00:00Z'),
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "total_amount": 60000,
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "notes": "To be finalized after inventory purchase orders",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BudgetLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "travel",
            
        
    
        
        
            
                "planned_amount": 42000,
            
        
    
        
        
            
                "actual_amount": 38500,
            
        
    
        
        
            
                "notes": "Cloud and SaaS tools",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "payroll",
            
        
    
        
        
            
                "planned_amount": 270000,
            
        
    
        
        
            
                "actual_amount": 276000,
            
        
    
        
        
            
                "notes": "Engineering and go to market team",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "tax",
            
        
    
        
        
            
                "planned_amount": 18000,
            
        
    
        
        
            
                "actual_amount": 9200,
            
        
    
        
        
            
                "notes": "Local partnerships and paid search",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "category": "interest",
            
        
    
        
        
            
                "planned_amount": 65000,
            
        
    
        
        
            
                "actual_amount": 31200,
            
        
    
        
        
            
                "notes": "Vehicle parts and depot work",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ForecastsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "forecast_name": "Northpeak 13 Week Cash Forecast",
            
        
    
        
        
            
                "horizon": "13_weeks",
            
        
    
        
        
            
                "start_date": new Date('2026-02-24T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-05-26T00:00:00Z'),
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "starting_cash": 184250.75,
            
        
    
        
        
            
                "projected_ending_cash": 102400.0,
            
        
    
        
        
            
                "runway_months": 8.4,
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "forecast_name": "Harborfield 8 Week Cash Forecast",
            
        
    
        
        
            
                "horizon": "4_weeks",
            
        
    
        
        
            
                "start_date": new Date('2026-02-17T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-04-14T00:00:00Z'),
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "starting_cash": 42110.1,
            
        
    
        
        
            
                "projected_ending_cash": 28500.0,
            
        
    
        
        
            
                "runway_months": 4.1,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "forecast_name": "Cedarline 6 Month Forecast",
            
        
    
        
        
            
                "horizon": "6_months",
            
        
    
        
        
            
                "start_date": new Date('2026-02-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-08-01T00:00:00Z'),
            
        
    
        
        
            
                "currency": "EUR",
            
        
    
        
        
            
                "starting_cash": 61000.0,
            
        
    
        
        
            
                "projected_ending_cash": 24000.0,
            
        
    
        
        
            
                "runway_months": 5.6,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "forecast_name": "Sunstone 12 Month Forecast",
            
        
    
        
        
            
                "horizon": "8_weeks",
            
        
    
        
        
            
                "start_date": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "end_date": new Date('2026-12-31T00:00:00Z'),
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "starting_cash": 98000.0,
            
        
    
        
        
            
                "projected_ending_cash": 55000.0,
            
        
    
        
        
            
                "runway_months": 10.2,
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ForecastScenariosData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scenario_name": "Base Case",
            
        
    
        
        
            
                "scenario_type": "optimistic",
            
        
    
        
        
            
                "revenue_multiplier": 1.0,
            
        
    
        
        
            
                "expense_multiplier": 1.0,
            
        
    
        
        
            
                "cash_buffer_target": 50000,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "assumptions": "Stable churn and steady pipeline conversion",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scenario_name": "Conservative Case",
            
        
    
        
        
            
                "scenario_type": "optimistic",
            
        
    
        
        
            
                "revenue_multiplier": 0.85,
            
        
    
        
        
            
                "expense_multiplier": 1.05,
            
        
    
        
        
            
                "cash_buffer_target": 75000,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "assumptions": "Slower collections and higher cloud usage",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scenario_name": "Optimistic Case",
            
        
    
        
        
            
                "scenario_type": "base",
            
        
    
        
        
            
                "revenue_multiplier": 1.2,
            
        
    
        
        
            
                "expense_multiplier": 1.0,
            
        
    
        
        
            
                "cash_buffer_target": 20000,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "assumptions": "Two large projects close in March",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scenario_name": "Fuel Shock Scenario",
            
        
    
        
        
            
                "scenario_type": "base",
            
        
    
        
        
            
                "revenue_multiplier": 1.0,
            
        
    
        
        
            
                "expense_multiplier": 1.15,
            
        
    
        
        
            
                "cash_buffer_target": 30000,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "assumptions": "Fuel and maintenance costs rise for 8 weeks",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MetricsSnapshotsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "as_of_at": new Date('2026-02-26T00:00:00Z'),
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "cash_balance": 184250.75,
            
        
    
        
        
            
                "net_burn_monthly": -22000.0,
            
        
    
        
        
            
                "gross_margin_percent": 78.5,
            
        
    
        
        
            
                "mrr": 62000.0,
            
        
    
        
        
            
                "arr": 744000.0,
            
        
    
        
        
            
                "accounts_receivable": 38500.0,
            
        
    
        
        
            
                "accounts_payable": 14600.0,
            
        
    
        
        
            
                "runway_months": 8.4,
            
        
    
        
        
            
                "quality_grade": "poor",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "as_of_at": new Date('2026-01-31T00:00:00Z'),
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "cash_balance": 199800.1,
            
        
    
        
        
            
                "net_burn_monthly": -20500.0,
            
        
    
        
        
            
                "gross_margin_percent": 79.2,
            
        
    
        
        
            
                "mrr": 60000.0,
            
        
    
        
        
            
                "arr": 720000.0,
            
        
    
        
        
            
                "accounts_receivable": 41200.0,
            
        
    
        
        
            
                "accounts_payable": 13200.0,
            
        
    
        
        
            
                "runway_months": 9.1,
            
        
    
        
        
            
                "quality_grade": "good",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "as_of_at": new Date('2026-02-20T00:00:00Z'),
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "cash_balance": 42110.1,
            
        
    
        
        
            
                "net_burn_monthly": -6800.0,
            
        
    
        
        
            
                "gross_margin_percent": 54.0,
            
        
    
        
        
            
                "mrr": 0,
            
        
    
        
        
            
                "arr": 0,
            
        
    
        
        
            
                "accounts_receivable": 9800.0,
            
        
    
        
        
            
                "accounts_payable": 3200.0,
            
        
    
        
        
            
                "runway_months": 4.1,
            
        
    
        
        
            
                "quality_grade": "good",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "as_of_at": new Date('2026-02-26T00:00:00Z'),
            
        
    
        
        
            
                "currency": "EUR",
            
        
    
        
        
            
                "cash_balance": 61000.0,
            
        
    
        
        
            
                "net_burn_monthly": -10800.0,
            
        
    
        
        
            
                "gross_margin_percent": 32.5,
            
        
    
        
        
            
                "mrr": 0,
            
        
    
        
        
            
                "arr": 0,
            
        
    
        
        
            
                "accounts_receivable": 24500.0,
            
        
    
        
        
            
                "accounts_payable": 18100.0,
            
        
    
        
        
            
                "runway_months": 5.6,
            
        
    
        
        
            
                "quality_grade": "excellent",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AnomaliesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "anomaly_type": "amount_spike",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "anomaly_score": 0.91,
            
        
    
        
        
            
                "summary": "Cloud bill higher than usual",
            
        
    
        
        
            
                "explanation": "Nimbus Cloud Hosting charge is 38 percent above trailing 3 month average and coincides with increased compute usage.",
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                "detected_at": new Date('2026-02-22T01:15:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-28T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "anomaly_type": "amount_spike",
            
        
    
        
        
            
                "severity": "low",
            
        
    
        
        
            
                "anomaly_score": 0.63,
            
        
    
        
        
            
                "summary": "New payroll related vendor detected",
            
        
    
        
        
            
                "explanation": "BrightHire Recruiting appeared for the first time in the last 90 days and is categorized as payroll.",
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                "detected_at": new Date('2026-02-21T02:05:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-28T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "anomaly_type": "new_vendor",
            
        
    
        
        
            
                "severity": "medium",
            
        
    
        
        
            
                "anomaly_score": 0.58,
            
        
    
        
        
            
                "summary": "COGS classification needs review",
            
        
    
        
        
            
                "explanation": "Canvas Supplies Co spending pattern resembles recurring materials but was marked needs attention for category confirmation.",
            
        
    
        
        
            
                "status": "acknowledged",
            
        
    
        
        
            
                "detected_at": new Date('2026-02-19T03:10:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-28T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "anomaly_type": "currency_mismatch",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "anomaly_score": 0.41,
            
        
    
        
        
            
                "summary": "Loan payment timing slightly early",
            
        
    
        
        
            
                "explanation": "Payment posted 3 days earlier than typical schedule; confirm autopay date change.",
            
        
    
        
        
            
                "status": "acknowledged",
            
        
    
        
        
            
                "detected_at": new Date('2026-02-18T04:30:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-18T06:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AlertsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "budget_overrun",
            
        
    
        
        
            
                "severity": "warning",
            
        
    
        
        
            
                "title_text": "Unexpected cloud spend increase",
            
        
    
        
        
            
                "message": "Cloud hosting outflow is elevated versus baseline. Review recent deploys and consider budget caps.",
            
        
    
        
        
            
                "triggered_at": new Date('2026-02-22T01:20:00Z'),
            
        
    
        
        
            
                "acknowledged_at": new Date('2026-02-22T09:00:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-25T09:05:00Z'),
            
        
    
        
        
            
                "status": "acknowledged",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "budget_overrun",
            
        
    
        
        
            
                "severity": "warning",
            
        
    
        
        
            
                "title_text": "Runway decreased below 9 months",
            
        
    
        
        
            
                "message": "Projected runway decreased due to higher expenses. Consider deferring nonessential spend or improving collections.",
            
        
    
        
        
            
                "triggered_at": new Date('2026-02-23T00:30:00Z'),
            
        
    
        
        
            
                "acknowledged_at": new Date('2026-02-23T10:15:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-28T00:00:00Z'),
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "collections_risk",
            
        
    
        
        
            
                "severity": "info",
            
        
    
        
        
            
                "title_text": "Bank feed needs reauthentication",
            
        
    
        
        
            
                "message": "Bank connection failed with authentication expired. Reconnect to resume automatic updates.",
            
        
    
        
        
            
                "triggered_at": new Date('2026-02-20T08:35:00Z'),
            
        
    
        
        
            
                "acknowledged_at": new Date('2026-02-20T09:10:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-28T00:00:00Z'),
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "expense_spike",
            
        
    
        
        
            
                "severity": "info",
            
        
    
        
        
            
                "title_text": "Receivables trending higher",
            
        
    
        
        
            
                "message": "Accounts receivable increased compared to last period. Monitor overdue invoices and follow up with top customers.",
            
        
    
        
        
            
                "triggered_at": new Date('2026-02-26T06:30:00Z'),
            
        
    
        
        
            
                "acknowledged_at": new Date('2026-02-26T08:00:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-02-28T00:00:00Z'),
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RecommendationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommendation_type": "pricing",
            
        
    
        
        
            
                "priority": "medium",
            
        
    
        
        
            
                "title_text": "Set a 60 day cash buffer",
            
        
    
        
        
            
                "rationale": "Runway sensitivity is high to cloud usage and payroll timing; buffer reduces operational risk.",
            
        
    
        
        
            
                "action_steps": "Define minimum cash threshold and enable alerts at 75 percent of threshold; pause discretionary spend if breached.",
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                "created_on": new Date('2026-02-22T12:00:00Z'),
            
        
    
        
        
            
                "due_on": new Date('2026-03-05T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommendation_type": "fundraising",
            
        
    
        
        
            
                "priority": "high",
            
        
    
        
        
            
                "title_text": "Cap nonproduction cloud usage",
            
        
    
        
        
            
                "rationale": "Recent cloud bill spike suggests development environments are overprovisioned.",
            
        
    
        
        
            
                "action_steps": "Audit idle resources; enforce schedules; set budget limits and notifications.",
            
        
    
        
        
            
                "status": "proposed",
            
        
    
        
        
            
                "created_on": new Date('2026-02-23T09:00:00Z'),
            
        
    
        
        
            
                "due_on": new Date('2026-03-10T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommendation_type": "pricing",
            
        
    
        
        
            
                "priority": "low",
            
        
    
        
        
            
                "title_text": "Collect deposits upfront on new projects",
            
        
    
        
        
            
                "rationale": "Cash balance is sensitive to project start dates and vendor purchases.",
            
        
    
        
        
            
                "action_steps": "Update contract template; request 40 percent deposit; automate invoice reminders.",
            
        
    
        
        
            
                "status": "proposed",
            
        
    
        
        
            
                "created_on": new Date('2026-02-20T10:30:00Z'),
            
        
    
        
        
            
                "due_on": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommendation_type": "fundraising",
            
        
    
        
        
            
                "priority": "low",
            
        
    
        
        
            
                "title_text": "Standardize invoice follow ups weekly",
            
        
    
        
        
            
                "rationale": "Higher receivables can be reduced by consistent outreach cadence.",
            
        
    
        
        
            
                "action_steps": "Create weekly aging report; assign owners; track response outcomes.",
            
        
    
        
        
            
                "status": "proposed",
            
        
    
        
        
            
                "created_on": new Date('2026-02-18T08:00:00Z'),
            
        
    
        
        
            
                "due_on": new Date('2026-02-25T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ChatThreadsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "thread_title": "Weekly CFO check in",
            
        
    
        
        
            
                "thread_type": "data_question",
            
        
    
        
        
            
                "last_message_at": new Date('2026-02-26T10:45:00Z'),
            
        
    
        
        
            
                "is_pinned": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "thread_title": "Runway and burn analysis",
            
        
    
        
        
            
                "thread_type": "analysis",
            
        
    
        
        
            
                "last_message_at": new Date('2026-02-23T10:20:00Z'),
            
        
    
        
        
            
                "is_pinned": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "thread_title": "Bank feed reconnection help",
            
        
    
        
        
            
                "thread_type": "advice",
            
        
    
        
        
            
                "last_message_at": new Date('2026-02-20T09:15:00Z'),
            
        
    
        
        
            
                "is_pinned": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "thread_title": "Receivables follow up plan",
            
        
    
        
        
            
                "thread_type": "analysis",
            
        
    
        
        
            
                "last_message_at": new Date('2026-02-26T08:10:00Z'),
            
        
    
        
        
            
                "is_pinned": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ChatMessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "author_type": "assistant",
            
        
    
        
        
            
                "content": "What should I watch this week for cash and runway",
            
        
    
        
        
            
                "sent_at": new Date('2026-02-26T10:40:00Z'),
            
        
    
        
        
            
                "message_kind": "note",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "author_type": "user",
            
        
    
        
        
            
                "content": "Watch the cloud spend variance and collections timing. If cloud spend stays elevated consider caps. Also follow up on top two receivables to stabilize runway.",
            
        
    
        
        
            
                "sent_at": new Date('2026-02-26T10:45:00Z'),
            
        
    
        
        
            
                "message_kind": "tool_result",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "author_type": "system",
            
        
    
        
        
            
                "content": "Explain why runway dropped and what levers we have",
            
        
    
        
        
            
                "sent_at": new Date('2026-02-23T10:10:00Z'),
            
        
    
        
        
            
                "message_kind": "note",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "author_type": "assistant",
            
        
    
        
        
            
                "content": "How do I fix the bank feed authentication expired error",
            
        
    
        
        
            
                "sent_at": new Date('2026-02-20T09:10:00Z'),
            
        
    
        
        
            
                "message_kind": "note",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MessageCitationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "budget",
            
        
    
        
        
            
                "source_label": "Northpeak metrics 2026-02-26",
            
        
    
        
        
            
                "source_reference": "metrics_np_2026_02_26",
            
        
    
        
        
            
                "amount": 184250.75,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "occurred_at": new Date('2026-02-26T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "anomaly",
            
        
    
        
        
            
                "source_label": "Cloud bill higher than usual",
            
        
    
        
        
            
                "source_reference": "anomaly_np_cloud_001",
            
        
    
        
        
            
                "amount": -4820.55,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "occurred_at": new Date('2026-02-22T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "transaction",
            
        
    
        
        
            
                "source_label": "Runway decreased below 9 months",
            
        
    
        
        
            
                "source_reference": "alert_np_runway_001",
            
        
    
        
        
            
                "amount": 0,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "occurred_at": new Date('2026-02-23T00:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "budget",
            
        
    
        
        
            
                "source_label": "Northpeak 13 Week Cash Forecast",
            
        
    
        
        
            
                "source_reference": "forecast_np_13w_001",
            
        
    
        
        
            
                "amount": 102400.0,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "occurred_at": new Date('2026-05-26T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const FilesLibraryData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_type": "bank_statement",
            
        
    
        
        
            
                "file_name": "northpeak_expenses_feb_2026.csv",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-15T10:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Uploaded from finance shared drive",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_type": "receipt",
            
        
    
        
        
            
                "file_name": "mapleworks_invoice_2026_01.pdf",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-20T12:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Customer invoice for January subscription",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_type": "invoice",
            
        
    
        
        
            
                "file_name": "harborfield_statement_jan_2026.pdf",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-12T12:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Used for reconciliation",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_type": "invoice",
            
        
    
        
        
            
                "file_name": "fleet_parts_receipt_2026_02_18.pdf",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-18T17:25:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Parts receipt for maintenance job",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SyncJobsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "job_type": "incremental_sync",
            
        
    
        
        
            
                "status": "canceled",
            
        
    
        
        
            
                "started_at": new Date('2026-02-26T08:45:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-02-26T08:55:00Z'),
            
        
    
        
        
            
                "records_processed": 312,
            
        
    
        
        
            
                "error_message": "No errors",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "job_type": "recompute_metrics",
            
        
    
        
        
            
                "status": "running",
            
        
    
        
        
            
                "started_at": new Date('2026-02-26T08:30:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-02-26T08:40:00Z'),
            
        
    
        
        
            
                "records_processed": 128,
            
        
    
        
        
            
                "error_message": "No errors",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "job_type": "initial_import",
            
        
    
        
        
            
                "status": "canceled",
            
        
    
        
        
            
                "started_at": new Date('2026-02-20T08:25:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-02-20T08:30:00Z'),
            
        
    
        
        
            
                "records_processed": 0,
            
        
    
        
        
            
                "error_message": "Authentication expired",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "job_type": "incremental_sync",
            
        
    
        
        
            
                "status": "running",
            
        
    
        
        
            
                "started_at": new Date('2026-02-15T09:55:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-02-15T10:00:00Z'),
            
        
    
        
        
            
                "records_processed": 94,
            
        
    
        
        
            
                "error_message": "No errors",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




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

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateWorkspaceWithOwner() {
            
                const relatedOwner0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Workspace0 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Workspace0?.setOwner)
                {
                    await
                    Workspace0.
                    setOwner(relatedOwner0);
                }
            
                const relatedOwner1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Workspace1 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Workspace1?.setOwner)
                {
                    await
                    Workspace1.
                    setOwner(relatedOwner1);
                }
            
                const relatedOwner2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Workspace2 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Workspace2?.setOwner)
                {
                    await
                    Workspace2.
                    setOwner(relatedOwner2);
                }
            
                const relatedOwner3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Workspace3 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Workspace3?.setOwner)
                {
                    await
                    Workspace3.
                    setOwner(relatedOwner3);
                }
            
        }
        
    
        
            
            async function associateWorkspaceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace0 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Workspace0?.setOrganization)
                {
                    await
                    Workspace0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace1 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Workspace1?.setOrganization)
                {
                    await
                    Workspace1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace2 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Workspace2?.setOrganization)
                {
                    await
                    Workspace2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace3 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Workspace3?.setOrganization)
                {
                    await
                    Workspace3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateWorkspaceMembershipWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WorkspaceMembership0 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkspaceMembership0?.setWorkspace)
                {
                    await
                    WorkspaceMembership0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WorkspaceMembership1 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkspaceMembership1?.setWorkspace)
                {
                    await
                    WorkspaceMembership1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WorkspaceMembership2 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkspaceMembership2?.setWorkspace)
                {
                    await
                    WorkspaceMembership2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WorkspaceMembership3 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WorkspaceMembership3?.setWorkspace)
                {
                    await
                    WorkspaceMembership3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
            
            async function associateWorkspaceMembershipWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkspaceMembership0 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkspaceMembership0?.setUser)
                {
                    await
                    WorkspaceMembership0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkspaceMembership1 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkspaceMembership1?.setUser)
                {
                    await
                    WorkspaceMembership1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkspaceMembership2 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkspaceMembership2?.setUser)
                {
                    await
                    WorkspaceMembership2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkspaceMembership3 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WorkspaceMembership3?.setUser)
                {
                    await
                    WorkspaceMembership3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateWorkspaceMembershipWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkspaceMembership0 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkspaceMembership0?.setOrganization)
                {
                    await
                    WorkspaceMembership0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkspaceMembership1 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkspaceMembership1?.setOrganization)
                {
                    await
                    WorkspaceMembership1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkspaceMembership2 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkspaceMembership2?.setOrganization)
                {
                    await
                    WorkspaceMembership2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkspaceMembership3 = await WorkspaceMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WorkspaceMembership3?.setOrganization)
                {
                    await
                    WorkspaceMembership3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDataConnectionWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const DataConnection0 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DataConnection0?.setWorkspace)
                {
                    await
                    DataConnection0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const DataConnection1 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DataConnection1?.setWorkspace)
                {
                    await
                    DataConnection1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const DataConnection2 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DataConnection2?.setWorkspace)
                {
                    await
                    DataConnection2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const DataConnection3 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DataConnection3?.setWorkspace)
                {
                    await
                    DataConnection3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDataConnectionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DataConnection0 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DataConnection0?.setOrganization)
                {
                    await
                    DataConnection0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DataConnection1 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DataConnection1?.setOrganization)
                {
                    await
                    DataConnection1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DataConnection2 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DataConnection2?.setOrganization)
                {
                    await
                    DataConnection2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DataConnection3 = await DataConnections.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DataConnection3?.setOrganization)
                {
                    await
                    DataConnection3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateFinancialAccountWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FinancialAccount0 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FinancialAccount0?.setWorkspace)
                {
                    await
                    FinancialAccount0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FinancialAccount1 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FinancialAccount1?.setWorkspace)
                {
                    await
                    FinancialAccount1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FinancialAccount2 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FinancialAccount2?.setWorkspace)
                {
                    await
                    FinancialAccount2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FinancialAccount3 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FinancialAccount3?.setWorkspace)
                {
                    await
                    FinancialAccount3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
            
            async function associateFinancialAccountWithData_connection() {
            
                const relatedData_connection0 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const FinancialAccount0 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FinancialAccount0?.setData_connection)
                {
                    await
                    FinancialAccount0.
                    setData_connection(relatedData_connection0);
                }
            
                const relatedData_connection1 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const FinancialAccount1 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FinancialAccount1?.setData_connection)
                {
                    await
                    FinancialAccount1.
                    setData_connection(relatedData_connection1);
                }
            
                const relatedData_connection2 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const FinancialAccount2 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FinancialAccount2?.setData_connection)
                {
                    await
                    FinancialAccount2.
                    setData_connection(relatedData_connection2);
                }
            
                const relatedData_connection3 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const FinancialAccount3 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FinancialAccount3?.setData_connection)
                {
                    await
                    FinancialAccount3.
                    setData_connection(relatedData_connection3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateFinancialAccountWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FinancialAccount0 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FinancialAccount0?.setOrganization)
                {
                    await
                    FinancialAccount0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FinancialAccount1 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FinancialAccount1?.setOrganization)
                {
                    await
                    FinancialAccount1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FinancialAccount2 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FinancialAccount2?.setOrganization)
                {
                    await
                    FinancialAccount2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FinancialAccount3 = await FinancialAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FinancialAccount3?.setOrganization)
                {
                    await
                    FinancialAccount3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateVendorWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Vendor0 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vendor0?.setWorkspace)
                {
                    await
                    Vendor0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Vendor1 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vendor1?.setWorkspace)
                {
                    await
                    Vendor1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Vendor2 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vendor2?.setWorkspace)
                {
                    await
                    Vendor2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Vendor3 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Vendor3?.setWorkspace)
                {
                    await
                    Vendor3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateVendorWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor0 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vendor0?.setOrganization)
                {
                    await
                    Vendor0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor1 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vendor1?.setOrganization)
                {
                    await
                    Vendor1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor2 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vendor2?.setOrganization)
                {
                    await
                    Vendor2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor3 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Vendor3?.setOrganization)
                {
                    await
                    Vendor3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCustomerWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Customer0 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Customer0?.setWorkspace)
                {
                    await
                    Customer0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Customer1 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Customer1?.setWorkspace)
                {
                    await
                    Customer1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Customer2 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Customer2?.setWorkspace)
                {
                    await
                    Customer2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Customer3 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Customer3?.setWorkspace)
                {
                    await
                    Customer3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateCustomerWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Customer0 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Customer0?.setOrganization)
                {
                    await
                    Customer0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Customer1 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Customer1?.setOrganization)
                {
                    await
                    Customer1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Customer2 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Customer2?.setOrganization)
                {
                    await
                    Customer2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Customer3 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Customer3?.setOrganization)
                {
                    await
                    Customer3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTransactionWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Transaction0 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Transaction0?.setWorkspace)
                {
                    await
                    Transaction0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Transaction1 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Transaction1?.setWorkspace)
                {
                    await
                    Transaction1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Transaction2 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Transaction2?.setWorkspace)
                {
                    await
                    Transaction2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Transaction3 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Transaction3?.setWorkspace)
                {
                    await
                    Transaction3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
            
            async function associateTransactionWithFinancial_account() {
            
                const relatedFinancial_account0 = await FinancialAccounts.findOne({
                    offset: Math.floor(Math.random() * (await FinancialAccounts.count())),
                });
                const Transaction0 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Transaction0?.setFinancial_account)
                {
                    await
                    Transaction0.
                    setFinancial_account(relatedFinancial_account0);
                }
            
                const relatedFinancial_account1 = await FinancialAccounts.findOne({
                    offset: Math.floor(Math.random() * (await FinancialAccounts.count())),
                });
                const Transaction1 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Transaction1?.setFinancial_account)
                {
                    await
                    Transaction1.
                    setFinancial_account(relatedFinancial_account1);
                }
            
                const relatedFinancial_account2 = await FinancialAccounts.findOne({
                    offset: Math.floor(Math.random() * (await FinancialAccounts.count())),
                });
                const Transaction2 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Transaction2?.setFinancial_account)
                {
                    await
                    Transaction2.
                    setFinancial_account(relatedFinancial_account2);
                }
            
                const relatedFinancial_account3 = await FinancialAccounts.findOne({
                    offset: Math.floor(Math.random() * (await FinancialAccounts.count())),
                });
                const Transaction3 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Transaction3?.setFinancial_account)
                {
                    await
                    Transaction3.
                    setFinancial_account(relatedFinancial_account3);
                }
            
        }
        
    
        
            
            async function associateTransactionWithData_connection() {
            
                const relatedData_connection0 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const Transaction0 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Transaction0?.setData_connection)
                {
                    await
                    Transaction0.
                    setData_connection(relatedData_connection0);
                }
            
                const relatedData_connection1 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const Transaction1 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Transaction1?.setData_connection)
                {
                    await
                    Transaction1.
                    setData_connection(relatedData_connection1);
                }
            
                const relatedData_connection2 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const Transaction2 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Transaction2?.setData_connection)
                {
                    await
                    Transaction2.
                    setData_connection(relatedData_connection2);
                }
            
                const relatedData_connection3 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const Transaction3 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Transaction3?.setData_connection)
                {
                    await
                    Transaction3.
                    setData_connection(relatedData_connection3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateTransactionWithVendor() {
            
                const relatedVendor0 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Transaction0 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Transaction0?.setVendor)
                {
                    await
                    Transaction0.
                    setVendor(relatedVendor0);
                }
            
                const relatedVendor1 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Transaction1 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Transaction1?.setVendor)
                {
                    await
                    Transaction1.
                    setVendor(relatedVendor1);
                }
            
                const relatedVendor2 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Transaction2 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Transaction2?.setVendor)
                {
                    await
                    Transaction2.
                    setVendor(relatedVendor2);
                }
            
                const relatedVendor3 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Transaction3 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Transaction3?.setVendor)
                {
                    await
                    Transaction3.
                    setVendor(relatedVendor3);
                }
            
        }
        
    
        
            
            async function associateTransactionWithCustomer() {
            
                const relatedCustomer0 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const Transaction0 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Transaction0?.setCustomer)
                {
                    await
                    Transaction0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const Transaction1 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Transaction1?.setCustomer)
                {
                    await
                    Transaction1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const Transaction2 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Transaction2?.setCustomer)
                {
                    await
                    Transaction2.
                    setCustomer(relatedCustomer2);
                }
            
                const relatedCustomer3 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const Transaction3 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Transaction3?.setCustomer)
                {
                    await
                    Transaction3.
                    setCustomer(relatedCustomer3);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateTransactionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Transaction0 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Transaction0?.setOrganization)
                {
                    await
                    Transaction0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Transaction1 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Transaction1?.setOrganization)
                {
                    await
                    Transaction1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Transaction2 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Transaction2?.setOrganization)
                {
                    await
                    Transaction2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Transaction3 = await Transactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Transaction3?.setOrganization)
                {
                    await
                    Transaction3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBudgetWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Budget0 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Budget0?.setWorkspace)
                {
                    await
                    Budget0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Budget1 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Budget1?.setWorkspace)
                {
                    await
                    Budget1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Budget2 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Budget2?.setWorkspace)
                {
                    await
                    Budget2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Budget3 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Budget3?.setWorkspace)
                {
                    await
                    Budget3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBudgetWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Budget0 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Budget0?.setOrganization)
                {
                    await
                    Budget0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Budget1 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Budget1?.setOrganization)
                {
                    await
                    Budget1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Budget2 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Budget2?.setOrganization)
                {
                    await
                    Budget2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Budget3 = await Budgets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Budget3?.setOrganization)
                {
                    await
                    Budget3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBudgetLineWithBudget() {
            
                const relatedBudget0 = await Budgets.findOne({
                    offset: Math.floor(Math.random() * (await Budgets.count())),
                });
                const BudgetLine0 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BudgetLine0?.setBudget)
                {
                    await
                    BudgetLine0.
                    setBudget(relatedBudget0);
                }
            
                const relatedBudget1 = await Budgets.findOne({
                    offset: Math.floor(Math.random() * (await Budgets.count())),
                });
                const BudgetLine1 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BudgetLine1?.setBudget)
                {
                    await
                    BudgetLine1.
                    setBudget(relatedBudget1);
                }
            
                const relatedBudget2 = await Budgets.findOne({
                    offset: Math.floor(Math.random() * (await Budgets.count())),
                });
                const BudgetLine2 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BudgetLine2?.setBudget)
                {
                    await
                    BudgetLine2.
                    setBudget(relatedBudget2);
                }
            
                const relatedBudget3 = await Budgets.findOne({
                    offset: Math.floor(Math.random() * (await Budgets.count())),
                });
                const BudgetLine3 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BudgetLine3?.setBudget)
                {
                    await
                    BudgetLine3.
                    setBudget(relatedBudget3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBudgetLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BudgetLine0 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BudgetLine0?.setOrganization)
                {
                    await
                    BudgetLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BudgetLine1 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BudgetLine1?.setOrganization)
                {
                    await
                    BudgetLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BudgetLine2 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BudgetLine2?.setOrganization)
                {
                    await
                    BudgetLine2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BudgetLine3 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BudgetLine3?.setOrganization)
                {
                    await
                    BudgetLine3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateForecastWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Forecast0 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Forecast0?.setWorkspace)
                {
                    await
                    Forecast0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Forecast1 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Forecast1?.setWorkspace)
                {
                    await
                    Forecast1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Forecast2 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Forecast2?.setWorkspace)
                {
                    await
                    Forecast2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Forecast3 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Forecast3?.setWorkspace)
                {
                    await
                    Forecast3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateForecastWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Forecast0 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Forecast0?.setOrganization)
                {
                    await
                    Forecast0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Forecast1 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Forecast1?.setOrganization)
                {
                    await
                    Forecast1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Forecast2 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Forecast2?.setOrganization)
                {
                    await
                    Forecast2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Forecast3 = await Forecasts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Forecast3?.setOrganization)
                {
                    await
                    Forecast3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateForecastScenarioWithForecast() {
            
                const relatedForecast0 = await Forecasts.findOne({
                    offset: Math.floor(Math.random() * (await Forecasts.count())),
                });
                const ForecastScenario0 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ForecastScenario0?.setForecast)
                {
                    await
                    ForecastScenario0.
                    setForecast(relatedForecast0);
                }
            
                const relatedForecast1 = await Forecasts.findOne({
                    offset: Math.floor(Math.random() * (await Forecasts.count())),
                });
                const ForecastScenario1 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ForecastScenario1?.setForecast)
                {
                    await
                    ForecastScenario1.
                    setForecast(relatedForecast1);
                }
            
                const relatedForecast2 = await Forecasts.findOne({
                    offset: Math.floor(Math.random() * (await Forecasts.count())),
                });
                const ForecastScenario2 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ForecastScenario2?.setForecast)
                {
                    await
                    ForecastScenario2.
                    setForecast(relatedForecast2);
                }
            
                const relatedForecast3 = await Forecasts.findOne({
                    offset: Math.floor(Math.random() * (await Forecasts.count())),
                });
                const ForecastScenario3 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ForecastScenario3?.setForecast)
                {
                    await
                    ForecastScenario3.
                    setForecast(relatedForecast3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateForecastScenarioWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ForecastScenario0 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ForecastScenario0?.setOrganization)
                {
                    await
                    ForecastScenario0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ForecastScenario1 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ForecastScenario1?.setOrganization)
                {
                    await
                    ForecastScenario1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ForecastScenario2 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ForecastScenario2?.setOrganization)
                {
                    await
                    ForecastScenario2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ForecastScenario3 = await ForecastScenarios.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ForecastScenario3?.setOrganization)
                {
                    await
                    ForecastScenario3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMetricsSnapshotWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const MetricsSnapshot0 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MetricsSnapshot0?.setWorkspace)
                {
                    await
                    MetricsSnapshot0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const MetricsSnapshot1 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MetricsSnapshot1?.setWorkspace)
                {
                    await
                    MetricsSnapshot1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const MetricsSnapshot2 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MetricsSnapshot2?.setWorkspace)
                {
                    await
                    MetricsSnapshot2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const MetricsSnapshot3 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MetricsSnapshot3?.setWorkspace)
                {
                    await
                    MetricsSnapshot3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMetricsSnapshotWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MetricsSnapshot0 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MetricsSnapshot0?.setOrganization)
                {
                    await
                    MetricsSnapshot0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MetricsSnapshot1 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MetricsSnapshot1?.setOrganization)
                {
                    await
                    MetricsSnapshot1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MetricsSnapshot2 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MetricsSnapshot2?.setOrganization)
                {
                    await
                    MetricsSnapshot2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MetricsSnapshot3 = await MetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MetricsSnapshot3?.setOrganization)
                {
                    await
                    MetricsSnapshot3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAnomalyWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Anomaly0 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Anomaly0?.setWorkspace)
                {
                    await
                    Anomaly0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Anomaly1 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Anomaly1?.setWorkspace)
                {
                    await
                    Anomaly1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Anomaly2 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Anomaly2?.setWorkspace)
                {
                    await
                    Anomaly2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Anomaly3 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Anomaly3?.setWorkspace)
                {
                    await
                    Anomaly3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
            
            async function associateAnomalyWithTransaction() {
            
                const relatedTransaction0 = await Transactions.findOne({
                    offset: Math.floor(Math.random() * (await Transactions.count())),
                });
                const Anomaly0 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Anomaly0?.setTransaction)
                {
                    await
                    Anomaly0.
                    setTransaction(relatedTransaction0);
                }
            
                const relatedTransaction1 = await Transactions.findOne({
                    offset: Math.floor(Math.random() * (await Transactions.count())),
                });
                const Anomaly1 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Anomaly1?.setTransaction)
                {
                    await
                    Anomaly1.
                    setTransaction(relatedTransaction1);
                }
            
                const relatedTransaction2 = await Transactions.findOne({
                    offset: Math.floor(Math.random() * (await Transactions.count())),
                });
                const Anomaly2 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Anomaly2?.setTransaction)
                {
                    await
                    Anomaly2.
                    setTransaction(relatedTransaction2);
                }
            
                const relatedTransaction3 = await Transactions.findOne({
                    offset: Math.floor(Math.random() * (await Transactions.count())),
                });
                const Anomaly3 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Anomaly3?.setTransaction)
                {
                    await
                    Anomaly3.
                    setTransaction(relatedTransaction3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAnomalyWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Anomaly0 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Anomaly0?.setOrganization)
                {
                    await
                    Anomaly0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Anomaly1 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Anomaly1?.setOrganization)
                {
                    await
                    Anomaly1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Anomaly2 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Anomaly2?.setOrganization)
                {
                    await
                    Anomaly2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Anomaly3 = await Anomalies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Anomaly3?.setOrganization)
                {
                    await
                    Anomaly3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAlertWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setWorkspace)
                {
                    await
                    Alert0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setWorkspace)
                {
                    await
                    Alert1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setWorkspace)
                {
                    await
                    Alert2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setWorkspace)
                {
                    await
                    Alert3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAlertWithRelated_anomaly() {
            
                const relatedRelated_anomaly0 = await Anomalies.findOne({
                    offset: Math.floor(Math.random() * (await Anomalies.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setRelated_anomaly)
                {
                    await
                    Alert0.
                    setRelated_anomaly(relatedRelated_anomaly0);
                }
            
                const relatedRelated_anomaly1 = await Anomalies.findOne({
                    offset: Math.floor(Math.random() * (await Anomalies.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setRelated_anomaly)
                {
                    await
                    Alert1.
                    setRelated_anomaly(relatedRelated_anomaly1);
                }
            
                const relatedRelated_anomaly2 = await Anomalies.findOne({
                    offset: Math.floor(Math.random() * (await Anomalies.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setRelated_anomaly)
                {
                    await
                    Alert2.
                    setRelated_anomaly(relatedRelated_anomaly2);
                }
            
                const relatedRelated_anomaly3 = await Anomalies.findOne({
                    offset: Math.floor(Math.random() * (await Anomalies.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setRelated_anomaly)
                {
                    await
                    Alert3.
                    setRelated_anomaly(relatedRelated_anomaly3);
                }
            
        }
        
    
        
            
            async function associateAlertWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setOrganization)
                {
                    await
                    Alert0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setOrganization)
                {
                    await
                    Alert1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setOrganization)
                {
                    await
                    Alert2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setOrganization)
                {
                    await
                    Alert3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateRecommendationWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Recommendation0 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Recommendation0?.setWorkspace)
                {
                    await
                    Recommendation0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Recommendation1 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Recommendation1?.setWorkspace)
                {
                    await
                    Recommendation1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Recommendation2 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Recommendation2?.setWorkspace)
                {
                    await
                    Recommendation2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Recommendation3 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Recommendation3?.setWorkspace)
                {
                    await
                    Recommendation3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateRecommendationWithAssigned_to() {
            
                const relatedAssigned_to0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Recommendation0 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Recommendation0?.setAssigned_to)
                {
                    await
                    Recommendation0.
                    setAssigned_to(relatedAssigned_to0);
                }
            
                const relatedAssigned_to1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Recommendation1 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Recommendation1?.setAssigned_to)
                {
                    await
                    Recommendation1.
                    setAssigned_to(relatedAssigned_to1);
                }
            
                const relatedAssigned_to2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Recommendation2 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Recommendation2?.setAssigned_to)
                {
                    await
                    Recommendation2.
                    setAssigned_to(relatedAssigned_to2);
                }
            
                const relatedAssigned_to3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Recommendation3 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Recommendation3?.setAssigned_to)
                {
                    await
                    Recommendation3.
                    setAssigned_to(relatedAssigned_to3);
                }
            
        }
        
    
        
            
            async function associateRecommendationWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Recommendation0 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Recommendation0?.setOrganization)
                {
                    await
                    Recommendation0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Recommendation1 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Recommendation1?.setOrganization)
                {
                    await
                    Recommendation1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Recommendation2 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Recommendation2?.setOrganization)
                {
                    await
                    Recommendation2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Recommendation3 = await Recommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Recommendation3?.setOrganization)
                {
                    await
                    Recommendation3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateChatThreadWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const ChatThread0 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatThread0?.setWorkspace)
                {
                    await
                    ChatThread0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const ChatThread1 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatThread1?.setWorkspace)
                {
                    await
                    ChatThread1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const ChatThread2 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatThread2?.setWorkspace)
                {
                    await
                    ChatThread2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const ChatThread3 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatThread3?.setWorkspace)
                {
                    await
                    ChatThread3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
            
            async function associateChatThreadWithStarted_by() {
            
                const relatedStarted_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatThread0 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatThread0?.setStarted_by)
                {
                    await
                    ChatThread0.
                    setStarted_by(relatedStarted_by0);
                }
            
                const relatedStarted_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatThread1 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatThread1?.setStarted_by)
                {
                    await
                    ChatThread1.
                    setStarted_by(relatedStarted_by1);
                }
            
                const relatedStarted_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatThread2 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatThread2?.setStarted_by)
                {
                    await
                    ChatThread2.
                    setStarted_by(relatedStarted_by2);
                }
            
                const relatedStarted_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatThread3 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatThread3?.setStarted_by)
                {
                    await
                    ChatThread3.
                    setStarted_by(relatedStarted_by3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateChatThreadWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatThread0 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatThread0?.setOrganization)
                {
                    await
                    ChatThread0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatThread1 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatThread1?.setOrganization)
                {
                    await
                    ChatThread1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatThread2 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatThread2?.setOrganization)
                {
                    await
                    ChatThread2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatThread3 = await ChatThreads.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatThread3?.setOrganization)
                {
                    await
                    ChatThread3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateChatMessageWithThread() {
            
                const relatedThread0 = await ChatThreads.findOne({
                    offset: Math.floor(Math.random() * (await ChatThreads.count())),
                });
                const ChatMessage0 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatMessage0?.setThread)
                {
                    await
                    ChatMessage0.
                    setThread(relatedThread0);
                }
            
                const relatedThread1 = await ChatThreads.findOne({
                    offset: Math.floor(Math.random() * (await ChatThreads.count())),
                });
                const ChatMessage1 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatMessage1?.setThread)
                {
                    await
                    ChatMessage1.
                    setThread(relatedThread1);
                }
            
                const relatedThread2 = await ChatThreads.findOne({
                    offset: Math.floor(Math.random() * (await ChatThreads.count())),
                });
                const ChatMessage2 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatMessage2?.setThread)
                {
                    await
                    ChatMessage2.
                    setThread(relatedThread2);
                }
            
                const relatedThread3 = await ChatThreads.findOne({
                    offset: Math.floor(Math.random() * (await ChatThreads.count())),
                });
                const ChatMessage3 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatMessage3?.setThread)
                {
                    await
                    ChatMessage3.
                    setThread(relatedThread3);
                }
            
        }
        
    
        
            
            async function associateChatMessageWithAuthor_user() {
            
                const relatedAuthor_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatMessage0 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatMessage0?.setAuthor_user)
                {
                    await
                    ChatMessage0.
                    setAuthor_user(relatedAuthor_user0);
                }
            
                const relatedAuthor_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatMessage1 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatMessage1?.setAuthor_user)
                {
                    await
                    ChatMessage1.
                    setAuthor_user(relatedAuthor_user1);
                }
            
                const relatedAuthor_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatMessage2 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatMessage2?.setAuthor_user)
                {
                    await
                    ChatMessage2.
                    setAuthor_user(relatedAuthor_user2);
                }
            
                const relatedAuthor_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChatMessage3 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatMessage3?.setAuthor_user)
                {
                    await
                    ChatMessage3.
                    setAuthor_user(relatedAuthor_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateChatMessageWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage0 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatMessage0?.setOrganization)
                {
                    await
                    ChatMessage0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage1 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatMessage1?.setOrganization)
                {
                    await
                    ChatMessage1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage2 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatMessage2?.setOrganization)
                {
                    await
                    ChatMessage2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage3 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatMessage3?.setOrganization)
                {
                    await
                    ChatMessage3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMessageCitationWithMessage() {
            
                const relatedMessage0 = await ChatMessages.findOne({
                    offset: Math.floor(Math.random() * (await ChatMessages.count())),
                });
                const MessageCitation0 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MessageCitation0?.setMessage)
                {
                    await
                    MessageCitation0.
                    setMessage(relatedMessage0);
                }
            
                const relatedMessage1 = await ChatMessages.findOne({
                    offset: Math.floor(Math.random() * (await ChatMessages.count())),
                });
                const MessageCitation1 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MessageCitation1?.setMessage)
                {
                    await
                    MessageCitation1.
                    setMessage(relatedMessage1);
                }
            
                const relatedMessage2 = await ChatMessages.findOne({
                    offset: Math.floor(Math.random() * (await ChatMessages.count())),
                });
                const MessageCitation2 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MessageCitation2?.setMessage)
                {
                    await
                    MessageCitation2.
                    setMessage(relatedMessage2);
                }
            
                const relatedMessage3 = await ChatMessages.findOne({
                    offset: Math.floor(Math.random() * (await ChatMessages.count())),
                });
                const MessageCitation3 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MessageCitation3?.setMessage)
                {
                    await
                    MessageCitation3.
                    setMessage(relatedMessage3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMessageCitationWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageCitation0 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MessageCitation0?.setOrganization)
                {
                    await
                    MessageCitation0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageCitation1 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MessageCitation1?.setOrganization)
                {
                    await
                    MessageCitation1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageCitation2 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MessageCitation2?.setOrganization)
                {
                    await
                    MessageCitation2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MessageCitation3 = await MessageCitations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MessageCitation3?.setOrganization)
                {
                    await
                    MessageCitation3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateFilesLibraryWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FilesLibrary0 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FilesLibrary0?.setWorkspace)
                {
                    await
                    FilesLibrary0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FilesLibrary1 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FilesLibrary1?.setWorkspace)
                {
                    await
                    FilesLibrary1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FilesLibrary2 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FilesLibrary2?.setWorkspace)
                {
                    await
                    FilesLibrary2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const FilesLibrary3 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FilesLibrary3?.setWorkspace)
                {
                    await
                    FilesLibrary3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateFilesLibraryWithUploaded_by() {
            
                const relatedUploaded_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const FilesLibrary0 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FilesLibrary0?.setUploaded_by)
                {
                    await
                    FilesLibrary0.
                    setUploaded_by(relatedUploaded_by0);
                }
            
                const relatedUploaded_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const FilesLibrary1 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FilesLibrary1?.setUploaded_by)
                {
                    await
                    FilesLibrary1.
                    setUploaded_by(relatedUploaded_by1);
                }
            
                const relatedUploaded_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const FilesLibrary2 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FilesLibrary2?.setUploaded_by)
                {
                    await
                    FilesLibrary2.
                    setUploaded_by(relatedUploaded_by2);
                }
            
                const relatedUploaded_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const FilesLibrary3 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FilesLibrary3?.setUploaded_by)
                {
                    await
                    FilesLibrary3.
                    setUploaded_by(relatedUploaded_by3);
                }
            
        }
        
    
        
    
        
            
            async function associateFilesLibraryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FilesLibrary0 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FilesLibrary0?.setOrganization)
                {
                    await
                    FilesLibrary0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FilesLibrary1 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FilesLibrary1?.setOrganization)
                {
                    await
                    FilesLibrary1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FilesLibrary2 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FilesLibrary2?.setOrganization)
                {
                    await
                    FilesLibrary2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FilesLibrary3 = await FilesLibrary.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (FilesLibrary3?.setOrganization)
                {
                    await
                    FilesLibrary3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSyncJobWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const SyncJob0 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SyncJob0?.setWorkspace)
                {
                    await
                    SyncJob0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const SyncJob1 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SyncJob1?.setWorkspace)
                {
                    await
                    SyncJob1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const SyncJob2 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SyncJob2?.setWorkspace)
                {
                    await
                    SyncJob2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const SyncJob3 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SyncJob3?.setWorkspace)
                {
                    await
                    SyncJob3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
            
            async function associateSyncJobWithData_connection() {
            
                const relatedData_connection0 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const SyncJob0 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SyncJob0?.setData_connection)
                {
                    await
                    SyncJob0.
                    setData_connection(relatedData_connection0);
                }
            
                const relatedData_connection1 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const SyncJob1 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SyncJob1?.setData_connection)
                {
                    await
                    SyncJob1.
                    setData_connection(relatedData_connection1);
                }
            
                const relatedData_connection2 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const SyncJob2 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SyncJob2?.setData_connection)
                {
                    await
                    SyncJob2.
                    setData_connection(relatedData_connection2);
                }
            
                const relatedData_connection3 = await DataConnections.findOne({
                    offset: Math.floor(Math.random() * (await DataConnections.count())),
                });
                const SyncJob3 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SyncJob3?.setData_connection)
                {
                    await
                    SyncJob3.
                    setData_connection(relatedData_connection3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSyncJobWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SyncJob0 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SyncJob0?.setOrganization)
                {
                    await
                    SyncJob0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SyncJob1 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SyncJob1?.setOrganization)
                {
                    await
                    SyncJob1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SyncJob2 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SyncJob2?.setOrganization)
                {
                    await
                    SyncJob2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SyncJob3 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SyncJob3?.setOrganization)
                {
                    await
                    SyncJob3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Workspaces.bulkCreate(WorkspacesData);
                
            
            
                
                await WorkspaceMemberships.bulkCreate(WorkspaceMembershipsData);
                
            
            
                
                await DataConnections.bulkCreate(DataConnectionsData);
                
            
            
                
                await FinancialAccounts.bulkCreate(FinancialAccountsData);
                
            
            
                
                await Vendors.bulkCreate(VendorsData);
                
            
            
                
                await Customers.bulkCreate(CustomersData);
                
            
            
                
                await Transactions.bulkCreate(TransactionsData);
                
            
            
                
                await Budgets.bulkCreate(BudgetsData);
                
            
            
                
                await BudgetLines.bulkCreate(BudgetLinesData);
                
            
            
                
                await Forecasts.bulkCreate(ForecastsData);
                
            
            
                
                await ForecastScenarios.bulkCreate(ForecastScenariosData);
                
            
            
                
                await MetricsSnapshots.bulkCreate(MetricsSnapshotsData);
                
            
            
                
                await Anomalies.bulkCreate(AnomaliesData);
                
            
            
                
                await Alerts.bulkCreate(AlertsData);
                
            
            
                
                await Recommendations.bulkCreate(RecommendationsData);
                
            
            
                
                await ChatThreads.bulkCreate(ChatThreadsData);
                
            
            
                
                await ChatMessages.bulkCreate(ChatMessagesData);
                
            
            
                
                await MessageCitations.bulkCreate(MessageCitationsData);
                
            
            
                
                await FilesLibrary.bulkCreate(FilesLibraryData);
                
            
            
                
                await SyncJobs.bulkCreate(SyncJobsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWorkspaceWithOwner(),
                    
                
                    
                        
                        await associateWorkspaceWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWorkspaceMembershipWithWorkspace(),
                    
                
                    
                        
                        await associateWorkspaceMembershipWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWorkspaceMembershipWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDataConnectionWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDataConnectionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateFinancialAccountWithWorkspace(),
                    
                
                    
                        
                        await associateFinancialAccountWithData_connection(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateFinancialAccountWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateVendorWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateVendorWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCustomerWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCustomerWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTransactionWithWorkspace(),
                    
                
                    
                        
                        await associateTransactionWithFinancial_account(),
                    
                
                    
                        
                        await associateTransactionWithData_connection(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateTransactionWithVendor(),
                    
                
                    
                        
                        await associateTransactionWithCustomer(),
                    
                
                    
                
                    
                
                    
                        
                        await associateTransactionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBudgetWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBudgetWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBudgetLineWithBudget(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBudgetLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateForecastWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateForecastWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateForecastScenarioWithForecast(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateForecastScenarioWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMetricsSnapshotWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMetricsSnapshotWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAnomalyWithWorkspace(),
                    
                
                    
                        
                        await associateAnomalyWithTransaction(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAnomalyWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAlertWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAlertWithRelated_anomaly(),
                    
                
                    
                        
                        await associateAlertWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateRecommendationWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRecommendationWithAssigned_to(),
                    
                
                    
                        
                        await associateRecommendationWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateChatThreadWithWorkspace(),
                    
                
                    
                        
                        await associateChatThreadWithStarted_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateChatThreadWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateChatMessageWithThread(),
                    
                
                    
                        
                        await associateChatMessageWithAuthor_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateChatMessageWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMessageCitationWithMessage(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMessageCitationWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateFilesLibraryWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateFilesLibraryWithUploaded_by(),
                    
                
                    
                
                    
                        
                        await associateFilesLibraryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSyncJobWithWorkspace(),
                    
                
                    
                        
                        await associateSyncJobWithData_connection(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSyncJobWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('workspaces', null, {});
            
            
            await queryInterface.bulkDelete('workspace_memberships', null, {});
            
            
            await queryInterface.bulkDelete('data_connections', null, {});
            
            
            await queryInterface.bulkDelete('financial_accounts', null, {});
            
            
            await queryInterface.bulkDelete('vendors', null, {});
            
            
            await queryInterface.bulkDelete('customers', null, {});
            
            
            await queryInterface.bulkDelete('transactions', null, {});
            
            
            await queryInterface.bulkDelete('budgets', null, {});
            
            
            await queryInterface.bulkDelete('budget_lines', null, {});
            
            
            await queryInterface.bulkDelete('forecasts', null, {});
            
            
            await queryInterface.bulkDelete('forecast_scenarios', null, {});
            
            
            await queryInterface.bulkDelete('metrics_snapshots', null, {});
            
            
            await queryInterface.bulkDelete('anomalies', null, {});
            
            
            await queryInterface.bulkDelete('alerts', null, {});
            
            
            await queryInterface.bulkDelete('recommendations', null, {});
            
            
            await queryInterface.bulkDelete('chat_threads', null, {});
            
            
            await queryInterface.bulkDelete('chat_messages', null, {});
            
            
            await queryInterface.bulkDelete('message_citations', null, {});
            
            
            await queryInterface.bulkDelete('files_library', null, {});
            
            
            await queryInterface.bulkDelete('sync_jobs', null, {});
            
        
    },
};