





















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






const StoreSettings = db.store_settings;

const Pages = db.pages;

const Categories = db.categories;

const Brands = db.brands;

const Products = db.products;

const ProductVariants = db.product_variants;

const VariantOptions = db.variant_options;

const ProductReviews = db.product_reviews;

const Carts = db.carts;

const CartItems = db.cart_items;

const Orders = db.orders;

const OrderItems = db.order_items;

const Addresses = db.addresses;

const OrderAddresses = db.order_addresses;

const Payments = db.payments;

const Shipments = db.shipments;

const Coupons = db.coupons;

const CouponRedemptions = db.coupon_redemptions;

const WishlistItems = db.wishlist_items;

const HomeSections = db.home_sections;

const HomeSectionItems = db.home_section_items;

const ContactMessages = db.contact_messages;

const MediaAssets = db.media_assets;

const AuditLogs = db.audit_logs;







const StoreSettingsData = [
    
    {
    
        
        
            
                "store_name": "Wrghuk Alm Store",
            
        
    
        
        
            
                "store_tagline": "Quality essentials in Arabic",
            
        
    
        
        
            
                "default_currency": "SAR",
            
        
    
        
        
            
                "support_phone": "+966112223333",
            
        
    
        
        
            
                "support_email": "support@wrghukalm.example",
            
        
    
        
        
            
                "whatsapp_number": "+966500009999",
            
        
    
        
        
            
                "address_text": "Riyadh, Saudi Arabia",
            
        
    
        
        
            
                "primary_language": "ar",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "maintenance_mode": false,
            
        
    
        
        
            
                "maintenance_message": "Store is operating normally",
            
        
    
    },
    
    {
    
        
        
            
                "store_name": "Wrghuk Alm Store - Branch 1",
            
        
    
        
        
            
                "store_tagline": "Fast delivery across Riyadh",
            
        
    
        
        
            
                "default_currency": "SAR",
            
        
    
        
        
            
                "support_phone": "+966112223334",
            
        
    
        
        
            
                "support_email": "riyadh@wrghukalm.example",
            
        
    
        
        
            
                "whatsapp_number": "+966500009998",
            
        
    
        
        
            
                "address_text": "Al Olaya District, Riyadh",
            
        
    
        
        
            
                "primary_language": "ar",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "maintenance_mode": true,
            
        
    
        
        
            
                "maintenance_message": "All services available",
            
        
    
    },
    
    {
    
        
        
            
                "store_name": "Wrghuk Alm Store - Branch 2",
            
        
    
        
        
            
                "store_tagline": "Weekly deals and bundles",
            
        
    
        
        
            
                "default_currency": "SAR",
            
        
    
        
        
            
                "support_phone": "+966112223335",
            
        
    
        
        
            
                "support_email": "deals@wrghukalm.example",
            
        
    
        
        
            
                "whatsapp_number": "+966500009997",
            
        
    
        
        
            
                "address_text": "Al Malaz, Riyadh",
            
        
    
        
        
            
                "primary_language": "ar",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "maintenance_mode": true,
            
        
    
        
        
            
                "maintenance_message": "Limited-time promotions",
            
        
    
    },
    
    {
    
        
        
            
                "store_name": "Wrghuk Alm Store - Wholesale",
            
        
    
        
        
            
                "store_tagline": "Bulk orders for businesses",
            
        
    
        
        
            
                "default_currency": "SAR",
            
        
    
        
        
            
                "support_phone": "+966112223336",
            
        
    
        
        
            
                "support_email": "wholesale@wrghukalm.example",
            
        
    
        
        
            
                "whatsapp_number": "+966500009996",
            
        
    
        
        
            
                "address_text": "Industrial Area, Riyadh",
            
        
    
        
        
            
                "primary_language": "ar",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "maintenance_mode": true,
            
        
    
        
        
            
                "maintenance_message": "Wholesale portal maintenance",
            
        
    
    },
    
];



