





















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






const Skills = db.skills;

const ServiceCategories = db.service_categories;

const ServiceListings = db.service_listings;

const Tags = db.tags;

const Portfolios = db.portfolios;

const Jobs = db.jobs;

const JobAttachments = db.job_attachments;

const Proposals = db.proposals;

const Contracts = db.contracts;

const Milestones = db.milestones;

const Deliverables = db.deliverables;

const Conversations = db.conversations;

const Messages = db.messages;

const Notifications = db.notifications;

const Payments = db.payments;

const Invoices = db.invoices;

const Reviews = db.reviews;

const Disputes = db.disputes;

const LearningArticles = db.learning_articles;

const AiTools = db.ai_tools;

const AiToolRuns = db.ai_tool_runs;

const AdminAnnouncements = db.admin_announcements;







const SkillsData = [
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "category": "video_editing",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "category": "deployment",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "category": "video_editing",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "category": "web_development",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
];



const ServiceCategoriesData = [
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "sort_order_note": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "sort_order_note": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "sort_order_note": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "sort_order_note": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
];



const ServiceListingsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "starting_price": 0.25,
            
        
    
        
        
            
                "delivery_days": 8,
            
        
    
        
        
            
                "status": "paused",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_featured": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "pricing_model": "fixed",
            
        
    
        
        
            
                "starting_price": 8.75,
            
        
    
        
        
            
                "delivery_days": 7,
            
        
    
        
        
            
                "status": "paused",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_featured": false,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "pricing_model": "fixed",
            
        
    
        
        
            
                "starting_price": 2.73,
            
        
    
        
        
            
                "delivery_days": 4,
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_featured": false,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "starting_price": 7.44,
            
        
    
        
        
            
                "delivery_days": 4,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_featured": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const TagsData = [
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
];



const PortfoliosData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "summary": "Ada Lovelace",
            
        
    
        
        
            
                "portfolio_type": "video",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "external_url": "Grace Hopper",
            
        
    
        
        
            
                "client_testimonial": "Ada Lovelace",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "summary": "Grace Hopper",
            
        
    
        
        
            
                "portfolio_type": "link",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "external_url": "Alan Turing",
            
        
    
        
        
            
                "client_testimonial": "Alan Turing",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "summary": "Grace Hopper",
            
        
    
        
        
            
                "portfolio_type": "mixed",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "external_url": "Grace Hopper",
            
        
    
        
        
            
                "client_testimonial": "Grace Hopper",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": true,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "summary": "Alan Turing",
            
        
    
        
        
            
                "portfolio_type": "link",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "external_url": "Grace Hopper",
            
        
    
        
        
            
                "client_testimonial": "Alan Turing",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": true,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const JobsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "budget_min": 0.32,
            
        
    
        
        
            
                "budget_max": 9.64,
            
        
    
        
        
            
                "budget_type": "fixed",
            
        
    
        
        
            
                "deadline_at": new Date(Date.now()),
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "is_remote": true,
            
        
    
        
        
            
                "location_requirement": "Ada Lovelace",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "budget_min": 0.54,
            
        
    
        
        
            
                "budget_max": 5.44,
            
        
    
        
        
            
                "budget_type": "fixed",
            
        
    
        
        
            
                "deadline_at": new Date(Date.now()),
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "in_progress",
            
        
    
        
        
            
                "is_remote": false,
            
        
    
        
        
            
                "location_requirement": "Grace Hopper",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "budget_min": 7.5,
            
        
    
        
        
            
                "budget_max": 4.48,
            
        
    
        
        
            
                "budget_type": "hourly",
            
        
    
        
        
            
                "deadline_at": new Date(Date.now()),
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "is_remote": true,
            
        
    
        
        
            
                "location_requirement": "Marie Curie",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "budget_min": 8.56,
            
        
    
        
        
            
                "budget_max": 6.84,
            
        
    
        
        
            
                "budget_type": "fixed",
            
        
    
        
        
            
                "deadline_at": new Date(Date.now()),
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "in_review",
            
        
    
        
        
            
                "is_remote": false,
            
        
    
        
        
            
                "location_requirement": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const JobAttachmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "caption": "Grace Hopper",
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "caption": "Alan Turing",
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "caption": "Marie Curie",
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "caption": "Marie Curie",
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
    },
    
];



const ProposalsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "cover_letter": "Grace Hopper",
            
        
    
        
        
            
                "proposed_amount": 5.68,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "estimated_days": 3,
            
        
    
        
        
            
                "status": "shortlisted",
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "responded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "cover_letter": "Ada Lovelace",
            
        
    
        
        
            
                "proposed_amount": 2.1,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "estimated_days": 7,
            
        
    
        
        
            
                "status": "shortlisted",
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "responded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "cover_letter": "Ada Lovelace",
            
        
    
        
        
            
                "proposed_amount": 6.37,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "estimated_days": 2,
            
        
    
        
        
            
                "status": "accepted",
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "responded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "cover_letter": "Grace Hopper",
            
        
    
        
        
            
                "proposed_amount": 7.24,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "estimated_days": 8,
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "responded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const ContractsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "agreed_amount": 4.97,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "terms": "Alan Turing",
            
        
    
        
        
            
                "revision_limit": 2,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "agreed_amount": 3.9,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "terms": "Ada Lovelace",
            
        
    
        
        
            
                "revision_limit": 9,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "paused",
            
        
    
        
        
            
                "agreed_amount": 2.65,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "terms": "Grace Hopper",
            
        
    
        
        
            
                "revision_limit": 9,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "agreed_amount": 3.23,
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "terms": "Marie Curie",
            
        
    
        
        
            
                "revision_limit": 2,
            
        
    
    },
    
];



const MilestonesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "amount": 9.91,
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "approved",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "amount": 5.43,
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "amount": 2.51,
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "approved",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "amount": 6.63,
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "pending",
            
        
    
    },
    
];



const DeliverablesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "message": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "review_status": "changes_requested",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "message": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "review_status": "pending",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "message": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "review_status": "pending",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "message": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "review_status": "pending",
            
        
    
    },
    
];



const ConversationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const MessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "body": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "body": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
    },
    
];



const NotificationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "system",
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "deep_link": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "payment",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "body": "Marie Curie",
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "deep_link": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "proposal",
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                "is_read": false,
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "deep_link": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "system",
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "body": "Ada Lovelace",
            
        
    
        
        
            
                "is_read": false,
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "deep_link": "Ada Lovelace",
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "escrow_deposit",
            
        
    
        
        
            
                "amount_gross": 9.72,
            
        
    
        
        
            
                "platform_fee_client_rate": 4.91,
            
        
    
        
        
            
                "platform_fee_freelancer_rate": 2.89,
            
        
    
        
        
            
                "platform_fee_amount": 1.53,
            
        
    
        
        
            
                "amount_net": 9.27,
            
        
    
        
        
            
                "status": "refunded",
            
        
    
        
        
            
                "provider": "simulated",
            
        
    
        
        
            
                "provider_reference": "Alan Turing",
            
        
    
        
        
            
                "initiated_at": new Date(Date.now()),
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "milestone_release",
            
        
    
        
        
            
                "amount_gross": 3.4,
            
        
    
        
        
            
                "platform_fee_client_rate": 2.34,
            
        
    
        
        
            
                "platform_fee_freelancer_rate": 3.74,
            
        
    
        
        
            
                "platform_fee_amount": 3.53,
            
        
    
        
        
            
                "amount_net": 1.75,
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "provider": "simulated",
            
        
    
        
        
            
                "provider_reference": "Alan Turing",
            
        
    
        
        
            
                "initiated_at": new Date(Date.now()),
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "payout",
            
        
    
        
        
            
                "amount_gross": 8.03,
            
        
    
        
        
            
                "platform_fee_client_rate": 3.1,
            
        
    
        
        
            
                "platform_fee_freelancer_rate": 1.68,
            
        
    
        
        
            
                "platform_fee_amount": 7.57,
            
        
    
        
        
            
                "amount_net": 6.7,
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "provider": "paypal",
            
        
    
        
        
            
                "provider_reference": "Grace Hopper",
            
        
    
        
        
            
                "initiated_at": new Date(Date.now()),
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "milestone_release",
            
        
    
        
        
            
                "amount_gross": 9.31,
            
        
    
        
        
            
                "platform_fee_client_rate": 4.43,
            
        
    
        
        
            
                "platform_fee_freelancer_rate": 1.95,
            
        
    
        
        
            
                "platform_fee_amount": 0.98,
            
        
    
        
        
            
                "amount_net": 7.39,
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "provider": "simulated",
            
        
    
        
        
            
                "provider_reference": "Ada Lovelace",
            
        
    
        
        
            
                "initiated_at": new Date(Date.now()),
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
    },
    
];



const InvoicesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal_amount": 9.06,
            
        
    
        
        
            
                "fee_amount": 5.09,
            
        
    
        
        
            
                "total_amount": 3.24,
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal_amount": 9.02,
            
        
    
        
        
            
                "fee_amount": 1.47,
            
        
    
        
        
            
                "total_amount": 3.29,
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal_amount": 8.32,
            
        
    
        
        
            
                "fee_amount": 4.32,
            
        
    
        
        
            
                "total_amount": 8.23,
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal_amount": 1.87,
            
        
    
        
        
            
                "fee_amount": 0.05,
            
        
    
        
        
            
                "total_amount": 5.71,
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const ReviewsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 9,
            
        
    
        
        
            
                "comment": "Marie Curie",
            
        
    
        
        
            
                "review_type": "freelancer_to_client",
            
        
    
        
        
            
                "reviewed_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 5,
            
        
    
        
        
            
                "comment": "Ada Lovelace",
            
        
    
        
        
            
                "review_type": "client_to_freelancer",
            
        
    
        
        
            
                "reviewed_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 4,
            
        
    
        
        
            
                "comment": "Grace Hopper",
            
        
    
        
        
            
                "review_type": "client_to_freelancer",
            
        
    
        
        
            
                "reviewed_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 1,
            
        
    
        
        
            
                "comment": "Ada Lovelace",
            
        
    
        
        
            
                "review_type": "client_to_freelancer",
            
        
    
        
        
            
                "reviewed_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_public": false,
            
        
    
    },
    
];



const DisputesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Grace Hopper",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                "resolution": "pay_freelancer",
            
        
    
        
        
            
                "opened_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                "resolution": "pay_freelancer",
            
        
    
        
        
            
                "opened_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "status": "under_review",
            
        
    
        
        
            
                "resolution": "no_action",
            
        
    
        
        
            
                "opened_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject": "Marie Curie",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "resolution": "split",
            
        
    
        
        
            
                "opened_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const LearningArticlesData = [
    
    {
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "topic": "platform_guides",
            
        
    
        
        
            
                "summary": "Grace Hopper",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "level": "beginner",
            
        
    
        
        
            
                "is_published": false,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "topic": "freelancing",
            
        
    
        
        
            
                "summary": "Ada Lovelace",
            
        
    
        
        
            
                "content": "Grace Hopper",
            
        
    
        
        
            
                "level": "intermediate",
            
        
    
        
        
            
                "is_published": true,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "topic": "tools_templates",
            
        
    
        
        
            
                "summary": "Grace Hopper",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "level": "beginner",
            
        
    
        
        
            
                "is_published": false,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "topic": "tools_templates",
            
        
    
        
        
            
                "summary": "Marie Curie",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "level": "beginner",
            
        
    
        
        
            
                "is_published": false,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const AiToolsData = [
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "tool_type": "document_formatter",
            
        
    
        
        
            
                "prompt_template": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "tool_type": "policy_explainer",
            
        
    
        
        
            
                "prompt_template": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "tool_type": "caption_generator",
            
        
    
        
        
            
                "prompt_template": "Alan Turing",
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "tool_type": "caption_generator",
            
        
    
        
        
            
                "prompt_template": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
];



const AiToolRunsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "input_text": "Alan Turing",
            
        
    
        
        
            
                "output_text": "Ada Lovelace",
            
        
    
        
        
            
                "status": "succeeded",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "error_message": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "input_text": "Ada Lovelace",
            
        
    
        
        
            
                "output_text": "Grace Hopper",
            
        
    
        
        
            
                "status": "succeeded",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "error_message": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "input_text": "Ada Lovelace",
            
        
    
        
        
            
                "output_text": "Marie Curie",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "error_message": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "input_text": "Alan Turing",
            
        
    
        
        
            
                "output_text": "Grace Hopper",
            
        
    
        
        
            
                "status": "succeeded",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "error_message": "Alan Turing",
            
        
    
    },
    
];



