





















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






const ApiProviders = db.api_providers;

const MarketSymbols = db.market_symbols;

const SymbolFundamentals = db.symbol_fundamentals;

const PriceQuotes = db.price_quotes;

const TechnicalIndicators = db.technical_indicators;

const AnalystRatings = db.analyst_ratings;

const EarningsReports = db.earnings_reports;

const NewsArticles = db.news_articles;

const NewsArticleSymbols = db.news_article_symbols;

const ArticleBookmarks = db.article_bookmarks;

const Watchlists = db.watchlists;

const WatchlistItems = db.watchlist_items;

const PaperAccounts = db.paper_accounts;

const PaperOrders = db.paper_orders;

const PaperTrades = db.paper_trades;

const PaperPositions = db.paper_positions;

const PortfolioSnapshots = db.portfolio_snapshots;

const ScreenerFilters = db.screener_filters;

const ScreenerRuns = db.screener_runs;

const ScreenerResults = db.screener_results;

const AiChatSessions = db.ai_chat_sessions;

const AiMessages = db.ai_messages;

const LearningModules = db.learning_modules;

const UserTooltips = db.user_tooltips;

const IrCompanies = db.ir_companies;

const IrManagementMembers = db.ir_management_members;

const IrFilings = db.ir_filings;

const IrDividends = db.ir_dividends;

const IrAnnouncements = db.ir_announcements;

const IrFinancialStatementSummaries = db.ir_financial_statement_summaries;

const AuditEvents = db.audit_events;







const ApiProvidersData = [
    
    {
    
        
        
            
                "name": "Alpha Vantage",
            
        
    
        
        
            
                "base_url": "https://www.alphavantage.co",
            
        
    
        
        
            
                "provider_type": "news",
            
        
    
        
        
            
                "enabled": true,
            
        
    
        
        
            
                "last_health_check_at": new Date('2026-03-06T07:50:00Z'),
            
        
    
        
        
            
                "health_status": "ok",
            
        
    
        
        
            
                "notes": "Primary provider for quotes, indicators, and news metadata.",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alpha Vantage News",
            
        
    
        
        
            
                "base_url": "https://www.alphavantage.co/query",
            
        
    
        
        
            
                "provider_type": "market_data",
            
        
    
        
        
            
                "enabled": true,
            
        
    
        
        
            
                "last_health_check_at": new Date('2026-03-06T07:50:00Z'),
            
        
    
        
        
            
                "health_status": "down",
            
        
    
        
        
            
                "notes": "Used for financial news and ticker sentiment.",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Base44 AI",
            
        
    
        
        
            
                "base_url": "https://api.base44.example",
            
        
    
        
        
            
                "provider_type": "ai",
            
        
    
        
        
            
                "enabled": true,
            
        
    
        
        
            
                "last_health_check_at": new Date('2026-03-06T07:49:00Z'),
            
        
    
        
        
            
                "health_status": "down",
            
        
    
        
        
            
                "notes": "LLM analysis and chat assistant.",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Status Ping",
            
        
    
        
        
            
                "base_url": "https://status.nexvest.example",
            
        
    
        
        
            
                "provider_type": "news",
            
        
    
        
        
            
                "enabled": true,
            
        
    
        
        
            
                "last_health_check_at": new Date('2026-02-25T11:00:00Z'),
            
        
    
        
        
            
                "health_status": "degraded",
            
        
    
        
        
            
                "notes": "备用 provider kept disabled.",
            
        
    
    },
    
];



const MarketSymbolsData = [
    
    {
    
        
        
            
                "symbol": "AAPL",
            
        
    
        
        
            
                "name": "Apple Inc.",
            
        
    
        
        
            
                "asset_class": "stock",
            
        
    
        
        
            
                "exchange": "NASDAQ",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "country": "US",
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
        
        
            
                "industry": "Consumer Electronics",
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                "last_refreshed_at": new Date('2026-03-06T07:40:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "symbol": "MSFT",
            
        
    
        
        
            
                "name": "Microsoft Corp.",
            
        
    
        
        
            
                "asset_class": "index",
            
        
    
        
        
            
                "exchange": "NASDAQ",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "country": "US",
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
        
        
            
                "industry": "Software",
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                "last_refreshed_at": new Date('2026-03-06T07:40:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "symbol": "NVDA",
            
        
    
        
        
            
                "name": "NVIDIA Corp.",
            
        
    
        
        
            
                "asset_class": "etf",
            
        
    
        
        
            
                "exchange": "NASDAQ",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "country": "US",
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
        
        
            
                "industry": "Semiconductors",
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                "last_refreshed_at": new Date('2026-03-06T07:40:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "symbol": "BTC",
            
        
    
        
        
            
                "name": "Bitcoin",
            
        
    
        
        
            
                "asset_class": "crypto",
            
        
    
        
        
            
                "exchange": "CRYPTO",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "country": "Global",
            
        
    
        
        
            
                "sector": "Crypto",
            
        
    
        
        
            
                "industry": "Store of Value",
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                "last_refreshed_at": new Date('2026-03-06T07:40:00Z'),
            
        
    
    },
    
];



const SymbolFundamentalsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "pe_ratio": 28.4,
            
        
    
        
        
            
                "eps": 6.21,
            
        
    
        
        
            
                "market_cap": 2850000000000,
            
        
    
        
        
            
                "revenue": 383000000000,
            
        
    
        
        
            
                "dividend_yield": 0.005,
            
        
    
        
        
            
                "beta": 1.25,
            
        
    
        
        
            
                "shares_outstanding": 15600000000,
            
        
    
        
        
            
                "as_of_at": new Date('2026-03-05T00:00:00Z'),
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "pe_ratio": 33.1,
            
        
    
        
        
            
                "eps": 11.03,
            
        
    
        
        
            
                "market_cap": 3150000000000,
            
        
    
        
        
            
                "revenue": 245000000000,
            
        
    
        
        
            
                "dividend_yield": 0.007,
            
        
    
        
        
            
                "beta": 0.92,
            
        
    
        
        
            
                "shares_outstanding": 7430000000,
            
        
    
        
        
            
                "as_of_at": new Date('2026-03-05T00:00:00Z'),
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "pe_ratio": 40.8,
            
        
    
        
        
            
                "eps": 13.7,
            
        
    
        
        
            
                "market_cap": 2200000000000,
            
        
    
        
        
            
                "revenue": 96500000000,
            
        
    
        
        
            
                "dividend_yield": 0.0003,
            
        
    
        
        
            
                "beta": 1.68,
            
        
    
        
        
            
                "shares_outstanding": 2460000000,
            
        
    
        
        
            
                "as_of_at": new Date('2026-03-05T00:00:00Z'),
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "pe_ratio": 0,
            
        
    
        
        
            
                "eps": 0,
            
        
    
        
        
            
                "market_cap": 1300000000000,
            
        
    
        
        
            
                "revenue": 0,
            
        
    
        
        
            
                "dividend_yield": 0,
            
        
    
        
        
            
                "beta": 0,
            
        
    
        
        
            
                "shares_outstanding": 0,
            
        
    
        
        
            
                "as_of_at": new Date('2026-03-05T00:00:00Z'),
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
];



const PriceQuotesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quoted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "price": 192.35,
            
        
    
        
        
            
                "open": 191.2,
            
        
    
        
        
            
                "high": 193.1,
            
        
    
        
        
            
                "low": 190.8,
            
        
    
        
        
            
                "previous_close": 191.55,
            
        
    
        
        
            
                "change_amount": 0.8,
            
        
    
        
        
            
                "change_percent": 0.42,
            
        
    
        
        
            
                "volume": 51234000,
            
        
    
        
        
            
                "timeframe": "30min",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quoted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "price": 418.72,
            
        
    
        
        
            
                "open": 416.0,
            
        
    
        
        
            
                "high": 420.5,
            
        
    
        
        
            
                "low": 414.6,
            
        
    
        
        
            
                "previous_close": 416.88,
            
        
    
        
        
            
                "change_amount": 1.84,
            
        
    
        
        
            
                "change_percent": 0.44,
            
        
    
        
        
            
                "volume": 28991000,
            
        
    
        
        
            
                "timeframe": "monthly",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quoted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "price": 905.14,
            
        
    
        
        
            
                "open": 896.5,
            
        
    
        
        
            
                "high": 912.2,
            
        
    
        
        
            
                "low": 892.1,
            
        
    
        
        
            
                "previous_close": 898.0,
            
        
    
        
        
            
                "change_amount": 7.14,
            
        
    
        
        
            
                "change_percent": 0.79,
            
        
    
        
        
            
                "volume": 40122000,
            
        
    
        
        
            
                "timeframe": "1min",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quoted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "price": 64550.25,
            
        
    
        
        
            
                "open": 63990.1,
            
        
    
        
        
            
                "high": 65120.0,
            
        
    
        
        
            
                "low": 63400.0,
            
        
    
        
        
            
                "previous_close": 64010.0,
            
        
    
        
        
            
                "change_amount": 540.25,
            
        
    
        
        
            
                "change_percent": 0.84,
            
        
    
        
        
            
                "volume": 12540,
            
        
    
        
        
            
                "timeframe": "30min",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
];



const TechnicalIndicatorsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "calculated_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "indicator_type": "macd",
            
        
    
        
        
            
                "timeframe": "60min",
            
        
    
        
        
            
                "period": 14,
            
        
    
        
        
            
                "value": 62.4,
            
        
    
        
        
            
                "signal": 0,
            
        
    
        
        
            
                "histogram": 0,
            
        
    
        
        
            
                "upper_band": 0,
            
        
    
        
        
            
                "middle_band": 0,
            
        
    
        
        
            
                "lower_band": 0,
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "calculated_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "indicator_type": "ema",
            
        
    
        
        
            
                "timeframe": "1min",
            
        
    
        
        
            
                "period": 12,
            
        
    
        
        
            
                "value": 8.15,
            
        
    
        
        
            
                "signal": 7.62,
            
        
    
        
        
            
                "histogram": 0.53,
            
        
    
        
        
            
                "upper_band": 0,
            
        
    
        
        
            
                "middle_band": 0,
            
        
    
        
        
            
                "lower_band": 0,
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "calculated_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "indicator_type": "macd",
            
        
    
        
        
            
                "timeframe": "1min",
            
        
    
        
        
            
                "period": 20,
            
        
    
        
        
            
                "value": 0,
            
        
    
        
        
            
                "signal": 0,
            
        
    
        
        
            
                "histogram": 0,
            
        
    
        
        
            
                "upper_band": 198.2,
            
        
    
        
        
            
                "middle_band": 191.7,
            
        
    
        
        
            
                "lower_band": 185.2,
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "calculated_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "indicator_type": "rsi",
            
        
    
        
        
            
                "timeframe": "1min",
            
        
    
        
        
            
                "period": 50,
            
        
    
        
        
            
                "value": 405.3,
            
        
    
        
        
            
                "signal": 0,
            
        
    
        
        
            
                "histogram": 0,
            
        
    
        
        
            
                "upper_band": 0,
            
        
    
        
        
            
                "middle_band": 0,
            
        
    
        
        
            
                "lower_band": 0,
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
];



const AnalystRatingsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "firm_name": "NorthBridge Research",
            
        
    
        
        
            
                "rating": "strong_buy",
            
        
    
        
        
            
                "price_target": 980,
            
        
    
        
        
            
                "rating_at": new Date('2026-02-28T13:00:00Z'),
            
        
    
        
        
            
                "summary": "Strong demand tailwinds in accelerated computing with elevated volatility risk.",
            
        
    
        
        
            
                "source_url": "https://research.example/nvda-2026q1",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "firm_name": "Harbor Street Equity",
            
        
    
        
        
            
                "rating": "sell",
            
        
    
        
        
            
                "price_target": 200,
            
        
    
        
        
            
                "rating_at": new Date('2026-02-20T14:30:00Z'),
            
        
    
        
        
            
                "summary": "Services resilience offsets slower hardware cycles; valuation fairly priced.",
            
        
    
        
        
            
                "source_url": "https://research.example/aapl-feb-2026",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "firm_name": "Summit Analytics",
            
        
    
        
        
            
                "rating": "strong_sell",
            
        
    
        
        
            
                "price_target": 460,
            
        
    
        
        
            
                "rating_at": new Date('2026-03-01T16:10:00Z'),
            
        
    
        
        
            
                "summary": "Cloud growth and productivity suite attach rates remain supportive.",
            
        
    
        
        
            
                "source_url": "https://research.example/msft-mar-2026",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "firm_name": "IndexFlow Insights",
            
        
    
        
        
            
                "rating": "buy",
            
        
    
        
        
            
                "price_target": 0,
            
        
    
        
        
            
                "rating_at": new Date('2026-02-15T10:00:00Z'),
            
        
    
        
        
            
                "summary": "Broad market exposure; risk aligns with equity beta.",
            
        
    
        
        
            
                "source_url": "https://research.example/spy-overview",
            
        
    
    },
    
];



const EarningsReportsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_end_at": new Date('2026-01-31T00:00:00Z'),
            
        
    
        
        
            
                "reported_at": new Date('2026-02-26T21:00:00Z'),
            
        
    
        
        
            
                "reported_eps": 5.12,
            
        
    
        
        
            
                "estimated_eps": 4.85,
            
        
    
        
        
            
                "surprise": 0.27,
            
        
    
        
        
            
                "surprise_percent": 5.57,
            
        
    
        
        
            
                "reported_revenue": 22100000000,
            
        
    
        
        
            
                "estimated_revenue": 21400000000,
            
        
    
        
        
            
                "notes": "Datacenter strength drove upside.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_end_at": new Date('2025-12-31T00:00:00Z'),
            
        
    
        
        
            
                "reported_at": new Date('2026-01-28T21:00:00Z'),
            
        
    
        
        
            
                "reported_eps": 2.21,
            
        
    
        
        
            
                "estimated_eps": 2.1,
            
        
    
        
        
            
                "surprise": 0.11,
            
        
    
        
        
            
                "surprise_percent": 5.24,
            
        
    
        
        
            
                "reported_revenue": 118000000000,
            
        
    
        
        
            
                "estimated_revenue": 115000000000,
            
        
    
        
        
            
                "notes": "Margins improved with services mix.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_end_at": new Date('2025-12-31T00:00:00Z'),
            
        
    
        
        
            
                "reported_at": new Date('2026-01-29T21:00:00Z'),
            
        
    
        
        
            
                "reported_eps": 3.05,
            
        
    
        
        
            
                "estimated_eps": 2.93,
            
        
    
        
        
            
                "surprise": 0.12,
            
        
    
        
        
            
                "surprise_percent": 4.1,
            
        
    
        
        
            
                "reported_revenue": 65500000000,
            
        
    
        
        
            
                "estimated_revenue": 64200000000,
            
        
    
        
        
            
                "notes": "Azure growth stable; guidance steady.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_end_at": new Date('2025-12-31T00:00:00Z'),
            
        
    
        
        
            
                "reported_at": new Date('2026-02-01T15:30:00Z'),
            
        
    
        
        
            
                "reported_eps": 0,
            
        
    
        
        
            
                "estimated_eps": 0,
            
        
    
        
        
            
                "surprise": 0,
            
        
    
        
        
            
                "surprise_percent": 0,
            
        
    
        
        
            
                "reported_revenue": 0,
            
        
    
        
        
            
                "estimated_revenue": 0,
            
        
    
        
        
            
                "notes": "ETF does not report earnings.",
            
        
    
    },
    
];



const NewsArticlesData = [
    
    {
    
        
        
            
                "title": "Chipmakers extend rally as AI demand stays strong",
            
        
    
        
        
            
                "publisher": "Market Journal",
            
        
    
        
        
            
                "published_at": new Date('2026-03-06T07:10:00Z'),
            
        
    
        
        
            
                "category": "etfs",
            
        
    
        
        
            
                "url": "https://news.example/chips-ai-demand",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "summary": "Semiconductor leaders rose ahead of fresh enterprise AI spending updates.",
            
        
    
        
        
            
                "content": "Investors continued rotating into growth as enterprise AI budgets remained firm.",
            
        
    
        
        
            
                "sentiment": "negative",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                "title": "Major indices steady amid mixed macro signals",
            
        
    
        
        
            
                "publisher": "Daily Macro",
            
        
    
        
        
            
                "published_at": new Date('2026-03-06T06:45:00Z'),
            
        
    
        
        
            
                "category": "stocks",
            
        
    
        
        
            
                "url": "https://news.example/indices-macro-mix",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "summary": "Rates and equities moved sideways following mixed economic prints.",
            
        
    
        
        
            
                "content": "Traders weighed inflation progress against resilient labor indicators.",
            
        
    
        
        
            
                "sentiment": "unknown",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                "title": "Bitcoin trades higher as risk appetite returns",
            
        
    
        
        
            
                "publisher": "Crypto Ledger",
            
        
    
        
        
            
                "published_at": new Date('2026-03-05T23:15:00Z'),
            
        
    
        
        
            
                "category": "etfs",
            
        
    
        
        
            
                "url": "https://news.example/btc-risk-appetite",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "summary": "Digital assets advanced with improved liquidity conditions.",
            
        
    
        
        
            
                "content": "Spot buying increased while derivatives funding remained contained.",
            
        
    
        
        
            
                "sentiment": "unknown",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
    {
    
        
        
            
                "title": "Earnings preview: software leaders in focus",
            
        
    
        
        
            
                "publisher": "Earnings Wire",
            
        
    
        
        
            
                "published_at": new Date('2026-03-05T19:20:00Z'),
            
        
    
        
        
            
                "category": "etfs",
            
        
    
        
        
            
                "url": "https://news.example/software-earnings-preview",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "summary": "Analysts expect steady cloud growth and disciplined expense control.",
            
        
    
        
        
            
                "content": "Consensus estimates imply modest acceleration in select segments.",
            
        
    
        
        
            
                "sentiment": "mixed",
            
        
    
        
        
            
                "source": "Alpha Vantage",
            
        
    
    },
    
];



const NewsArticleSymbolsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "relevance": "primary",
            
        
    
        
        
            
                "sentiment_score": 0.62,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "relevance": "secondary",
            
        
    
        
        
            
                "sentiment_score": 0.21,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "relevance": "primary",
            
        
    
        
        
            
                "sentiment_score": 0.05,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "relevance": "primary",
            
        
    
        
        
            
                "sentiment_score": 0.58,
            
        
    
    },
    
];



const ArticleBookmarksData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bookmarked_at": new Date('2026-03-06T07:30:00Z'),
            
        
    
        
        
            
                "note": "Track AI sector sentiment.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bookmarked_at": new Date('2026-03-06T00:10:00Z'),
            
        
    
        
        
            
                "note": "Useful for BTC risk framing.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bookmarked_at": new Date('2026-03-06T06:55:00Z'),
            
        
    
        
        
            
                "note": "Macro context for portfolio exposure.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bookmarked_at": new Date('2026-03-05T15:00:00Z'),
            
        
    
        
        
            
                "note": "Check flow trends weekly.",
            
        
    
    },
    
];



const WatchlistsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Beginner Starter",
            
        
    
        
        
            
                "description": "Core tickers to learn price action and news impact.",
            
        
    
        
        
            
                "is_default": true,
            
        
    
        
        
            
                "last_viewed_at": new Date('2026-03-06T07:35:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "AI Leaders",
            
        
    
        
        
            
                "description": "High beta names tied to compute and cloud.",
            
        
    
        
        
            
                "is_default": false,
            
        
    
        
        
            
                "last_viewed_at": new Date('2026-03-05T22:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Long Term Core",
            
        
    
        
        
            
                "description": "Diversified core holdings and index exposure.",
            
        
    
        
        
            
                "is_default": true,
            
        
    
        
        
            
                "last_viewed_at": new Date('2026-03-06T08:05:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Macro Watch",
            
        
    
        
        
            
                "description": "ETFs and proxies for broad risk.",
            
        
    
        
        
            
                "is_default": true,
            
        
    
        
        
            
                "last_viewed_at": new Date('2026-03-01T10:00:00Z'),
            
        
    
    },
    
];



const WatchlistItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-02T12:00:00Z'),
            
        
    
        
        
            
                "alert_above_price": 200,
            
        
    
        
        
            
                "alert_below_price": 180,
            
        
    
        
        
            
                "alerts_enabled": true,
            
        
    
        
        
            
                "note": "Large cap example",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-02T12:01:00Z'),
            
        
    
        
        
            
                "alert_above_price": 530,
            
        
    
        
        
            
                "alert_below_price": 490,
            
        
    
        
        
            
                "alerts_enabled": true,
            
        
    
        
        
            
                "note": "Market proxy",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-03T09:00:00Z'),
            
        
    
        
        
            
                "alert_above_price": 950,
            
        
    
        
        
            
                "alert_below_price": 850,
            
        
    
        
        
            
                "alerts_enabled": true,
            
        
    
        
        
            
                "note": "Track earnings volatility",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-03T09:05:00Z'),
            
        
    
        
        
            
                "alert_above_price": 450,
            
        
    
        
        
            
                "alert_below_price": 390,
            
        
    
        
        
            
                "alerts_enabled": true,
            
        
    
        
        
            
                "note": "Cloud benchmark",
            
        
    
    },
    
];



const PaperAccountsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Paper Account 1",
            
        
    
        
        
            
                "base_currency": "GBP",
            
        
    
        
        
            
                "starting_cash": 100000,
            
        
    
        
        
            
                "cash_balance": 84500,
            
        
    
        
        
            
                "buying_power": 84500,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "opened_at": new Date('2026-03-01T12:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Pro Sandbox",
            
        
    
        
        
            
                "base_currency": "GBP",
            
        
    
        
        
            
                "starting_cash": 100000,
            
        
    
        
        
            
                "cash_balance": 60250,
            
        
    
        
        
            
                "buying_power": 60250,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "opened_at": new Date('2026-02-15T12:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Core Practice",
            
        
    
        
        
            
                "base_currency": "JPY",
            
        
    
        
        
            
                "starting_cash": 100000,
            
        
    
        
        
            
                "cash_balance": 91000,
            
        
    
        
        
            
                "buying_power": 91000,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "opened_at": new Date('2026-03-04T12:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Beginner Practice",
            
        
    
        
        
            
                "base_currency": "JPY",
            
        
    
        
        
            
                "starting_cash": 100000,
            
        
    
        
        
            
                "cash_balance": 100000,
            
        
    
        
        
            
                "buying_power": 100000,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "opened_at": new Date('2026-03-01T09:00:00Z'),
            
        
    
    },
    
];



const PaperOrdersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "placed_at": new Date('2026-03-02T14:00:00Z'),
            
        
    
        
        
            
                "filled_at": new Date('2026-03-02T14:00:05Z'),
            
        
    
        
        
            
                "side": "sell",
            
        
    
        
        
            
                "order_type": "limit",
            
        
    
        
        
            
                "quantity": 50,
            
        
    
        
        
            
                "limit_price": 0,
            
        
    
        
        
            
                "stop_price": 0,
            
        
    
        
        
            
                "filled_quantity": 50,
            
        
    
        
        
            
                "average_fill_price": 190.8,
            
        
    
        
        
            
                "status": "expired",
            
        
    
        
        
            
                "rejection_reason": "",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "placed_at": new Date('2026-03-02T15:00:00Z'),
            
        
    
        
        
            
                "filled_at": new Date('2026-03-02T15:00:06Z'),
            
        
    
        
        
            
                "side": "sell",
            
        
    
        
        
            
                "order_type": "stop_limit",
            
        
    
        
        
            
                "quantity": 30,
            
        
    
        
        
            
                "limit_price": 0,
            
        
    
        
        
            
                "stop_price": 0,
            
        
    
        
        
            
                "filled_quantity": 30,
            
        
    
        
        
            
                "average_fill_price": 510.2,
            
        
    
        
        
            
                "status": "placed",
            
        
    
        
        
            
                "rejection_reason": "",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "placed_at": new Date('2026-03-01T16:10:00Z'),
            
        
    
        
        
            
                "filled_at": new Date('2026-03-01T16:10:04Z'),
            
        
    
        
        
            
                "side": "buy",
            
        
    
        
        
            
                "order_type": "stop_limit",
            
        
    
        
        
            
                "quantity": 20,
            
        
    
        
        
            
                "limit_price": 890,
            
        
    
        
        
            
                "stop_price": 0,
            
        
    
        
        
            
                "filled_quantity": 20,
            
        
    
        
        
            
                "average_fill_price": 890,
            
        
    
        
        
            
                "status": "placed",
            
        
    
        
        
            
                "rejection_reason": "",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "placed_at": new Date('2026-03-05T17:00:00Z'),
            
        
    
        
        
            
                "filled_at": new Date('2020-01-01T00:00:00Z'),
            
        
    
        
        
            
                "side": "buy",
            
        
    
        
        
            
                "order_type": "limit",
            
        
    
        
        
            
                "quantity": 5,
            
        
    
        
        
            
                "limit_price": 0,
            
        
    
        
        
            
                "stop_price": 860,
            
        
    
        
        
            
                "filled_quantity": 0,
            
        
    
        
        
            
                "average_fill_price": 0,
            
        
    
        
        
            
                "status": "placed",
            
        
    
        
        
            
                "rejection_reason": "",
            
        
    
    },
    
];



const PaperTradesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "executed_at": new Date('2026-03-02T14:00:05Z'),
            
        
    
        
        
            
                "quantity": 50,
            
        
    
        
        
            
                "price": 190.8,
            
        
    
        
        
            
                "fees": 0,
            
        
    
        
        
            
                "venue": "SIM",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "executed_at": new Date('2026-03-02T15:00:06Z'),
            
        
    
        
        
            
                "quantity": 30,
            
        
    
        
        
            
                "price": 510.2,
            
        
    
        
        
            
                "fees": 0,
            
        
    
        
        
            
                "venue": "SIM",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "executed_at": new Date('2026-03-01T16:10:04Z'),
            
        
    
        
        
            
                "quantity": 20,
            
        
    
        
        
            
                "price": 890,
            
        
    
        
        
            
                "fees": 0,
            
        
    
        
        
            
                "venue": "SIM",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "executed_at": new Date('2026-03-02T14:00:05Z'),
            
        
    
        
        
            
                "quantity": 0,
            
        
    
        
        
            
                "price": 0,
            
        
    
        
        
            
                "fees": 0,
            
        
    
        
        
            
                "venue": "SIM",
            
        
    
    },
    
];



const PaperPositionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 50,
            
        
    
        
        
            
                "average_cost": 190.8,
            
        
    
        
        
            
                "market_value": 9617.5,
            
        
    
        
        
            
                "unrealized_pl": 77.5,
            
        
    
        
        
            
                "realized_pl": 0,
            
        
    
        
        
            
                "day_pl": 77.5,
            
        
    
        
        
            
                "last_priced_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 30,
            
        
    
        
        
            
                "average_cost": 510.2,
            
        
    
        
        
            
                "market_value": 15468.6,
            
        
    
        
        
            
                "unrealized_pl": 162.6,
            
        
    
        
        
            
                "realized_pl": 0,
            
        
    
        
        
            
                "day_pl": 162.6,
            
        
    
        
        
            
                "last_priced_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 20,
            
        
    
        
        
            
                "average_cost": 890,
            
        
    
        
        
            
                "market_value": 18102.8,
            
        
    
        
        
            
                "unrealized_pl": 302.8,
            
        
    
        
        
            
                "realized_pl": 0,
            
        
    
        
        
            
                "day_pl": 302.8,
            
        
    
        
        
            
                "last_priced_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 0,
            
        
    
        
        
            
                "average_cost": 0,
            
        
    
        
        
            
                "market_value": 0,
            
        
    
        
        
            
                "unrealized_pl": 0,
            
        
    
        
        
            
                "realized_pl": 0,
            
        
    
        
        
            
                "day_pl": 0,
            
        
    
        
        
            
                "last_priced_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
    },
    
];



const PortfolioSnapshotsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "snapshotted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "total_value": 109586.1,
            
        
    
        
        
            
                "cash_value": 84500,
            
        
    
        
        
            
                "positions_value": 25086.1,
            
        
    
        
        
            
                "day_pl": 240.1,
            
        
    
        
        
            
                "all_time_pl": 9586.1,
            
        
    
        
        
            
                "day_pl_percent": 0.22,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "snapshotted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "total_value": 102352.8,
            
        
    
        
        
            
                "cash_value": 60250,
            
        
    
        
        
            
                "positions_value": 42102.8,
            
        
    
        
        
            
                "day_pl": 302.8,
            
        
    
        
        
            
                "all_time_pl": 2352.8,
            
        
    
        
        
            
                "day_pl_percent": 0.3,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "snapshotted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "total_value": 100000,
            
        
    
        
        
            
                "cash_value": 91000,
            
        
    
        
        
            
                "positions_value": 9000,
            
        
    
        
        
            
                "day_pl": 0,
            
        
    
        
        
            
                "all_time_pl": 0,
            
        
    
        
        
            
                "day_pl_percent": 0,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "snapshotted_at": new Date('2026-03-06T08:00:00Z'),
            
        
    
        
        
            
                "total_value": 100000,
            
        
    
        
        
            
                "cash_value": 100000,
            
        
    
        
        
            
                "positions_value": 0,
            
        
    
        
        
            
                "day_pl": 0,
            
        
    
        
        
            
                "all_time_pl": 0,
            
        
    
        
        
            
                "day_pl_percent": 0,
            
        
    
    },
    
];



const ScreenerFiltersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Large Cap Tech Quality",
            
        
    
        
        
            
                "asset_class": "crypto",
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
        
        
            
                "market_cap_min": 500000000000,
            
        
    
        
        
            
                "market_cap_max": 5000000000000,
            
        
    
        
        
            
                "pe_min": 10,
            
        
    
        
        
            
                "pe_max": 60,
            
        
    
        
        
            
                "price_min": 50,
            
        
    
        
        
            
                "price_max": 2000,
            
        
    
        
        
            
                "volume_min": 5000000,
            
        
    
        
        
            
                "performance_52w_min": -0.1,
            
        
    
        
        
            
                "performance_52w_max": 2.0,
            
        
    
        
        
            
                "is_pinned": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Dividend Tilt",
            
        
    
        
        
            
                "asset_class": "stock",
            
        
    
        
        
            
                "sector": "",
            
        
    
        
        
            
                "market_cap_min": 10000000000,
            
        
    
        
        
            
                "market_cap_max": 5000000000000,
            
        
    
        
        
            
                "pe_min": 0,
            
        
    
        
        
            
                "pe_max": 30,
            
        
    
        
        
            
                "price_min": 5,
            
        
    
        
        
            
                "price_max": 500,
            
        
    
        
        
            
                "volume_min": 1000000,
            
        
    
        
        
            
                "performance_52w_min": -0.2,
            
        
    
        
        
            
                "performance_52w_max": 1.0,
            
        
    
        
        
            
                "is_pinned": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Beginner Safe Zone",
            
        
    
        
        
            
                "asset_class": "stock",
            
        
    
        
        
            
                "sector": "ETF",
            
        
    
        
        
            
                "market_cap_min": 0,
            
        
    
        
        
            
                "market_cap_max": 0,
            
        
    
        
        
            
                "pe_min": 0,
            
        
    
        
        
            
                "pe_max": 0,
            
        
    
        
        
            
                "price_min": 50,
            
        
    
        
        
            
                "price_max": 700,
            
        
    
        
        
            
                "volume_min": 10000000,
            
        
    
        
        
            
                "performance_52w_min": -0.15,
            
        
    
        
        
            
                "performance_52w_max": 0.8,
            
        
    
        
        
            
                "is_pinned": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ops Smoke Test",
            
        
    
        
        
            
                "asset_class": "forex",
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
        
        
            
                "market_cap_min": 1000000000,
            
        
    
        
        
            
                "market_cap_max": 0,
            
        
    
        
        
            
                "pe_min": 0,
            
        
    
        
        
            
                "pe_max": 0,
            
        
    
        
        
            
                "price_min": 1,
            
        
    
        
        
            
                "price_max": 5000,
            
        
    
        
        
            
                "volume_min": 0,
            
        
    
        
        
            
                "performance_52w_min": 0,
            
        
    
        
        
            
                "performance_52w_max": 0,
            
        
    
        
        
            
                "is_pinned": false,
            
        
    
    },
    
];



const ScreenerRunsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_at": new Date('2026-03-06T07:20:00Z'),
            
        
    
        
        
            
                "result_count": 42,
            
        
    
        
        
            
                "status": "running",
            
        
    
        
        
            
                "error_message": "",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_at": new Date('2026-03-06T07:25:00Z'),
            
        
    
        
        
            
                "result_count": 58,
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "error_message": "",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_at": new Date('2026-03-06T07:30:00Z'),
            
        
    
        
        
            
                "result_count": 15,
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "error_message": "",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_at": new Date('2026-03-06T07:35:00Z'),
            
        
    
        
        
            
                "result_count": 0,
            
        
    
        
        
            
                "status": "running",
            
        
    
        
        
            
                "error_message": "Provider rate limit reached",
            
        
    
    },
    
];



const ScreenerResultsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "last_price": 418.72,
            
        
    
        
        
            
                "market_cap": 3150000000000,
            
        
    
        
        
            
                "pe_ratio": 33.1,
            
        
    
        
        
            
                "volume": 28991000,
            
        
    
        
        
            
                "performance_52w": 0.42,
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "last_price": 192.35,
            
        
    
        
        
            
                "market_cap": 2850000000000,
            
        
    
        
        
            
                "pe_ratio": 28.4,
            
        
    
        
        
            
                "volume": 51234000,
            
        
    
        
        
            
                "performance_52w": 0.25,
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "last_price": 905.14,
            
        
    
        
        
            
                "market_cap": 2200000000000,
            
        
    
        
        
            
                "pe_ratio": 40.8,
            
        
    
        
        
            
                "volume": 40122000,
            
        
    
        
        
            
                "performance_52w": 1.12,
            
        
    
        
        
            
                "sector": "Technology",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "last_price": 515.62,
            
        
    
        
        
            
                "market_cap": 0,
            
        
    
        
        
            
                "pe_ratio": 0,
            
        
    
        
        
            
                "volume": 61234000,
            
        
    
        
        
            
                "performance_52w": 0.18,
            
        
    
        
        
            
                "sector": "ETF",
            
        
    
    },
    
];



const AiChatSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "NVDA quick take",
            
        
    
        
        
            
                "mode": "pro",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "started_at": new Date('2026-03-06T07:05:00Z'),
            
        
    
        
        
            
                "last_message_at": new Date('2026-03-06T07:06:10Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "AAPL vs MSFT comparison",
            
        
    
        
        
            
                "mode": "beginner",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "started_at": new Date('2026-03-05T22:10:00Z'),
            
        
    
        
        
            
                "last_message_at": new Date('2026-03-05T22:15:30Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Portfolio allocation review",
            
        
    
        
        
            
                "mode": "pro",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "started_at": new Date('2026-03-06T08:02:00Z'),
            
        
    
        
        
            
                "last_message_at": new Date('2026-03-06T08:04:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "What is an ETF",
            
        
    
        
        
            
                "mode": "pro",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "started_at": new Date('2026-02-28T10:00:00Z'),
            
        
    
        
        
            
                "last_message_at": new Date('2026-02-28T10:06:00Z'),
            
        
    
    },
    
];



const AiMessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sent_at": new Date('2026-03-06T07:05:10Z'),
            
        
    
        
        
            
                "sender": "user",
            
        
    
        
        
            
                "content": "Analyze NVDA for me and explain the risks.",
            
        
    
        
        
            
                "intent": "news_summary",
            
        
    
        
        
            
                "risk_level": "low",
            
        
    
        
        
            
                "recommendation": "buy",
            
        
    
        
        
            
                "confidence": 0,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sent_at": new Date('2026-03-06T07:06:10Z'),
            
        
    
        
        
            
                "sender": "system",
            
        
    
        
        
            
                "content": "NVDA shows strong momentum with elevated valuation sensitivity. Key risks include demand cyclicality, supply constraints, and broader growth drawdowns. Consider position sizing and stop discipline.",
            
        
    
        
        
            
                "intent": "education",
            
        
    
        
        
            
                "risk_level": "unknown",
            
        
    
        
        
            
                "recommendation": "hold",
            
        
    
        
        
            
                "confidence": 0.68,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sent_at": new Date('2026-03-05T22:10:30Z'),
            
        
    
        
        
            
                "sender": "assistant",
            
        
    
        
        
            
                "content": "Compare AAPL vs MSFT using fundamentals and recent news.",
            
        
    
        
        
            
                "intent": "news_summary",
            
        
    
        
        
            
                "risk_level": "high",
            
        
    
        
        
            
                "recommendation": "sell",
            
        
    
        
        
            
                "confidence": 0,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sent_at": new Date('2026-03-05T22:15:30Z'),
            
        
    
        
        
            
                "sender": "assistant",
            
        
    
        
        
            
                "content": "MSFT has stronger cloud-driven growth while AAPL offers resilient cash flows and services mix. Both are high quality; MSFT may carry less product-cycle risk, AAPL may be more valuation-sensitive to consumer demand.",
            
        
    
        
        
            
                "intent": "portfolio_question",
            
        
    
        
        
            
                "risk_level": "unknown",
            
        
    
        
        
            
                "recommendation": "hold",
            
        
    
        
        
            
                "confidence": 0.72,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const LearningModulesData = [
    
    {
    
        
        
            
                "title": "Getting Started With Tickers",
            
        
    
        
        
            
                "difficulty": "advanced",
            
        
    
        
        
            
                "topic": "risk_management",
            
        
    
        
        
            
                "summary": "Learn symbols, quotes, and percent change.",
            
        
    
        
        
            
                "content": "This module explains how tickers work and how to read a quote panel.",
            
        
    
        
        
            
                "estimated_minutes": 10,
            
        
    
        
        
            
                "published": true,
            
        
    
    },
    
    {
    
        
        
            
                "title": "Understanding Risk and Position Sizing",
            
        
    
        
        
            
                "difficulty": "intermediate",
            
        
    
        
        
            
                "topic": "fundamentals",
            
        
    
        
        
            
                "summary": "A simple framework for sizing trades.",
            
        
    
        
        
            
                "content": "Use smaller sizes for higher volatility and define exits before entry.",
            
        
    
        
        
            
                "estimated_minutes": 12,
            
        
    
        
        
            
                "published": true,
            
        
    
    },
    
    {
    
        
        
            
                "title": "RSI, MACD, and Bollinger Bands",
            
        
    
        
        
            
                "difficulty": "advanced",
            
        
    
        
        
            
                "topic": "risk_management",
            
        
    
        
        
            
                "summary": "Core indicators and common pitfalls.",
            
        
    
        
        
            
                "content": "Indicators are tools, not guarantees. Combine with trend and volume context.",
            
        
    
        
        
            
                "estimated_minutes": 20,
            
        
    
        
        
            
                "published": true,
            
        
    
    },
    
    {
    
        
        
            
                "title": "Reading Fundamentals Quickly",
            
        
    
        
        
            
                "difficulty": "intermediate",
            
        
    
        
        
            
                "topic": "macro",
            
        
    
        
        
            
                "summary": "P E, EPS, market cap, and revenue basics.",
            
        
    
        
        
            
                "content": "Compare metrics within a sector and account for growth expectations.",
            
        
    
        
        
            
                "estimated_minutes": 18,
            
        
    
        
        
            
                "published": true,
            
        
    
    },
    
];



const UserTooltipsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "tooltip_key": "dashboard_ticker_tape",
            
        
    
        
        
            
                "dismissed": true,
            
        
    
        
        
            
                "dismissed_at": new Date('2026-03-02T12:05:00Z'),
            
        
    
        
        
            
                "experience_mode": "pro",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "tooltip_key": "paper_order_confirm",
            
        
    
        
        
            
                "dismissed": true,
            
        
    
        
        
            
                "dismissed_at": new Date('2020-01-01T00:00:00Z'),
            
        
    
        
        
            
                "experience_mode": "pro",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "tooltip_key": "indicator_panel_macd",
            
        
    
        
        
            
                "dismissed": true,
            
        
    
        
        
            
                "dismissed_at": new Date('2026-02-20T10:00:00Z'),
            
        
    
        
        
            
                "experience_mode": "pro",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "tooltip_key": "watchlist_add_symbol",
            
        
    
        
        
            
                "dismissed": true,
            
        
    
        
        
            
                "dismissed_at": new Date('2026-03-01T10:10:00Z'),
            
        
    
        
        
            
                "experience_mode": "beginner",
            
        
    
    },
    
];