const PagesData = [
    
    {
    
        
        
            
                "title": "About Us",
            
        
    
        
        
            
                "slug": "about-us",
            
        
    
        
        
            
                "content": "We provide curated products with reliable service.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "published_at": new Date('2026-02-05T08:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "title": "Privacy Policy",
            
        
    
        
        
            
                "slug": "privacy-policy",
            
        
    
        
        
            
                "content": "We respect your privacy and handle data responsibly.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                "published_at": new Date('2026-02-05T08:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "title": "Terms and Conditions",
            
        
    
        
        
            
                "slug": "terms",
            
        
    
        
        
            
                "content": "Please review terms before placing an order.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "published_at": new Date('2026-02-05T08:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "title": "Shipping and Delivery",
            
        
    
        
        
            
                "slug": "shipping",
            
        
    
        
        
            
                "content": "Delivery times vary by location and stock availability.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "published_at": new Date('2026-02-10T09:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CategoriesData = [
    
    {
    
        
        
            
                "name": "Electronics",
            
        
    
        
        
            
                "slug": "electronics",
            
        
    
        
        
            
                "description": "Phones, accessories, and gadgets.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Home and Kitchen",
            
        
    
        
        
            
                "slug": "home-kitchen",
            
        
    
        
        
            
                "description": "Daily essentials for home use.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "sort_order": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Beauty",
            
        
    
        
        
            
                "slug": "beauty",
            
        
    
        
        
            
                "description": "Personal care and beauty items.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "sort_order": 3,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Mobile Accessories",
            
        
    
        
        
            
                "slug": "mobile-accessories",
            
        
    
        
        
            
                "description": "Cases, cables, and chargers.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BrandsData = [
    
    {
    
        
        
            
                "name": "NouraTech",
            
        
    
        
        
            
                "slug": "nouratech",
            
        
    
        
        
            
                "description": "Affordable electronics and accessories.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "SaharaHome",
            
        
    
        
        
            
                "slug": "saharahome",
            
        
    
        
        
            
                "description": "Home goods designed for daily life.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "JaziraCare",
            
        
    
        
        
            
                "slug": "jaziracare",
            
        
    
        
        
            
                "description": "Personal care essentials.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "RimalClean",
            
        
    
        
        
            
                "slug": "rimalclean",
            
        
    
        
        
            
                "description": "Household cleaning solutions.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
];



const ProductsData = [
    
    {
    
        
        
            
                "name": "Fast Charge USB-C Cable 1m",
            
        
    
        
        
            
                "slug": "fast-charge-usbc-cable-1m",
            
        
    
        
        
            
                "sku": "NT-CBL-001",
            
        
    
        
        
            
                "short_description": "Durable USB-C cable for fast charging.",
            
        
    
        
        
            
                "description": "High-quality braided cable compatible with most USB-C devices.",
            
        
    
        
        
            
                "price": 29.9,
            
        
    
        
        
            
                "compare_at_price": 39.9,
            
        
    
        
        
            
                "stock_quantity": 120,
            
        
    
        
        
            
                "stock_status": "preorder",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "is_featured": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Wireless Earbuds Lite",
            
        
    
        
        
            
                "slug": "wireless-earbuds-lite",
            
        
    
        
        
            
                "sku": "NT-AUD-014",
            
        
    
        
        
            
                "short_description": "Compact earbuds with clear sound.",
            
        
    
        
        
            
                "description": "Bluetooth earbuds with charging case and stable connection.",
            
        
    
        
        
            
                "price": 149,
            
        
    
        
        
            
                "compare_at_price": 199,
            
        
    
        
        
            
                "stock_quantity": 45,
            
        
    
        
        
            
                "stock_status": "preorder",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "is_featured": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Stainless Steel Water Bottle 750ml",
            
        
    
        
        
            
                "slug": "stainless-water-bottle-750",
            
        
    
        
        
            
                "sku": "SH-KIT-220",
            
        
    
        
        
            
                "short_description": "Keeps drinks cool for hours.",
            
        
    
        
        
            
                "description": "Insulated bottle suitable for travel and daily use.",
            
        
    
        
        
            
                "price": 79,
            
        
    
        
        
            
                "compare_at_price": 99,
            
        
    
        
        
            
                "stock_quantity": 80,
            
        
    
        
        
            
                "stock_status": "preorder",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "is_featured": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Aloe Vera Hand Cream 75ml",
            
        
    
        
        
            
                "slug": "aloe-vera-hand-cream-75",
            
        
    
        
        
            
                "sku": "JC-BEA-031",
            
        
    
        
        
            
                "short_description": "Moisturizing cream for dry hands.",
            
        
    
        
        
            
                "description": "Lightweight formula with aloe vera extract for daily care.",
            
        
    
        
        
            
                "price": 22.5,
            
        
    
        
        
            
                "compare_at_price": 29,
            
        
    
        
        
            
                "stock_quantity": 200,
            
        
    
        
        
            
                "stock_status": "in_stock",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "is_featured": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ProductVariantsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "variant_name": "Black",
            
        
    
        
        
            
                "variant_sku": "NT-CBL-001-BLK",
            
        
    
        
        
            
                "variant_price": 29.9,
            
        
    
        
        
            
                "variant_stock_quantity": 70,
            
        
    
        
        
            
                "variant_status": "active",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "variant_name": "White",
            
        
    
        
        
            
                "variant_sku": "NT-CBL-001-WHT",
            
        
    
        
        
            
                "variant_price": 29.9,
            
        
    
        
        
            
                "variant_stock_quantity": 50,
            
        
    
        
        
            
                "variant_status": "inactive",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "variant_name": "White Edition",
            
        
    
        
        
            
                "variant_sku": "NT-AUD-014-WHT",
            
        
    
        
        
            
                "variant_price": 149,
            
        
    
        
        
            
                "variant_stock_quantity": 25,
            
        
    
        
        
            
                "variant_status": "inactive",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "variant_name": "Black Edition",
            
        
    
        
        
            
                "variant_sku": "NT-AUD-014-BLK",
            
        
    
        
        
            
                "variant_price": 149,
            
        
    
        
        
            
                "variant_stock_quantity": 20,
            
        
    
        
        
            
                "variant_status": "inactive",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
];



const VariantOptionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "option_name": "Color",
            
        
    
        
        
            
                "option_value": "Black",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "option_name": "Color",
            
        
    
        
        
            
                "option_value": "White",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "option_name": "Color",
            
        
    
        
        
            
                "option_value": "White",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "option_name": "Color",
            
        
    
        
        
            
                "option_value": "Black",
            
        
    
    },
    
];



const ProductReviewsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 5,
            
        
    
        
        
            
                "review_title": "Excellent cable",
            
        
    
        
        
            
                "review_body": "Charges quickly and feels sturdy.",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-05T13:10:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 4,
            
        
    
        
        
            
                "review_title": "Good value",
            
        
    
        
        
            
                "review_body": "Sound is clear and battery is decent.",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-06T16:30:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 5,
            
        
    
        
        
            
                "review_title": "Very practical",
            
        
    
        
        
            
                "review_body": "Keeps water cold during the day.",
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-08T09:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 3,
            
        
    
        
        
            
                "review_title": "Nice but small",
            
        
    
        
        
            
                "review_body": "Moisturizes well but I wish it was larger.",
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-09T11:20:00Z'),
            
        
    
    },
    
];



const CartsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "converted",
            
        
    
        
        
            
                "created_on": new Date('2026-03-29T18:00:00Z'),
            
        
    
        
        
            
                "last_activity_at": new Date('2026-03-29T18:12:00Z'),
            
        
    
        
        
            
                "notes": "Prefers evening delivery",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "converted",
            
        
    
        
        
            
                "created_on": new Date('2026-03-20T10:05:00Z'),
            
        
    
        
        
            
                "last_activity_at": new Date('2026-03-20T10:20:00Z'),
            
        
    
        
        
            
                "notes": "Left before checkout",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "created_on": new Date('2026-03-10T09:00:00Z'),
            
        
    
        
        
            
                "last_activity_at": new Date('2026-03-10T09:30:00Z'),
            
        
    
        
        
            
                "notes": "Converted to order",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "created_on": new Date('2026-03-28T21:10:00Z'),
            
        
    
        
        
            
                "last_activity_at": new Date('2026-03-28T21:25:00Z'),
            
        
    
        
        
            
                "notes": "Wants gift wrap",
            
        
    
    },
    
];



const CartItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 2,
            
        
    
        
        
            
                "unit_price": 29.9,
            
        
    
        
        
            
                "line_total": 59.8,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 149,
            
        
    
        
        
            
                "line_total": 149,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 22.5,
            
        
    
        
        
            
                "line_total": 22.5,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 79,
            
        
    
        
        
            
                "line_total": 79,
            
        
    
    },
    
];