const AdminAnnouncementsData = [
    
    {
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                "audience": "all",
            
        
    
        
        
            
                "is_published": true,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "body": "Grace Hopper",
            
        
    
        
        
            
                "audience": "freelancers",
            
        
    
        
        
            
                "is_published": false,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "body": "Ada Lovelace",
            
        
    
        
        
            
                "audience": "freelancers",
            
        
    
        
        
            
                "is_published": true,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "body": "Ada Lovelace",
            
        
    
        
        
            
                "audience": "clients",
            
        
    
        
        
            
                "is_published": true,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
    
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateServiceListingWithFreelancer() {
            
                const relatedFreelancer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ServiceListing0 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceListing0?.setFreelancer)
                {
                    await
                    ServiceListing0.
                    setFreelancer(relatedFreelancer0);
                }
            
                const relatedFreelancer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ServiceListing1 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceListing1?.setFreelancer)
                {
                    await
                    ServiceListing1.
                    setFreelancer(relatedFreelancer1);
                }
            
                const relatedFreelancer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ServiceListing2 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceListing2?.setFreelancer)
                {
                    await
                    ServiceListing2.
                    setFreelancer(relatedFreelancer2);
                }
            
                const relatedFreelancer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ServiceListing3 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ServiceListing3?.setFreelancer)
                {
                    await
                    ServiceListing3.
                    setFreelancer(relatedFreelancer3);
                }
            
        }
        
    
        
            
            async function associateServiceListingWithCategory() {
            
                const relatedCategory0 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const ServiceListing0 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceListing0?.setCategory)
                {
                    await
                    ServiceListing0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const ServiceListing1 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceListing1?.setCategory)
                {
                    await
                    ServiceListing1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const ServiceListing2 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceListing2?.setCategory)
                {
                    await
                    ServiceListing2.
                    setCategory(relatedCategory2);
                }
            
                const relatedCategory3 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const ServiceListing3 = await ServiceListings.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ServiceListing3?.setCategory)
                {
                    await
                    ServiceListing3.
                    setCategory(relatedCategory3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePortfolioWithFreelancer() {
            
                const relatedFreelancer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Portfolio0 = await Portfolios.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Portfolio0?.setFreelancer)
                {
                    await
                    Portfolio0.
                    setFreelancer(relatedFreelancer0);
                }
            
                const relatedFreelancer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Portfolio1 = await Portfolios.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Portfolio1?.setFreelancer)
                {
                    await
                    Portfolio1.
                    setFreelancer(relatedFreelancer1);
                }
            
                const relatedFreelancer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Portfolio2 = await Portfolios.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Portfolio2?.setFreelancer)
                {
                    await
                    Portfolio2.
                    setFreelancer(relatedFreelancer2);
                }
            
                const relatedFreelancer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Portfolio3 = await Portfolios.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Portfolio3?.setFreelancer)
                {
                    await
                    Portfolio3.
                    setFreelancer(relatedFreelancer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
            
            async function associateJobWithClient() {
            
                const relatedClient0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Job0 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Job0?.setClient)
                {
                    await
                    Job0.
                    setClient(relatedClient0);
                }
            
                const relatedClient1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Job1 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Job1?.setClient)
                {
                    await
                    Job1.
                    setClient(relatedClient1);
                }
            
                const relatedClient2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Job2 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Job2?.setClient)
                {
                    await
                    Job2.
                    setClient(relatedClient2);
                }
            
                const relatedClient3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Job3 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Job3?.setClient)
                {
                    await
                    Job3.
                    setClient(relatedClient3);
                }
            
        }
        
    
        
            
            async function associateJobWithCategory() {
            
                const relatedCategory0 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const Job0 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Job0?.setCategory)
                {
                    await
                    Job0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const Job1 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Job1?.setCategory)
                {
                    await
                    Job1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const Job2 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Job2?.setCategory)
                {
                    await
                    Job2.
                    setCategory(relatedCategory2);
                }
            
                const relatedCategory3 = await ServiceCategories.findOne({
                    offset: Math.floor(Math.random() * (await ServiceCategories.count())),
                });
                const Job3 = await Jobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Job3?.setCategory)
                {
                    await
                    Job3.
                    setCategory(relatedCategory3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
            
            async function associateJobAttachmentWithJob() {
            
                const relatedJob0 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const JobAttachment0 = await JobAttachments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JobAttachment0?.setJob)
                {
                    await
                    JobAttachment0.
                    setJob(relatedJob0);
                }
            
                const relatedJob1 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const JobAttachment1 = await JobAttachments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JobAttachment1?.setJob)
                {
                    await
                    JobAttachment1.
                    setJob(relatedJob1);
                }
            
                const relatedJob2 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const JobAttachment2 = await JobAttachments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JobAttachment2?.setJob)
                {
                    await
                    JobAttachment2.
                    setJob(relatedJob2);
                }
            
                const relatedJob3 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const JobAttachment3 = await JobAttachments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JobAttachment3?.setJob)
                {
                    await
                    JobAttachment3.
                    setJob(relatedJob3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateProposalWithJob() {
            
                const relatedJob0 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Proposal0 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Proposal0?.setJob)
                {
                    await
                    Proposal0.
                    setJob(relatedJob0);
                }
            
                const relatedJob1 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Proposal1 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Proposal1?.setJob)
                {
                    await
                    Proposal1.
                    setJob(relatedJob1);
                }
            
                const relatedJob2 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Proposal2 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Proposal2?.setJob)
                {
                    await
                    Proposal2.
                    setJob(relatedJob2);
                }
            
                const relatedJob3 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Proposal3 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Proposal3?.setJob)
                {
                    await
                    Proposal3.
                    setJob(relatedJob3);
                }
            
        }
        
    
        
            
            async function associateProposalWithFreelancer() {
            
                const relatedFreelancer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Proposal0 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Proposal0?.setFreelancer)
                {
                    await
                    Proposal0.
                    setFreelancer(relatedFreelancer0);
                }
            
                const relatedFreelancer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Proposal1 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Proposal1?.setFreelancer)
                {
                    await
                    Proposal1.
                    setFreelancer(relatedFreelancer1);
                }
            
                const relatedFreelancer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Proposal2 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Proposal2?.setFreelancer)
                {
                    await
                    Proposal2.
                    setFreelancer(relatedFreelancer2);
                }
            
                const relatedFreelancer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Proposal3 = await Proposals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Proposal3?.setFreelancer)
                {
                    await
                    Proposal3.
                    setFreelancer(relatedFreelancer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateContractWithJob() {
            
                const relatedJob0 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Contract0 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Contract0?.setJob)
                {
                    await
                    Contract0.
                    setJob(relatedJob0);
                }
            
                const relatedJob1 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Contract1 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Contract1?.setJob)
                {
                    await
                    Contract1.
                    setJob(relatedJob1);
                }
            
                const relatedJob2 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Contract2 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Contract2?.setJob)
                {
                    await
                    Contract2.
                    setJob(relatedJob2);
                }
            
                const relatedJob3 = await Jobs.findOne({
                    offset: Math.floor(Math.random() * (await Jobs.count())),
                });
                const Contract3 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Contract3?.setJob)
                {
                    await
                    Contract3.
                    setJob(relatedJob3);
                }
            
        }
        
    
        
            
            async function associateContractWithProposal() {
            
                const relatedProposal0 = await Proposals.findOne({
                    offset: Math.floor(Math.random() * (await Proposals.count())),
                });
                const Contract0 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Contract0?.setProposal)
                {
                    await
                    Contract0.
                    setProposal(relatedProposal0);
                }
            
                const relatedProposal1 = await Proposals.findOne({
                    offset: Math.floor(Math.random() * (await Proposals.count())),
                });
                const Contract1 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Contract1?.setProposal)
                {
                    await
                    Contract1.
                    setProposal(relatedProposal1);
                }
            
                const relatedProposal2 = await Proposals.findOne({
                    offset: Math.floor(Math.random() * (await Proposals.count())),
                });
                const Contract2 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Contract2?.setProposal)
                {
                    await
                    Contract2.
                    setProposal(relatedProposal2);
                }
            
                const relatedProposal3 = await Proposals.findOne({
                    offset: Math.floor(Math.random() * (await Proposals.count())),
                });
                const Contract3 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Contract3?.setProposal)
                {
                    await
                    Contract3.
                    setProposal(relatedProposal3);
                }
            
        }
        
    
        
            
            async function associateContractWithClient() {
            
                const relatedClient0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract0 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Contract0?.setClient)
                {
                    await
                    Contract0.
                    setClient(relatedClient0);
                }
            
                const relatedClient1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract1 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Contract1?.setClient)
                {
                    await
                    Contract1.
                    setClient(relatedClient1);
                }
            
                const relatedClient2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract2 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Contract2?.setClient)
                {
                    await
                    Contract2.
                    setClient(relatedClient2);
                }
            
                const relatedClient3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract3 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Contract3?.setClient)
                {
                    await
                    Contract3.
                    setClient(relatedClient3);
                }
            
        }
        
    
        
            
            async function associateContractWithFreelancer() {
            
                const relatedFreelancer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract0 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Contract0?.setFreelancer)
                {
                    await
                    Contract0.
                    setFreelancer(relatedFreelancer0);
                }
            
                const relatedFreelancer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract1 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Contract1?.setFreelancer)
                {
                    await
                    Contract1.
                    setFreelancer(relatedFreelancer1);
                }
            
                const relatedFreelancer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract2 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Contract2?.setFreelancer)
                {
                    await
                    Contract2.
                    setFreelancer(relatedFreelancer2);
                }
            
                const relatedFreelancer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Contract3 = await Contracts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Contract3?.setFreelancer)
                {
                    await
                    Contract3.
                    setFreelancer(relatedFreelancer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateMilestoneWithContract() {
            
                const relatedContract0 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Milestone0 = await Milestones.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Milestone0?.setContract)
                {
                    await
                    Milestone0.
                    setContract(relatedContract0);
                }
            
                const relatedContract1 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Milestone1 = await Milestones.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Milestone1?.setContract)
                {
                    await
                    Milestone1.
                    setContract(relatedContract1);
                }
            
                const relatedContract2 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Milestone2 = await Milestones.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Milestone2?.setContract)
                {
                    await
                    Milestone2.
                    setContract(relatedContract2);
                }
            
                const relatedContract3 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Milestone3 = await Milestones.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Milestone3?.setContract)
                {
                    await
                    Milestone3.
                    setContract(relatedContract3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateDeliverableWithContract() {
            
                const relatedContract0 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Deliverable0 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Deliverable0?.setContract)
                {
                    await
                    Deliverable0.
                    setContract(relatedContract0);
                }
            
                const relatedContract1 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Deliverable1 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Deliverable1?.setContract)
                {
                    await
                    Deliverable1.
                    setContract(relatedContract1);
                }
            
                const relatedContract2 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Deliverable2 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Deliverable2?.setContract)
                {
                    await
                    Deliverable2.
                    setContract(relatedContract2);
                }
            
                const relatedContract3 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Deliverable3 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Deliverable3?.setContract)
                {
                    await
                    Deliverable3.
                    setContract(relatedContract3);
                }
            
        }
        
    
        
            
            async function associateDeliverableWithMilestone() {
            
                const relatedMilestone0 = await Milestones.findOne({
                    offset: Math.floor(Math.random() * (await Milestones.count())),
                });
                const Deliverable0 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Deliverable0?.setMilestone)
                {
                    await
                    Deliverable0.
                    setMilestone(relatedMilestone0);
                }
            
                const relatedMilestone1 = await Milestones.findOne({
                    offset: Math.floor(Math.random() * (await Milestones.count())),
                });
                const Deliverable1 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Deliverable1?.setMilestone)
                {
                    await
                    Deliverable1.
                    setMilestone(relatedMilestone1);
                }
            
                const relatedMilestone2 = await Milestones.findOne({
                    offset: Math.floor(Math.random() * (await Milestones.count())),
                });
                const Deliverable2 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Deliverable2?.setMilestone)
                {
                    await
                    Deliverable2.
                    setMilestone(relatedMilestone2);
                }
            
                const relatedMilestone3 = await Milestones.findOne({
                    offset: Math.floor(Math.random() * (await Milestones.count())),
                });
                const Deliverable3 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Deliverable3?.setMilestone)
                {
                    await
                    Deliverable3.
                    setMilestone(relatedMilestone3);
                }
            
        }
        
    
        
            
            async function associateDeliverableWithSubmitted_by() {
            
                const relatedSubmitted_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Deliverable0 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Deliverable0?.setSubmitted_by)
                {
                    await
                    Deliverable0.
                    setSubmitted_by(relatedSubmitted_by0);
                }
            
                const relatedSubmitted_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Deliverable1 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Deliverable1?.setSubmitted_by)
                {
                    await
                    Deliverable1.
                    setSubmitted_by(relatedSubmitted_by1);
                }
            
                const relatedSubmitted_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Deliverable2 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Deliverable2?.setSubmitted_by)
                {
                    await
                    Deliverable2.
                    setSubmitted_by(relatedSubmitted_by2);
                }
            
                const relatedSubmitted_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Deliverable3 = await Deliverables.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Deliverable3?.setSubmitted_by)
                {
                    await
                    Deliverable3.
                    setSubmitted_by(relatedSubmitted_by3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateConversationWithContract() {
            
                const relatedContract0 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Conversation0 = await Conversations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Conversation0?.setContract)
                {
                    await
                    Conversation0.
                    setContract(relatedContract0);
                }
            
                const relatedContract1 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Conversation1 = await Conversations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Conversation1?.setContract)
                {
                    await
                    Conversation1.
                    setContract(relatedContract1);
                }
            
                const relatedContract2 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Conversation2 = await Conversations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Conversation2?.setContract)
                {
                    await
                    Conversation2.
                    setContract(relatedContract2);
                }
            
                const relatedContract3 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Conversation3 = await Conversations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Conversation3?.setContract)
                {
                    await
                    Conversation3.
                    setContract(relatedContract3);
                }
            
        }
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
            
            async function associateMessageWithConversation() {
            
                const relatedConversation0 = await Conversations.findOne({
                    offset: Math.floor(Math.random() * (await Conversations.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setConversation)
                {
                    await
                    Message0.
                    setConversation(relatedConversation0);
                }
            
                const relatedConversation1 = await Conversations.findOne({
                    offset: Math.floor(Math.random() * (await Conversations.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setConversation)
                {
                    await
                    Message1.
                    setConversation(relatedConversation1);
                }
            
                const relatedConversation2 = await Conversations.findOne({
                    offset: Math.floor(Math.random() * (await Conversations.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setConversation)
                {
                    await
                    Message2.
                    setConversation(relatedConversation2);
                }
            
                const relatedConversation3 = await Conversations.findOne({
                    offset: Math.floor(Math.random() * (await Conversations.count())),
                });
                const Message3 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Message3?.setConversation)
                {
                    await
                    Message3.
                    setConversation(relatedConversation3);
                }
            
        }
        
    
        
            
            async function associateMessageWithSender() {
            
                const relatedSender0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setSender)
                {
                    await
                    Message0.
                    setSender(relatedSender0);
                }
            
                const relatedSender1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setSender)
                {
                    await
                    Message1.
                    setSender(relatedSender1);
                }
            
                const relatedSender2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setSender)
                {
                    await
                    Message2.
                    setSender(relatedSender2);
                }
            
                const relatedSender3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message3 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Message3?.setSender)
                {
                    await
                    Message3.
                    setSender(relatedSender3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateNotificationWithRecipient() {
            
                const relatedRecipient0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setRecipient)
                {
                    await
                    Notification0.
                    setRecipient(relatedRecipient0);
                }
            
                const relatedRecipient1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setRecipient)
                {
                    await
                    Notification1.
                    setRecipient(relatedRecipient1);
                }
            
                const relatedRecipient2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setRecipient)
                {
                    await
                    Notification2.
                    setRecipient(relatedRecipient2);
                }
            
                const relatedRecipient3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification3 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Notification3?.setRecipient)
                {
                    await
                    Notification3.
                    setRecipient(relatedRecipient3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaymentWithContract() {
            
                const relatedContract0 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setContract)
                {
                    await
                    Payment0.
                    setContract(relatedContract0);
                }
            
                const relatedContract1 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setContract)
                {
                    await
                    Payment1.
                    setContract(relatedContract1);
                }
            
                const relatedContract2 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setContract)
                {
                    await
                    Payment2.
                    setContract(relatedContract2);
                }
            
                const relatedContract3 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setContract)
                {
                    await
                    Payment3.
                    setContract(relatedContract3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithPayer() {
            
                const relatedPayer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setPayer)
                {
                    await
                    Payment0.
                    setPayer(relatedPayer0);
                }
            
                const relatedPayer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setPayer)
                {
                    await
                    Payment1.
                    setPayer(relatedPayer1);
                }
            
                const relatedPayer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setPayer)
                {
                    await
                    Payment2.
                    setPayer(relatedPayer2);
                }
            
                const relatedPayer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setPayer)
                {
                    await
                    Payment3.
                    setPayer(relatedPayer3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithPayee() {
            
                const relatedPayee0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setPayee)
                {
                    await
                    Payment0.
                    setPayee(relatedPayee0);
                }
            
                const relatedPayee1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setPayee)
                {
                    await
                    Payment1.
                    setPayee(relatedPayee1);
                }
            
                const relatedPayee2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setPayee)
                {
                    await
                    Payment2.
                    setPayee(relatedPayee2);
                }
            
                const relatedPayee3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setPayee)
                {
                    await
                    Payment3.
                    setPayee(relatedPayee3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateInvoiceWithPayment() {
            
                const relatedPayment0 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setPayment)
                {
                    await
                    Invoice0.
                    setPayment(relatedPayment0);
                }
            
                const relatedPayment1 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setPayment)
                {
                    await
                    Invoice1.
                    setPayment(relatedPayment1);
                }
            
                const relatedPayment2 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setPayment)
                {
                    await
                    Invoice2.
                    setPayment(relatedPayment2);
                }
            
                const relatedPayment3 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setPayment)
                {
                    await
                    Invoice3.
                    setPayment(relatedPayment3);
                }
            
        }
        
    
        
    
        
            
            async function associateInvoiceWithBilled_to() {
            
                const relatedBilled_to0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setBilled_to)
                {
                    await
                    Invoice0.
                    setBilled_to(relatedBilled_to0);
                }
            
                const relatedBilled_to1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setBilled_to)
                {
                    await
                    Invoice1.
                    setBilled_to(relatedBilled_to1);
                }
            
                const relatedBilled_to2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setBilled_to)
                {
                    await
                    Invoice2.
                    setBilled_to(relatedBilled_to2);
                }
            
                const relatedBilled_to3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setBilled_to)
                {
                    await
                    Invoice3.
                    setBilled_to(relatedBilled_to3);
                }
            
        }
        
    
        
            
            async function associateInvoiceWithBilled_from() {
            
                const relatedBilled_from0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setBilled_from)
                {
                    await
                    Invoice0.
                    setBilled_from(relatedBilled_from0);
                }
            
                const relatedBilled_from1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setBilled_from)
                {
                    await
                    Invoice1.
                    setBilled_from(relatedBilled_from1);
                }
            
                const relatedBilled_from2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setBilled_from)
                {
                    await
                    Invoice2.
                    setBilled_from(relatedBilled_from2);
                }
            
                const relatedBilled_from3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setBilled_from)
                {
                    await
                    Invoice3.
                    setBilled_from(relatedBilled_from3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateReviewWithContract() {
            
                const relatedContract0 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Review0 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Review0?.setContract)
                {
                    await
                    Review0.
                    setContract(relatedContract0);
                }
            
                const relatedContract1 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Review1 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Review1?.setContract)
                {
                    await
                    Review1.
                    setContract(relatedContract1);
                }
            
                const relatedContract2 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Review2 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Review2?.setContract)
                {
                    await
                    Review2.
                    setContract(relatedContract2);
                }
            
                const relatedContract3 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Review3 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Review3?.setContract)
                {
                    await
                    Review3.
                    setContract(relatedContract3);
                }
            
        }
        
    
        
            
            async function associateReviewWithReviewer() {
            
                const relatedReviewer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review0 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Review0?.setReviewer)
                {
                    await
                    Review0.
                    setReviewer(relatedReviewer0);
                }
            
                const relatedReviewer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review1 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Review1?.setReviewer)
                {
                    await
                    Review1.
                    setReviewer(relatedReviewer1);
                }
            
                const relatedReviewer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review2 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Review2?.setReviewer)
                {
                    await
                    Review2.
                    setReviewer(relatedReviewer2);
                }
            
                const relatedReviewer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review3 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Review3?.setReviewer)
                {
                    await
                    Review3.
                    setReviewer(relatedReviewer3);
                }
            
        }
        
    
        
            
            async function associateReviewWithReviewee() {
            
                const relatedReviewee0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review0 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Review0?.setReviewee)
                {
                    await
                    Review0.
                    setReviewee(relatedReviewee0);
                }
            
                const relatedReviewee1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review1 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Review1?.setReviewee)
                {
                    await
                    Review1.
                    setReviewee(relatedReviewee1);
                }
            
                const relatedReviewee2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review2 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Review2?.setReviewee)
                {
                    await
                    Review2.
                    setReviewee(relatedReviewee2);
                }
            
                const relatedReviewee3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Review3 = await Reviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Review3?.setReviewee)
                {
                    await
                    Review3.
                    setReviewee(relatedReviewee3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateDisputeWithContract() {
            
                const relatedContract0 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Dispute0 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Dispute0?.setContract)
                {
                    await
                    Dispute0.
                    setContract(relatedContract0);
                }
            
                const relatedContract1 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Dispute1 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Dispute1?.setContract)
                {
                    await
                    Dispute1.
                    setContract(relatedContract1);
                }
            
                const relatedContract2 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Dispute2 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Dispute2?.setContract)
                {
                    await
                    Dispute2.
                    setContract(relatedContract2);
                }
            
                const relatedContract3 = await Contracts.findOne({
                    offset: Math.floor(Math.random() * (await Contracts.count())),
                });
                const Dispute3 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Dispute3?.setContract)
                {
                    await
                    Dispute3.
                    setContract(relatedContract3);
                }
            
        }
        
    
        
            
            async function associateDisputeWithOpened_by() {
            
                const relatedOpened_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Dispute0 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Dispute0?.setOpened_by)
                {
                    await
                    Dispute0.
                    setOpened_by(relatedOpened_by0);
                }
            
                const relatedOpened_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Dispute1 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Dispute1?.setOpened_by)
                {
                    await
                    Dispute1.
                    setOpened_by(relatedOpened_by1);
                }
            
                const relatedOpened_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Dispute2 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Dispute2?.setOpened_by)
                {
                    await
                    Dispute2.
                    setOpened_by(relatedOpened_by2);
                }
            
                const relatedOpened_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Dispute3 = await Disputes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Dispute3?.setOpened_by)
                {
                    await
                    Dispute3.
                    setOpened_by(relatedOpened_by3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAiToolRunWithTool() {
            
                const relatedTool0 = await AiTools.findOne({
                    offset: Math.floor(Math.random() * (await AiTools.count())),
                });
                const AiToolRun0 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiToolRun0?.setTool)
                {
                    await
                    AiToolRun0.
                    setTool(relatedTool0);
                }
            
                const relatedTool1 = await AiTools.findOne({
                    offset: Math.floor(Math.random() * (await AiTools.count())),
                });
                const AiToolRun1 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiToolRun1?.setTool)
                {
                    await
                    AiToolRun1.
                    setTool(relatedTool1);
                }
            
                const relatedTool2 = await AiTools.findOne({
                    offset: Math.floor(Math.random() * (await AiTools.count())),
                });
                const AiToolRun2 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiToolRun2?.setTool)
                {
                    await
                    AiToolRun2.
                    setTool(relatedTool2);
                }
            
                const relatedTool3 = await AiTools.findOne({
                    offset: Math.floor(Math.random() * (await AiTools.count())),
                });
                const AiToolRun3 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AiToolRun3?.setTool)
                {
                    await
                    AiToolRun3.
                    setTool(relatedTool3);
                }
            
        }
        
    
        
            
            async function associateAiToolRunWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiToolRun0 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiToolRun0?.setUser)
                {
                    await
                    AiToolRun0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiToolRun1 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiToolRun1?.setUser)
                {
                    await
                    AiToolRun1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiToolRun2 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiToolRun2?.setUser)
                {
                    await
                    AiToolRun2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AiToolRun3 = await AiToolRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AiToolRun3?.setUser)
                {
                    await
                    AiToolRun3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Skills.bulkCreate(SkillsData);
                
            
            
                
                await ServiceCategories.bulkCreate(ServiceCategoriesData);
                
            
            
                
                await ServiceListings.bulkCreate(ServiceListingsData);
                
            
            
                
                await Tags.bulkCreate(TagsData);
                
            
            
                
                await Portfolios.bulkCreate(PortfoliosData);
                
            
            
                
                await Jobs.bulkCreate(JobsData);
                
            
            
                
                await JobAttachments.bulkCreate(JobAttachmentsData);
                
            
            
                
                await Proposals.bulkCreate(ProposalsData);
                
            
            
                
                await Contracts.bulkCreate(ContractsData);
                
            
            
                
                await Milestones.bulkCreate(MilestonesData);
                
            
            
                
                await Deliverables.bulkCreate(DeliverablesData);
                
            
            
                
                await Conversations.bulkCreate(ConversationsData);
                
            
            
                
                await Messages.bulkCreate(MessagesData);
                
            
            
                
                await Notifications.bulkCreate(NotificationsData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await Invoices.bulkCreate(InvoicesData);
                
            
            
                
                await Reviews.bulkCreate(ReviewsData);
                
            
            
                
                await Disputes.bulkCreate(DisputesData);
                
            
            
                
                await LearningArticles.bulkCreate(LearningArticlesData);
                
            
            
                
                await AiTools.bulkCreate(AiToolsData);
                
            
            
                
                await AiToolRuns.bulkCreate(AiToolRunsData);
                
            
            
                
                await AdminAnnouncements.bulkCreate(AdminAnnouncementsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateServiceListingWithFreelancer(),
                    
                
                    
                        
                        await associateServiceListingWithCategory(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePortfolioWithFreelancer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                        
                        await associateJobWithClient(),
                    
                
                    
                        
                        await associateJobWithCategory(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                        
                        await associateJobAttachmentWithJob(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateProposalWithJob(),
                    
                
                    
                        
                        await associateProposalWithFreelancer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateContractWithJob(),
                    
                
                    
                        
                        await associateContractWithProposal(),
                    
                
                    
                        
                        await associateContractWithClient(),
                    
                
                    
                        
                        await associateContractWithFreelancer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMilestoneWithContract(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateDeliverableWithContract(),
                    
                
                    
                        
                        await associateDeliverableWithMilestone(),
                    
                
                    
                        
                        await associateDeliverableWithSubmitted_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateConversationWithContract(),
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                        
                        await associateMessageWithConversation(),
                    
                
                    
                        
                        await associateMessageWithSender(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateNotificationWithRecipient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaymentWithContract(),
                    
                
                    
                        
                        await associatePaymentWithPayer(),
                    
                
                    
                        
                        await associatePaymentWithPayee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateInvoiceWithPayment(),
                    
                
                    
                
                    
                        
                        await associateInvoiceWithBilled_to(),
                    
                
                    
                        
                        await associateInvoiceWithBilled_from(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateReviewWithContract(),
                    
                
                    
                        
                        await associateReviewWithReviewer(),
                    
                
                    
                        
                        await associateReviewWithReviewee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateDisputeWithContract(),
                    
                
                    
                        
                        await associateDisputeWithOpened_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAiToolRunWithTool(),
                    
                
                    
                        
                        await associateAiToolRunWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('skills', null, {});
            
            
            await queryInterface.bulkDelete('service_categories', null, {});
            
            
            await queryInterface.bulkDelete('service_listings', null, {});
            
            
            await queryInterface.bulkDelete('tags', null, {});
            
            
            await queryInterface.bulkDelete('portfolios', null, {});
            
            
            await queryInterface.bulkDelete('jobs', null, {});
            
            
            await queryInterface.bulkDelete('job_attachments', null, {});
            
            
            await queryInterface.bulkDelete('proposals', null, {});
            
            
            await queryInterface.bulkDelete('contracts', null, {});
            
            
            await queryInterface.bulkDelete('milestones', null, {});
            
            
            await queryInterface.bulkDelete('deliverables', null, {});
            
            
            await queryInterface.bulkDelete('conversations', null, {});
            
            
            await queryInterface.bulkDelete('messages', null, {});
            
            
            await queryInterface.bulkDelete('notifications', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('invoices', null, {});
            
            
            await queryInterface.bulkDelete('reviews', null, {});
            
            
            await queryInterface.bulkDelete('disputes', null, {});
            
            
            await queryInterface.bulkDelete('learning_articles', null, {});
            
            
            await queryInterface.bulkDelete('ai_tools', null, {});
            
            
            await queryInterface.bulkDelete('ai_tool_runs', null, {});
            
            
            await queryInterface.bulkDelete('admin_announcements', null, {});
            
        
    },
};