const IrCompaniesData = [
    
    {
    
        
        
            
                "name": "Apple Investor Relations",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "website": "https://investor.apple.com",
            
        
    
        
        
            
                "description": "Investor relations profile with filings, events, and capital return overview.",
            
        
    
        
        
            
                "hq_location": "Cupertino, CA",
            
        
    
        
        
            
                "last_updated_at": new Date('2026-03-05T12:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "name": "Microsoft Investor Relations",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "website": "https://www.microsoft.com/en-us/investor",
            
        
    
        
        
            
                "description": "IR resources including SEC filings and earnings materials.",
            
        
    
        
        
            
                "hq_location": "Redmond, WA",
            
        
    
        
        
            
                "last_updated_at": new Date('2026-03-05T12:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "name": "NVIDIA Investor Relations",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "website": "https://investor.nvidia.com",
            
        
    
        
        
            
                "description": "Earnings, presentations, and governance information.",
            
        
    
        
        
            
                "hq_location": "Santa Clara, CA",
            
        
    
        
        
            
                "last_updated_at": new Date('2026-03-05T12:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "name": "SPDR Fund Resources",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "website": "https://www.ssga.com/us/en/individual/etfs/funds/spdr-sp-500-etf-trust-spy",
            
        
    
        
        
            
                "description": "Fund documents and distribution history.",
            
        
    
        
        
            
                "hq_location": "Boston, MA",
            
        
    
        
        
            
                "last_updated_at": new Date('2026-03-05T12:00:00Z'),
            
        
    
    },
    
];



const IrManagementMembersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Lena Brooks",
            
        
    
        
        
            
                "title": "VP Investor Relations",
            
        
    
        
        
            
                "bio": "Leads investor communications and quarterly earnings materials.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "display_order": 1,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Ethan Moore",
            
        
    
        
        
            
                "title": "Head of Investor Relations",
            
        
    
        
        
            
                "bio": "Oversees shareholder engagement and reporting cadence.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "display_order": 1,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Priya Nair",
            
        
    
        
        
            
                "title": "Director, Investor Relations",
            
        
    
        
        
            
                "bio": "Coordinates earnings prep, guidance materials, and investor Q and A.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "display_order": 1,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "full_name": "Caleb Wright",
            
        
    
        
        
            
                "title": "Fund Communications Lead",
            
        
    
        
        
            
                "bio": "Publishes fund notices and distribution updates.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "display_order": 1,
            
        
    
    },
    
];



const IrFilingsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "filing_type": "other",
            
        
    
        
        
            
                "title": "Form 10-K Annual Report",
            
        
    
        
        
            
                "filed_at": new Date('2025-11-01T00:00:00Z'),
            
        
    
        
        
            
                "sec_url": "https://sec.example/aapl-10k-2025",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "summary": "Annual results and risk disclosures.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "filing_type": "10k",
            
        
    
        
        
            
                "title": "Form 10-Q Quarterly Report",
            
        
    
        
        
            
                "filed_at": new Date('2026-02-01T00:00:00Z'),
            
        
    
        
        
            
                "sec_url": "https://sec.example/msft-10q-2026q2",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "summary": "Quarterly financials and management discussion.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "filing_type": "8k",
            
        
    
        
        
            
                "title": "Form 8-K Current Report",
            
        
    
        
        
            
                "filed_at": new Date('2026-02-27T00:00:00Z'),
            
        
    
        
        
            
                "sec_url": "https://sec.example/nvda-8k-earnings",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "summary": "Earnings release and related exhibits.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "filing_type": "8k",
            
        
    
        
        
            
                "title": "DEF 14A Proxy Statement",
            
        
    
        
        
            
                "filed_at": new Date('2026-01-15T00:00:00Z'),
            
        
    
        
        
            
                "sec_url": "https://sec.example/aapl-proxy-2026",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "summary": "Governance, compensation, and shareholder voting items.",
            
        
    
    },
    
];



const IrDividendsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "declaration_at": new Date('2026-01-30T00:00:00Z'),
            
        
    
        
        
            
                "ex_dividend_at": new Date('2026-02-10T00:00:00Z'),
            
        
    
        
        
            
                "record_at": new Date('2026-02-12T00:00:00Z'),
            
        
    
        
        
            
                "payable_at": new Date('2026-02-20T00:00:00Z'),
            
        
    
        
        
            
                "amount": 0.25,
            
        
    
        
        
            
                "currency": "EUR",
            
        
    
        
        
            
                "frequency": "monthly",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "declaration_at": new Date('2026-02-05T00:00:00Z'),
            
        
    
        
        
            
                "ex_dividend_at": new Date('2026-02-19T00:00:00Z'),
            
        
    
        
        
            
                "record_at": new Date('2026-02-21T00:00:00Z'),
            
        
    
        
        
            
                "payable_at": new Date('2026-03-10T00:00:00Z'),
            
        
    
        
        
            
                "amount": 0.83,
            
        
    
        
        
            
                "currency": "EUR",
            
        
    
        
        
            
                "frequency": "semi_annual",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "declaration_at": new Date('2026-02-28T00:00:00Z'),
            
        
    
        
        
            
                "ex_dividend_at": new Date('2026-03-15T00:00:00Z'),
            
        
    
        
        
            
                "record_at": new Date('2026-03-17T00:00:00Z'),
            
        
    
        
        
            
                "payable_at": new Date('2026-03-30T00:00:00Z'),
            
        
    
        
        
            
                "amount": 0.04,
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "frequency": "quarterly",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "declaration_at": new Date('2026-02-01T00:00:00Z'),
            
        
    
        
        
            
                "ex_dividend_at": new Date('2026-02-03T00:00:00Z'),
            
        
    
        
        
            
                "record_at": new Date('2026-02-05T00:00:00Z'),
            
        
    
        
        
            
                "payable_at": new Date('2026-02-07T00:00:00Z'),
            
        
    
        
        
            
                "amount": 1.56,
            
        
    
        
        
            
                "currency": "JPY",
            
        
    
        
        
            
                "frequency": "one_time",
            
        
    
    },
    
];



const IrAnnouncementsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Quarterly earnings release and webcast details",
            
        
    
        
        
            
                "announced_at": new Date('2026-02-27T00:00:00Z'),
            
        
    
        
        
            
                "body": "NVIDIA announced quarterly results and provided webcast access details.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "source_url": "https://ir.example/nvda-earnings-webcast",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Investor event scheduled for April",
            
        
    
        
        
            
                "announced_at": new Date('2026-03-02T00:00:00Z'),
            
        
    
        
        
            
                "body": "Microsoft announced an upcoming investor event with agenda highlights.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "source_url": "https://ir.example/msft-investor-event",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Capital return program update",
            
        
    
        
        
            
                "announced_at": new Date('2026-02-01T00:00:00Z'),
            
        
    
        
        
            
                "body": "Apple provided an update on share repurchases and dividend policy.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "source_url": "https://ir.example/aapl-capital-return",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Distribution notice",
            
        
    
        
        
            
                "announced_at": new Date('2026-02-02T00:00:00Z'),
            
        
    
        
        
            
                "body": "Fund distributor published distribution amounts and key dates.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "source_url": "https://ir.example/spy-distribution",
            
        
    
    },
    
];



const IrFinancialStatementSummariesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "statement_type": "cash_flow",
            
        
    
        
        
            
                "period_type": "quarterly",
            
        
    
        
        
            
                "period_end_at": new Date('2025-12-31T00:00:00Z'),
            
        
    
        
        
            
                "total_revenue": 383000000000,
            
        
    
        
        
            
                "net_income": 97000000000,
            
        
    
        
        
            
                "total_assets": 352000000000,
            
        
    
        
        
            
                "total_liabilities": 287000000000,
            
        
    
        
        
            
                "free_cash_flow": 99000000000,
            
        
    
        
        
            
                "notes": "High services contribution supported margins.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "statement_type": "cash_flow",
            
        
    
        
        
            
                "period_type": "quarterly",
            
        
    
        
        
            
                "period_end_at": new Date('2025-12-31T00:00:00Z'),
            
        
    
        
        
            
                "total_revenue": 245000000000,
            
        
    
        
        
            
                "net_income": 88000000000,
            
        
    
        
        
            
                "total_assets": 450000000000,
            
        
    
        
        
            
                "total_liabilities": 230000000000,
            
        
    
        
        
            
                "free_cash_flow": 74000000000,
            
        
    
        
        
            
                "notes": "Cloud and productivity suites remained key drivers.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "statement_type": "balance_sheet",
            
        
    
        
        
            
                "period_type": "quarterly",
            
        
    
        
        
            
                "period_end_at": new Date('2025-12-31T00:00:00Z'),
            
        
    
        
        
            
                "total_revenue": 96500000000,
            
        
    
        
        
            
                "net_income": 29000000000,
            
        
    
        
        
            
                "total_assets": 80000000000,
            
        
    
        
        
            
                "total_liabilities": 35000000000,
            
        
    
        
        
            
                "free_cash_flow": 27000000000,
            
        
    
        
        
            
                "notes": "Accelerated computing demand expanded operating leverage.",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "statement_type": "balance_sheet",
            
        
    
        
        
            
                "period_type": "annual",
            
        
    
        
        
            
                "period_end_at": new Date('2025-12-31T00:00:00Z'),
            
        
    
        
        
            
                "total_revenue": 0,
            
        
    
        
        
            
                "net_income": 0,
            
        
    
        
        
            
                "total_assets": 0,
            
        
    
        
        
            
                "total_liabilities": 0,
            
        
    
        
        
            
                "free_cash_flow": 25000000000,
            
        
    
        
        
            
                "notes": "Quarterly free cash flow estimate for illustration.",
            
        
    
    },
    
];