const OrdersData = [
    
    {
    
        
        
            
                "order_number": "ORD-2026-0001",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_status": "refunded",
            
        
    
        
        
            
                "payment_status": "failed",
            
        
    
        
        
            
                "fulfillment_status": "partially_fulfilled",
            
        
    
        
        
            
                "subtotal_amount": 208.8,
            
        
    
        
        
            
                "discount_amount": 0,
            
        
    
        
        
            
                "shipping_amount": 15,
            
        
    
        
        
            
                "total_amount": 223.8,
            
        
    
        
        
            
                "currency": "SAR",
            
        
    
        
        
            
                "customer_note": "Call before delivery",
            
        
    
        
        
            
                "placed_at": new Date('2026-03-10T09:35:00Z'),
            
        
    
        
        
            
                "paid_at": new Date('2026-03-10T09:40:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "order_number": "ORD-2026-0002",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_status": "refunded",
            
        
    
        
        
            
                "payment_status": "refunded",
            
        
    
        
        
            
                "fulfillment_status": "partially_fulfilled",
            
        
    
        
        
            
                "subtotal_amount": 22.5,
            
        
    
        
        
            
                "discount_amount": 0,
            
        
    
        
        
            
                "shipping_amount": 15,
            
        
    
        
        
            
                "total_amount": 37.5,
            
        
    
        
        
            
                "currency": "SAR",
            
        
    
        
        
            
                "customer_note": "Please deliver after 6pm",
            
        
    
        
        
            
                "placed_at": new Date('2026-03-21T11:00:00Z'),
            
        
    
        
        
            
                "paid_at": new Date('2026-03-21T11:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "order_number": "ORD-2026-0003",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_status": "confirmed",
            
        
    
        
        
            
                "payment_status": "refunded",
            
        
    
        
        
            
                "fulfillment_status": "unfulfilled",
            
        
    
        
        
            
                "subtotal_amount": 79,
            
        
    
        
        
            
                "discount_amount": 10,
            
        
    
        
        
            
                "shipping_amount": 15,
            
        
    
        
        
            
                "total_amount": 84,
            
        
    
        
        
            
                "currency": "SAR",
            
        
    
        
        
            
                "customer_note": "Leave at reception",
            
        
    
        
        
            
                "placed_at": new Date('2026-03-25T08:10:00Z'),
            
        
    
        
        
            
                "paid_at": new Date('2026-03-25T08:15:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "order_number": "ORD-2026-0004",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_status": "processing",
            
        
    
        
        
            
                "payment_status": "refunded",
            
        
    
        
        
            
                "fulfillment_status": "fulfilled",
            
        
    
        
        
            
                "subtotal_amount": 149,
            
        
    
        
        
            
                "discount_amount": 0,
            
        
    
        
        
            
                "shipping_amount": 0,
            
        
    
        
        
            
                "total_amount": 149,
            
        
    
        
        
            
                "currency": "SAR",
            
        
    
        
        
            
                "customer_note": "Pickup selected",
            
        
    
        
        
            
                "placed_at": new Date('2026-03-26T17:00:00Z'),
            
        
    
        
        
            
                "paid_at": new Date('2026-03-26T17:05:00Z'),
            
        
    
    },
    
];



const OrderItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_name": "Fast Charge USB-C Cable 1m",
            
        
    
        
        
            
                "item_sku": "NT-CBL-001-BLK",
            
        
    
        
        
            
                "quantity": 2,
            
        
    
        
        
            
                "unit_price": 29.9,
            
        
    
        
        
            
                "line_total": 59.8,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_name": "Wireless Earbuds Lite",
            
        
    
        
        
            
                "item_sku": "NT-AUD-014-WHT",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 149,
            
        
    
        
        
            
                "line_total": 149,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_name": "Aloe Vera Hand Cream 75ml",
            
        
    
        
        
            
                "item_sku": "JC-BEA-031",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 22.5,
            
        
    
        
        
            
                "line_total": 22.5,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_name": "Stainless Steel Water Bottle 750ml",
            
        
    
        
        
            
                "item_sku": "SH-KIT-220-SLV",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 79,
            
        
    
        
        
            
                "line_total": 79,
            
        
    
    },
    
];



const AddressesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "billing",
            
        
    
        
        
            
                "full_name": "Lina Al Rashid",
            
        
    
        
        
            
                "phone": "+966500004444",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Riyadh",
            
        
    
        
        
            
                "state_region": "Riyadh",
            
        
    
        
        
            
                "postal_code": "11564",
            
        
    
        
        
            
                "street_address": "King Fahd Road, Building 12",
            
        
    
        
        
            
                "landmark": "Near metro station",
            
        
    
        
        
            
                "is_default": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "billing",
            
        
    
        
        
            
                "full_name": "Lina Al Rashid",
            
        
    
        
        
            
                "phone": "+966500004444",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Riyadh",
            
        
    
        
        
            
                "state_region": "Riyadh",
            
        
    
        
        
            
                "postal_code": "11564",
            
        
    
        
        
            
                "street_address": "Al Olaya, Office 4",
            
        
    
        
        
            
                "landmark": "Opposite mall",
            
        
    
        
        
            
                "is_default": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "shipping",
            
        
    
        
        
            
                "full_name": "Khalid Al Zahrani",
            
        
    
        
        
            
                "phone": "+966500005555",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Jeddah",
            
        
    
        
        
            
                "state_region": "Makkah",
            
        
    
        
        
            
                "postal_code": "21442",
            
        
    
        
        
            
                "street_address": "Prince Sultan Street, Villa 7",
            
        
    
        
        
            
                "landmark": "Near pharmacy",
            
        
    
        
        
            
                "is_default": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "shipping",
            
        
    
        
        
            
                "full_name": "Khalid Al Zahrani",
            
        
    
        
        
            
                "phone": "+966500005555",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Jeddah",
            
        
    
        
        
            
                "state_region": "Makkah",
            
        
    
        
        
            
                "postal_code": "21442",
            
        
    
        
        
            
                "street_address": "Al Rawdah, Apartment 18",
            
        
    
        
        
            
                "landmark": "Next to park",
            
        
    
        
        
            
                "is_default": true,
            
        
    
    },
    
];



const OrderAddressesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "billing",
            
        
    
        
        
            
                "full_name": "Lina Al Rashid",
            
        
    
        
        
            
                "phone": "+966500004444",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Riyadh",
            
        
    
        
        
            
                "state_region": "Riyadh",
            
        
    
        
        
            
                "postal_code": "11564",
            
        
    
        
        
            
                "street_address": "King Fahd Road, Building 12",
            
        
    
        
        
            
                "landmark": "Near metro station",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "billing",
            
        
    
        
        
            
                "full_name": "Lina Al Rashid",
            
        
    
        
        
            
                "phone": "+966500004444",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Riyadh",
            
        
    
        
        
            
                "state_region": "Riyadh",
            
        
    
        
        
            
                "postal_code": "11564",
            
        
    
        
        
            
                "street_address": "Al Olaya, Office 4",
            
        
    
        
        
            
                "landmark": "Opposite mall",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "shipping",
            
        
    
        
        
            
                "full_name": "Khalid Al Zahrani",
            
        
    
        
        
            
                "phone": "+966500005555",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Jeddah",
            
        
    
        
        
            
                "state_region": "Makkah",
            
        
    
        
        
            
                "postal_code": "21442",
            
        
    
        
        
            
                "street_address": "Prince Sultan Street, Villa 7",
            
        
    
        
        
            
                "landmark": "Near pharmacy",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "address_type": "shipping",
            
        
    
        
        
            
                "full_name": "Lina Al Rashid",
            
        
    
        
        
            
                "phone": "+966500004444",
            
        
    
        
        
            
                "country": "Saudi Arabia",
            
        
    
        
        
            
                "city": "Riyadh",
            
        
    
        
        
            
                "state_region": "Riyadh",
            
        
    
        
        
            
                "postal_code": "11564",
            
        
    
        
        
            
                "street_address": "Al Malaz, Street 9",
            
        
    
        
        
            
                "landmark": "Near school",
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "wallet",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "amount": 223.8,
            
        
    
        
        
            
                "transaction_reference": "TXN-10001",
            
        
    
        
        
            
                "initiated_at": new Date('2026-03-10T09:38:00Z'),
            
        
    
        
        
            
                "completed_at": new Date('2026-03-10T09:40:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "cod",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "amount": 37.5,
            
        
    
        
        
            
                "transaction_reference": "TXN-10002",
            
        
    
        
        
            
                "initiated_at": new Date('2026-03-21T11:00:00Z'),
            
        
    
        
        
            
                "completed_at": new Date('2026-03-21T11:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "bank_transfer",
            
        
    
        
        
            
                "status": "refunded",
            
        
    
        
        
            
                "amount": 84,
            
        
    
        
        
            
                "transaction_reference": "TXN-10003",
            
        
    
        
        
            
                "initiated_at": new Date('2026-03-25T08:12:00Z'),
            
        
    
        
        
            
                "completed_at": new Date('2026-03-25T08:15:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "bank_transfer",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "amount": 149,
            
        
    
        
        
            
                "transaction_reference": "TXN-10004",
            
        
    
        
        
            
                "initiated_at": new Date('2026-03-26T17:03:00Z'),
            
        
    
        
        
            
                "completed_at": new Date('2026-03-26T17:05:00Z'),
            
        
    
    },
    
];



const ShipmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "carrier": "pickup",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "tracking_number": "TRK-50001",
            
        
    
        
        
            
                "shipped_at": new Date('2026-03-11T10:00:00Z'),
            
        
    
        
        
            
                "delivered_at": new Date('2026-03-12T18:00:00Z'),
            
        
    
        
        
            
                "shipping_note": "Handle with care",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "carrier": "store_delivery",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "tracking_number": "TRK-50002",
            
        
    
        
        
            
                "shipped_at": new Date('2026-03-22T09:00:00Z'),
            
        
    
        
        
            
                "delivered_at": new Date('2026-03-23T18:00:00Z'),
            
        
    
        
        
            
                "shipping_note": "Evening delivery requested",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "carrier": "third_party",
            
        
    
        
        
            
                "status": "out_for_delivery",
            
        
    
        
        
            
                "tracking_number": "TRK-50003",
            
        
    
        
        
            
                "shipped_at": new Date('2026-03-25T14:00:00Z'),
            
        
    
        
        
            
                "delivered_at": new Date('2026-03-26T16:30:00Z'),
            
        
    
        
        
            
                "shipping_note": "Left at reception",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "carrier": "third_party",
            
        
    
        
        
            
                "status": "returned",
            
        
    
        
        
            
                "tracking_number": "TRK-50004",
            
        
    
        
        
            
                "shipped_at": new Date('2026-03-26T17:10:00Z'),
            
        
    
        
        
            
                "delivered_at": new Date('2026-03-26T17:20:00Z'),
            
        
    
        
        
            
                "shipping_note": "Customer pickup completed",
            
        
    
    },
    
];



