





















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






const Organizations = db.organizations;

const Workspaces = db.workspaces;

const WorkspaceMemberships = db.workspace_memberships;

const Projects = db.projects;

const MindMaps = db.mind_maps;

const MapNodes = db.map_nodes;

const MapEdges = db.map_edges;

const SourceItems = db.source_items;

const NodeEvidenceItems = db.node_evidence_items;

const AiRuns = db.ai_runs;

const BusinessPlanVersions = db.business_plan_versions;

const PitchDecks = db.pitch_decks;

const DealPackages = db.deal_packages;

const PartnerTargets = db.partner_targets;

const Tasks = db.tasks;







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



const WorkspacesData = [
    
    {
    
        
        
            
                "name": "Northstar Foundry",
            
        
    
        
        
            
                "slug": "northstar-foundry",
            
        
    
        
        
            
                "description": "Workspace for acquisition entrepreneurship and investor-ready planning.",
            
        
    
        
        
            
                "plan_tier": "enterprise",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "trial_ends_at": new Date('2026-03-20T00:00:00Z'),
            
        
    
        
        
            
                "billing_period_ends_at": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Venture Studio Lab",
            
        
    
        
        
            
                "slug": "venture-studio-lab",
            
        
    
        
        
            
                "description": "Studio workspace for generating venture concepts and validating markets.",
            
        
    
        
        
            
                "plan_tier": "enterprise",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "trial_ends_at": new Date('2026-03-10T00:00:00Z'),
            
        
    
        
        
            
                "billing_period_ends_at": new Date('2026-04-10T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Operator Partners",
            
        
    
        
        
            
                "slug": "operator-partners",
            
        
    
        
        
            
                "description": "Partnership-focused workspace for vendor finance and JV structures.",
            
        
    
        
        
            
                "plan_tier": "free",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "trial_ends_at": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                "billing_period_ends_at": new Date('2026-04-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Solo Builder Hub",
            
        
    
        
        
            
                "slug": "solo-builder-hub",
            
        
    
        
        
            
                "description": "Personal workspace for iterating on a single flagship business.",
            
        
    
        
        
            
                "plan_tier": "enterprise",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "trial_ends_at": new Date('2026-03-07T00:00:00Z'),
            
        
    
        
        
            
                "billing_period_ends_at": new Date('2026-04-07T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WorkspaceMembershipsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "member",
            
        
    
        
        
            
                "status": "removed",
            
        
    
        
        
            
                "invited_at": new Date('2026-01-10T10:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-01-10T10:15:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "owner",
            
        
    
        
        
            
                "status": "invited",
            
        
    
        
        
            
                "invited_at": new Date('2026-01-12T09:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-01-12T09:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "member",
            
        
    
        
        
            
                "status": "invited",
            
        
    
        
        
            
                "invited_at": new Date('2026-01-15T14:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-01-15T14:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "member",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "invited_at": new Date('2026-02-01T16:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-02-05T11:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ProjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "HVAC Maintenance Roll-Up",
            
        
    
        
        
            
                "summary": "Acquire and consolidate regional HVAC maintenance contracts with a subscription model.",
            
        
    
        
        
            
                "project_type": "acquisition",
            
        
    
        
        
            
                "status": "launched",
            
        
    
        
        
            
                "industry": "Facilities Services",
            
        
    
        
        
            
                "target_market": "SMBs and property managers in metro regions.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "AI Ops Assistant for Clinics",
            
        
    
        
        
            
                "summary": "Workflow automation and patient intake optimization for small clinics.",
            
        
    
        
        
            
                "project_type": "acquisition",
            
        
    
        
        
            
                "status": "planning",
            
        
    
        
        
            
                "industry": "Healthcare SaaS",
            
        
    
        
        
            
                "target_market": "Independent primary care and dental clinics.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Vendor-Financed Logistics Partner",
            
        
    
        
        
            
                "summary": "Structure a vendor-financed acquisition of a small logistics company with earn-out protections.",
            
        
    
        
        
            
                "project_type": "partnership",
            
        
    
        
        
            
                "status": "negotiation",
            
        
    
        
        
            
                "industry": "Logistics",
            
        
    
        
        
            
                "target_market": "Owner-operated regional carriers.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Sustainable Packaging Expansion",
            
        
    
        
        
            
                "summary": "Expand into compostable packaging via distribution partnerships and licensing.",
            
        
    
        
        
            
                "project_type": "startup",
            
        
    
        
        
            
                "status": "fundraising",
            
        
    
        
        
            
                "industry": "Manufacturing",
            
        
    
        
        
            
                "target_market": "D2C brands and food service distributors.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MindMapsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "HVAC Roll-Up Model Map",
            
        
    
        
        
            
                "description": "Business model map focused on acquisition thesis, integration plan, and unit economics.",
            
        
    
        
        
            
                "status": "frozen",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Clinic Ops Automation Map",
            
        
    
        
        
            
                "description": "Map of workflows, integrations, and monetization paths.",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Logistics Vendor Finance Strategy Map",
            
        
    
        
        
            
                "description": "Deal structure options and risk mitigations for seller financing.",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Packaging GTM Map",
            
        
    
        
        
            
                "description": "Channels, partners, and pricing ladder for sustainable packaging.",
            
        
    
        
        
            
                "status": "frozen",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MapNodesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Target customer segment",
            
        
    
        
        
            
                "node_type": "customer_segment",
            
        
    
        
        
            
                "content": "Property managers and mid-sized commercial building owners seeking predictable HVAC maintenance.",
            
        
    
        
        
            
                "x_position": 120.5,
            
        
    
        
        
            
                "y_position": 80.25,
            
        
    
        
        
            
                "confidence_level": "medium",
            
        
    
        
        
            
                "ai_generated": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Core value proposition",
            
        
    
        
        
            
                "node_type": "milestone",
            
        
    
        
        
            
                "content": "Reduce downtime with proactive maintenance, 24 hour response SLAs, and clear subscription pricing.",
            
        
    
        
        
            
                "x_position": 320,
            
        
    
        
        
            
                "y_position": 82.75,
            
        
    
        
        
            
                "confidence_level": "low",
            
        
    
        
        
            
                "ai_generated": true,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Primary channel",
            
        
    
        
        
            
                "node_type": "assumption",
            
        
    
        
        
            
                "content": "Direct outreach to property management firms and referral partnerships with builders.",
            
        
    
        
        
            
                "x_position": 520.25,
            
        
    
        
        
            
                "y_position": 90,
            
        
    
        
        
            
                "confidence_level": "high",
            
        
    
        
        
            
                "ai_generated": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Key risk",
            
        
    
        
        
            
                "node_type": "metric",
            
        
    
        
        
            
                "content": "Integration risk across acquired operators and inconsistent service quality impacting renewals.",
            
        
    
        
        
            
                "x_position": 260.75,
            
        
    
        
        
            
                "y_position": 240.5,
            
        
    
        
        
            
                "confidence_level": "high",
            
        
    
        
        
            
                "ai_generated": true,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MapEdgesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "from_node_key": "node-1",
            
        
    
        
        
            
                "to_node_key": "node-2",
            
        
    
        
        
            
                "relation_type": "precedes",
            
        
    
        
        
            
                "reasoning": "Customer segment pain around downtime supports a subscription-based value proposition.",
            
        
    
        
        
            
                "strength": "weak",
            
        
    
        
        
            
                "ai_generated": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "from_node_key": "node-2",
            
        
    
        
        
            
                "to_node_key": "node-3",
            
        
    
        
        
            
                "relation_type": "supports",
            
        
    
        
        
            
                "reasoning": "Clear value proposition enables outbound and partner channel messaging and targeting.",
            
        
    
        
        
            
                "strength": "weak",
            
        
    
        
        
            
                "ai_generated": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "from_node_key": "node-4",
            
        
    
        
        
            
                "to_node_key": "node-5",
            
        
    
        
        
            
                "relation_type": "supports",
            
        
    
        
        
            
                "reasoning": "Standardized onboarding and QA processes mitigate integration risk while protecting renewals.",
            
        
    
        
        
            
                "strength": "weak",
            
        
    
        
        
            
                "ai_generated": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "from_node_key": "node-3",
            
        
    
        
        
            
                "to_node_key": "node-5",
            
        
    
        
        
            
                "relation_type": "contradicts",
            
        
    
        
        
            
                "reasoning": "Channel partnerships support recurring revenue growth through referrals and renewals.",
            
        
    
        
        
            
                "strength": "weak",
            
        
    
        
        
            
                "ai_generated": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SourceItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "ppt",
            
        
    
        
        
            
                "title": "Subscription pricing benchmarks for field services",
            
        
    
        
        
            
                "url": "https://example.com/field-services-subscription-benchmarks",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "raw_text": "Key points about subscription pricing models for HVAC maintenance and service contracts.",
            
        
    
        
        
            
                "extracted_summary": "Summarizes common pricing tiers, churn drivers, and service level implications.",
            
        
    
        
        
            
                "ingestion_status": "processing",
            
        
    
        
        
            
                "ingested_at": new Date('2026-03-01T10:30:00Z'),
            
        
    
        
        
            
                "tags": "pricing,field-services,subscriptions",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "url",
            
        
    
        
        
            
                "title": "Clinic intake workflow report",
            
        
    
        
        
            
                "url": "https://example.com/clinic-intake-report",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "raw_text": "Extracted notes on clinic intake bottlenecks and automation opportunities.",
            
        
    
        
        
            
                "extracted_summary": "Highlights high-impact automation steps and common EHR integration constraints.",
            
        
    
        
        
            
                "ingestion_status": "processing",
            
        
    
        
        
            
                "ingested_at": new Date('2026-03-02T09:10:00Z'),
            
        
    
        
        
            
                "tags": "healthcare,workflow,integrations",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "text_note",
            
        
    
        
        
            
                "title": "Vendor financing deal structure examples",
            
        
    
        
        
            
                "url": "https://example.com/vendor-financing-examples",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "raw_text": "Overview of seller notes, earn-outs, and key legal considerations in vendor finance deals.",
            
        
    
        
        
            
                "extracted_summary": "Provides structure patterns, risk mitigations, and negotiation levers.",
            
        
    
        
        
            
                "ingestion_status": "processing",
            
        
    
        
        
            
                "ingested_at": new Date('2026-03-03T15:45:00Z'),
            
        
    
        
        
            
                "tags": "vendor-finance,acquisition,deal-structure",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "spreadsheet",
            
        
    
        
        
            
                "title": "Competitor notes for compliance tracking tools",
            
        
    
        
        
            
                "url": "https://example.com/compliance-competitors",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "raw_text": "Competitors include lightweight compliance checklists and full ERP add-ons; many lack reminders.",
            
        
    
        
        
            
                "extracted_summary": "Competitor landscape and gaps for small contractor compliance tracking.",
            
        
    
        
        
            
                "ingestion_status": "queued",
            
        
    
        
        
            
                "ingested_at": new Date('2026-03-04T11:20:00Z'),
            
        
    
        
        
            
                "tags": "competitive-analysis,compliance,saas",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const NodeEvidenceItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "excerpt": "Service contracts reduce seasonal revenue volatility and increase LTV via renewals.",
            
        
    
        
        
            
                "notes": "Use as justification for subscription-first GTM in the plan.",
            
        
    
        
        
            
                "relevance": "medium",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "excerpt": "Automation wins: pre-visit forms and insurance capture reduce front desk load.",
            
        
    
        
        
            
                "notes": "Map to product MVP scope and integration requirements.",
            
        
    
        
        
            
                "relevance": "low",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "excerpt": "Seller note with performance covenant can align incentives and reduce upfront cash need.",
            
        
    
        
        
            
                "notes": "Include as recommended baseline structure with downside protections.",
            
        
    
        
        
            
                "relevance": "low",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "excerpt": "Most small-business tools lack audit-ready exports and recurring reminders.",
            
        
    
        
        
            
                "notes": "Differentiator for compliance micro-SaaS positioning.",
            
        
    
        
        
            
                "relevance": "high",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AiRunsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_type": "summarize_sources",
            
        
    
        
        
            
                "status": "running",
            
        
    
        
        
            
                "prompt": "Expand the HVAC acquisition thesis into a complete operating model mind map with risks and mitigations.",
            
        
    
        
        
            
                "result_text": "Added nodes for integration playbook, churn drivers, unit economics, and hiring plan.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "cost_usd": 2.45,
            
        
    
        
        
            
                "tokens_in": 1800,
            
        
    
        
        
            
                "tokens_out": 2200,
            
        
    
        
        
            
                "started_at": new Date('2026-03-01T10:40:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-03-01T10:42:10Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_type": "generate_pitch_deck_outline",
            
        
    
        
        
            
                "status": "canceled",
            
        
    
        
        
            
                "prompt": "Generate an investor-ready business plan for AI Ops Assistant for Clinics including market, GTM, and 3 year financial assumptions.",
            
        
    
        
        
            
                "result_text": "Produced full plan draft with executive summary, product, GTM, ops plan, risks, and KPI targets.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "cost_usd": 4.9,
            
        
    
        
        
            
                "tokens_in": 3200,
            
        
    
        
        
            
                "tokens_out": 4100,
            
        
    
        
        
            
                "started_at": new Date('2026-03-02T09:20:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-03-02T09:24:45Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_type": "suggest_missing_nodes",
            
        
    
        
        
            
                "status": "canceled",
            
        
    
        
        
            
                "prompt": "Propose vendor-financed acquisition structure for a regional logistics business with risk mitigations and next steps.",
            
        
    
        
        
            
                "result_text": "Recommended seller note, earn-out triggers, diligence checklist, and covenant package.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "cost_usd": 1.85,
            
        
    
        
        
            
                "tokens_in": 1400,
            
        
    
        
        
            
                "tokens_out": 1600,
            
        
    
        
        
            
                "started_at": new Date('2026-03-03T16:10:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-03-03T16:12:20Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_type": "financial_model_outline",
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "prompt": "Critique the sustainable packaging expansion plan for risks and weak assumptions.",
            
        
    
        
        
            
                "result_text": "Run failed due to source ingestion error; retry after sources are reprocessed.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "cost_usd": 0.2,
            
        
    
        
        
            
                "tokens_in": 300,
            
        
    
        
        
            
                "tokens_out": 0,
            
        
    
        
        
            
                "started_at": new Date('2026-03-04T18:20:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-03-04T18:20:40Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BusinessPlanVersionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "AI Ops Assistant Plan v1",
            
        
    
        
        
            
                "audience": "strategic_partner",
            
        
    
        
        
            
                "stage": "final",
            
        
    
        
        
            
                "executive_summary": "Automation platform for small clinics to reduce admin time and improve patient intake conversion.",
            
        
    
        
        
            
                "full_plan": "Full business plan draft covering market analysis, product, GTM, operations, and 3 year projections.",
            
        
    
        
        
            
                "assumptions": "Assumes 250 USD monthly ARPA, 3 percent monthly churn, 6 month payback target.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-02T09:25:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "HVAC Roll-Up Investor Plan v2",
            
        
    
        
        
            
                "audience": "seller_owner",
            
        
    
        
        
            
                "stage": "review",
            
        
    
        
        
            
                "executive_summary": "Acquire profitable HVAC maintenance operators and expand recurring revenue through subscriptions.",
            
        
    
        
        
            
                "full_plan": "Includes acquisition criteria, integration playbook, pricing, sales motion, and unit economics.",
            
        
    
        
        
            
                "assumptions": "Assumes 4.0x EBITDA purchase multiple and 15 percent margin improvement post integration.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-03T11:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Logistics Seller Meeting Plan",
            
        
    
        
        
            
                "audience": "seller_owner",
            
        
    
        
        
            
                "stage": "review",
            
        
    
        
        
            
                "executive_summary": "Proposal for a vendor-financed transition preserving legacy operations and staff stability.",
            
        
    
        
        
            
                "full_plan": "Explains transition timeline, continuity plan, vendor finance terms, and governance approach.",
            
        
    
        
        
            
                "assumptions": "Assumes 20 percent down payment and seller note amortized over 60 months.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-03T16:15:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Packaging Expansion Partner Brief",
            
        
    
        
        
            
                "audience": "seller_owner",
            
        
    
        
        
            
                "stage": "final",
            
        
    
        
        
            
                "executive_summary": "Distribution partnership proposal to scale compostable packaging into new regions.",
            
        
    
        
        
            
                "full_plan": "Covers channel roles, incentives, pricing ladder, and operational requirements.",
            
        
    
        
        
            
                "assumptions": "Assumes partner margin of 18 percent and minimum quarterly volume commitments.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-04T18:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PitchDecksData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "HVAC Roll-Up Deck Outline",
            
        
    
        
        
            
                "status": "final",
            
        
    
        
        
            
                "deck_outline": "Slides: Title, Problem, Market, Thesis, Acquisition Criteria, Integration, Unit Economics, GTM, Competition, Team, Financials, Ask.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-04T09:26:20Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Clinic Ops Assistant Seed Deck",
            
        
    
        
        
            
                "status": "final",
            
        
    
        
        
            
                "deck_outline": "Slides: Title, Problem, Solution, Product, Market, Traction Plan, Business Model, GTM, Moat, Team, Financials, Use of Funds.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-02T09:26:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Logistics Vendor Finance Deck",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "deck_outline": "Slides: Overview, Target Profile, Deal Terms, Transition Plan, Risk Mitigation, Financial Snapshot, Timeline, Next Steps.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-03T16:16:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Packaging Partnership Deck",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "deck_outline": "Slides: Market Timing, Product Line, Partner Value, Channel Plan, Commercial Terms, Operations, Risks, Next Steps.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "generated_at": new Date('2026-03-04T18:12:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DealPackagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Logistics Vendor Finance Base Terms",
            
        
    
        
        
            
                "deal_type": "share_purchase",
            
        
    
        
        
            
                "status": "ready",
            
        
    
        
        
            
                "target_price": 1800000,
            
        
    
        
        
            
                "down_payment": 180000,
            
        
    
        
        
            
                "seller_note_amount": 1440000,
            
        
    
        
        
            
                "interest_rate": 7.5,
            
        
    
        
        
            
                "term_months": 60,
            
        
    
        
        
            
                "structure_overview": "Seller note with 24 month interest-only period, earn-out tied to retained accounts, and working capital peg.",
            
        
    
        
        
            
                "risk_factors": "Customer concentration, fuel price volatility, driver retention, deferred maintenance.",
            
        
    
        
        
            
                "next_steps": "Confirm add-backs, validate contracts, draft LOI, outline transition services.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                "created_at_time": new Date('2026-03-03T16:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "HVAC Asset Purchase Proposal",
            
        
    
        
        
            
                "deal_type": "share_purchase",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "target_price": 1200000,
            
        
    
        
        
            
                "down_payment": 240000,
            
        
    
        
        
            
                "seller_note_amount": 720000,
            
        
    
        
        
            
                "interest_rate": 8,
            
        
    
        
        
            
                "term_months": 48,
            
        
    
        
        
            
                "structure_overview": "Asset purchase with seller note and holdback contingent on customer retention at 90 days.",
            
        
    
        
        
            
                "risk_factors": "Service quality variance, tech stack fragmentation, seasonal demand swings.",
            
        
    
        
        
            
                "next_steps": "Site visit, review maintenance logs, validate churn and renewal terms.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                "created_at_time": new Date('2026-03-02T14:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Packaging Distribution Joint Venture",
            
        
    
        
        
            
                "deal_type": "joint_venture",
            
        
    
        
        
            
                "status": "ready",
            
        
    
        
        
            
                "target_price": 0,
            
        
    
        
        
            
                "down_payment": 0,
            
        
    
        
        
            
                "seller_note_amount": 0,
            
        
    
        
        
            
                "interest_rate": 0,
            
        
    
        
        
            
                "term_months": 0,
            
        
    
        
        
            
                "structure_overview": "JV with regional distributor to co-market and share margin on compostable packaging line.",
            
        
    
        
        
            
                "risk_factors": "Channel conflict, supply constraints, price sensitivity, compliance requirements.",
            
        
    
        
        
            
                "next_steps": "Define territories, set volume targets, agree on marketing commitments.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                "created_at_time": new Date('2026-03-04T17:50:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Clinic Integrations Strategic Partnership",
            
        
    
        
        
            
                "deal_type": "share_purchase",
            
        
    
        
        
            
                "status": "in_review",
            
        
    
        
        
            
                "target_price": 0,
            
        
    
        
        
            
                "down_payment": 0,
            
        
    
        
        
            
                "seller_note_amount": 0,
            
        
    
        
        
            
                "interest_rate": 0,
            
        
    
        
        
            
                "term_months": 0,
            
        
    
        
        
            
                "structure_overview": "Partner with EHR integrator to co-sell automation modules to independent clinics.",
            
        
    
        
        
            
                "risk_factors": "Integration complexity, sales cycle length, dependency on partner roadmap.",
            
        
    
        
        
            
                "next_steps": "Map integration endpoints, propose revenue share, run pilot with two clinics.",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                "created_at_time": new Date('2026-03-02T09:50:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PartnerTargetsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Summit Regional Logistics",
            
        
    
        
        
            
                "partner_type": "investor",
            
        
    
        
        
            
                "website_url": "https://example.com/summit-logistics",
            
        
    
        
        
            
                "contact_name": "Jordan Lee",
            
        
    
        
        
            
                "contact_email": "jordan.lee@summitlogistics.example",
            
        
    
        
        
            
                "notes": "Owner nearing retirement; open to seller note if transition plan is strong.",
            
        
    
        
        
            
                "status": "contacted",
            
        
    
        
        
            
                "last_contact_at": new Date('2026-03-01T13:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "BlueRiver Property Management",
            
        
    
        
        
            
                "partner_type": "advisor",
            
        
    
        
        
            
                "website_url": "https://example.com/blueriver-pm",
            
        
    
        
        
            
                "contact_name": "Taylor Morgan",
            
        
    
        
        
            
                "contact_email": "taylor.morgan@blueriverpm.example",
            
        
    
        
        
            
                "notes": "Potential referral partner for HVAC subscription maintenance contracts.",
            
        
    
        
        
            
                "status": "in_talks",
            
        
    
        
        
            
                "last_contact_at": new Date('2026-02-26T16:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "EHR Integration Co",
            
        
    
        
        
            
                "partner_type": "strategic_partner",
            
        
    
        
        
            
                "website_url": "https://example.com/ehr-integration-co",
            
        
    
        
        
            
                "contact_name": "Casey Nguyen",
            
        
    
        
        
            
                "contact_email": "casey.nguyen@ehrintegration.example",
            
        
    
        
        
            
                "notes": "Strong relationships with small clinics; propose co-sell and integration bundle.",
            
        
    
        
        
            
                "status": "in_talks",
            
        
    
        
        
            
                "last_contact_at": new Date('2026-02-20T09:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "GreenPack Distribution",
            
        
    
        
        
            
                "partner_type": "distributor",
            
        
    
        
        
            
                "website_url": "https://example.com/greenpack",
            
        
    
        
        
            
                "contact_name": "Riley Shah",
            
        
    
        
        
            
                "contact_email": "riley.shah@greenpack.example",
            
        
    
        
        
            
                "notes": "Regional distributor with interest in compostable packaging SKUs.",
            
        
    
        
        
            
                "status": "in_talks",
            
        
    
        
        
            
                "last_contact_at": new Date('2026-03-04T10:45:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TasksData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Define acquisition criteria and screening checklist",
            
        
    
        
        
            
                "description": "Create criteria for target HVAC operators including margin, contracts, geography, and staffing.",
            
        
    
        
        
            
                "priority": "medium",
            
        
    
        
        
            
                "status": "backlog",
            
        
    
        
        
            
                "due_at": new Date('2026-03-12T17:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "ai_suggested": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Draft clinic MVP integration requirements",
            
        
    
        
        
            
                "description": "Document required EHR integration points and data flow constraints for the first release.",
            
        
    
        
        
            
                "priority": "high",
            
        
    
        
        
            
                "status": "in_progress",
            
        
    
        
        
            
                "due_at": new Date('2026-03-15T17:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "ai_suggested": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Prepare vendor finance LOI term sheet",
            
        
    
        
        
            
                "description": "Create a clear LOI with seller note terms, covenants, diligence timeline, and transition services.",
            
        
    
        
        
            
                "priority": "urgent",
            
        
    
        
        
            
                "status": "backlog",
            
        
    
        
        
            
                "due_at": new Date('2026-03-08T12:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "ai_suggested": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Build 3 year financial model assumptions",
            
        
    
        
        
            
                "description": "Compile pricing, churn, CAC, and staffing assumptions and align them with the business plan narrative.",
            
        
    
        
        
            
                "priority": "medium",
            
        
    
        
        
            
                "status": "backlog",
            
        
    
        
        
            
                "due_at": new Date('2026-03-20T17:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "ai_suggested": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




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

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateWorkspaceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace0 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Workspace0?.setOrganization)
                {
                    await
                    Workspace0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace1 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Workspace1?.setOrganization)
                {
                    await
                    Workspace1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace2 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Workspace2?.setOrganization)
                {
                    await
                    Workspace2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace3 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Workspace3?.setOrganization)
                {
                    await
                    Workspace3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

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

    
    
    
        
            
            async function associateProjectWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Project0 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Project0?.setWorkspace)
                {
                    await
                    Project0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Project1 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Project1?.setWorkspace)
                {
                    await
                    Project1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Project2 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Project2?.setWorkspace)
                {
                    await
                    Project2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Project3 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Project3?.setWorkspace)
                {
                    await
                    Project3.
                    setWorkspace(relatedWorkspace3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateProjectWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project0 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Project0?.setOrganization)
                {
                    await
                    Project0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project1 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Project1?.setOrganization)
                {
                    await
                    Project1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project2 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Project2?.setOrganization)
                {
                    await
                    Project2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project3 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Project3?.setOrganization)
                {
                    await
                    Project3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMindMapWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const MindMap0 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MindMap0?.setProject)
                {
                    await
                    MindMap0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const MindMap1 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MindMap1?.setProject)
                {
                    await
                    MindMap1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const MindMap2 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MindMap2?.setProject)
                {
                    await
                    MindMap2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const MindMap3 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MindMap3?.setProject)
                {
                    await
                    MindMap3.
                    setProject(relatedProject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateMindMapWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MindMap0 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MindMap0?.setOrganization)
                {
                    await
                    MindMap0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MindMap1 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MindMap1?.setOrganization)
                {
                    await
                    MindMap1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MindMap2 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MindMap2?.setOrganization)
                {
                    await
                    MindMap2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MindMap3 = await MindMaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MindMap3?.setOrganization)
                {
                    await
                    MindMap3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMapNodeWithMind_map() {
            
                const relatedMind_map0 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapNode0 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MapNode0?.setMind_map)
                {
                    await
                    MapNode0.
                    setMind_map(relatedMind_map0);
                }
            
                const relatedMind_map1 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapNode1 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MapNode1?.setMind_map)
                {
                    await
                    MapNode1.
                    setMind_map(relatedMind_map1);
                }
            
                const relatedMind_map2 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapNode2 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MapNode2?.setMind_map)
                {
                    await
                    MapNode2.
                    setMind_map(relatedMind_map2);
                }
            
                const relatedMind_map3 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapNode3 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MapNode3?.setMind_map)
                {
                    await
                    MapNode3.
                    setMind_map(relatedMind_map3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateMapNodeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapNode0 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MapNode0?.setOrganization)
                {
                    await
                    MapNode0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapNode1 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MapNode1?.setOrganization)
                {
                    await
                    MapNode1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapNode2 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MapNode2?.setOrganization)
                {
                    await
                    MapNode2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapNode3 = await MapNodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MapNode3?.setOrganization)
                {
                    await
                    MapNode3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMapEdgeWithMind_map() {
            
                const relatedMind_map0 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapEdge0 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MapEdge0?.setMind_map)
                {
                    await
                    MapEdge0.
                    setMind_map(relatedMind_map0);
                }
            
                const relatedMind_map1 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapEdge1 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MapEdge1?.setMind_map)
                {
                    await
                    MapEdge1.
                    setMind_map(relatedMind_map1);
                }
            
                const relatedMind_map2 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapEdge2 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MapEdge2?.setMind_map)
                {
                    await
                    MapEdge2.
                    setMind_map(relatedMind_map2);
                }
            
                const relatedMind_map3 = await MindMaps.findOne({
                    offset: Math.floor(Math.random() * (await MindMaps.count())),
                });
                const MapEdge3 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MapEdge3?.setMind_map)
                {
                    await
                    MapEdge3.
                    setMind_map(relatedMind_map3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMapEdgeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapEdge0 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MapEdge0?.setOrganization)
                {
                    await
                    MapEdge0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapEdge1 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MapEdge1?.setOrganization)
                {
                    await
                    MapEdge1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapEdge2 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MapEdge2?.setOrganization)
                {
                    await
                    MapEdge2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MapEdge3 = await MapEdges.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MapEdge3?.setOrganization)
                {
                    await
                    MapEdge3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSourceItemWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const SourceItem0 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SourceItem0?.setProject)
                {
                    await
                    SourceItem0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const SourceItem1 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SourceItem1?.setProject)
                {
                    await
                    SourceItem1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const SourceItem2 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SourceItem2?.setProject)
                {
                    await
                    SourceItem2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const SourceItem3 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SourceItem3?.setProject)
                {
                    await
                    SourceItem3.
                    setProject(relatedProject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSourceItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SourceItem0 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SourceItem0?.setOrganization)
                {
                    await
                    SourceItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SourceItem1 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SourceItem1?.setOrganization)
                {
                    await
                    SourceItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SourceItem2 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SourceItem2?.setOrganization)
                {
                    await
                    SourceItem2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SourceItem3 = await SourceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SourceItem3?.setOrganization)
                {
                    await
                    SourceItem3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateNodeEvidenceItemWithNode() {
            
                const relatedNode0 = await MapNodes.findOne({
                    offset: Math.floor(Math.random() * (await MapNodes.count())),
                });
                const NodeEvidenceItem0 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NodeEvidenceItem0?.setNode)
                {
                    await
                    NodeEvidenceItem0.
                    setNode(relatedNode0);
                }
            
                const relatedNode1 = await MapNodes.findOne({
                    offset: Math.floor(Math.random() * (await MapNodes.count())),
                });
                const NodeEvidenceItem1 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NodeEvidenceItem1?.setNode)
                {
                    await
                    NodeEvidenceItem1.
                    setNode(relatedNode1);
                }
            
                const relatedNode2 = await MapNodes.findOne({
                    offset: Math.floor(Math.random() * (await MapNodes.count())),
                });
                const NodeEvidenceItem2 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NodeEvidenceItem2?.setNode)
                {
                    await
                    NodeEvidenceItem2.
                    setNode(relatedNode2);
                }
            
                const relatedNode3 = await MapNodes.findOne({
                    offset: Math.floor(Math.random() * (await MapNodes.count())),
                });
                const NodeEvidenceItem3 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NodeEvidenceItem3?.setNode)
                {
                    await
                    NodeEvidenceItem3.
                    setNode(relatedNode3);
                }
            
        }
        
    
        
            
            async function associateNodeEvidenceItemWithSource_item() {
            
                const relatedSource_item0 = await SourceItems.findOne({
                    offset: Math.floor(Math.random() * (await SourceItems.count())),
                });
                const NodeEvidenceItem0 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NodeEvidenceItem0?.setSource_item)
                {
                    await
                    NodeEvidenceItem0.
                    setSource_item(relatedSource_item0);
                }
            
                const relatedSource_item1 = await SourceItems.findOne({
                    offset: Math.floor(Math.random() * (await SourceItems.count())),
                });
                const NodeEvidenceItem1 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NodeEvidenceItem1?.setSource_item)
                {
                    await
                    NodeEvidenceItem1.
                    setSource_item(relatedSource_item1);
                }
            
                const relatedSource_item2 = await SourceItems.findOne({
                    offset: Math.floor(Math.random() * (await SourceItems.count())),
                });
                const NodeEvidenceItem2 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NodeEvidenceItem2?.setSource_item)
                {
                    await
                    NodeEvidenceItem2.
                    setSource_item(relatedSource_item2);
                }
            
                const relatedSource_item3 = await SourceItems.findOne({
                    offset: Math.floor(Math.random() * (await SourceItems.count())),
                });
                const NodeEvidenceItem3 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NodeEvidenceItem3?.setSource_item)
                {
                    await
                    NodeEvidenceItem3.
                    setSource_item(relatedSource_item3);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateNodeEvidenceItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NodeEvidenceItem0 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NodeEvidenceItem0?.setOrganization)
                {
                    await
                    NodeEvidenceItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NodeEvidenceItem1 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NodeEvidenceItem1?.setOrganization)
                {
                    await
                    NodeEvidenceItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NodeEvidenceItem2 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NodeEvidenceItem2?.setOrganization)
                {
                    await
                    NodeEvidenceItem2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NodeEvidenceItem3 = await NodeEvidenceItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NodeEvidenceItem3?.setOrganization)
                {
                    await
                    NodeEvidenceItem3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAiRunWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const AiRun0 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiRun0?.setProject)
                {
                    await
                    AiRun0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const AiRun1 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiRun1?.setProject)
                {
                    await
                    AiRun1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const AiRun2 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiRun2?.setProject)
                {
                    await
                    AiRun2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const AiRun3 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AiRun3?.setProject)
                {
                    await
                    AiRun3.
                    setProject(relatedProject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAiRunWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiRun0 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiRun0?.setOrganization)
                {
                    await
                    AiRun0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiRun1 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiRun1?.setOrganization)
                {
                    await
                    AiRun1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiRun2 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiRun2?.setOrganization)
                {
                    await
                    AiRun2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiRun3 = await AiRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AiRun3?.setOrganization)
                {
                    await
                    AiRun3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBusinessPlanVersionWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const BusinessPlanVersion0 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BusinessPlanVersion0?.setProject)
                {
                    await
                    BusinessPlanVersion0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const BusinessPlanVersion1 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BusinessPlanVersion1?.setProject)
                {
                    await
                    BusinessPlanVersion1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const BusinessPlanVersion2 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BusinessPlanVersion2?.setProject)
                {
                    await
                    BusinessPlanVersion2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const BusinessPlanVersion3 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BusinessPlanVersion3?.setProject)
                {
                    await
                    BusinessPlanVersion3.
                    setProject(relatedProject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBusinessPlanVersionWithGenerated_by_run() {
            
                const relatedGenerated_by_run0 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const BusinessPlanVersion0 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BusinessPlanVersion0?.setGenerated_by_run)
                {
                    await
                    BusinessPlanVersion0.
                    setGenerated_by_run(relatedGenerated_by_run0);
                }
            
                const relatedGenerated_by_run1 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const BusinessPlanVersion1 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BusinessPlanVersion1?.setGenerated_by_run)
                {
                    await
                    BusinessPlanVersion1.
                    setGenerated_by_run(relatedGenerated_by_run1);
                }
            
                const relatedGenerated_by_run2 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const BusinessPlanVersion2 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BusinessPlanVersion2?.setGenerated_by_run)
                {
                    await
                    BusinessPlanVersion2.
                    setGenerated_by_run(relatedGenerated_by_run2);
                }
            
                const relatedGenerated_by_run3 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const BusinessPlanVersion3 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BusinessPlanVersion3?.setGenerated_by_run)
                {
                    await
                    BusinessPlanVersion3.
                    setGenerated_by_run(relatedGenerated_by_run3);
                }
            
        }
        
    
        
            
            async function associateBusinessPlanVersionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BusinessPlanVersion0 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BusinessPlanVersion0?.setOrganization)
                {
                    await
                    BusinessPlanVersion0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BusinessPlanVersion1 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BusinessPlanVersion1?.setOrganization)
                {
                    await
                    BusinessPlanVersion1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BusinessPlanVersion2 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BusinessPlanVersion2?.setOrganization)
                {
                    await
                    BusinessPlanVersion2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BusinessPlanVersion3 = await BusinessPlanVersions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BusinessPlanVersion3?.setOrganization)
                {
                    await
                    BusinessPlanVersion3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePitchDeckWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const PitchDeck0 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PitchDeck0?.setProject)
                {
                    await
                    PitchDeck0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const PitchDeck1 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PitchDeck1?.setProject)
                {
                    await
                    PitchDeck1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const PitchDeck2 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PitchDeck2?.setProject)
                {
                    await
                    PitchDeck2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const PitchDeck3 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PitchDeck3?.setProject)
                {
                    await
                    PitchDeck3.
                    setProject(relatedProject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePitchDeckWithGenerated_by_run() {
            
                const relatedGenerated_by_run0 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const PitchDeck0 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PitchDeck0?.setGenerated_by_run)
                {
                    await
                    PitchDeck0.
                    setGenerated_by_run(relatedGenerated_by_run0);
                }
            
                const relatedGenerated_by_run1 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const PitchDeck1 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PitchDeck1?.setGenerated_by_run)
                {
                    await
                    PitchDeck1.
                    setGenerated_by_run(relatedGenerated_by_run1);
                }
            
                const relatedGenerated_by_run2 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const PitchDeck2 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PitchDeck2?.setGenerated_by_run)
                {
                    await
                    PitchDeck2.
                    setGenerated_by_run(relatedGenerated_by_run2);
                }
            
                const relatedGenerated_by_run3 = await AiRuns.findOne({
                    offset: Math.floor(Math.random() * (await AiRuns.count())),
                });
                const PitchDeck3 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PitchDeck3?.setGenerated_by_run)
                {
                    await
                    PitchDeck3.
                    setGenerated_by_run(relatedGenerated_by_run3);
                }
            
        }
        
    
        
            
            async function associatePitchDeckWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PitchDeck0 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PitchDeck0?.setOrganization)
                {
                    await
                    PitchDeck0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PitchDeck1 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PitchDeck1?.setOrganization)
                {
                    await
                    PitchDeck1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PitchDeck2 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PitchDeck2?.setOrganization)
                {
                    await
                    PitchDeck2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PitchDeck3 = await PitchDecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PitchDeck3?.setOrganization)
                {
                    await
                    PitchDeck3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDealPackageWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const DealPackage0 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DealPackage0?.setProject)
                {
                    await
                    DealPackage0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const DealPackage1 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DealPackage1?.setProject)
                {
                    await
                    DealPackage1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const DealPackage2 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DealPackage2?.setProject)
                {
                    await
                    DealPackage2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const DealPackage3 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DealPackage3?.setProject)
                {
                    await
                    DealPackage3.
                    setProject(relatedProject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
    
        
            
            async function associateDealPackageWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DealPackage0 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DealPackage0?.setOrganization)
                {
                    await
                    DealPackage0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DealPackage1 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DealPackage1?.setOrganization)
                {
                    await
                    DealPackage1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DealPackage2 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DealPackage2?.setOrganization)
                {
                    await
                    DealPackage2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DealPackage3 = await DealPackages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DealPackage3?.setOrganization)
                {
                    await
                    DealPackage3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePartnerTargetWithDeal_package() {
            
                const relatedDeal_package0 = await DealPackages.findOne({
                    offset: Math.floor(Math.random() * (await DealPackages.count())),
                });
                const PartnerTarget0 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PartnerTarget0?.setDeal_package)
                {
                    await
                    PartnerTarget0.
                    setDeal_package(relatedDeal_package0);
                }
            
                const relatedDeal_package1 = await DealPackages.findOne({
                    offset: Math.floor(Math.random() * (await DealPackages.count())),
                });
                const PartnerTarget1 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PartnerTarget1?.setDeal_package)
                {
                    await
                    PartnerTarget1.
                    setDeal_package(relatedDeal_package1);
                }
            
                const relatedDeal_package2 = await DealPackages.findOne({
                    offset: Math.floor(Math.random() * (await DealPackages.count())),
                });
                const PartnerTarget2 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PartnerTarget2?.setDeal_package)
                {
                    await
                    PartnerTarget2.
                    setDeal_package(relatedDeal_package2);
                }
            
                const relatedDeal_package3 = await DealPackages.findOne({
                    offset: Math.floor(Math.random() * (await DealPackages.count())),
                });
                const PartnerTarget3 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PartnerTarget3?.setDeal_package)
                {
                    await
                    PartnerTarget3.
                    setDeal_package(relatedDeal_package3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePartnerTargetWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PartnerTarget0 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PartnerTarget0?.setOrganization)
                {
                    await
                    PartnerTarget0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PartnerTarget1 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PartnerTarget1?.setOrganization)
                {
                    await
                    PartnerTarget1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PartnerTarget2 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PartnerTarget2?.setOrganization)
                {
                    await
                    PartnerTarget2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PartnerTarget3 = await PartnerTargets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PartnerTarget3?.setOrganization)
                {
                    await
                    PartnerTarget3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTaskWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setProject)
                {
                    await
                    Task0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setProject)
                {
                    await
                    Task1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setProject)
                {
                    await
                    Task2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Task3 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Task3?.setProject)
                {
                    await
                    Task3.
                    setProject(relatedProject3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateTaskWithAssignee() {
            
                const relatedAssignee0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setAssignee)
                {
                    await
                    Task0.
                    setAssignee(relatedAssignee0);
                }
            
                const relatedAssignee1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setAssignee)
                {
                    await
                    Task1.
                    setAssignee(relatedAssignee1);
                }
            
                const relatedAssignee2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setAssignee)
                {
                    await
                    Task2.
                    setAssignee(relatedAssignee2);
                }
            
                const relatedAssignee3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Task3 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Task3?.setAssignee)
                {
                    await
                    Task3.
                    setAssignee(relatedAssignee3);
                }
            
        }
        
    
        
    
        
            
            async function associateTaskWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setOrganization)
                {
                    await
                    Task0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setOrganization)
                {
                    await
                    Task1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setOrganization)
                {
                    await
                    Task2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Task3 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Task3?.setOrganization)
                {
                    await
                    Task3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Workspaces.bulkCreate(WorkspacesData);
                
            
            
                
                await WorkspaceMemberships.bulkCreate(WorkspaceMembershipsData);
                
            
            
                
                await Projects.bulkCreate(ProjectsData);
                
            
            
                
                await MindMaps.bulkCreate(MindMapsData);
                
            
            
                
                await MapNodes.bulkCreate(MapNodesData);
                
            
            
                
                await MapEdges.bulkCreate(MapEdgesData);
                
            
            
                
                await SourceItems.bulkCreate(SourceItemsData);
                
            
            
                
                await NodeEvidenceItems.bulkCreate(NodeEvidenceItemsData);
                
            
            
                
                await AiRuns.bulkCreate(AiRunsData);
                
            
            
                
                await BusinessPlanVersions.bulkCreate(BusinessPlanVersionsData);
                
            
            
                
                await PitchDecks.bulkCreate(PitchDecksData);
                
            
            
                
                await DealPackages.bulkCreate(DealPackagesData);
                
            
            
                
                await PartnerTargets.bulkCreate(PartnerTargetsData);
                
            
            
                
                await Tasks.bulkCreate(TasksData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateWorkspaceWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWorkspaceMembershipWithWorkspace(),
                    
                
                    
                        
                        await associateWorkspaceMembershipWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWorkspaceMembershipWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateProjectWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateProjectWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMindMapWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateMindMapWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMapNodeWithMind_map(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateMapNodeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMapEdgeWithMind_map(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMapEdgeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSourceItemWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSourceItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateNodeEvidenceItemWithNode(),
                    
                
                    
                        
                        await associateNodeEvidenceItemWithSource_item(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNodeEvidenceItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAiRunWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAiRunWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBusinessPlanVersionWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBusinessPlanVersionWithGenerated_by_run(),
                    
                
                    
                        
                        await associateBusinessPlanVersionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePitchDeckWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePitchDeckWithGenerated_by_run(),
                    
                
                    
                        
                        await associatePitchDeckWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDealPackageWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                
                    
                        
                        await associateDealPackageWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePartnerTargetWithDeal_package(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePartnerTargetWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTaskWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateTaskWithAssignee(),
                    
                
                    
                
                    
                        
                        await associateTaskWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('workspaces', null, {});
            
            
            await queryInterface.bulkDelete('workspace_memberships', null, {});
            
            
            await queryInterface.bulkDelete('projects', null, {});
            
            
            await queryInterface.bulkDelete('mind_maps', null, {});
            
            
            await queryInterface.bulkDelete('map_nodes', null, {});
            
            
            await queryInterface.bulkDelete('map_edges', null, {});
            
            
            await queryInterface.bulkDelete('source_items', null, {});
            
            
            await queryInterface.bulkDelete('node_evidence_items', null, {});
            
            
            await queryInterface.bulkDelete('ai_runs', null, {});
            
            
            await queryInterface.bulkDelete('business_plan_versions', null, {});
            
            
            await queryInterface.bulkDelete('pitch_decks', null, {});
            
            
            await queryInterface.bulkDelete('deal_packages', null, {});
            
            
            await queryInterface.bulkDelete('partner_targets', null, {});
            
            
            await queryInterface.bulkDelete('tasks', null, {});
            
        
    },
};