const AuditEventsData = [
    
    {
    
        
        
            
                "occurred_at": new Date('2026-03-06T07:35:10Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "order_canceled",
            
        
    
        
        
            
                "entity_name": "users",
            
        
    
        
        
            
                "entity_reference": "jpatel",
            
        
    
        
        
            
                "metadata_json": "{from:beginner,to:pro}",
            
        
    
        
        
            
                "severity": "warning",
            
        
    
    },
    
    {
    
        
        
            
                "occurred_at": new Date('2026-03-06T07:36:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "mode_switch",
            
        
    
        
        
            
                "entity_name": "users",
            
        
    
        
        
            
                "entity_reference": "jpatel",
            
        
    
        
        
            
                "metadata_json": "{from:clean_light,to:dark_pro}",
            
        
    
        
        
            
                "severity": "info",
            
        
    
    },
    
    {
    
        
        
            
                "occurred_at": new Date('2026-03-02T14:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "bookmark_removed",
            
        
    
        
        
            
                "entity_name": "paper_orders",
            
        
    
        
        
            
                "entity_reference": "AAPL buy 50",
            
        
    
        
        
            
                "metadata_json": "{order_type:market,symbol:AAPL}",
            
        
    
        
        
            
                "severity": "error",
            
        
    
    },
    
    {
    
        
        
            
                "occurred_at": new Date('2026-03-06T07:35:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "order_filled",
            
        
    
        
        
            
                "entity_name": "api_providers",
            
        
    
        
        
            
                "entity_reference": "Alpha Vantage",
            
        
    
        
        
            
                "metadata_json": "{message:rate limit warning}",
            
        
    
        
        
            
                "severity": "warning",
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateSymbolFundamentalWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const SymbolFundamental0 = await SymbolFundamentals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SymbolFundamental0?.setMarket_symbol)
                {
                    await
                    SymbolFundamental0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const SymbolFundamental1 = await SymbolFundamentals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SymbolFundamental1?.setMarket_symbol)
                {
                    await
                    SymbolFundamental1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const SymbolFundamental2 = await SymbolFundamentals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SymbolFundamental2?.setMarket_symbol)
                {
                    await
                    SymbolFundamental2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const SymbolFundamental3 = await SymbolFundamentals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SymbolFundamental3?.setMarket_symbol)
                {
                    await
                    SymbolFundamental3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePriceQuoteWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PriceQuote0 = await PriceQuotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PriceQuote0?.setMarket_symbol)
                {
                    await
                    PriceQuote0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PriceQuote1 = await PriceQuotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PriceQuote1?.setMarket_symbol)
                {
                    await
                    PriceQuote1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PriceQuote2 = await PriceQuotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PriceQuote2?.setMarket_symbol)
                {
                    await
                    PriceQuote2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PriceQuote3 = await PriceQuotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PriceQuote3?.setMarket_symbol)
                {
                    await
                    PriceQuote3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateTechnicalIndicatorWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const TechnicalIndicator0 = await TechnicalIndicators.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TechnicalIndicator0?.setMarket_symbol)
                {
                    await
                    TechnicalIndicator0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const TechnicalIndicator1 = await TechnicalIndicators.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TechnicalIndicator1?.setMarket_symbol)
                {
                    await
                    TechnicalIndicator1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const TechnicalIndicator2 = await TechnicalIndicators.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TechnicalIndicator2?.setMarket_symbol)
                {
                    await
                    TechnicalIndicator2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const TechnicalIndicator3 = await TechnicalIndicators.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (TechnicalIndicator3?.setMarket_symbol)
                {
                    await
                    TechnicalIndicator3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAnalystRatingWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const AnalystRating0 = await AnalystRatings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AnalystRating0?.setMarket_symbol)
                {
                    await
                    AnalystRating0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const AnalystRating1 = await AnalystRatings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AnalystRating1?.setMarket_symbol)
                {
                    await
                    AnalystRating1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const AnalystRating2 = await AnalystRatings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AnalystRating2?.setMarket_symbol)
                {
                    await
                    AnalystRating2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const AnalystRating3 = await AnalystRatings.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AnalystRating3?.setMarket_symbol)
                {
                    await
                    AnalystRating3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateEarningsReportWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const EarningsReport0 = await EarningsReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EarningsReport0?.setMarket_symbol)
                {
                    await
                    EarningsReport0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const EarningsReport1 = await EarningsReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EarningsReport1?.setMarket_symbol)
                {
                    await
                    EarningsReport1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const EarningsReport2 = await EarningsReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EarningsReport2?.setMarket_symbol)
                {
                    await
                    EarningsReport2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const EarningsReport3 = await EarningsReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (EarningsReport3?.setMarket_symbol)
                {
                    await
                    EarningsReport3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateNewsArticleSymbolWithNews_article() {
            
                const relatedNews_article0 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const NewsArticleSymbol0 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NewsArticleSymbol0?.setNews_article)
                {
                    await
                    NewsArticleSymbol0.
                    setNews_article(relatedNews_article0);
                }
            
                const relatedNews_article1 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const NewsArticleSymbol1 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NewsArticleSymbol1?.setNews_article)
                {
                    await
                    NewsArticleSymbol1.
                    setNews_article(relatedNews_article1);
                }
            
                const relatedNews_article2 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const NewsArticleSymbol2 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NewsArticleSymbol2?.setNews_article)
                {
                    await
                    NewsArticleSymbol2.
                    setNews_article(relatedNews_article2);
                }
            
                const relatedNews_article3 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const NewsArticleSymbol3 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NewsArticleSymbol3?.setNews_article)
                {
                    await
                    NewsArticleSymbol3.
                    setNews_article(relatedNews_article3);
                }
            
        }
        
    
        
            
            async function associateNewsArticleSymbolWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const NewsArticleSymbol0 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NewsArticleSymbol0?.setMarket_symbol)
                {
                    await
                    NewsArticleSymbol0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const NewsArticleSymbol1 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NewsArticleSymbol1?.setMarket_symbol)
                {
                    await
                    NewsArticleSymbol1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const NewsArticleSymbol2 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NewsArticleSymbol2?.setMarket_symbol)
                {
                    await
                    NewsArticleSymbol2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const NewsArticleSymbol3 = await NewsArticleSymbols.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NewsArticleSymbol3?.setMarket_symbol)
                {
                    await
                    NewsArticleSymbol3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateArticleBookmarkWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ArticleBookmark0 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArticleBookmark0?.setUser)
                {
                    await
                    ArticleBookmark0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ArticleBookmark1 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArticleBookmark1?.setUser)
                {
                    await
                    ArticleBookmark1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ArticleBookmark2 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArticleBookmark2?.setUser)
                {
                    await
                    ArticleBookmark2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ArticleBookmark3 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ArticleBookmark3?.setUser)
                {
                    await
                    ArticleBookmark3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
            
            async function associateArticleBookmarkWithNews_article() {
            
                const relatedNews_article0 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const ArticleBookmark0 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArticleBookmark0?.setNews_article)
                {
                    await
                    ArticleBookmark0.
                    setNews_article(relatedNews_article0);
                }
            
                const relatedNews_article1 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const ArticleBookmark1 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArticleBookmark1?.setNews_article)
                {
                    await
                    ArticleBookmark1.
                    setNews_article(relatedNews_article1);
                }
            
                const relatedNews_article2 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const ArticleBookmark2 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArticleBookmark2?.setNews_article)
                {
                    await
                    ArticleBookmark2.
                    setNews_article(relatedNews_article2);
                }
            
                const relatedNews_article3 = await NewsArticles.findOne({
                    offset: Math.floor(Math.random() * (await NewsArticles.count())),
                });
                const ArticleBookmark3 = await ArticleBookmarks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ArticleBookmark3?.setNews_article)
                {
                    await
                    ArticleBookmark3.
                    setNews_article(relatedNews_article3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateWatchlistWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Watchlist0 = await Watchlists.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Watchlist0?.setUser)
                {
                    await
                    Watchlist0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Watchlist1 = await Watchlists.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Watchlist1?.setUser)
                {
                    await
                    Watchlist1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Watchlist2 = await Watchlists.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Watchlist2?.setUser)
                {
                    await
                    Watchlist2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Watchlist3 = await Watchlists.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Watchlist3?.setUser)
                {
                    await
                    Watchlist3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateWatchlistItemWithWatchlist() {
            
                const relatedWatchlist0 = await Watchlists.findOne({
                    offset: Math.floor(Math.random() * (await Watchlists.count())),
                });
                const WatchlistItem0 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WatchlistItem0?.setWatchlist)
                {
                    await
                    WatchlistItem0.
                    setWatchlist(relatedWatchlist0);
                }
            
                const relatedWatchlist1 = await Watchlists.findOne({
                    offset: Math.floor(Math.random() * (await Watchlists.count())),
                });
                const WatchlistItem1 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WatchlistItem1?.setWatchlist)
                {
                    await
                    WatchlistItem1.
                    setWatchlist(relatedWatchlist1);
                }
            
                const relatedWatchlist2 = await Watchlists.findOne({
                    offset: Math.floor(Math.random() * (await Watchlists.count())),
                });
                const WatchlistItem2 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WatchlistItem2?.setWatchlist)
                {
                    await
                    WatchlistItem2.
                    setWatchlist(relatedWatchlist2);
                }
            
                const relatedWatchlist3 = await Watchlists.findOne({
                    offset: Math.floor(Math.random() * (await Watchlists.count())),
                });
                const WatchlistItem3 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WatchlistItem3?.setWatchlist)
                {
                    await
                    WatchlistItem3.
                    setWatchlist(relatedWatchlist3);
                }
            
        }
        
    
        
            
            async function associateWatchlistItemWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const WatchlistItem0 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WatchlistItem0?.setMarket_symbol)
                {
                    await
                    WatchlistItem0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const WatchlistItem1 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WatchlistItem1?.setMarket_symbol)
                {
                    await
                    WatchlistItem1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const WatchlistItem2 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WatchlistItem2?.setMarket_symbol)
                {
                    await
                    WatchlistItem2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const WatchlistItem3 = await WatchlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WatchlistItem3?.setMarket_symbol)
                {
                    await
                    WatchlistItem3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaperAccountWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PaperAccount0 = await PaperAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PaperAccount0?.setUser)
                {
                    await
                    PaperAccount0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PaperAccount1 = await PaperAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PaperAccount1?.setUser)
                {
                    await
                    PaperAccount1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PaperAccount2 = await PaperAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PaperAccount2?.setUser)
                {
                    await
                    PaperAccount2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PaperAccount3 = await PaperAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PaperAccount3?.setUser)
                {
                    await
                    PaperAccount3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaperOrderWithPaper_account() {
            
                const relatedPaper_account0 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperOrder0 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PaperOrder0?.setPaper_account)
                {
                    await
                    PaperOrder0.
                    setPaper_account(relatedPaper_account0);
                }
            
                const relatedPaper_account1 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperOrder1 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PaperOrder1?.setPaper_account)
                {
                    await
                    PaperOrder1.
                    setPaper_account(relatedPaper_account1);
                }
            
                const relatedPaper_account2 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperOrder2 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PaperOrder2?.setPaper_account)
                {
                    await
                    PaperOrder2.
                    setPaper_account(relatedPaper_account2);
                }
            
                const relatedPaper_account3 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperOrder3 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PaperOrder3?.setPaper_account)
                {
                    await
                    PaperOrder3.
                    setPaper_account(relatedPaper_account3);
                }
            
        }
        
    
        
            
            async function associatePaperOrderWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperOrder0 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PaperOrder0?.setMarket_symbol)
                {
                    await
                    PaperOrder0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperOrder1 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PaperOrder1?.setMarket_symbol)
                {
                    await
                    PaperOrder1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperOrder2 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PaperOrder2?.setMarket_symbol)
                {
                    await
                    PaperOrder2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperOrder3 = await PaperOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PaperOrder3?.setMarket_symbol)
                {
                    await
                    PaperOrder3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaperTradeWithPaper_order() {
            
                const relatedPaper_order0 = await PaperOrders.findOne({
                    offset: Math.floor(Math.random() * (await PaperOrders.count())),
                });
                const PaperTrade0 = await PaperTrades.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PaperTrade0?.setPaper_order)
                {
                    await
                    PaperTrade0.
                    setPaper_order(relatedPaper_order0);
                }
            
                const relatedPaper_order1 = await PaperOrders.findOne({
                    offset: Math.floor(Math.random() * (await PaperOrders.count())),
                });
                const PaperTrade1 = await PaperTrades.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PaperTrade1?.setPaper_order)
                {
                    await
                    PaperTrade1.
                    setPaper_order(relatedPaper_order1);
                }
            
                const relatedPaper_order2 = await PaperOrders.findOne({
                    offset: Math.floor(Math.random() * (await PaperOrders.count())),
                });
                const PaperTrade2 = await PaperTrades.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PaperTrade2?.setPaper_order)
                {
                    await
                    PaperTrade2.
                    setPaper_order(relatedPaper_order2);
                }
            
                const relatedPaper_order3 = await PaperOrders.findOne({
                    offset: Math.floor(Math.random() * (await PaperOrders.count())),
                });
                const PaperTrade3 = await PaperTrades.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PaperTrade3?.setPaper_order)
                {
                    await
                    PaperTrade3.
                    setPaper_order(relatedPaper_order3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaperPositionWithPaper_account() {
            
                const relatedPaper_account0 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperPosition0 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PaperPosition0?.setPaper_account)
                {
                    await
                    PaperPosition0.
                    setPaper_account(relatedPaper_account0);
                }
            
                const relatedPaper_account1 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperPosition1 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PaperPosition1?.setPaper_account)
                {
                    await
                    PaperPosition1.
                    setPaper_account(relatedPaper_account1);
                }
            
                const relatedPaper_account2 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperPosition2 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PaperPosition2?.setPaper_account)
                {
                    await
                    PaperPosition2.
                    setPaper_account(relatedPaper_account2);
                }
            
                const relatedPaper_account3 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PaperPosition3 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PaperPosition3?.setPaper_account)
                {
                    await
                    PaperPosition3.
                    setPaper_account(relatedPaper_account3);
                }
            
        }
        
    
        
            
            async function associatePaperPositionWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperPosition0 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PaperPosition0?.setMarket_symbol)
                {
                    await
                    PaperPosition0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperPosition1 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PaperPosition1?.setMarket_symbol)
                {
                    await
                    PaperPosition1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperPosition2 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PaperPosition2?.setMarket_symbol)
                {
                    await
                    PaperPosition2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const PaperPosition3 = await PaperPositions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PaperPosition3?.setMarket_symbol)
                {
                    await
                    PaperPosition3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePortfolioSnapshotWithPaper_account() {
            
                const relatedPaper_account0 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PortfolioSnapshot0 = await PortfolioSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PortfolioSnapshot0?.setPaper_account)
                {
                    await
                    PortfolioSnapshot0.
                    setPaper_account(relatedPaper_account0);
                }
            
                const relatedPaper_account1 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PortfolioSnapshot1 = await PortfolioSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PortfolioSnapshot1?.setPaper_account)
                {
                    await
                    PortfolioSnapshot1.
                    setPaper_account(relatedPaper_account1);
                }
            
                const relatedPaper_account2 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PortfolioSnapshot2 = await PortfolioSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PortfolioSnapshot2?.setPaper_account)
                {
                    await
                    PortfolioSnapshot2.
                    setPaper_account(relatedPaper_account2);
                }
            
                const relatedPaper_account3 = await PaperAccounts.findOne({
                    offset: Math.floor(Math.random() * (await PaperAccounts.count())),
                });
                const PortfolioSnapshot3 = await PortfolioSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PortfolioSnapshot3?.setPaper_account)
                {
                    await
                    PortfolioSnapshot3.
                    setPaper_account(relatedPaper_account3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateScreenerFilterWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScreenerFilter0 = await ScreenerFilters.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ScreenerFilter0?.setUser)
                {
                    await
                    ScreenerFilter0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScreenerFilter1 = await ScreenerFilters.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ScreenerFilter1?.setUser)
                {
                    await
                    ScreenerFilter1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScreenerFilter2 = await ScreenerFilters.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ScreenerFilter2?.setUser)
                {
                    await
                    ScreenerFilter2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScreenerFilter3 = await ScreenerFilters.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ScreenerFilter3?.setUser)
                {
                    await
                    ScreenerFilter3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateScreenerRunWithScreener_filter() {
            
                const relatedScreener_filter0 = await ScreenerFilters.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerFilters.count())),
                });
                const ScreenerRun0 = await ScreenerRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ScreenerRun0?.setScreener_filter)
                {
                    await
                    ScreenerRun0.
                    setScreener_filter(relatedScreener_filter0);
                }
            
                const relatedScreener_filter1 = await ScreenerFilters.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerFilters.count())),
                });
                const ScreenerRun1 = await ScreenerRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ScreenerRun1?.setScreener_filter)
                {
                    await
                    ScreenerRun1.
                    setScreener_filter(relatedScreener_filter1);
                }
            
                const relatedScreener_filter2 = await ScreenerFilters.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerFilters.count())),
                });
                const ScreenerRun2 = await ScreenerRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ScreenerRun2?.setScreener_filter)
                {
                    await
                    ScreenerRun2.
                    setScreener_filter(relatedScreener_filter2);
                }
            
                const relatedScreener_filter3 = await ScreenerFilters.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerFilters.count())),
                });
                const ScreenerRun3 = await ScreenerRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ScreenerRun3?.setScreener_filter)
                {
                    await
                    ScreenerRun3.
                    setScreener_filter(relatedScreener_filter3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateScreenerResultWithScreener_run() {
            
                const relatedScreener_run0 = await ScreenerRuns.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerRuns.count())),
                });
                const ScreenerResult0 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ScreenerResult0?.setScreener_run)
                {
                    await
                    ScreenerResult0.
                    setScreener_run(relatedScreener_run0);
                }
            
                const relatedScreener_run1 = await ScreenerRuns.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerRuns.count())),
                });
                const ScreenerResult1 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ScreenerResult1?.setScreener_run)
                {
                    await
                    ScreenerResult1.
                    setScreener_run(relatedScreener_run1);
                }
            
                const relatedScreener_run2 = await ScreenerRuns.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerRuns.count())),
                });
                const ScreenerResult2 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ScreenerResult2?.setScreener_run)
                {
                    await
                    ScreenerResult2.
                    setScreener_run(relatedScreener_run2);
                }
            
                const relatedScreener_run3 = await ScreenerRuns.findOne({
                    offset: Math.floor(Math.random() * (await ScreenerRuns.count())),
                });
                const ScreenerResult3 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ScreenerResult3?.setScreener_run)
                {
                    await
                    ScreenerResult3.
                    setScreener_run(relatedScreener_run3);
                }
            
        }
        
    
        
            
            async function associateScreenerResultWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const ScreenerResult0 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ScreenerResult0?.setMarket_symbol)
                {
                    await
                    ScreenerResult0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const ScreenerResult1 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ScreenerResult1?.setMarket_symbol)
                {
                    await
                    ScreenerResult1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const ScreenerResult2 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ScreenerResult2?.setMarket_symbol)
                {
                    await
                    ScreenerResult2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const ScreenerResult3 = await ScreenerResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ScreenerResult3?.setMarket_symbol)
                {
                    await
                    ScreenerResult3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAiChatSessionWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiChatSession0 = await AiChatSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiChatSession0?.setUser)
                {
                    await
                    AiChatSession0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiChatSession1 = await AiChatSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiChatSession1?.setUser)
                {
                    await
                    AiChatSession1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiChatSession2 = await AiChatSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiChatSession2?.setUser)
                {
                    await
                    AiChatSession2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiChatSession3 = await AiChatSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AiChatSession3?.setUser)
                {
                    await
                    AiChatSession3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAiMessageWithAi_chat_session() {
            
                const relatedAi_chat_session0 = await AiChatSessions.findOne({
                    offset: Math.floor(Math.random() * (await AiChatSessions.count())),
                });
                const AiMessage0 = await AiMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiMessage0?.setAi_chat_session)
                {
                    await
                    AiMessage0.
                    setAi_chat_session(relatedAi_chat_session0);
                }
            
                const relatedAi_chat_session1 = await AiChatSessions.findOne({
                    offset: Math.floor(Math.random() * (await AiChatSessions.count())),
                });
                const AiMessage1 = await AiMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiMessage1?.setAi_chat_session)
                {
                    await
                    AiMessage1.
                    setAi_chat_session(relatedAi_chat_session1);
                }
            
                const relatedAi_chat_session2 = await AiChatSessions.findOne({
                    offset: Math.floor(Math.random() * (await AiChatSessions.count())),
                });
                const AiMessage2 = await AiMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiMessage2?.setAi_chat_session)
                {
                    await
                    AiMessage2.
                    setAi_chat_session(relatedAi_chat_session2);
                }
            
                const relatedAi_chat_session3 = await AiChatSessions.findOne({
                    offset: Math.floor(Math.random() * (await AiChatSessions.count())),
                });
                const AiMessage3 = await AiMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AiMessage3?.setAi_chat_session)
                {
                    await
                    AiMessage3.
                    setAi_chat_session(relatedAi_chat_session3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateUserTooltipWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserTooltip0 = await UserTooltips.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserTooltip0?.setUser)
                {
                    await
                    UserTooltip0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserTooltip1 = await UserTooltips.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserTooltip1?.setUser)
                {
                    await
                    UserTooltip1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserTooltip2 = await UserTooltips.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserTooltip2?.setUser)
                {
                    await
                    UserTooltip2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserTooltip3 = await UserTooltips.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (UserTooltip3?.setUser)
                {
                    await
                    UserTooltip3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
            
            async function associateIrCompanyWithMarket_symbol() {
            
                const relatedMarket_symbol0 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const IrCompany0 = await IrCompanies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IrCompany0?.setMarket_symbol)
                {
                    await
                    IrCompany0.
                    setMarket_symbol(relatedMarket_symbol0);
                }
            
                const relatedMarket_symbol1 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const IrCompany1 = await IrCompanies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IrCompany1?.setMarket_symbol)
                {
                    await
                    IrCompany1.
                    setMarket_symbol(relatedMarket_symbol1);
                }
            
                const relatedMarket_symbol2 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const IrCompany2 = await IrCompanies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IrCompany2?.setMarket_symbol)
                {
                    await
                    IrCompany2.
                    setMarket_symbol(relatedMarket_symbol2);
                }
            
                const relatedMarket_symbol3 = await MarketSymbols.findOne({
                    offset: Math.floor(Math.random() * (await MarketSymbols.count())),
                });
                const IrCompany3 = await IrCompanies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IrCompany3?.setMarket_symbol)
                {
                    await
                    IrCompany3.
                    setMarket_symbol(relatedMarket_symbol3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateIrManagementMemberWithIr_company() {
            
                const relatedIr_company0 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrManagementMember0 = await IrManagementMembers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IrManagementMember0?.setIr_company)
                {
                    await
                    IrManagementMember0.
                    setIr_company(relatedIr_company0);
                }
            
                const relatedIr_company1 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrManagementMember1 = await IrManagementMembers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IrManagementMember1?.setIr_company)
                {
                    await
                    IrManagementMember1.
                    setIr_company(relatedIr_company1);
                }
            
                const relatedIr_company2 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrManagementMember2 = await IrManagementMembers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IrManagementMember2?.setIr_company)
                {
                    await
                    IrManagementMember2.
                    setIr_company(relatedIr_company2);
                }
            
                const relatedIr_company3 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrManagementMember3 = await IrManagementMembers.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IrManagementMember3?.setIr_company)
                {
                    await
                    IrManagementMember3.
                    setIr_company(relatedIr_company3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateIrFilingWithIr_company() {
            
                const relatedIr_company0 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFiling0 = await IrFilings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IrFiling0?.setIr_company)
                {
                    await
                    IrFiling0.
                    setIr_company(relatedIr_company0);
                }
            
                const relatedIr_company1 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFiling1 = await IrFilings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IrFiling1?.setIr_company)
                {
                    await
                    IrFiling1.
                    setIr_company(relatedIr_company1);
                }
            
                const relatedIr_company2 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFiling2 = await IrFilings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IrFiling2?.setIr_company)
                {
                    await
                    IrFiling2.
                    setIr_company(relatedIr_company2);
                }
            
                const relatedIr_company3 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFiling3 = await IrFilings.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IrFiling3?.setIr_company)
                {
                    await
                    IrFiling3.
                    setIr_company(relatedIr_company3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateIrDividendWithIr_company() {
            
                const relatedIr_company0 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrDividend0 = await IrDividends.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IrDividend0?.setIr_company)
                {
                    await
                    IrDividend0.
                    setIr_company(relatedIr_company0);
                }
            
                const relatedIr_company1 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrDividend1 = await IrDividends.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IrDividend1?.setIr_company)
                {
                    await
                    IrDividend1.
                    setIr_company(relatedIr_company1);
                }
            
                const relatedIr_company2 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrDividend2 = await IrDividends.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IrDividend2?.setIr_company)
                {
                    await
                    IrDividend2.
                    setIr_company(relatedIr_company2);
                }
            
                const relatedIr_company3 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrDividend3 = await IrDividends.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IrDividend3?.setIr_company)
                {
                    await
                    IrDividend3.
                    setIr_company(relatedIr_company3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateIrAnnouncementWithIr_company() {
            
                const relatedIr_company0 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrAnnouncement0 = await IrAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IrAnnouncement0?.setIr_company)
                {
                    await
                    IrAnnouncement0.
                    setIr_company(relatedIr_company0);
                }
            
                const relatedIr_company1 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrAnnouncement1 = await IrAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IrAnnouncement1?.setIr_company)
                {
                    await
                    IrAnnouncement1.
                    setIr_company(relatedIr_company1);
                }
            
                const relatedIr_company2 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrAnnouncement2 = await IrAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IrAnnouncement2?.setIr_company)
                {
                    await
                    IrAnnouncement2.
                    setIr_company(relatedIr_company2);
                }
            
                const relatedIr_company3 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrAnnouncement3 = await IrAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IrAnnouncement3?.setIr_company)
                {
                    await
                    IrAnnouncement3.
                    setIr_company(relatedIr_company3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateIrFinancialStatementSummaryWithIr_company() {
            
                const relatedIr_company0 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFinancialStatementSummary0 = await IrFinancialStatementSummaries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IrFinancialStatementSummary0?.setIr_company)
                {
                    await
                    IrFinancialStatementSummary0.
                    setIr_company(relatedIr_company0);
                }
            
                const relatedIr_company1 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFinancialStatementSummary1 = await IrFinancialStatementSummaries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IrFinancialStatementSummary1?.setIr_company)
                {
                    await
                    IrFinancialStatementSummary1.
                    setIr_company(relatedIr_company1);
                }
            
                const relatedIr_company2 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFinancialStatementSummary2 = await IrFinancialStatementSummaries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IrFinancialStatementSummary2?.setIr_company)
                {
                    await
                    IrFinancialStatementSummary2.
                    setIr_company(relatedIr_company2);
                }
            
                const relatedIr_company3 = await IrCompanies.findOne({
                    offset: Math.floor(Math.random() * (await IrCompanies.count())),
                });
                const IrFinancialStatementSummary3 = await IrFinancialStatementSummaries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IrFinancialStatementSummary3?.setIr_company)
                {
                    await
                    IrFinancialStatementSummary3.
                    setIr_company(relatedIr_company3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
            
            async function associateAuditEventWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent0 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditEvent0?.setUser)
                {
                    await
                    AuditEvent0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent1 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditEvent1?.setUser)
                {
                    await
                    AuditEvent1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent2 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditEvent2?.setUser)
                {
                    await
                    AuditEvent2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent3 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditEvent3?.setUser)
                {
                    await
                    AuditEvent3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await ApiProviders.bulkCreate(ApiProvidersData);
                
            
            
                
                await MarketSymbols.bulkCreate(MarketSymbolsData);
                
            
            
                
                await SymbolFundamentals.bulkCreate(SymbolFundamentalsData);
                
            
            
                
                await PriceQuotes.bulkCreate(PriceQuotesData);
                
            
            
                
                await TechnicalIndicators.bulkCreate(TechnicalIndicatorsData);
                
            
            
                
                await AnalystRatings.bulkCreate(AnalystRatingsData);
                
            
            
                
                await EarningsReports.bulkCreate(EarningsReportsData);
                
            
            
                
                await NewsArticles.bulkCreate(NewsArticlesData);
                
            
            
                
                await NewsArticleSymbols.bulkCreate(NewsArticleSymbolsData);
                
            
            
                
                await ArticleBookmarks.bulkCreate(ArticleBookmarksData);
                
            
            
                
                await Watchlists.bulkCreate(WatchlistsData);
                
            
            
                
                await WatchlistItems.bulkCreate(WatchlistItemsData);
                
            
            
                
                await PaperAccounts.bulkCreate(PaperAccountsData);
                
            
            
                
                await PaperOrders.bulkCreate(PaperOrdersData);
                
            
            
                
                await PaperTrades.bulkCreate(PaperTradesData);
                
            
            
                
                await PaperPositions.bulkCreate(PaperPositionsData);
                
            
            
                
                await PortfolioSnapshots.bulkCreate(PortfolioSnapshotsData);
                
            
            
                
                await ScreenerFilters.bulkCreate(ScreenerFiltersData);
                
            
            
                
                await ScreenerRuns.bulkCreate(ScreenerRunsData);
                
            
            
                
                await ScreenerResults.bulkCreate(ScreenerResultsData);
                
            
            
                
                await AiChatSessions.bulkCreate(AiChatSessionsData);
                
            
            
                
                await AiMessages.bulkCreate(AiMessagesData);
                
            
            
                
                await LearningModules.bulkCreate(LearningModulesData);
                
            
            
                
                await UserTooltips.bulkCreate(UserTooltipsData);
                
            
            
                
                await IrCompanies.bulkCreate(IrCompaniesData);
                
            
            
                
                await IrManagementMembers.bulkCreate(IrManagementMembersData);
                
            
            
                
                await IrFilings.bulkCreate(IrFilingsData);
                
            
            
                
                await IrDividends.bulkCreate(IrDividendsData);
                
            
            
                
                await IrAnnouncements.bulkCreate(IrAnnouncementsData);
                
            
            
                
                await IrFinancialStatementSummaries.bulkCreate(IrFinancialStatementSummariesData);
                
            
            
                
                await AuditEvents.bulkCreate(AuditEventsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateSymbolFundamentalWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePriceQuoteWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateTechnicalIndicatorWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAnalystRatingWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateEarningsReportWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateNewsArticleSymbolWithNews_article(),
                    
                
                    
                        
                        await associateNewsArticleSymbolWithMarket_symbol(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateArticleBookmarkWithUser(),
                    
                
                    
                        
                        await associateArticleBookmarkWithNews_article(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateWatchlistWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateWatchlistItemWithWatchlist(),
                    
                
                    
                        
                        await associateWatchlistItemWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaperAccountWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaperOrderWithPaper_account(),
                    
                
                    
                        
                        await associatePaperOrderWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaperTradeWithPaper_order(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaperPositionWithPaper_account(),
                    
                
                    
                        
                        await associatePaperPositionWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePortfolioSnapshotWithPaper_account(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateScreenerFilterWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateScreenerRunWithScreener_filter(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateScreenerResultWithScreener_run(),
                    
                
                    
                        
                        await associateScreenerResultWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAiChatSessionWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAiMessageWithAi_chat_session(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateUserTooltipWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                        
                        await associateIrCompanyWithMarket_symbol(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateIrManagementMemberWithIr_company(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateIrFilingWithIr_company(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateIrDividendWithIr_company(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateIrAnnouncementWithIr_company(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateIrFinancialStatementSummaryWithIr_company(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                        
                        await associateAuditEventWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('api_providers', null, {});
            
            
            await queryInterface.bulkDelete('market_symbols', null, {});
            
            
            await queryInterface.bulkDelete('symbol_fundamentals', null, {});
            
            
            await queryInterface.bulkDelete('price_quotes', null, {});
            
            
            await queryInterface.bulkDelete('technical_indicators', null, {});
            
            
            await queryInterface.bulkDelete('analyst_ratings', null, {});
            
            
            await queryInterface.bulkDelete('earnings_reports', null, {});
            
            
            await queryInterface.bulkDelete('news_articles', null, {});
            
            
            await queryInterface.bulkDelete('news_article_symbols', null, {});
            
            
            await queryInterface.bulkDelete('article_bookmarks', null, {});
            
            
            await queryInterface.bulkDelete('watchlists', null, {});
            
            
            await queryInterface.bulkDelete('watchlist_items', null, {});
            
            
            await queryInterface.bulkDelete('paper_accounts', null, {});
            
            
            await queryInterface.bulkDelete('paper_orders', null, {});
            
            
            await queryInterface.bulkDelete('paper_trades', null, {});
            
            
            await queryInterface.bulkDelete('paper_positions', null, {});
            
            
            await queryInterface.bulkDelete('portfolio_snapshots', null, {});
            
            
            await queryInterface.bulkDelete('screener_filters', null, {});
            
            
            await queryInterface.bulkDelete('screener_runs', null, {});
            
            
            await queryInterface.bulkDelete('screener_results', null, {});
            
            
            await queryInterface.bulkDelete('ai_chat_sessions', null, {});
            
            
            await queryInterface.bulkDelete('ai_messages', null, {});
            
            
            await queryInterface.bulkDelete('learning_modules', null, {});
            
            
            await queryInterface.bulkDelete('user_tooltips', null, {});
            
            
            await queryInterface.bulkDelete('ir_companies', null, {});
            
            
            await queryInterface.bulkDelete('ir_management_members', null, {});
            
            
            await queryInterface.bulkDelete('ir_filings', null, {});
            
            
            await queryInterface.bulkDelete('ir_dividends', null, {});
            
            
            await queryInterface.bulkDelete('ir_announcements', null, {});
            
            
            await queryInterface.bulkDelete('ir_financial_statement_summaries', null, {});
            
            
            await queryInterface.bulkDelete('audit_events', null, {});
            
        
    },
};