const CouponsData = [
    
    {
    
        
        
            
                "code": "RAMADAN10",
            
        
    
        
        
            
                "title": "Ramadan Discount",
            
        
    
        
        
            
                "discount_type": "percentage",
            
        
    
        
        
            
                "discount_value": 10,
            
        
    
        
        
            
                "min_order_amount": 100,
            
        
    
        
        
            
                "usage_limit": 500,
            
        
    
        
        
            
                "usage_count": 32,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "starts_at": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-04-01T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "code": "WELCOME15",
            
        
    
        
        
            
                "title": "New Customer Offer",
            
        
    
        
        
            
                "discount_type": "fixed_amount",
            
        
    
        
        
            
                "discount_value": 15,
            
        
    
        
        
            
                "min_order_amount": 80,
            
        
    
        
        
            
                "usage_limit": 1000,
            
        
    
        
        
            
                "usage_count": 210,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "starts_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-12-31T23:59:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "code": "FREESHIP",
            
        
    
        
        
            
                "title": "Free Shipping Promo",
            
        
    
        
        
            
                "discount_type": "percentage",
            
        
    
        
        
            
                "discount_value": 15,
            
        
    
        
        
            
                "min_order_amount": 120,
            
        
    
        
        
            
                "usage_limit": 300,
            
        
    
        
        
            
                "usage_count": 98,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "starts_at": new Date('2026-02-01T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-06-01T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "code": "BUNDLE5",
            
        
    
        
        
            
                "title": "Bundle Saver",
            
        
    
        
        
            
                "discount_type": "percentage",
            
        
    
        
        
            
                "discount_value": 5,
            
        
    
        
        
            
                "min_order_amount": 200,
            
        
    
        
        
            
                "usage_limit": 200,
            
        
    
        
        
            
                "usage_count": 12,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "starts_at": new Date('2026-03-15T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-05-15T00:00:00Z'),
            
        
    
    },
    
];



const CouponRedemptionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "redeemed_at": new Date('2026-03-25T08:10:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "redeemed_at": new Date('2026-03-10T09:35:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "redeemed_at": new Date('2026-03-21T11:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "redeemed_at": new Date('2026-03-26T17:00:00Z'),
            
        
    
    },
    
];



const WishlistItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-01T12:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-02T09:30:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-05T16:10:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "added_at": new Date('2026-03-07T18:25:00Z'),
            
        
    
    },
    
];



const HomeSectionsData = [
    
    {
    
        
        
            
                "section_title": "Main Hero",
            
        
    
        
        
            
                "section_type": "banner",
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "html_content": "Discover weekly deals and best sellers.",
            
        
    
    },
    
    {
    
        
        
            
                "section_title": "Featured Products",
            
        
    
        
        
            
                "section_type": "featured_products",
            
        
    
        
        
            
                "sort_order": 2,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "html_content": "Top picks curated for you.",
            
        
    
    },
    
    {
    
        
        
            
                "section_title": "Shop by Category",
            
        
    
        
        
            
                "section_type": "banner",
            
        
    
        
        
            
                "sort_order": 3,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "html_content": "Browse categories quickly.",
            
        
    
    },
    
    {
    
        
        
            
                "section_title": "Seasonal Banner",
            
        
    
        
        
            
                "section_type": "category_grid",
            
        
    
        
        
            
                "sort_order": 4,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "html_content": "Limited time seasonal offers.",
            
        
    
    },
    
];



const HomeSectionItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_type": "product",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "link_url": "https://wrghukalm.example/products/wireless-earbuds-lite",
            
        
    
        
        
            
                "item_title": "Wireless Earbuds Lite",
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_type": "image_only",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "link_url": "https://wrghukalm.example/products/fast-charge-usbc-cable-1m",
            
        
    
        
        
            
                "item_title": "Fast Charge USB-C Cable",
            
        
    
        
        
            
                "sort_order": 2,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_type": "category",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "link_url": "https://wrghukalm.example/categories/electronics",
            
        
    
        
        
            
                "item_title": "Electronics",
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_type": "image_only",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "link_url": "https://wrghukalm.example/categories/home-kitchen",
            
        
    
        
        
            
                "item_title": "Home and Kitchen",
            
        
    
        
        
            
                "sort_order": 2,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
];



