





















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






const Organizations = db.organizations;

const OrganizationMemberships = db.organization_memberships;

const Currencies = db.currencies;

const TaxRates = db.tax_rates;

const Accounts = db.accounts;

const Contacts = db.contacts;

const Products = db.products;

const Warehouses = db.warehouses;

const InventoryItems = db.inventory_items;

const Quotes = db.quotes;

const QuoteLines = db.quote_lines;

const Invoices = db.invoices;

const InvoiceLines = db.invoice_lines;

const Bills = db.bills;

const BillLines = db.bill_lines;

const Expenses = db.expenses;

const BankAccounts = db.bank_accounts;

const BankTransactions = db.bank_transactions;

const Payments = db.payments;

const JournalEntries = db.journal_entries;

const JournalLines = db.journal_lines;

const Documents = db.documents;

const AuditEvents = db.audit_events;







const OrganizationsData = [
    
    {
    
        
        
            
                "name": "Qweli Demo Trading",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Nile & Co Services",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Kivu Accounting Partners",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Sunrise Supplies Group",
            
        
    
    },
    
];



const OrganizationMembershipsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "owner",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
        
        
            
                "invited_at": new Date('2026-04-10T09:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-04-10T09:10:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "owner",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
        
        
            
                "invited_at": new Date('2026-04-12T10:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-04-12T11:30:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "viewer",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "invited_at": new Date('2026-05-02T15:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-05-10T09:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "owner",
            
        
    
        
        
            
                "status": "invited",
            
        
    
        
        
            
                "invited_at": new Date('2026-03-01T08:00:00Z'),
            
        
    
        
        
            
                "joined_at": new Date('2026-03-01T08:15:00Z'),
            
        
    
    },
    
];



const CurrenciesData = [
    
    {
    
        
        
            
                "code": "GBP",
            
        
    
        
        
            
                "name": "British Pound",
            
        
    
        
        
            
                "symbol": "£",
            
        
    
        
        
            
                "minor_unit": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "USD",
            
        
    
        
        
            
                "name": "US Dollar",
            
        
    
        
        
            
                "symbol": "$",
            
        
    
        
        
            
                "minor_unit": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "EUR",
            
        
    
        
        
            
                "name": "Euro",
            
        
    
        
        
            
                "symbol": "€",
            
        
    
        
        
            
                "minor_unit": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "code": "KES",
            
        
    
        
        
            
                "name": "Kenyan Shilling",
            
        
    
        
        
            
                "symbol": "KSh",
            
        
    
        
        
            
                "minor_unit": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TaxRatesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "VAT 20%",
            
        
    
        
        
            
                "rate": 0.2,
            
        
    
        
        
            
                "tax_type": "withholding",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Sales Tax 8.5%",
            
        
    
        
        
            
                "rate": 0.085,
            
        
    
        
        
            
                "tax_type": "gst",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "GST 10%",
            
        
    
        
        
            
                "rate": 0.1,
            
        
    
        
        
            
                "tax_type": "sales_tax",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "VAT 0%",
            
        
    
        
        
            
                "rate": 0,
            
        
    
        
        
            
                "tax_type": "gst",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
];



const AccountsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Main Bank",
            
        
    
        
        
            
                "code": "1000",
            
        
    
        
        
            
                "account_type": "asset",
            
        
    
        
        
            
                "subtype": "revenue",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Primary operating bank account",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Accounts Receivable",
            
        
    
        
        
            
                "code": "1100",
            
        
    
        
        
            
                "account_type": "equity",
            
        
    
        
        
            
                "subtype": "cost_of_goods_sold",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Amounts owed by customers",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Accounts Payable",
            
        
    
        
        
            
                "code": "2000",
            
        
    
        
        
            
                "account_type": "income",
            
        
    
        
        
            
                "subtype": "operating_expense",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Amounts owed to suppliers",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Sales Revenue",
            
        
    
        
        
            
                "code": "4000",
            
        
    
        
        
            
                "account_type": "liability",
            
        
    
        
        
            
                "subtype": "operating_expense",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Product and service sales",
            
        
    
    },
    
];



const ContactsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contact_type": "employee",
            
        
    
        
        
            
                "display_name": "Cityline Retail Network",
            
        
    
        
        
            
                "company_name": "Cityline Retail Network",
            
        
    
        
        
            
                "first_name": "Maya",
            
        
    
        
        
            
                "last_name": "Thompson",
            
        
    
        
        
            
                "email": "ap@cityline.example",
            
        
    
        
        
            
                "phone": "+44-20-5555-0211",
            
        
    
        
        
            
                "billing_address": "10 King Street, London",
            
        
    
        
        
            
                "shipping_address": "Dock 3, London Warehouse District",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "Preferred email for invoices is accounts payable inbox",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contact_type": "supplier",
            
        
    
        
        
            
                "display_name": "Sunrise Supplies Group",
            
        
    
        
        
            
                "company_name": "Sunrise Supplies Group",
            
        
    
        
        
            
                "first_name": "Leo",
            
        
    
        
        
            
                "last_name": "Wagner",
            
        
    
        
        
            
                "email": "billing@sunrisesupplies.example",
            
        
    
        
        
            
                "phone": "+34-91-555-0200",
            
        
    
        
        
            
                "billing_address": "22 Avenida Central, Madrid",
            
        
    
        
        
            
                "shipping_address": "Returns Dept, 22 Avenida Central, Madrid",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "Ships within 3 business days",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contact_type": "other",
            
        
    
        
        
            
                "display_name": "Nile & Co Services",
            
        
    
        
        
            
                "company_name": "Nile & Co Services",
            
        
    
        
        
            
                "first_name": "Daniel",
            
        
    
        
        
            
                "last_name": "Okoye",
            
        
    
        
        
            
                "email": "finance@nileco.example",
            
        
    
        
        
            
                "phone": "+1-415-555-0207",
            
        
    
        
        
            
                "billing_address": "500 Market Street, San Francisco",
            
        
    
        
        
            
                "shipping_address": "500 Market Street, San Francisco",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "Handles both consulting and procurement",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "contact_type": "both",
            
        
    
        
        
            
                "display_name": "Sofia Reyes",
            
        
    
        
        
            
                "company_name": "",
            
        
    
        
        
            
                "first_name": "Sofia",
            
        
    
        
        
            
                "last_name": "Reyes",
            
        
    
        
        
            
                "email": "sofia.reyes@qweli.example",
            
        
    
        
        
            
                "phone": "+34-91-555-0300",
            
        
    
        
        
            
                "billing_address": "Madrid",
            
        
    
        
        
            
                "shipping_address": "Madrid",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "Expense reimbursements paid monthly",
            
        
    
    },
    
];



const ProductsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Monthly Bookkeeping",
            
        
    
        
        
            
                "sku": "SERV-BOOK-001",
            
        
    
        
        
            
                "product_type": "service",
            
        
    
        
        
            
                "description": "Monthly bookkeeping and reconciliations",
            
        
    
        
        
            
                "sales_price": 450,
            
        
    
        
        
            
                "purchase_price": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "track_inventory": false,
            
        
    
        
        
            
                "reorder_level": 0,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Premium Support Retainer",
            
        
    
        
        
            
                "sku": "SERV-SUP-010",
            
        
    
        
        
            
                "product_type": "service",
            
        
    
        
        
            
                "description": "Priority support and advisory hours",
            
        
    
        
        
            
                "sales_price": 300,
            
        
    
        
        
            
                "purchase_price": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "track_inventory": true,
            
        
    
        
        
            
                "reorder_level": 0,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Wireless Barcode Scanner",
            
        
    
        
        
            
                "sku": "GOOD-SCAN-100",
            
        
    
        
        
            
                "product_type": "service",
            
        
    
        
        
            
                "description": "Handheld wireless barcode scanner",
            
        
    
        
        
            
                "sales_price": 129.99,
            
        
    
        
        
            
                "purchase_price": 79.5,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "track_inventory": true,
            
        
    
        
        
            
                "reorder_level": 5,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Thermal Receipt Paper Pack",
            
        
    
        
        
            
                "sku": "GOOD-PAPR-200",
            
        
    
        
        
            
                "product_type": "goods",
            
        
    
        
        
            
                "description": "Thermal paper rolls pack of 20",
            
        
    
        
        
            
                "sales_price": 24.5,
            
        
    
        
        
            
                "purchase_price": 12,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "track_inventory": true,
            
        
    
        
        
            
                "reorder_level": 20,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
    },
    
];



const WarehousesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "London Main Warehouse",
            
        
    
        
        
            
                "location": "East London",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "London Returns Hub",
            
        
    
        
        
            
                "location": "North London",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Manchester Stockpoint",
            
        
    
        
        
            
                "location": "Manchester",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Partner Fulfillment Center",
            
        
    
        
        
            
                "location": "Birmingham",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
];



const InventoryItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_on_hand": 48,
            
        
    
        
        
            
                "quantity_reserved": 6,
            
        
    
        
        
            
                "quantity_available": 42,
            
        
    
        
        
            
                "average_cost": 78.9,
            
        
    
        
        
            
                "as_of_at": new Date('2026-05-31T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_on_hand": 20,
            
        
    
        
        
            
                "quantity_reserved": 2,
            
        
    
        
        
            
                "quantity_available": 18,
            
        
    
        
        
            
                "average_cost": 79.1,
            
        
    
        
        
            
                "as_of_at": new Date('2026-05-31T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_on_hand": 320,
            
        
    
        
        
            
                "quantity_reserved": 40,
            
        
    
        
        
            
                "quantity_available": 280,
            
        
    
        
        
            
                "average_cost": 11.8,
            
        
    
        
        
            
                "as_of_at": new Date('2026-05-31T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_on_hand": 120,
            
        
    
        
        
            
                "quantity_reserved": 10,
            
        
    
        
        
            
                "quantity_available": 110,
            
        
    
        
        
            
                "average_cost": 11.9,
            
        
    
        
        
            
                "as_of_at": new Date('2026-05-31T00:00:00Z'),
            
        
    
    },
    
];



const QuotesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quote_number": "Q-2026-0005",
            
        
    
        
        
            
                "status": "accepted",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-10T00:00:00Z'),
            
        
    
        
        
            
                "expiry_date": new Date('2026-05-25T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 650,
            
        
    
        
        
            
                "tax_total": 130,
            
        
    
        
        
            
                "total": 780,
            
        
    
        
        
            
                "customer_notes": "Pricing valid until expiry date",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quote_number": "Q-2026-0006",
            
        
    
        
        
            
                "status": "declined",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-12T00:00:00Z'),
            
        
    
        
        
            
                "expiry_date": new Date('2026-05-27T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 259.98,
            
        
    
        
        
            
                "tax_total": 51.996,
            
        
    
        
        
            
                "total": 311.976,
            
        
    
        
        
            
                "customer_notes": "Delivery within 5 business days",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quote_number": "Q-2026-0007",
            
        
    
        
        
            
                "status": "expired",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-15T00:00:00Z'),
            
        
    
        
        
            
                "expiry_date": new Date('2026-05-30T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 300,
            
        
    
        
        
            
                "tax_total": 25.5,
            
        
    
        
        
            
                "total": 325.5,
            
        
    
        
        
            
                "customer_notes": "Includes two advisory calls",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quote_number": "Q-2026-0008",
            
        
    
        
        
            
                "status": "sent",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-18T00:00:00Z'),
            
        
    
        
        
            
                "expiry_date": new Date('2026-06-02T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 220,
            
        
    
        
        
            
                "tax_total": 44,
            
        
    
        
        
            
                "total": 264,
            
        
    
        
        
            
                "customer_notes": "Optional onsite setup",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const QuoteLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Monthly Bookkeeping for May",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 450,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 540,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Premium Support Retainer",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 200,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 240,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Wireless Barcode Scanner",
            
        
    
        
        
            
                "quantity": 2,
            
        
    
        
        
            
                "unit_price": 129.99,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 311.976,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Premium Support Retainer",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 300,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 325.5,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const InvoicesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-2026-0101",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-20T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-06-03T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 259.98,
            
        
    
        
        
            
                "tax_total": 51.996,
            
        
    
        
        
            
                "total": 311.976,
            
        
    
        
        
            
                "amount_due": 311.976,
            
        
    
        
        
            
                "reference": "PO-CLN-7781",
            
        
    
        
        
            
                "customer_notes": "Thank you for your business",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-2026-0102",
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-22T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-06-05T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 450,
            
        
    
        
        
            
                "tax_total": 90,
            
        
    
        
        
            
                "total": 540,
            
        
    
        
        
            
                "amount_due": 240,
            
        
    
        
        
            
                "reference": "MAY-BOOKKEEP",
            
        
    
        
        
            
                "customer_notes": "Monthly service invoice",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-2026-0103",
            
        
    
        
        
            
                "status": "viewed",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-25T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-06-08T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 300,
            
        
    
        
        
            
                "tax_total": 25.5,
            
        
    
        
        
            
                "total": 325.5,
            
        
    
        
        
            
                "amount_due": 325.5,
            
        
    
        
        
            
                "reference": "RET-0526",
            
        
    
        
        
            
                "customer_notes": "Please pay by due date",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-2026-0104",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-05T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-05-19T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 24.5,
            
        
    
        
        
            
                "tax_total": 4.9,
            
        
    
        
        
            
                "total": 29.4,
            
        
    
        
        
            
                "amount_due": 0,
            
        
    
        
        
            
                "reference": "PAPER-APR",
            
        
    
        
        
            
                "customer_notes": "Paid via bank transfer",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const InvoiceLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Wireless Barcode Scanner",
            
        
    
        
        
            
                "quantity": 2,
            
        
    
        
        
            
                "unit_price": 129.99,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 311.976,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Monthly Bookkeeping",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 450,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 540,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Premium Support Retainer",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 300,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 325.5,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Thermal Receipt Paper Pack",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 24.5,
            
        
    
        
        
            
                "discount": 0,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 29.4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BillsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bill_number": "BILL-2026-0041",
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-18T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-06-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 240,
            
        
    
        
        
            
                "tax_total": 12,
            
        
    
        
        
            
                "total": 252,
            
        
    
        
        
            
                "amount_due": 252,
            
        
    
        
        
            
                "reference": "SSG-PO-4412",
            
        
    
        
        
            
                "notes": "Bulk purchase for May",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bill_number": "BILL-2026-0042",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-20T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-06-03T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 159,
            
        
    
        
        
            
                "tax_total": 7.95,
            
        
    
        
        
            
                "total": 166.95,
            
        
    
        
        
            
                "amount_due": 66.95,
            
        
    
        
        
            
                "reference": "SSG-INV-9011",
            
        
    
        
        
            
                "notes": "Scanner accessories",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bill_number": "BILL-2026-0043",
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-25T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-06-08T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 120,
            
        
    
        
        
            
                "tax_total": 6,
            
        
    
        
        
            
                "total": 126,
            
        
    
        
        
            
                "amount_due": 126,
            
        
    
        
        
            
                "reference": "SSG-INV-9050",
            
        
    
        
        
            
                "notes": "Office supplies",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bill_number": "BILL-2026-0044",
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                "issue_date": new Date('2026-05-01T00:00:00Z'),
            
        
    
        
        
            
                "due_date": new Date('2026-05-15T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subtotal": 300,
            
        
    
        
        
            
                "tax_total": 15,
            
        
    
        
        
            
                "total": 315,
            
        
    
        
        
            
                "amount_due": 0,
            
        
    
        
        
            
                "reference": "SSG-INV-8801",
            
        
    
        
        
            
                "notes": "Receipt paper replenishment",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const BillLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Thermal Receipt Paper Pack",
            
        
    
        
        
            
                "quantity": 20,
            
        
    
        
        
            
                "unit_price": 12,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 252,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Wireless Barcode Scanner",
            
        
    
        
        
            
                "quantity": 2,
            
        
    
        
        
            
                "unit_price": 79.5,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 166.95,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Thermal Receipt Paper Pack",
            
        
    
        
        
            
                "quantity": 10,
            
        
    
        
        
            
                "unit_price": 12,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 126,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Thermal Receipt Paper Pack",
            
        
    
        
        
            
                "quantity": 25,
            
        
    
        
        
            
                "unit_price": 12,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "line_total": 315,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExpensesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_type": "general",
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "expense_date": new Date('2026-05-14T00:00:00Z'),
            
        
    
        
        
            
                "amount": 68.2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Team lunch during client workshop",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_type": "mileage",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "expense_date": new Date('2026-05-16T00:00:00Z'),
            
        
    
        
        
            
                "amount": 34.5,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Mileage for onsite visit",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_type": "general",
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "expense_date": new Date('2026-05-20T00:00:00Z'),
            
        
    
        
        
            
                "amount": 19.99,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Cloud storage subscription",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_type": "general",
            
        
    
        
        
            
                "status": "reimbursed",
            
        
    
        
        
            
                "expense_date": new Date('2026-05-02T00:00:00Z'),
            
        
    
        
        
            
                "amount": 42.75,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Stationery purchase for office",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const BankAccountsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Barclays Operating Account",
            
        
    
        
        
            
                "bank_name": "Barclays",
            
        
    
        
        
            
                "account_number_masked": "XXXX6789",
            
        
    
        
        
            
                "account_type_label": "Business Current",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "last_sync_at": new Date('2026-05-31T06:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "HSBC Savings Account",
            
        
    
        
        
            
                "bank_name": "HSBC",
            
        
    
        
        
            
                "account_number_masked": "XXXX1122",
            
        
    
        
        
            
                "account_type_label": "Business Savings",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "last_sync_at": new Date('2026-05-30T06:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Chase Operating Account",
            
        
    
        
        
            
                "bank_name": "Chase",
            
        
    
        
        
            
                "account_number_masked": "XXXX3344",
            
        
    
        
        
            
                "account_type_label": "Business Checking",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "last_sync_at": new Date('2026-05-31T05:30:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Stripe Payouts",
            
        
    
        
        
            
                "bank_name": "Stripe",
            
        
    
        
        
            
                "account_number_masked": "XXXXSTRP",
            
        
    
        
        
            
                "account_type_label": "Payout Account",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "last_sync_at": new Date('2026-05-31T07:15:00Z'),
            
        
    
    },
    
];



const BankTransactionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_date": new Date('2026-05-24T00:00:00Z'),
            
        
    
        
        
            
                "posted_at": new Date('2026-05-24T10:05:00Z'),
            
        
    
        
        
            
                "direction": "inflow",
            
        
    
        
        
            
                "amount": 29.4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Payment received INV-2026-0104",
            
        
    
        
        
            
                "reference": "BARC-TRX-88921",
            
        
    
        
        
            
                "match_status": "unmatched",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_date": new Date('2026-05-27T00:00:00Z'),
            
        
    
        
        
            
                "posted_at": new Date('2026-05-27T12:11:00Z'),
            
        
    
        
        
            
                "direction": "inflow",
            
        
    
        
        
            
                "amount": 300,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Partial payment INV-2026-0102",
            
        
    
        
        
            
                "reference": "BARC-TRX-89210",
            
        
    
        
        
            
                "match_status": "matched",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_date": new Date('2026-05-28T00:00:00Z'),
            
        
    
        
        
            
                "posted_at": new Date('2026-05-28T15:42:00Z'),
            
        
    
        
        
            
                "direction": "inflow",
            
        
    
        
        
            
                "amount": 150,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Office supplies vendor payment",
            
        
    
        
        
            
                "reference": "BARC-TRX-89400",
            
        
    
        
        
            
                "match_status": "excluded",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_date": new Date('2026-05-15T00:00:00Z'),
            
        
    
        
        
            
                "posted_at": new Date('2026-05-15T09:01:00Z'),
            
        
    
        
        
            
                "direction": "outflow",
            
        
    
        
        
            
                "amount": 315,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Payment BILL-2026-0044",
            
        
    
        
        
            
                "reference": "HSBC-TRX-44110",
            
        
    
        
        
            
                "match_status": "unmatched",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "customer_payment",
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "payment_date": new Date('2026-05-24T10:05:00Z'),
            
        
    
        
        
            
                "amount": 29.4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reference": "PAY-2026-0201",
            
        
    
        
        
            
                "notes": "Matched to bank transaction",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "supplier_payment",
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "payment_date": new Date('2026-05-27T12:11:00Z'),
            
        
    
        
        
            
                "amount": 300,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reference": "PAY-2026-0202",
            
        
    
        
        
            
                "notes": "Partial settlement",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "refund",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "payment_date": new Date('2026-05-15T09:01:00Z'),
            
        
    
        
        
            
                "amount": 315,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reference": "PAY-2026-0203",
            
        
    
        
        
            
                "notes": "Paid in full",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_type": "supplier_payment",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "payment_date": new Date('2026-05-30T00:00:00Z'),
            
        
    
        
        
            
                "amount": 100,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reference": "PAY-2026-0204",
            
        
    
        
        
            
                "notes": "Scheduled transfer",
            
        
    
    },
    
];



const JournalEntriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entry_number": "JE-2026-0009",
            
        
    
        
        
            
                "entry_date": new Date('2026-05-24T00:00:00Z'),
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "memo": "Record customer payment for INV-2026-0104",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entry_number": "JE-2026-0010",
            
        
    
        
        
            
                "entry_date": new Date('2026-05-27T00:00:00Z'),
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                "memo": "Partial payment for INV-2026-0102",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entry_number": "JE-2026-0011",
            
        
    
        
        
            
                "entry_date": new Date('2026-05-28T00:00:00Z'),
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "memo": "Unmatched vendor payment to categorize",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entry_number": "JE-2026-0012",
            
        
    
        
        
            
                "entry_date": new Date('2026-05-15T00:00:00Z'),
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "memo": "Supplier payment for BILL-2026-0044",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const JournalLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "debit": 29.4,
            
        
    
        
        
            
                "credit": 0,
            
        
    
        
        
            
                "description": "Increase bank balance",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "debit": 0,
            
        
    
        
        
            
                "credit": 29.4,
            
        
    
        
        
            
                "description": "Reduce accounts receivable",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "debit": 300,
            
        
    
        
        
            
                "credit": 0,
            
        
    
        
        
            
                "description": "Increase bank balance",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "debit": 0,
            
        
    
        
        
            
                "credit": 300,
            
        
    
        
        
            
                "description": "Reduce accounts receivable",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DocumentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_type": "other",
            
        
    
        
        
            
                "title": "Master Services Agreement",
            
        
    
        
        
            
                "description": "Signed agreement for ongoing services",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date('2026-01-10T00:00:00Z'),
            
        
    
        
        
            
                "expires_at": new Date('2027-01-10T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_type": "invoice",
            
        
    
        
        
            
                "title": "Stationery Receipt May 2",
            
        
    
        
        
            
                "description": "Office stationery purchase receipt",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date('2026-05-02T00:00:00Z'),
            
        
    
        
        
            
                "expires_at": new Date('2027-05-02T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_type": "quote",
            
        
    
        
        
            
                "title": "Invoice INV-2026-0101 PDF",
            
        
    
        
        
            
                "description": "Customer invoice export",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date('2026-05-20T00:00:00Z'),
            
        
    
        
        
            
                "expires_at": new Date('2027-05-20T00:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_type": "other",
            
        
    
        
        
            
                "title": "Bill BILL-2026-0041 PDF",
            
        
    
        
        
            
                "description": "Supplier bill scan",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date('2026-05-18T00:00:00Z'),
            
        
    
        
        
            
                "expires_at": new Date('2027-05-18T00:00:00Z'),
            
        
    
    },
    
];



const AuditEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "invoice_sent",
            
        
    
        
        
            
                "entity_name": "invoices",
            
        
    
        
        
            
                "entity_reference": "INV-2026-0101",
            
        
    
        
        
            
                "occurred_at": new Date('2026-05-20T10:00:00Z'),
            
        
    
        
        
            
                "details": "Invoice emailed to customer",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "bill_approved",
            
        
    
        
        
            
                "entity_name": "bills",
            
        
    
        
        
            
                "entity_reference": "BILL-2026-0041",
            
        
    
        
        
            
                "occurred_at": new Date('2026-05-19T09:30:00Z'),
            
        
    
        
        
            
                "details": "Bill approved for payment",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "payment_recorded",
            
        
    
        
        
            
                "entity_name": "payments",
            
        
    
        
        
            
                "entity_reference": "PAY-2026-0201",
            
        
    
        
        
            
                "occurred_at": new Date('2026-05-24T10:06:00Z'),
            
        
    
        
        
            
                "details": "Payment matched to bank transaction",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "expense_submitted",
            
        
    
        
        
            
                "entity_name": "expenses",
            
        
    
        
        
            
                "entity_reference": "Team lunch during client workshop",
            
        
    
        
        
            
                "occurred_at": new Date('2026-05-14T17:20:00Z'),
            
        
    
        
        
            
                "details": "Receipt submitted for approval",
            
        
    
    },
    
];




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

    
    
    
    
    
        
    

    
    
    
        
            
            async function associateOrganizationMembershipWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership0 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrganizationMembership0?.setOrganization)
                {
                    await
                    OrganizationMembership0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership1 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrganizationMembership1?.setOrganization)
                {
                    await
                    OrganizationMembership1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership2 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrganizationMembership2?.setOrganization)
                {
                    await
                    OrganizationMembership2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership3 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrganizationMembership3?.setOrganization)
                {
                    await
                    OrganizationMembership3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateOrganizationMembershipWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership0 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrganizationMembership0?.setUser)
                {
                    await
                    OrganizationMembership0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership1 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrganizationMembership1?.setUser)
                {
                    await
                    OrganizationMembership1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership2 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrganizationMembership2?.setUser)
                {
                    await
                    OrganizationMembership2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership3 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrganizationMembership3?.setUser)
                {
                    await
                    OrganizationMembership3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
            
            async function associateCurrencyWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Currency0 = await Currencies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Currency0?.setOrganization)
                {
                    await
                    Currency0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Currency1 = await Currencies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Currency1?.setOrganization)
                {
                    await
                    Currency1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Currency2 = await Currencies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Currency2?.setOrganization)
                {
                    await
                    Currency2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Currency3 = await Currencies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Currency3?.setOrganization)
                {
                    await
                    Currency3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTaxRateWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TaxRate0 = await TaxRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TaxRate0?.setOrganization)
                {
                    await
                    TaxRate0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TaxRate1 = await TaxRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TaxRate1?.setOrganization)
                {
                    await
                    TaxRate1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TaxRate2 = await TaxRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TaxRate2?.setOrganization)
                {
                    await
                    TaxRate2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TaxRate3 = await TaxRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (TaxRate3?.setOrganization)
                {
                    await
                    TaxRate3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAccountWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Account0 = await Accounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Account0?.setOrganization)
                {
                    await
                    Account0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Account1 = await Accounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Account1?.setOrganization)
                {
                    await
                    Account1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Account2 = await Accounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Account2?.setOrganization)
                {
                    await
                    Account2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Account3 = await Accounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Account3?.setOrganization)
                {
                    await
                    Account3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateContactWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Contact0 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Contact0?.setOrganization)
                {
                    await
                    Contact0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Contact1 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Contact1?.setOrganization)
                {
                    await
                    Contact1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Contact2 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Contact2?.setOrganization)
                {
                    await
                    Contact2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Contact3 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Contact3?.setOrganization)
                {
                    await
                    Contact3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateContactWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Contact0 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Contact0?.setCurrency)
                {
                    await
                    Contact0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Contact1 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Contact1?.setCurrency)
                {
                    await
                    Contact1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Contact2 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Contact2?.setCurrency)
                {
                    await
                    Contact2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Contact3 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Contact3?.setCurrency)
                {
                    await
                    Contact3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
            
            async function associateContactWithDefault_tax_rate() {
            
                const relatedDefault_tax_rate0 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Contact0 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Contact0?.setDefault_tax_rate)
                {
                    await
                    Contact0.
                    setDefault_tax_rate(relatedDefault_tax_rate0);
                }
            
                const relatedDefault_tax_rate1 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Contact1 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Contact1?.setDefault_tax_rate)
                {
                    await
                    Contact1.
                    setDefault_tax_rate(relatedDefault_tax_rate1);
                }
            
                const relatedDefault_tax_rate2 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Contact2 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Contact2?.setDefault_tax_rate)
                {
                    await
                    Contact2.
                    setDefault_tax_rate(relatedDefault_tax_rate2);
                }
            
                const relatedDefault_tax_rate3 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Contact3 = await Contacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Contact3?.setDefault_tax_rate)
                {
                    await
                    Contact3.
                    setDefault_tax_rate(relatedDefault_tax_rate3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateProductWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setOrganization)
                {
                    await
                    Product0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setOrganization)
                {
                    await
                    Product1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setOrganization)
                {
                    await
                    Product2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setOrganization)
                {
                    await
                    Product3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateProductWithSales_account() {
            
                const relatedSales_account0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setSales_account)
                {
                    await
                    Product0.
                    setSales_account(relatedSales_account0);
                }
            
                const relatedSales_account1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setSales_account)
                {
                    await
                    Product1.
                    setSales_account(relatedSales_account1);
                }
            
                const relatedSales_account2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setSales_account)
                {
                    await
                    Product2.
                    setSales_account(relatedSales_account2);
                }
            
                const relatedSales_account3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setSales_account)
                {
                    await
                    Product3.
                    setSales_account(relatedSales_account3);
                }
            
        }
        
    
        
            
            async function associateProductWithPurchase_account() {
            
                const relatedPurchase_account0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setPurchase_account)
                {
                    await
                    Product0.
                    setPurchase_account(relatedPurchase_account0);
                }
            
                const relatedPurchase_account1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setPurchase_account)
                {
                    await
                    Product1.
                    setPurchase_account(relatedPurchase_account1);
                }
            
                const relatedPurchase_account2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setPurchase_account)
                {
                    await
                    Product2.
                    setPurchase_account(relatedPurchase_account2);
                }
            
                const relatedPurchase_account3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setPurchase_account)
                {
                    await
                    Product3.
                    setPurchase_account(relatedPurchase_account3);
                }
            
        }
        
    
        
            
            async function associateProductWithTax_rate() {
            
                const relatedTax_rate0 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setTax_rate)
                {
                    await
                    Product0.
                    setTax_rate(relatedTax_rate0);
                }
            
                const relatedTax_rate1 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setTax_rate)
                {
                    await
                    Product1.
                    setTax_rate(relatedTax_rate1);
                }
            
                const relatedTax_rate2 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setTax_rate)
                {
                    await
                    Product2.
                    setTax_rate(relatedTax_rate2);
                }
            
                const relatedTax_rate3 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setTax_rate)
                {
                    await
                    Product3.
                    setTax_rate(relatedTax_rate3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateWarehousWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Warehous0 = await Warehouses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Warehous0?.setOrganization)
                {
                    await
                    Warehous0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Warehous1 = await Warehouses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Warehous1?.setOrganization)
                {
                    await
                    Warehous1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Warehous2 = await Warehouses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Warehous2?.setOrganization)
                {
                    await
                    Warehous2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Warehous3 = await Warehouses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Warehous3?.setOrganization)
                {
                    await
                    Warehous3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateInventoryItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryItem0 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryItem0?.setOrganization)
                {
                    await
                    InventoryItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryItem1 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryItem1?.setOrganization)
                {
                    await
                    InventoryItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryItem2 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryItem2?.setOrganization)
                {
                    await
                    InventoryItem2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryItem3 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InventoryItem3?.setOrganization)
                {
                    await
                    InventoryItem3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateInventoryItemWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryItem0 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryItem0?.setProduct)
                {
                    await
                    InventoryItem0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryItem1 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryItem1?.setProduct)
                {
                    await
                    InventoryItem1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryItem2 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryItem2?.setProduct)
                {
                    await
                    InventoryItem2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryItem3 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InventoryItem3?.setProduct)
                {
                    await
                    InventoryItem3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
            
            async function associateInventoryItemWithWarehouse() {
            
                const relatedWarehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryItem0 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryItem0?.setWarehouse)
                {
                    await
                    InventoryItem0.
                    setWarehouse(relatedWarehouse0);
                }
            
                const relatedWarehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryItem1 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryItem1?.setWarehouse)
                {
                    await
                    InventoryItem1.
                    setWarehouse(relatedWarehouse1);
                }
            
                const relatedWarehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryItem2 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryItem2?.setWarehouse)
                {
                    await
                    InventoryItem2.
                    setWarehouse(relatedWarehouse2);
                }
            
                const relatedWarehouse3 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryItem3 = await InventoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InventoryItem3?.setWarehouse)
                {
                    await
                    InventoryItem3.
                    setWarehouse(relatedWarehouse3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateQuoteWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Quote0 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Quote0?.setOrganization)
                {
                    await
                    Quote0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Quote1 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Quote1?.setOrganization)
                {
                    await
                    Quote1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Quote2 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Quote2?.setOrganization)
                {
                    await
                    Quote2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Quote3 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Quote3?.setOrganization)
                {
                    await
                    Quote3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateQuoteWithCustomer() {
            
                const relatedCustomer0 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Quote0 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Quote0?.setCustomer)
                {
                    await
                    Quote0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Quote1 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Quote1?.setCustomer)
                {
                    await
                    Quote1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Quote2 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Quote2?.setCustomer)
                {
                    await
                    Quote2.
                    setCustomer(relatedCustomer2);
                }
            
                const relatedCustomer3 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Quote3 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Quote3?.setCustomer)
                {
                    await
                    Quote3.
                    setCustomer(relatedCustomer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateQuoteWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Quote0 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Quote0?.setCurrency)
                {
                    await
                    Quote0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Quote1 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Quote1?.setCurrency)
                {
                    await
                    Quote1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Quote2 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Quote2?.setCurrency)
                {
                    await
                    Quote2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Quote3 = await Quotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Quote3?.setCurrency)
                {
                    await
                    Quote3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateQuoteLineWithQuote() {
            
                const relatedQuote0 = await Quotes.findOne({
                    offset: Math.floor(Math.random() * (await Quotes.count())),
                });
                const QuoteLine0 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (QuoteLine0?.setQuote)
                {
                    await
                    QuoteLine0.
                    setQuote(relatedQuote0);
                }
            
                const relatedQuote1 = await Quotes.findOne({
                    offset: Math.floor(Math.random() * (await Quotes.count())),
                });
                const QuoteLine1 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (QuoteLine1?.setQuote)
                {
                    await
                    QuoteLine1.
                    setQuote(relatedQuote1);
                }
            
                const relatedQuote2 = await Quotes.findOne({
                    offset: Math.floor(Math.random() * (await Quotes.count())),
                });
                const QuoteLine2 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (QuoteLine2?.setQuote)
                {
                    await
                    QuoteLine2.
                    setQuote(relatedQuote2);
                }
            
                const relatedQuote3 = await Quotes.findOne({
                    offset: Math.floor(Math.random() * (await Quotes.count())),
                });
                const QuoteLine3 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (QuoteLine3?.setQuote)
                {
                    await
                    QuoteLine3.
                    setQuote(relatedQuote3);
                }
            
        }
        
    
        
            
            async function associateQuoteLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const QuoteLine0 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (QuoteLine0?.setProduct)
                {
                    await
                    QuoteLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const QuoteLine1 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (QuoteLine1?.setProduct)
                {
                    await
                    QuoteLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const QuoteLine2 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (QuoteLine2?.setProduct)
                {
                    await
                    QuoteLine2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const QuoteLine3 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (QuoteLine3?.setProduct)
                {
                    await
                    QuoteLine3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateQuoteLineWithTax_rate() {
            
                const relatedTax_rate0 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const QuoteLine0 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (QuoteLine0?.setTax_rate)
                {
                    await
                    QuoteLine0.
                    setTax_rate(relatedTax_rate0);
                }
            
                const relatedTax_rate1 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const QuoteLine1 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (QuoteLine1?.setTax_rate)
                {
                    await
                    QuoteLine1.
                    setTax_rate(relatedTax_rate1);
                }
            
                const relatedTax_rate2 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const QuoteLine2 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (QuoteLine2?.setTax_rate)
                {
                    await
                    QuoteLine2.
                    setTax_rate(relatedTax_rate2);
                }
            
                const relatedTax_rate3 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const QuoteLine3 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (QuoteLine3?.setTax_rate)
                {
                    await
                    QuoteLine3.
                    setTax_rate(relatedTax_rate3);
                }
            
        }
        
    
        
    
        
            
            async function associateQuoteLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const QuoteLine0 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (QuoteLine0?.setOrganization)
                {
                    await
                    QuoteLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const QuoteLine1 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (QuoteLine1?.setOrganization)
                {
                    await
                    QuoteLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const QuoteLine2 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (QuoteLine2?.setOrganization)
                {
                    await
                    QuoteLine2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const QuoteLine3 = await QuoteLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (QuoteLine3?.setOrganization)
                {
                    await
                    QuoteLine3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateInvoiceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setOrganization)
                {
                    await
                    Invoice0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setOrganization)
                {
                    await
                    Invoice1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setOrganization)
                {
                    await
                    Invoice2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setOrganization)
                {
                    await
                    Invoice3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateInvoiceWithCustomer() {
            
                const relatedCustomer0 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setCustomer)
                {
                    await
                    Invoice0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setCustomer)
                {
                    await
                    Invoice1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setCustomer)
                {
                    await
                    Invoice2.
                    setCustomer(relatedCustomer2);
                }
            
                const relatedCustomer3 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setCustomer)
                {
                    await
                    Invoice3.
                    setCustomer(relatedCustomer3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateInvoiceWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setCurrency)
                {
                    await
                    Invoice0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setCurrency)
                {
                    await
                    Invoice1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setCurrency)
                {
                    await
                    Invoice2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setCurrency)
                {
                    await
                    Invoice3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateInvoiceLineWithInvoice() {
            
                const relatedInvoice0 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const InvoiceLine0 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InvoiceLine0?.setInvoice)
                {
                    await
                    InvoiceLine0.
                    setInvoice(relatedInvoice0);
                }
            
                const relatedInvoice1 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const InvoiceLine1 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InvoiceLine1?.setInvoice)
                {
                    await
                    InvoiceLine1.
                    setInvoice(relatedInvoice1);
                }
            
                const relatedInvoice2 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const InvoiceLine2 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InvoiceLine2?.setInvoice)
                {
                    await
                    InvoiceLine2.
                    setInvoice(relatedInvoice2);
                }
            
                const relatedInvoice3 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const InvoiceLine3 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InvoiceLine3?.setInvoice)
                {
                    await
                    InvoiceLine3.
                    setInvoice(relatedInvoice3);
                }
            
        }
        
    
        
            
            async function associateInvoiceLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine0 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InvoiceLine0?.setProduct)
                {
                    await
                    InvoiceLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine1 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InvoiceLine1?.setProduct)
                {
                    await
                    InvoiceLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine2 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InvoiceLine2?.setProduct)
                {
                    await
                    InvoiceLine2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine3 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InvoiceLine3?.setProduct)
                {
                    await
                    InvoiceLine3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateInvoiceLineWithTax_rate() {
            
                const relatedTax_rate0 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const InvoiceLine0 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InvoiceLine0?.setTax_rate)
                {
                    await
                    InvoiceLine0.
                    setTax_rate(relatedTax_rate0);
                }
            
                const relatedTax_rate1 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const InvoiceLine1 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InvoiceLine1?.setTax_rate)
                {
                    await
                    InvoiceLine1.
                    setTax_rate(relatedTax_rate1);
                }
            
                const relatedTax_rate2 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const InvoiceLine2 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InvoiceLine2?.setTax_rate)
                {
                    await
                    InvoiceLine2.
                    setTax_rate(relatedTax_rate2);
                }
            
                const relatedTax_rate3 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const InvoiceLine3 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InvoiceLine3?.setTax_rate)
                {
                    await
                    InvoiceLine3.
                    setTax_rate(relatedTax_rate3);
                }
            
        }
        
    
        
    
        
            
            async function associateInvoiceLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine0 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InvoiceLine0?.setOrganization)
                {
                    await
                    InvoiceLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine1 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InvoiceLine1?.setOrganization)
                {
                    await
                    InvoiceLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine2 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InvoiceLine2?.setOrganization)
                {
                    await
                    InvoiceLine2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine3 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InvoiceLine3?.setOrganization)
                {
                    await
                    InvoiceLine3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBillWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Bill0 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Bill0?.setOrganization)
                {
                    await
                    Bill0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Bill1 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Bill1?.setOrganization)
                {
                    await
                    Bill1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Bill2 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Bill2?.setOrganization)
                {
                    await
                    Bill2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Bill3 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Bill3?.setOrganization)
                {
                    await
                    Bill3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateBillWithSupplier() {
            
                const relatedSupplier0 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Bill0 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Bill0?.setSupplier)
                {
                    await
                    Bill0.
                    setSupplier(relatedSupplier0);
                }
            
                const relatedSupplier1 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Bill1 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Bill1?.setSupplier)
                {
                    await
                    Bill1.
                    setSupplier(relatedSupplier1);
                }
            
                const relatedSupplier2 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Bill2 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Bill2?.setSupplier)
                {
                    await
                    Bill2.
                    setSupplier(relatedSupplier2);
                }
            
                const relatedSupplier3 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Bill3 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Bill3?.setSupplier)
                {
                    await
                    Bill3.
                    setSupplier(relatedSupplier3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBillWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Bill0 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Bill0?.setCurrency)
                {
                    await
                    Bill0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Bill1 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Bill1?.setCurrency)
                {
                    await
                    Bill1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Bill2 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Bill2?.setCurrency)
                {
                    await
                    Bill2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Bill3 = await Bills.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Bill3?.setCurrency)
                {
                    await
                    Bill3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateBillLineWithBill() {
            
                const relatedBill0 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const BillLine0 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillLine0?.setBill)
                {
                    await
                    BillLine0.
                    setBill(relatedBill0);
                }
            
                const relatedBill1 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const BillLine1 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillLine1?.setBill)
                {
                    await
                    BillLine1.
                    setBill(relatedBill1);
                }
            
                const relatedBill2 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const BillLine2 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillLine2?.setBill)
                {
                    await
                    BillLine2.
                    setBill(relatedBill2);
                }
            
                const relatedBill3 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const BillLine3 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BillLine3?.setBill)
                {
                    await
                    BillLine3.
                    setBill(relatedBill3);
                }
            
        }
        
    
        
            
            async function associateBillLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const BillLine0 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillLine0?.setProduct)
                {
                    await
                    BillLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const BillLine1 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillLine1?.setProduct)
                {
                    await
                    BillLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const BillLine2 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillLine2?.setProduct)
                {
                    await
                    BillLine2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const BillLine3 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BillLine3?.setProduct)
                {
                    await
                    BillLine3.
                    setProduct(relatedProduct3);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateBillLineWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BillLine0 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillLine0?.setAccount)
                {
                    await
                    BillLine0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BillLine1 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillLine1?.setAccount)
                {
                    await
                    BillLine1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BillLine2 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillLine2?.setAccount)
                {
                    await
                    BillLine2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BillLine3 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BillLine3?.setAccount)
                {
                    await
                    BillLine3.
                    setAccount(relatedAccount3);
                }
            
        }
        
    
        
            
            async function associateBillLineWithTax_rate() {
            
                const relatedTax_rate0 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const BillLine0 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillLine0?.setTax_rate)
                {
                    await
                    BillLine0.
                    setTax_rate(relatedTax_rate0);
                }
            
                const relatedTax_rate1 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const BillLine1 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillLine1?.setTax_rate)
                {
                    await
                    BillLine1.
                    setTax_rate(relatedTax_rate1);
                }
            
                const relatedTax_rate2 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const BillLine2 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillLine2?.setTax_rate)
                {
                    await
                    BillLine2.
                    setTax_rate(relatedTax_rate2);
                }
            
                const relatedTax_rate3 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const BillLine3 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BillLine3?.setTax_rate)
                {
                    await
                    BillLine3.
                    setTax_rate(relatedTax_rate3);
                }
            
        }
        
    
        
    
        
            
            async function associateBillLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BillLine0 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillLine0?.setOrganization)
                {
                    await
                    BillLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BillLine1 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillLine1?.setOrganization)
                {
                    await
                    BillLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BillLine2 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillLine2?.setOrganization)
                {
                    await
                    BillLine2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BillLine3 = await BillLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BillLine3?.setOrganization)
                {
                    await
                    BillLine3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExpensWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setOrganization)
                {
                    await
                    Expens0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setOrganization)
                {
                    await
                    Expens1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setOrganization)
                {
                    await
                    Expens2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Expens3 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Expens3?.setOrganization)
                {
                    await
                    Expens3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateExpensWithContact() {
            
                const relatedContact0 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setContact)
                {
                    await
                    Expens0.
                    setContact(relatedContact0);
                }
            
                const relatedContact1 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setContact)
                {
                    await
                    Expens1.
                    setContact(relatedContact1);
                }
            
                const relatedContact2 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setContact)
                {
                    await
                    Expens2.
                    setContact(relatedContact2);
                }
            
                const relatedContact3 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Expens3 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Expens3?.setContact)
                {
                    await
                    Expens3.
                    setContact(relatedContact3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExpensWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setCurrency)
                {
                    await
                    Expens0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setCurrency)
                {
                    await
                    Expens1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setCurrency)
                {
                    await
                    Expens2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Expens3 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Expens3?.setCurrency)
                {
                    await
                    Expens3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
            
            async function associateExpensWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setAccount)
                {
                    await
                    Expens0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setAccount)
                {
                    await
                    Expens1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setAccount)
                {
                    await
                    Expens2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Expens3 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Expens3?.setAccount)
                {
                    await
                    Expens3.
                    setAccount(relatedAccount3);
                }
            
        }
        
    
        
            
            async function associateExpensWithTax_rate() {
            
                const relatedTax_rate0 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setTax_rate)
                {
                    await
                    Expens0.
                    setTax_rate(relatedTax_rate0);
                }
            
                const relatedTax_rate1 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setTax_rate)
                {
                    await
                    Expens1.
                    setTax_rate(relatedTax_rate1);
                }
            
                const relatedTax_rate2 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setTax_rate)
                {
                    await
                    Expens2.
                    setTax_rate(relatedTax_rate2);
                }
            
                const relatedTax_rate3 = await TaxRates.findOne({
                    offset: Math.floor(Math.random() * (await TaxRates.count())),
                });
                const Expens3 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Expens3?.setTax_rate)
                {
                    await
                    Expens3.
                    setTax_rate(relatedTax_rate3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateBankAccountWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankAccount0 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BankAccount0?.setOrganization)
                {
                    await
                    BankAccount0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankAccount1 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BankAccount1?.setOrganization)
                {
                    await
                    BankAccount1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankAccount2 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BankAccount2?.setOrganization)
                {
                    await
                    BankAccount2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankAccount3 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BankAccount3?.setOrganization)
                {
                    await
                    BankAccount3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBankAccountWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankAccount0 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BankAccount0?.setCurrency)
                {
                    await
                    BankAccount0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankAccount1 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BankAccount1?.setCurrency)
                {
                    await
                    BankAccount1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankAccount2 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BankAccount2?.setCurrency)
                {
                    await
                    BankAccount2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankAccount3 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BankAccount3?.setCurrency)
                {
                    await
                    BankAccount3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
            
            async function associateBankAccountWithGl_account() {
            
                const relatedGl_account0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BankAccount0 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BankAccount0?.setGl_account)
                {
                    await
                    BankAccount0.
                    setGl_account(relatedGl_account0);
                }
            
                const relatedGl_account1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BankAccount1 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BankAccount1?.setGl_account)
                {
                    await
                    BankAccount1.
                    setGl_account(relatedGl_account1);
                }
            
                const relatedGl_account2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BankAccount2 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BankAccount2?.setGl_account)
                {
                    await
                    BankAccount2.
                    setGl_account(relatedGl_account2);
                }
            
                const relatedGl_account3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const BankAccount3 = await BankAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BankAccount3?.setGl_account)
                {
                    await
                    BankAccount3.
                    setGl_account(relatedGl_account3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateBankTransactionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankTransaction0 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BankTransaction0?.setOrganization)
                {
                    await
                    BankTransaction0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankTransaction1 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BankTransaction1?.setOrganization)
                {
                    await
                    BankTransaction1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankTransaction2 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BankTransaction2?.setOrganization)
                {
                    await
                    BankTransaction2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BankTransaction3 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BankTransaction3?.setOrganization)
                {
                    await
                    BankTransaction3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateBankTransactionWithBank_account() {
            
                const relatedBank_account0 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const BankTransaction0 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BankTransaction0?.setBank_account)
                {
                    await
                    BankTransaction0.
                    setBank_account(relatedBank_account0);
                }
            
                const relatedBank_account1 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const BankTransaction1 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BankTransaction1?.setBank_account)
                {
                    await
                    BankTransaction1.
                    setBank_account(relatedBank_account1);
                }
            
                const relatedBank_account2 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const BankTransaction2 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BankTransaction2?.setBank_account)
                {
                    await
                    BankTransaction2.
                    setBank_account(relatedBank_account2);
                }
            
                const relatedBank_account3 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const BankTransaction3 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BankTransaction3?.setBank_account)
                {
                    await
                    BankTransaction3.
                    setBank_account(relatedBank_account3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBankTransactionWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankTransaction0 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BankTransaction0?.setCurrency)
                {
                    await
                    BankTransaction0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankTransaction1 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BankTransaction1?.setCurrency)
                {
                    await
                    BankTransaction1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankTransaction2 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BankTransaction2?.setCurrency)
                {
                    await
                    BankTransaction2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const BankTransaction3 = await BankTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BankTransaction3?.setCurrency)
                {
                    await
                    BankTransaction3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaymentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setOrganization)
                {
                    await
                    Payment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setOrganization)
                {
                    await
                    Payment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setOrganization)
                {
                    await
                    Payment2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setOrganization)
                {
                    await
                    Payment3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePaymentWithCurrency() {
            
                const relatedCurrency0 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setCurrency)
                {
                    await
                    Payment0.
                    setCurrency(relatedCurrency0);
                }
            
                const relatedCurrency1 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setCurrency)
                {
                    await
                    Payment1.
                    setCurrency(relatedCurrency1);
                }
            
                const relatedCurrency2 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setCurrency)
                {
                    await
                    Payment2.
                    setCurrency(relatedCurrency2);
                }
            
                const relatedCurrency3 = await Currencies.findOne({
                    offset: Math.floor(Math.random() * (await Currencies.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setCurrency)
                {
                    await
                    Payment3.
                    setCurrency(relatedCurrency3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithBank_account() {
            
                const relatedBank_account0 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setBank_account)
                {
                    await
                    Payment0.
                    setBank_account(relatedBank_account0);
                }
            
                const relatedBank_account1 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setBank_account)
                {
                    await
                    Payment1.
                    setBank_account(relatedBank_account1);
                }
            
                const relatedBank_account2 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setBank_account)
                {
                    await
                    Payment2.
                    setBank_account(relatedBank_account2);
                }
            
                const relatedBank_account3 = await BankAccounts.findOne({
                    offset: Math.floor(Math.random() * (await BankAccounts.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setBank_account)
                {
                    await
                    Payment3.
                    setBank_account(relatedBank_account3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithContact() {
            
                const relatedContact0 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setContact)
                {
                    await
                    Payment0.
                    setContact(relatedContact0);
                }
            
                const relatedContact1 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setContact)
                {
                    await
                    Payment1.
                    setContact(relatedContact1);
                }
            
                const relatedContact2 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setContact)
                {
                    await
                    Payment2.
                    setContact(relatedContact2);
                }
            
                const relatedContact3 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setContact)
                {
                    await
                    Payment3.
                    setContact(relatedContact3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithInvoice() {
            
                const relatedInvoice0 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setInvoice)
                {
                    await
                    Payment0.
                    setInvoice(relatedInvoice0);
                }
            
                const relatedInvoice1 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setInvoice)
                {
                    await
                    Payment1.
                    setInvoice(relatedInvoice1);
                }
            
                const relatedInvoice2 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setInvoice)
                {
                    await
                    Payment2.
                    setInvoice(relatedInvoice2);
                }
            
                const relatedInvoice3 = await Invoices.findOne({
                    offset: Math.floor(Math.random() * (await Invoices.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setInvoice)
                {
                    await
                    Payment3.
                    setInvoice(relatedInvoice3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithBill() {
            
                const relatedBill0 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setBill)
                {
                    await
                    Payment0.
                    setBill(relatedBill0);
                }
            
                const relatedBill1 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setBill)
                {
                    await
                    Payment1.
                    setBill(relatedBill1);
                }
            
                const relatedBill2 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setBill)
                {
                    await
                    Payment2.
                    setBill(relatedBill2);
                }
            
                const relatedBill3 = await Bills.findOne({
                    offset: Math.floor(Math.random() * (await Bills.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setBill)
                {
                    await
                    Payment3.
                    setBill(relatedBill3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateJournalEntryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalEntry0 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalEntry0?.setOrganization)
                {
                    await
                    JournalEntry0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalEntry1 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalEntry1?.setOrganization)
                {
                    await
                    JournalEntry1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalEntry2 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalEntry2?.setOrganization)
                {
                    await
                    JournalEntry2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalEntry3 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JournalEntry3?.setOrganization)
                {
                    await
                    JournalEntry3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateJournalEntryWithSource_bank_transaction() {
            
                const relatedSource_bank_transaction0 = await BankTransactions.findOne({
                    offset: Math.floor(Math.random() * (await BankTransactions.count())),
                });
                const JournalEntry0 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalEntry0?.setSource_bank_transaction)
                {
                    await
                    JournalEntry0.
                    setSource_bank_transaction(relatedSource_bank_transaction0);
                }
            
                const relatedSource_bank_transaction1 = await BankTransactions.findOne({
                    offset: Math.floor(Math.random() * (await BankTransactions.count())),
                });
                const JournalEntry1 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalEntry1?.setSource_bank_transaction)
                {
                    await
                    JournalEntry1.
                    setSource_bank_transaction(relatedSource_bank_transaction1);
                }
            
                const relatedSource_bank_transaction2 = await BankTransactions.findOne({
                    offset: Math.floor(Math.random() * (await BankTransactions.count())),
                });
                const JournalEntry2 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalEntry2?.setSource_bank_transaction)
                {
                    await
                    JournalEntry2.
                    setSource_bank_transaction(relatedSource_bank_transaction2);
                }
            
                const relatedSource_bank_transaction3 = await BankTransactions.findOne({
                    offset: Math.floor(Math.random() * (await BankTransactions.count())),
                });
                const JournalEntry3 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JournalEntry3?.setSource_bank_transaction)
                {
                    await
                    JournalEntry3.
                    setSource_bank_transaction(relatedSource_bank_transaction3);
                }
            
        }
        
    
        
    

    
    
    
        
            
            async function associateJournalLineWithJournal_entry() {
            
                const relatedJournal_entry0 = await JournalEntries.findOne({
                    offset: Math.floor(Math.random() * (await JournalEntries.count())),
                });
                const JournalLine0 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalLine0?.setJournal_entry)
                {
                    await
                    JournalLine0.
                    setJournal_entry(relatedJournal_entry0);
                }
            
                const relatedJournal_entry1 = await JournalEntries.findOne({
                    offset: Math.floor(Math.random() * (await JournalEntries.count())),
                });
                const JournalLine1 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalLine1?.setJournal_entry)
                {
                    await
                    JournalLine1.
                    setJournal_entry(relatedJournal_entry1);
                }
            
                const relatedJournal_entry2 = await JournalEntries.findOne({
                    offset: Math.floor(Math.random() * (await JournalEntries.count())),
                });
                const JournalLine2 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalLine2?.setJournal_entry)
                {
                    await
                    JournalLine2.
                    setJournal_entry(relatedJournal_entry2);
                }
            
                const relatedJournal_entry3 = await JournalEntries.findOne({
                    offset: Math.floor(Math.random() * (await JournalEntries.count())),
                });
                const JournalLine3 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JournalLine3?.setJournal_entry)
                {
                    await
                    JournalLine3.
                    setJournal_entry(relatedJournal_entry3);
                }
            
        }
        
    
        
            
            async function associateJournalLineWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const JournalLine0 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalLine0?.setAccount)
                {
                    await
                    JournalLine0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const JournalLine1 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalLine1?.setAccount)
                {
                    await
                    JournalLine1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const JournalLine2 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalLine2?.setAccount)
                {
                    await
                    JournalLine2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const JournalLine3 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JournalLine3?.setAccount)
                {
                    await
                    JournalLine3.
                    setAccount(relatedAccount3);
                }
            
        }
        
    
        
            
            async function associateJournalLineWithContact() {
            
                const relatedContact0 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const JournalLine0 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalLine0?.setContact)
                {
                    await
                    JournalLine0.
                    setContact(relatedContact0);
                }
            
                const relatedContact1 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const JournalLine1 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalLine1?.setContact)
                {
                    await
                    JournalLine1.
                    setContact(relatedContact1);
                }
            
                const relatedContact2 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const JournalLine2 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalLine2?.setContact)
                {
                    await
                    JournalLine2.
                    setContact(relatedContact2);
                }
            
                const relatedContact3 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const JournalLine3 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JournalLine3?.setContact)
                {
                    await
                    JournalLine3.
                    setContact(relatedContact3);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateJournalLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalLine0 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalLine0?.setOrganization)
                {
                    await
                    JournalLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalLine1 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalLine1?.setOrganization)
                {
                    await
                    JournalLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalLine2 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalLine2?.setOrganization)
                {
                    await
                    JournalLine2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const JournalLine3 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (JournalLine3?.setOrganization)
                {
                    await
                    JournalLine3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDocumentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setOrganization)
                {
                    await
                    Document0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setOrganization)
                {
                    await
                    Document1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setOrganization)
                {
                    await
                    Document2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setOrganization)
                {
                    await
                    Document3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDocumentWithContact() {
            
                const relatedContact0 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setContact)
                {
                    await
                    Document0.
                    setContact(relatedContact0);
                }
            
                const relatedContact1 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setContact)
                {
                    await
                    Document1.
                    setContact(relatedContact1);
                }
            
                const relatedContact2 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setContact)
                {
                    await
                    Document2.
                    setContact(relatedContact2);
                }
            
                const relatedContact3 = await Contacts.findOne({
                    offset: Math.floor(Math.random() * (await Contacts.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setContact)
                {
                    await
                    Document3.
                    setContact(relatedContact3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateAuditEventWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent0 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditEvent0?.setOrganization)
                {
                    await
                    AuditEvent0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent1 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditEvent1?.setOrganization)
                {
                    await
                    AuditEvent1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent2 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditEvent2?.setOrganization)
                {
                    await
                    AuditEvent2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent3 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditEvent3?.setOrganization)
                {
                    await
                    AuditEvent3.
                    setOrganization(relatedOrganization3);
                }
            
        }
        
    
        
            
            async function associateAuditEventWithActor() {
            
                const relatedActor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent0 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditEvent0?.setActor)
                {
                    await
                    AuditEvent0.
                    setActor(relatedActor0);
                }
            
                const relatedActor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent1 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditEvent1?.setActor)
                {
                    await
                    AuditEvent1.
                    setActor(relatedActor1);
                }
            
                const relatedActor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent2 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditEvent2?.setActor)
                {
                    await
                    AuditEvent2.
                    setActor(relatedActor2);
                }
            
                const relatedActor3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent3 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditEvent3?.setActor)
                {
                    await
                    AuditEvent3.
                    setActor(relatedActor3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await OrganizationMemberships.bulkCreate(OrganizationMembershipsData);
                
            
            
                
                await Currencies.bulkCreate(CurrenciesData);
                
            
            
                
                await TaxRates.bulkCreate(TaxRatesData);
                
            
            
                
                await Accounts.bulkCreate(AccountsData);
                
            
            
                
                await Contacts.bulkCreate(ContactsData);
                
            
            
                
                await Products.bulkCreate(ProductsData);
                
            
            
                
                await Warehouses.bulkCreate(WarehousesData);
                
            
            
                
                await InventoryItems.bulkCreate(InventoryItemsData);
                
            
            
                
                await Quotes.bulkCreate(QuotesData);
                
            
            
                
                await QuoteLines.bulkCreate(QuoteLinesData);
                
            
            
                
                await Invoices.bulkCreate(InvoicesData);
                
            
            
                
                await InvoiceLines.bulkCreate(InvoiceLinesData);
                
            
            
                
                await Bills.bulkCreate(BillsData);
                
            
            
                
                await BillLines.bulkCreate(BillLinesData);
                
            
            
                
                await Expenses.bulkCreate(ExpensesData);
                
            
            
                
                await BankAccounts.bulkCreate(BankAccountsData);
                
            
            
                
                await BankTransactions.bulkCreate(BankTransactionsData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await JournalEntries.bulkCreate(JournalEntriesData);
                
            
            
                
                await JournalLines.bulkCreate(JournalLinesData);
                
            
            
                
                await Documents.bulkCreate(DocumentsData);
                
            
            
                
                await AuditEvents.bulkCreate(AuditEventsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                        
                        await associateOrganizationMembershipWithOrganization(),
                    
                
                    
                        
                        await associateOrganizationMembershipWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCurrencyWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTaxRateWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAccountWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateContactWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateContactWithCurrency(),
                    
                
                    
                        
                        await associateContactWithDefault_tax_rate(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateProductWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProductWithSales_account(),
                    
                
                    
                        
                        await associateProductWithPurchase_account(),
                    
                
                    
                        
                        await associateProductWithTax_rate(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateWarehousWithOrganization(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateInventoryItemWithOrganization(),
                    
                
                    
                        
                        await associateInventoryItemWithProduct(),
                    
                
                    
                        
                        await associateInventoryItemWithWarehouse(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateQuoteWithOrganization(),
                    
                
                    
                        
                        await associateQuoteWithCustomer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateQuoteWithCurrency(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateQuoteLineWithQuote(),
                    
                
                    
                        
                        await associateQuoteLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateQuoteLineWithTax_rate(),
                    
                
                    
                
                    
                        
                        await associateQuoteLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateInvoiceWithOrganization(),
                    
                
                    
                        
                        await associateInvoiceWithCustomer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInvoiceWithCurrency(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateInvoiceLineWithInvoice(),
                    
                
                    
                        
                        await associateInvoiceLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInvoiceLineWithTax_rate(),
                    
                
                    
                
                    
                        
                        await associateInvoiceLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBillWithOrganization(),
                    
                
                    
                        
                        await associateBillWithSupplier(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBillWithCurrency(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateBillLineWithBill(),
                    
                
                    
                        
                        await associateBillLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBillLineWithAccount(),
                    
                
                    
                        
                        await associateBillLineWithTax_rate(),
                    
                
                    
                
                    
                        
                        await associateBillLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateExpensWithOrganization(),
                    
                
                    
                        
                        await associateExpensWithContact(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExpensWithCurrency(),
                    
                
                    
                        
                        await associateExpensWithAccount(),
                    
                
                    
                        
                        await associateExpensWithTax_rate(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateBankAccountWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBankAccountWithCurrency(),
                    
                
                    
                        
                        await associateBankAccountWithGl_account(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateBankTransactionWithOrganization(),
                    
                
                    
                        
                        await associateBankTransactionWithBank_account(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBankTransactionWithCurrency(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaymentWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePaymentWithCurrency(),
                    
                
                    
                        
                        await associatePaymentWithBank_account(),
                    
                
                    
                        
                        await associatePaymentWithContact(),
                    
                
                    
                        
                        await associatePaymentWithInvoice(),
                    
                
                    
                        
                        await associatePaymentWithBill(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateJournalEntryWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateJournalEntryWithSource_bank_transaction(),
                    
                
                    
                
            
                
                
                    
                        
                        await associateJournalLineWithJournal_entry(),
                    
                
                    
                        
                        await associateJournalLineWithAccount(),
                    
                
                    
                        
                        await associateJournalLineWithContact(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateJournalLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDocumentWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDocumentWithContact(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAuditEventWithOrganization(),
                    
                
                    
                        
                        await associateAuditEventWithActor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('organization_memberships', null, {});
            
            
            await queryInterface.bulkDelete('currencies', null, {});
            
            
            await queryInterface.bulkDelete('tax_rates', null, {});
            
            
            await queryInterface.bulkDelete('accounts', null, {});
            
            
            await queryInterface.bulkDelete('contacts', null, {});
            
            
            await queryInterface.bulkDelete('products', null, {});
            
            
            await queryInterface.bulkDelete('warehouses', null, {});
            
            
            await queryInterface.bulkDelete('inventory_items', null, {});
            
            
            await queryInterface.bulkDelete('quotes', null, {});
            
            
            await queryInterface.bulkDelete('quote_lines', null, {});
            
            
            await queryInterface.bulkDelete('invoices', null, {});
            
            
            await queryInterface.bulkDelete('invoice_lines', null, {});
            
            
            await queryInterface.bulkDelete('bills', null, {});
            
            
            await queryInterface.bulkDelete('bill_lines', null, {});
            
            
            await queryInterface.bulkDelete('expenses', null, {});
            
            
            await queryInterface.bulkDelete('bank_accounts', null, {});
            
            
            await queryInterface.bulkDelete('bank_transactions', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('journal_entries', null, {});
            
            
            await queryInterface.bulkDelete('journal_lines', null, {});
            
            
            await queryInterface.bulkDelete('documents', null, {});
            
            
            await queryInterface.bulkDelete('audit_events', null, {});
            
        
    },
};