const ContactMessagesData = [
    
    {
    
        
        
            
                "sender_name": "Hanan Saleh",
            
        
    
        
        
            
                "sender_email": "hanan.saleh@example.com",
            
        
    
        
        
            
                "sender_phone": "+966500006666",
            
        
    
        
        
            
                "subject": "Order status inquiry",
            
        
    
        
        
            
                "message_body": "Can you confirm when my order will ship",
            
        
    
        
        
            
                "status": "spam",
            
        
    
        
        
            
                "received_at": new Date('2026-03-30T10:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "sender_name": "Fahad Mansour",
            
        
    
        
        
            
                "sender_email": "fahad.mansour@example.com",
            
        
    
        
        
            
                "sender_phone": "+966500007777",
            
        
    
        
        
            
                "subject": "Product availability",
            
        
    
        
        
            
                "message_body": "Will the cleaner be restocked this week",
            
        
    
        
        
            
                "status": "in_progress",
            
        
    
        
        
            
                "received_at": new Date('2026-03-29T15:40:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "sender_name": "Reem Ahmad",
            
        
    
        
        
            
                "sender_email": "reem.ahmad@example.com",
            
        
    
        
        
            
                "sender_phone": "+966500008888",
            
        
    
        
        
            
                "subject": "Change delivery address",
            
        
    
        
        
            
                "message_body": "I need to update the shipping address for my order",
            
        
    
        
        
            
                "status": "new",
            
        
    
        
        
            
                "received_at": new Date('2026-03-25T09:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "sender_name": "Saleh Nabil",
            
        
    
        
        
            
                "sender_email": "saleh.nabil@example.com",
            
        
    
        
        
            
                "sender_phone": "+966500009111",
            
        
    
        
        
            
                "subject": "Wholesale request",
            
        
    
        
        
            
                "message_body": "Please share pricing for bulk orders",
            
        
    
        
        
            
                "status": "new",
            
        
    
        
        
            
                "received_at": new Date('2026-03-27T12:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MediaAssetsData = [
    
    {
    
        
        
            
                "title": "Homepage Hero Banner",
            
        
    
        
        
            
                "asset_type": "image",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "alt_text": "Main hero banner",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-01T09:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "title": "Brand Logo Nouratech",
            
        
    
        
        
            
                "asset_type": "file",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "alt_text": "NouraTech logo",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-02T10:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "title": "Product Spec Sheet Earbuds",
            
        
    
        
        
            
                "asset_type": "image",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "alt_text": "Earbuds spec sheet",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-15T11:30:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "title": "Category Banner Electronics",
            
        
    
        
        
            
                "asset_type": "file",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "alt_text": "Electronics category banner",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "uploaded_at": new Date('2026-02-20T14:20:00Z'),
            
        
    
    },
    
];



const AuditLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "CREATE_PRODUCT",
            
        
    
        
        
            
                "entity_name": "products",
            
        
    
        
        
            
                "record_identifier": "NT-CBL-001",
            
        
    
        
        
            
                "details": "Created product Fast Charge USB-C Cable 1m",
            
        
    
        
        
            
                "logged_at": new Date('2026-02-10T10:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "UPDATE_ORDER_STATUS",
            
        
    
        
        
            
                "entity_name": "orders",
            
        
    
        
        
            
                "record_identifier": "ORD-2026-0001",
            
        
    
        
        
            
                "details": "Order moved to confirmed",
            
        
    
        
        
            
                "logged_at": new Date('2026-03-10T09:36:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "PUBLISH_PAGE",
            
        
    
        
        
            
                "entity_name": "pages",
            
        
    
        
        
            
                "record_identifier": "shipping",
            
        
    
        
        
            
                "details": "Published Shipping and Delivery page",
            
        
    
        
        
            
                "logged_at": new Date('2026-02-10T09:01:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "CREATE_COUPON",
            
        
    
        
        
            
                "entity_name": "coupons",
            
        
    
        
        
            
                "record_identifier": "RAMADAN10",
            
        
    
        
        
            
                "details": "Created Ramadan10 coupon",
            
        
    
        
        
            
                "logged_at": new Date('2026-03-01T00:05:00Z'),
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePageWithAuthor() {
            
                const relatedAuthor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Page0 = await Pages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Page0?.setAuthor)
                {
                    await
                    Page0.
                    setAuthor(relatedAuthor0);
                }
            
                const relatedAuthor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Page1 = await Pages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Page1?.setAuthor)
                {
                    await
                    Page1.
                    setAuthor(relatedAuthor1);
                }
            
                const relatedAuthor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Page2 = await Pages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Page2?.setAuthor)
                {
                    await
                    Page2.
                    setAuthor(relatedAuthor2);
                }
            
                const relatedAuthor3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Page3 = await Pages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Page3?.setAuthor)
                {
                    await
                    Page3.
                    setAuthor(relatedAuthor3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCategoryWithParent_category() {
            
                const relatedParent_category0 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Category0 = await Categories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Category0?.setParent_category)
                {
                    await
                    Category0.
                    setParent_category(relatedParent_category0);
                }
            
                const relatedParent_category1 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Category1 = await Categories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Category1?.setParent_category)
                {
                    await
                    Category1.
                    setParent_category(relatedParent_category1);
                }
            
                const relatedParent_category2 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Category2 = await Categories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Category2?.setParent_category)
                {
                    await
                    Category2.
                    setParent_category(relatedParent_category2);
                }
            
                const relatedParent_category3 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Category3 = await Categories.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Category3?.setParent_category)
                {
                    await
                    Category3.
                    setParent_category(relatedParent_category3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateProductWithCategory() {
            
                const relatedCategory0 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setCategory)
                {
                    await
                    Product0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setCategory)
                {
                    await
                    Product1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setCategory)
                {
                    await
                    Product2.
                    setCategory(relatedCategory2);
                }
            
                const relatedCategory3 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setCategory)
                {
                    await
                    Product3.
                    setCategory(relatedCategory3);
                }
            
        }
        
    
        
            
            async function associateProductWithBrand() {
            
                const relatedBrand0 = await Brands.findOne({
                    offset: Math.floor(Math.random() * (await Brands.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setBrand)
                {
                    await
                    Product0.
                    setBrand(relatedBrand0);
                }
            
                const relatedBrand1 = await Brands.findOne({
                    offset: Math.floor(Math.random() * (await Brands.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setBrand)
                {
                    await
                    Product1.
                    setBrand(relatedBrand1);
                }
            
                const relatedBrand2 = await Brands.findOne({
                    offset: Math.floor(Math.random() * (await Brands.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setBrand)
                {
                    await
                    Product2.
                    setBrand(relatedBrand2);
                }
            
                const relatedBrand3 = await Brands.findOne({
                    offset: Math.floor(Math.random() * (await Brands.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setBrand)
                {
                    await
                    Product3.
                    setBrand(relatedBrand3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateProductVariantWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductVariant0 = await ProductVariants.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProductVariant0?.setProduct)
                {
                    await
                    ProductVariant0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductVariant1 = await ProductVariants.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProductVariant1?.setProduct)
                {
                    await
                    ProductVariant1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductVariant2 = await ProductVariants.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProductVariant2?.setProduct)
                {
                    await
                    ProductVariant2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductVariant3 = await ProductVariants.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ProductVariant3?.setProduct)
                {
                    await
                    ProductVariant3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateVariantOptionWithProduct_variant() {
            
                const relatedProduct_variant0 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const VariantOption0 = await VariantOptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VariantOption0?.setProduct_variant)
                {
                    await
                    VariantOption0.
                    setProduct_variant(relatedProduct_variant0);
                }
            
                const relatedProduct_variant1 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const VariantOption1 = await VariantOptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VariantOption1?.setProduct_variant)
                {
                    await
                    VariantOption1.
                    setProduct_variant(relatedProduct_variant1);
                }
            
                const relatedProduct_variant2 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const VariantOption2 = await VariantOptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VariantOption2?.setProduct_variant)
                {
                    await
                    VariantOption2.
                    setProduct_variant(relatedProduct_variant2);
                }
            
                const relatedProduct_variant3 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const VariantOption3 = await VariantOptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VariantOption3?.setProduct_variant)
                {
                    await
                    VariantOption3.
                    setProduct_variant(relatedProduct_variant3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateProductReviewWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductReview0 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProductReview0?.setProduct)
                {
                    await
                    ProductReview0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductReview1 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProductReview1?.setProduct)
                {
                    await
                    ProductReview1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductReview2 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProductReview2?.setProduct)
                {
                    await
                    ProductReview2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const ProductReview3 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ProductReview3?.setProduct)
                {
                    await
                    ProductReview3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
            
            async function associateProductReviewWithReviewer() {
            
                const relatedReviewer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ProductReview0 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProductReview0?.setReviewer)
                {
                    await
                    ProductReview0.
                    setReviewer(relatedReviewer0);
                }
            
                const relatedReviewer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ProductReview1 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProductReview1?.setReviewer)
                {
                    await
                    ProductReview1.
                    setReviewer(relatedReviewer1);
                }
            
                const relatedReviewer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ProductReview2 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProductReview2?.setReviewer)
                {
                    await
                    ProductReview2.
                    setReviewer(relatedReviewer2);
                }
            
                const relatedReviewer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ProductReview3 = await ProductReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ProductReview3?.setReviewer)
                {
                    await
                    ProductReview3.
                    setReviewer(relatedReviewer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateCartWithCustomer() {
            
                const relatedCustomer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Cart0 = await Carts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Cart0?.setCustomer)
                {
                    await
                    Cart0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Cart1 = await Carts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Cart1?.setCustomer)
                {
                    await
                    Cart1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Cart2 = await Carts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Cart2?.setCustomer)
                {
                    await
                    Cart2.
                    setCustomer(relatedCustomer2);
                }
            
                const relatedCustomer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Cart3 = await Carts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Cart3?.setCustomer)
                {
                    await
                    Cart3.
                    setCustomer(relatedCustomer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateCartItemWithCart() {
            
                const relatedCart0 = await Carts.findOne({
                    offset: Math.floor(Math.random() * (await Carts.count())),
                });
                const CartItem0 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CartItem0?.setCart)
                {
                    await
                    CartItem0.
                    setCart(relatedCart0);
                }
            
                const relatedCart1 = await Carts.findOne({
                    offset: Math.floor(Math.random() * (await Carts.count())),
                });
                const CartItem1 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CartItem1?.setCart)
                {
                    await
                    CartItem1.
                    setCart(relatedCart1);
                }
            
                const relatedCart2 = await Carts.findOne({
                    offset: Math.floor(Math.random() * (await Carts.count())),
                });
                const CartItem2 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CartItem2?.setCart)
                {
                    await
                    CartItem2.
                    setCart(relatedCart2);
                }
            
                const relatedCart3 = await Carts.findOne({
                    offset: Math.floor(Math.random() * (await Carts.count())),
                });
                const CartItem3 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CartItem3?.setCart)
                {
                    await
                    CartItem3.
                    setCart(relatedCart3);
                }
            
        }
        
    
        
            
            async function associateCartItemWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const CartItem0 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CartItem0?.setProduct)
                {
                    await
                    CartItem0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const CartItem1 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CartItem1?.setProduct)
                {
                    await
                    CartItem1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const CartItem2 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CartItem2?.setProduct)
                {
                    await
                    CartItem2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const CartItem3 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CartItem3?.setProduct)
                {
                    await
                    CartItem3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
            
            async function associateCartItemWithProduct_variant() {
            
                const relatedProduct_variant0 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const CartItem0 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CartItem0?.setProduct_variant)
                {
                    await
                    CartItem0.
                    setProduct_variant(relatedProduct_variant0);
                }
            
                const relatedProduct_variant1 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const CartItem1 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CartItem1?.setProduct_variant)
                {
                    await
                    CartItem1.
                    setProduct_variant(relatedProduct_variant1);
                }
            
                const relatedProduct_variant2 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const CartItem2 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CartItem2?.setProduct_variant)
                {
                    await
                    CartItem2.
                    setProduct_variant(relatedProduct_variant2);
                }
            
                const relatedProduct_variant3 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const CartItem3 = await CartItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CartItem3?.setProduct_variant)
                {
                    await
                    CartItem3.
                    setProduct_variant(relatedProduct_variant3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
    
        
            
            async function associateOrderWithCustomer() {
            
                const relatedCustomer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order0 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Order0?.setCustomer)
                {
                    await
                    Order0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order1 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Order1?.setCustomer)
                {
                    await
                    Order1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order2 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Order2?.setCustomer)
                {
                    await
                    Order2.
                    setCustomer(relatedCustomer2);
                }
            
                const relatedCustomer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order3 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Order3?.setCustomer)
                {
                    await
                    Order3.
                    setCustomer(relatedCustomer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateOrderItemWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem0 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrderItem0?.setOrder)
                {
                    await
                    OrderItem0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem1 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrderItem1?.setOrder)
                {
                    await
                    OrderItem1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem2 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrderItem2?.setOrder)
                {
                    await
                    OrderItem2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem3 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrderItem3?.setOrder)
                {
                    await
                    OrderItem3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
            
            async function associateOrderItemWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const OrderItem0 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrderItem0?.setProduct)
                {
                    await
                    OrderItem0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const OrderItem1 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrderItem1?.setProduct)
                {
                    await
                    OrderItem1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const OrderItem2 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrderItem2?.setProduct)
                {
                    await
                    OrderItem2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const OrderItem3 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrderItem3?.setProduct)
                {
                    await
                    OrderItem3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
            
            async function associateOrderItemWithProduct_variant() {
            
                const relatedProduct_variant0 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const OrderItem0 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrderItem0?.setProduct_variant)
                {
                    await
                    OrderItem0.
                    setProduct_variant(relatedProduct_variant0);
                }
            
                const relatedProduct_variant1 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const OrderItem1 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrderItem1?.setProduct_variant)
                {
                    await
                    OrderItem1.
                    setProduct_variant(relatedProduct_variant1);
                }
            
                const relatedProduct_variant2 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const OrderItem2 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrderItem2?.setProduct_variant)
                {
                    await
                    OrderItem2.
                    setProduct_variant(relatedProduct_variant2);
                }
            
                const relatedProduct_variant3 = await ProductVariants.findOne({
                    offset: Math.floor(Math.random() * (await ProductVariants.count())),
                });
                const OrderItem3 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrderItem3?.setProduct_variant)
                {
                    await
                    OrderItem3.
                    setProduct_variant(relatedProduct_variant3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAddressWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Address0 = await Addresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Address0?.setUser)
                {
                    await
                    Address0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Address1 = await Addresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Address1?.setUser)
                {
                    await
                    Address1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Address2 = await Addresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Address2?.setUser)
                {
                    await
                    Address2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Address3 = await Addresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Address3?.setUser)
                {
                    await
                    Address3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateOrderAddressWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderAddress0 = await OrderAddresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrderAddress0?.setOrder)
                {
                    await
                    OrderAddress0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderAddress1 = await OrderAddresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrderAddress1?.setOrder)
                {
                    await
                    OrderAddress1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderAddress2 = await OrderAddresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrderAddress2?.setOrder)
                {
                    await
                    OrderAddress2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderAddress3 = await OrderAddresses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrderAddress3?.setOrder)
                {
                    await
                    OrderAddress3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaymentWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setOrder)
                {
                    await
                    Payment0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setOrder)
                {
                    await
                    Payment1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setOrder)
                {
                    await
                    Payment2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setOrder)
                {
                    await
                    Payment3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateShipmentWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Shipment0 = await Shipments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Shipment0?.setOrder)
                {
                    await
                    Shipment0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Shipment1 = await Shipments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Shipment1?.setOrder)
                {
                    await
                    Shipment1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Shipment2 = await Shipments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Shipment2?.setOrder)
                {
                    await
                    Shipment2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Shipment3 = await Shipments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Shipment3?.setOrder)
                {
                    await
                    Shipment3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateCouponRedemptionWithCoupon() {
            
                const relatedCoupon0 = await Coupons.findOne({
                    offset: Math.floor(Math.random() * (await Coupons.count())),
                });
                const CouponRedemption0 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CouponRedemption0?.setCoupon)
                {
                    await
                    CouponRedemption0.
                    setCoupon(relatedCoupon0);
                }
            
                const relatedCoupon1 = await Coupons.findOne({
                    offset: Math.floor(Math.random() * (await Coupons.count())),
                });
                const CouponRedemption1 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CouponRedemption1?.setCoupon)
                {
                    await
                    CouponRedemption1.
                    setCoupon(relatedCoupon1);
                }
            
                const relatedCoupon2 = await Coupons.findOne({
                    offset: Math.floor(Math.random() * (await Coupons.count())),
                });
                const CouponRedemption2 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CouponRedemption2?.setCoupon)
                {
                    await
                    CouponRedemption2.
                    setCoupon(relatedCoupon2);
                }
            
                const relatedCoupon3 = await Coupons.findOne({
                    offset: Math.floor(Math.random() * (await Coupons.count())),
                });
                const CouponRedemption3 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CouponRedemption3?.setCoupon)
                {
                    await
                    CouponRedemption3.
                    setCoupon(relatedCoupon3);
                }
            
        }
        
    
        
            
            async function associateCouponRedemptionWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CouponRedemption0 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CouponRedemption0?.setOrder)
                {
                    await
                    CouponRedemption0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CouponRedemption1 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CouponRedemption1?.setOrder)
                {
                    await
                    CouponRedemption1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CouponRedemption2 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CouponRedemption2?.setOrder)
                {
                    await
                    CouponRedemption2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CouponRedemption3 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CouponRedemption3?.setOrder)
                {
                    await
                    CouponRedemption3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
            
            async function associateCouponRedemptionWithCustomer() {
            
                const relatedCustomer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CouponRedemption0 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CouponRedemption0?.setCustomer)
                {
                    await
                    CouponRedemption0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CouponRedemption1 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CouponRedemption1?.setCustomer)
                {
                    await
                    CouponRedemption1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CouponRedemption2 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CouponRedemption2?.setCustomer)
                {
                    await
                    CouponRedemption2.
                    setCustomer(relatedCustomer2);
                }
            
                const relatedCustomer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CouponRedemption3 = await CouponRedemptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CouponRedemption3?.setCustomer)
                {
                    await
                    CouponRedemption3.
                    setCustomer(relatedCustomer3);
                }
            
        }
        
    
        
    

    
    
    
        
            
            async function associateWishlistItemWithCustomer() {
            
                const relatedCustomer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WishlistItem0 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WishlistItem0?.setCustomer)
                {
                    await
                    WishlistItem0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WishlistItem1 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WishlistItem1?.setCustomer)
                {
                    await
                    WishlistItem1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WishlistItem2 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WishlistItem2?.setCustomer)
                {
                    await
                    WishlistItem2.
                    setCustomer(relatedCustomer2);
                }
            
                const relatedCustomer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WishlistItem3 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WishlistItem3?.setCustomer)
                {
                    await
                    WishlistItem3.
                    setCustomer(relatedCustomer3);
                }
            
        }
        
    
        
            
            async function associateWishlistItemWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const WishlistItem0 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WishlistItem0?.setProduct)
                {
                    await
                    WishlistItem0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const WishlistItem1 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WishlistItem1?.setProduct)
                {
                    await
                    WishlistItem1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const WishlistItem2 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WishlistItem2?.setProduct)
                {
                    await
                    WishlistItem2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const WishlistItem3 = await WishlistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WishlistItem3?.setProduct)
                {
                    await
                    WishlistItem3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateHomeSectionItemWithHome_section() {
            
                const relatedHome_section0 = await HomeSections.findOne({
                    offset: Math.floor(Math.random() * (await HomeSections.count())),
                });
                const HomeSectionItem0 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (HomeSectionItem0?.setHome_section)
                {
                    await
                    HomeSectionItem0.
                    setHome_section(relatedHome_section0);
                }
            
                const relatedHome_section1 = await HomeSections.findOne({
                    offset: Math.floor(Math.random() * (await HomeSections.count())),
                });
                const HomeSectionItem1 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (HomeSectionItem1?.setHome_section)
                {
                    await
                    HomeSectionItem1.
                    setHome_section(relatedHome_section1);
                }
            
                const relatedHome_section2 = await HomeSections.findOne({
                    offset: Math.floor(Math.random() * (await HomeSections.count())),
                });
                const HomeSectionItem2 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (HomeSectionItem2?.setHome_section)
                {
                    await
                    HomeSectionItem2.
                    setHome_section(relatedHome_section2);
                }
            
                const relatedHome_section3 = await HomeSections.findOne({
                    offset: Math.floor(Math.random() * (await HomeSections.count())),
                });
                const HomeSectionItem3 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (HomeSectionItem3?.setHome_section)
                {
                    await
                    HomeSectionItem3.
                    setHome_section(relatedHome_section3);
                }
            
        }
        
    
        
    
        
            
            async function associateHomeSectionItemWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const HomeSectionItem0 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (HomeSectionItem0?.setProduct)
                {
                    await
                    HomeSectionItem0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const HomeSectionItem1 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (HomeSectionItem1?.setProduct)
                {
                    await
                    HomeSectionItem1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const HomeSectionItem2 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (HomeSectionItem2?.setProduct)
                {
                    await
                    HomeSectionItem2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const HomeSectionItem3 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (HomeSectionItem3?.setProduct)
                {
                    await
                    HomeSectionItem3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
            
            async function associateHomeSectionItemWithCategory() {
            
                const relatedCategory0 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const HomeSectionItem0 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (HomeSectionItem0?.setCategory)
                {
                    await
                    HomeSectionItem0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const HomeSectionItem1 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (HomeSectionItem1?.setCategory)
                {
                    await
                    HomeSectionItem1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const HomeSectionItem2 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (HomeSectionItem2?.setCategory)
                {
                    await
                    HomeSectionItem2.
                    setCategory(relatedCategory2);
                }
            
                const relatedCategory3 = await Categories.findOne({
                    offset: Math.floor(Math.random() * (await Categories.count())),
                });
                const HomeSectionItem3 = await HomeSectionItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (HomeSectionItem3?.setCategory)
                {
                    await
                    HomeSectionItem3.
                    setCategory(relatedCategory3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateContactMessageWithAssigned_to() {
            
                const relatedAssigned_to0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ContactMessage0 = await ContactMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ContactMessage0?.setAssigned_to)
                {
                    await
                    ContactMessage0.
                    setAssigned_to(relatedAssigned_to0);
                }
            
                const relatedAssigned_to1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ContactMessage1 = await ContactMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ContactMessage1?.setAssigned_to)
                {
                    await
                    ContactMessage1.
                    setAssigned_to(relatedAssigned_to1);
                }
            
                const relatedAssigned_to2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ContactMessage2 = await ContactMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ContactMessage2?.setAssigned_to)
                {
                    await
                    ContactMessage2.
                    setAssigned_to(relatedAssigned_to2);
                }
            
                const relatedAssigned_to3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ContactMessage3 = await ContactMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ContactMessage3?.setAssigned_to)
                {
                    await
                    ContactMessage3.
                    setAssigned_to(relatedAssigned_to3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMediaAssetWithUploaded_by() {
            
                const relatedUploaded_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaAsset0 = await MediaAssets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaAsset0?.setUploaded_by)
                {
                    await
                    MediaAsset0.
                    setUploaded_by(relatedUploaded_by0);
                }
            
                const relatedUploaded_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaAsset1 = await MediaAssets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaAsset1?.setUploaded_by)
                {
                    await
                    MediaAsset1.
                    setUploaded_by(relatedUploaded_by1);
                }
            
                const relatedUploaded_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaAsset2 = await MediaAssets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaAsset2?.setUploaded_by)
                {
                    await
                    MediaAsset2.
                    setUploaded_by(relatedUploaded_by2);
                }
            
                const relatedUploaded_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaAsset3 = await MediaAssets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MediaAsset3?.setUploaded_by)
                {
                    await
                    MediaAsset3.
                    setUploaded_by(relatedUploaded_by3);
                }
            
        }
        
    
        
    

    
    
    
        
            
            async function associateAuditLogWithActor() {
            
                const relatedActor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setActor)
                {
                    await
                    AuditLog0.
                    setActor(relatedActor0);
                }
            
                const relatedActor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setActor)
                {
                    await
                    AuditLog1.
                    setActor(relatedActor1);
                }
            
                const relatedActor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setActor)
                {
                    await
                    AuditLog2.
                    setActor(relatedActor2);
                }
            
                const relatedActor3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog3 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditLog3?.setActor)
                {
                    await
                    AuditLog3.
                    setActor(relatedActor3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await StoreSettings.bulkCreate(StoreSettingsData);
                
            
            
                
                await Pages.bulkCreate(PagesData);
                
            
            
                
                await Categories.bulkCreate(CategoriesData);
                
            
            
                
                await Brands.bulkCreate(BrandsData);
                
            
            
                
                await Products.bulkCreate(ProductsData);
                
            
            
                
                await ProductVariants.bulkCreate(ProductVariantsData);
                
            
            
                
                await VariantOptions.bulkCreate(VariantOptionsData);
                
            
            
                
                await ProductReviews.bulkCreate(ProductReviewsData);
                
            
            
                
                await Carts.bulkCreate(CartsData);
                
            
            
                
                await CartItems.bulkCreate(CartItemsData);
                
            
            
                
                await Orders.bulkCreate(OrdersData);
                
            
            
                
                await OrderItems.bulkCreate(OrderItemsData);
                
            
            
                
                await Addresses.bulkCreate(AddressesData);
                
            
            
                
                await OrderAddresses.bulkCreate(OrderAddressesData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await Shipments.bulkCreate(ShipmentsData);
                
            
            
                
                await Coupons.bulkCreate(CouponsData);
                
            
            
                
                await CouponRedemptions.bulkCreate(CouponRedemptionsData);
                
            
            
                
                await WishlistItems.bulkCreate(WishlistItemsData);
                
            
            
                
                await HomeSections.bulkCreate(HomeSectionsData);
                
            
            
                
                await HomeSectionItems.bulkCreate(HomeSectionItemsData);
                
            
            
                
                await ContactMessages.bulkCreate(ContactMessagesData);
                
            
            
                
                await MediaAssets.bulkCreate(MediaAssetsData);
                
            
            
                
                await AuditLogs.bulkCreate(AuditLogsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePageWithAuthor(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCategoryWithParent_category(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProductWithCategory(),
                    
                
                    
                        
                        await associateProductWithBrand(),
                    
                
            
                
                
                    
                        
                        await associateProductVariantWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateVariantOptionWithProduct_variant(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateProductReviewWithProduct(),
                    
                
                    
                        
                        await associateProductReviewWithReviewer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateCartWithCustomer(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateCartItemWithCart(),
                    
                
                    
                        
                        await associateCartItemWithProduct(),
                    
                
                    
                        
                        await associateCartItemWithProduct_variant(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                        
                        await associateOrderWithCustomer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateOrderItemWithOrder(),
                    
                
                    
                        
                        await associateOrderItemWithProduct(),
                    
                
                    
                        
                        await associateOrderItemWithProduct_variant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAddressWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateOrderAddressWithOrder(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaymentWithOrder(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateShipmentWithOrder(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateCouponRedemptionWithCoupon(),
                    
                
                    
                        
                        await associateCouponRedemptionWithOrder(),
                    
                
                    
                        
                        await associateCouponRedemptionWithCustomer(),
                    
                
                    
                
            
                
                
                    
                        
                        await associateWishlistItemWithCustomer(),
                    
                
                    
                        
                        await associateWishlistItemWithProduct(),
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateHomeSectionItemWithHome_section(),
                    
                
                    
                
                    
                        
                        await associateHomeSectionItemWithProduct(),
                    
                
                    
                        
                        await associateHomeSectionItemWithCategory(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateContactMessageWithAssigned_to(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMediaAssetWithUploaded_by(),
                    
                
                    
                
            
                
                
                    
                        
                        await associateAuditLogWithActor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('store_settings', null, {});
            
            
            await queryInterface.bulkDelete('pages', null, {});
            
            
            await queryInterface.bulkDelete('categories', null, {});
            
            
            await queryInterface.bulkDelete('brands', null, {});
            
            
            await queryInterface.bulkDelete('products', null, {});
            
            
            await queryInterface.bulkDelete('product_variants', null, {});
            
            
            await queryInterface.bulkDelete('variant_options', null, {});
            
            
            await queryInterface.bulkDelete('product_reviews', null, {});
            
            
            await queryInterface.bulkDelete('carts', null, {});
            
            
            await queryInterface.bulkDelete('cart_items', null, {});
            
            
            await queryInterface.bulkDelete('orders', null, {});
            
            
            await queryInterface.bulkDelete('order_items', null, {});
            
            
            await queryInterface.bulkDelete('addresses', null, {});
            
            
            await queryInterface.bulkDelete('order_addresses', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('shipments', null, {});
            
            
            await queryInterface.bulkDelete('coupons', null, {});
            
            
            await queryInterface.bulkDelete('coupon_redemptions', null, {});
            
            
            await queryInterface.bulkDelete('wishlist_items', null, {});
            
            
            await queryInterface.bulkDelete('home_sections', null, {});
            
            
            await queryInterface.bulkDelete('home_section_items', null, {});
            
            
            await queryInterface.bulkDelete('contact_messages', null, {});
            
            
            await queryInterface.bulkDelete('media_assets', null, {});
            
            
            await queryInterface.bulkDelete('audit_logs', null, {});
            
        
    },
};