





















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






const Organizations = db.organizations;

const Companies = db.companies;

const Branches = db.branches;

const UserRoles = db.user_roles;

const AuditLogs = db.audit_logs;

const ProductCategories = db.product_categories;

const Products = db.products;

const PriceLists = db.price_lists;

const PriceListItems = db.price_list_items;

const Warehouses = db.warehouses;

const InventoryBatches = db.inventory_batches;

const InventoryTransactions = db.inventory_transactions;

const StockAdjustments = db.stock_adjustments;

const StockAdjustmentLines = db.stock_adjustment_lines;

const InterbranchTransfers = db.interbranch_transfers;

const TransferLines = db.transfer_lines;

const Suppliers = db.suppliers;

const SupplierProducts = db.supplier_products;

const PurchaseOrders = db.purchase_orders;

const PurchaseOrderLines = db.purchase_order_lines;

const GoodsReceipts = db.goods_receipts;

const GoodsReceiptLines = db.goods_receipt_lines;

const SupplierInvoices = db.supplier_invoices;

const Customers = db.customers;

const LoyaltyPrograms = db.loyalty_programs;

const PosRegisters = db.pos_registers;

const PosShifts = db.pos_shifts;

const Sales = db.sales;

const SaleLines = db.sale_lines;

const Payments = db.payments;

const Refunds = db.refunds;

const StoreChecklists = db.store_checklists;

const ChecklistItems = db.checklist_items;

const ChecklistRuns = db.checklist_runs;

const ChecklistRunItems = db.checklist_run_items;

const RiskAlerts = db.risk_alerts;

const Departments = db.departments;

const Employees = db.employees;

const WorkShifts = db.work_shifts;

const ShiftAssignments = db.shift_assignments;

const AttendanceRecords = db.attendance_records;

const PayrollRuns = db.payroll_runs;

const PayrollItems = db.payroll_items;

const PerformanceReviews = db.performance_reviews;

const ChartAccounts = db.chart_accounts;

const JournalEntries = db.journal_entries;

const JournalLines = db.journal_lines;

const Expenses = db.expenses;

const Assets = db.assets;

const MarketingCampaigns = db.marketing_campaigns;

const CampaignRecipients = db.campaign_recipients;

const AiReorderSuggestions = db.ai_reorder_suggestions;







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



const CompaniesData = [
    
    {
    
        
        
            
                "legal_name": "Marie Curie",
            
        
    
        
        
            
                "trade_name": "Grace Hopper",
            
        
    
        
        
            
                "registration_number": "Grace Hopper",
            
        
    
        
        
            
                "tax_number": "Marie Curie",
            
        
    
        
        
            
                "currency_code": "Grace Hopper",
            
        
    
        
        
            
                "timezone": "Marie Curie",
            
        
    
        
        
            
                "support_email": "Grace Hopper",
            
        
    
        
        
            
                "support_phone": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "legal_name": "Ada Lovelace",
            
        
    
        
        
            
                "trade_name": "Marie Curie",
            
        
    
        
        
            
                "registration_number": "Marie Curie",
            
        
    
        
        
            
                "tax_number": "Ada Lovelace",
            
        
    
        
        
            
                "currency_code": "Ada Lovelace",
            
        
    
        
        
            
                "timezone": "Marie Curie",
            
        
    
        
        
            
                "support_email": "Alan Turing",
            
        
    
        
        
            
                "support_phone": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "legal_name": "Marie Curie",
            
        
    
        
        
            
                "trade_name": "Grace Hopper",
            
        
    
        
        
            
                "registration_number": "Marie Curie",
            
        
    
        
        
            
                "tax_number": "Marie Curie",
            
        
    
        
        
            
                "currency_code": "Ada Lovelace",
            
        
    
        
        
            
                "timezone": "Alan Turing",
            
        
    
        
        
            
                "support_email": "Alan Turing",
            
        
    
        
        
            
                "support_phone": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BranchesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "branch_name": "Ada Lovelace",
            
        
    
        
        
            
                "branch_code": "Marie Curie",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "address_line": "Alan Turing",
            
        
    
        
        
            
                "city": "Ada Lovelace",
            
        
    
        
        
            
                "region": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "branch_name": "Grace Hopper",
            
        
    
        
        
            
                "branch_code": "Alan Turing",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "address_line": "Alan Turing",
            
        
    
        
        
            
                "city": "Grace Hopper",
            
        
    
        
        
            
                "region": "Marie Curie",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "branch_name": "Ada Lovelace",
            
        
    
        
        
            
                "branch_code": "Marie Curie",
            
        
    
        
        
            
                "phone": "Grace Hopper",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "address_line": "Ada Lovelace",
            
        
    
        
        
            
                "city": "Grace Hopper",
            
        
    
        
        
            
                "region": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const UserRolesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_primary": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "is_primary": false,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "is_primary": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AuditLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Grace Hopper",
            
        
    
        
        
            
                "entity_name": "Ada Lovelace",
            
        
    
        
        
            
                "record_key": "Alan Turing",
            
        
    
        
        
            
                "ip_address": "Grace Hopper",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Marie Curie",
            
        
    
        
        
            
                "entity_name": "Alan Turing",
            
        
    
        
        
            
                "record_key": "Alan Turing",
            
        
    
        
        
            
                "ip_address": "Marie Curie",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Marie Curie",
            
        
    
        
        
            
                "entity_name": "Ada Lovelace",
            
        
    
        
        
            
                "record_key": "Ada Lovelace",
            
        
    
        
        
            
                "ip_address": "Grace Hopper",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ProductCategoriesData = [
    
    {
    
        
        
            
                "category_name": "Grace Hopper",
            
        
    
        
        
            
                "category_code": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "category_name": "Marie Curie",
            
        
    
        
        
            
                "category_code": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "category_name": "Alan Turing",
            
        
    
        
        
            
                "category_code": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ProductsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "product_name": "Marie Curie",
            
        
    
        
        
            
                "sku": "Marie Curie",
            
        
    
        
        
            
                "barcode": "Alan Turing",
            
        
    
        
        
            
                "product_type": "bundle",
            
        
    
        
        
            
                "unit_of_measure": "Ada Lovelace",
            
        
    
        
        
            
                "tax_rate": 8.61,
            
        
    
        
        
            
                "default_cost": 1.74,
            
        
    
        
        
            
                "default_price": 3.87,
            
        
    
        
        
            
                "minimum_price": 5.29,
            
        
    
        
        
            
                "is_taxable": true,
            
        
    
        
        
            
                "track_batch": false,
            
        
    
        
        
            
                "track_expiry": true,
            
        
    
        
        
            
                "reorder_level": 9,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "product_name": "Alan Turing",
            
        
    
        
        
            
                "sku": "Ada Lovelace",
            
        
    
        
        
            
                "barcode": "Ada Lovelace",
            
        
    
        
        
            
                "product_type": "stock_item",
            
        
    
        
        
            
                "unit_of_measure": "Grace Hopper",
            
        
    
        
        
            
                "tax_rate": 1.82,
            
        
    
        
        
            
                "default_cost": 2.67,
            
        
    
        
        
            
                "default_price": 1.89,
            
        
    
        
        
            
                "minimum_price": 1.83,
            
        
    
        
        
            
                "is_taxable": false,
            
        
    
        
        
            
                "track_batch": true,
            
        
    
        
        
            
                "track_expiry": false,
            
        
    
        
        
            
                "reorder_level": 9,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "product_name": "Alan Turing",
            
        
    
        
        
            
                "sku": "Marie Curie",
            
        
    
        
        
            
                "barcode": "Alan Turing",
            
        
    
        
        
            
                "product_type": "service",
            
        
    
        
        
            
                "unit_of_measure": "Grace Hopper",
            
        
    
        
        
            
                "tax_rate": 1.62,
            
        
    
        
        
            
                "default_cost": 3.05,
            
        
    
        
        
            
                "default_price": 6.1,
            
        
    
        
        
            
                "minimum_price": 2.85,
            
        
    
        
        
            
                "is_taxable": true,
            
        
    
        
        
            
                "track_batch": false,
            
        
    
        
        
            
                "track_expiry": true,
            
        
    
        
        
            
                "reorder_level": 3,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PriceListsData = [
    
    {
    
        
        
            
                "price_list_name": "Grace Hopper",
            
        
    
        
        
            
                "scope": "company",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "price_list_name": "Alan Turing",
            
        
    
        
        
            
                "scope": "company",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "price_list_name": "Ada Lovelace",
            
        
    
        
        
            
                "scope": "company",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PriceListItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "unit_price": 3.83,
            
        
    
        
        
            
                "min_unit_price": 3.96,
            
        
    
        
        
            
                "is_promo": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "unit_price": 2.68,
            
        
    
        
        
            
                "min_unit_price": 0.4,
            
        
    
        
        
            
                "is_promo": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "unit_price": 7.93,
            
        
    
        
        
            
                "min_unit_price": 7.81,
            
        
    
        
        
            
                "is_promo": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WarehousesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "warehouse_name": "Ada Lovelace",
            
        
    
        
        
            
                "warehouse_code": "Marie Curie",
            
        
    
        
        
            
                "is_default": false,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "warehouse_name": "Grace Hopper",
            
        
    
        
        
            
                "warehouse_code": "Marie Curie",
            
        
    
        
        
            
                "is_default": false,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "warehouse_name": "Grace Hopper",
            
        
    
        
        
            
                "warehouse_code": "Grace Hopper",
            
        
    
        
        
            
                "is_default": false,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const InventoryBatchesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "batch_code": "Ada Lovelace",
            
        
    
        
        
            
                "manufactured_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "quantity_on_hand": 0.05,
            
        
    
        
        
            
                "unit_cost": 9.41,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "batch_code": "Alan Turing",
            
        
    
        
        
            
                "manufactured_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "quantity_on_hand": 2.72,
            
        
    
        
        
            
                "unit_cost": 5.71,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "batch_code": "Grace Hopper",
            
        
    
        
        
            
                "manufactured_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "quantity_on_hand": 9.33,
            
        
    
        
        
            
                "unit_cost": 0.26,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const InventoryTransactionsData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "txn_type": "adjustment_in",
            
        
    
        
        
            
                "quantity": 4.99,
            
        
    
        
        
            
                "unit_cost": 9.7,
            
        
    
        
        
            
                "txn_at": new Date(Date.now()),
            
        
    
        
        
            
                "reference": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "txn_type": "transfer_out",
            
        
    
        
        
            
                "quantity": 3.11,
            
        
    
        
        
            
                "unit_cost": 3.31,
            
        
    
        
        
            
                "txn_at": new Date(Date.now()),
            
        
    
        
        
            
                "reference": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "txn_type": "count_variance",
            
        
    
        
        
            
                "quantity": 6.18,
            
        
    
        
        
            
                "unit_cost": 6.54,
            
        
    
        
        
            
                "txn_at": new Date(Date.now()),
            
        
    
        
        
            
                "reference": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StockAdjustmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "adjustment_number": "Alan Turing",
            
        
    
        
        
            
                "reason": "shrinkage",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "adjustment_number": "Alan Turing",
            
        
    
        
        
            
                "reason": "count_correction",
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "adjustment_number": "Ada Lovelace",
            
        
    
        
        
            
                "reason": "damage",
            
        
    
        
        
            
                "status": "posted",
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StockAdjustmentLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_delta": 5.82,
            
        
    
        
        
            
                "unit_cost": 0.82,
            
        
    
        
        
            
                "line_notes": "Alan Turing",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "quantity_delta": 7.68,
            
        
    
        
        
            
                "unit_cost": 7.85,
            
        
    
        
        
            
                "line_notes": "Marie Curie",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "quantity_delta": 4.99,
            
        
    
        
        
            
                "unit_cost": 1.27,
            
        
    
        
        
            
                "line_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const InterbranchTransfersData = [
    
    {
    
        
        
            
                "transfer_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "dispatched_at": new Date(Date.now()),
            
        
    
        
        
            
                "received_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "transfer_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "in_transit",
            
        
    
        
        
            
                "dispatched_at": new Date(Date.now()),
            
        
    
        
        
            
                "received_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "transfer_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "dispatched_at": new Date(Date.now()),
            
        
    
        
        
            
                "received_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TransferLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 7.38,
            
        
    
        
        
            
                "unit_cost": 2.48,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "quantity": 7.16,
            
        
    
        
        
            
                "unit_cost": 4.05,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "quantity": 6.43,
            
        
    
        
        
            
                "unit_cost": 6.91,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SuppliersData = [
    
    {
    
        
        
            
                "supplier_name": "Grace Hopper",
            
        
    
        
        
            
                "supplier_code": "Ada Lovelace",
            
        
    
        
        
            
                "contact_name": "Marie Curie",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "address": "Marie Curie",
            
        
    
        
        
            
                "status": "blacklisted",
            
        
    
        
        
            
                "credit_days": 3,
            
        
    
        
        
            
                "credit_limit": 0.27,
            
        
    
        
        
            
                "risk_score": 0.35,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "supplier_name": "Grace Hopper",
            
        
    
        
        
            
                "supplier_code": "Marie Curie",
            
        
    
        
        
            
                "contact_name": "Alan Turing",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "address": "Grace Hopper",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "credit_days": 8,
            
        
    
        
        
            
                "credit_limit": 2.56,
            
        
    
        
        
            
                "risk_score": 6.91,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "supplier_name": "Ada Lovelace",
            
        
    
        
        
            
                "supplier_code": "Ada Lovelace",
            
        
    
        
        
            
                "contact_name": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                "credit_days": 3,
            
        
    
        
        
            
                "credit_limit": 4.02,
            
        
    
        
        
            
                "risk_score": 8.6,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SupplierProductsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "supplier_sku": "Marie Curie",
            
        
    
        
        
            
                "last_price": 0.47,
            
        
    
        
        
            
                "last_price_at": new Date(Date.now()),
            
        
    
        
        
            
                "lead_time_days": 1,
            
        
    
        
        
            
                "is_preferred": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "supplier_sku": "Marie Curie",
            
        
    
        
        
            
                "last_price": 2.47,
            
        
    
        
        
            
                "last_price_at": new Date(Date.now()),
            
        
    
        
        
            
                "lead_time_days": 7,
            
        
    
        
        
            
                "is_preferred": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "supplier_sku": "Ada Lovelace",
            
        
    
        
        
            
                "last_price": 0.48,
            
        
    
        
        
            
                "last_price_at": new Date(Date.now()),
            
        
    
        
        
            
                "lead_time_days": 3,
            
        
    
        
        
            
                "is_preferred": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PurchaseOrdersData = [
    
    {
    
        
        
            
                "po_number": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "matching_status": "matched",
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 7.72,
            
        
    
        
        
            
                "tax_total": 1.2,
            
        
    
        
        
            
                "total_amount": 8.39,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "po_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "matching_status": "partially_matched",
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 2.71,
            
        
    
        
        
            
                "tax_total": 2.08,
            
        
    
        
        
            
                "total_amount": 4.69,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "po_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "received",
            
        
    
        
        
            
                "matching_status": "unmatched",
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 7.27,
            
        
    
        
        
            
                "tax_total": 4.96,
            
        
    
        
        
            
                "total_amount": 9.99,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PurchaseOrderLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_ordered": 8.57,
            
        
    
        
        
            
                "unit_cost": 4.59,
            
        
    
        
        
            
                "line_total": 0.57,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_ordered": 4.51,
            
        
    
        
        
            
                "unit_cost": 8.2,
            
        
    
        
        
            
                "line_total": 7.99,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_ordered": 4.33,
            
        
    
        
        
            
                "unit_cost": 8.0,
            
        
    
        
        
            
                "line_total": 3.79,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GoodsReceiptsData = [
    
    {
    
        
        
            
                "grn_number": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "received_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "total_amount": 2.2,
            
        
    
        
        
            
                "supplier_delivery_note": "Ada Lovelace",
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "grn_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "posted",
            
        
    
        
        
            
                "received_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "total_amount": 6.34,
            
        
    
        
        
            
                "supplier_delivery_note": "Ada Lovelace",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "grn_number": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "posted",
            
        
    
        
        
            
                "received_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "total_amount": 3.25,
            
        
    
        
        
            
                "supplier_delivery_note": "Alan Turing",
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GoodsReceiptLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "batch_code": "Grace Hopper",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "quantity_received": 0.96,
            
        
    
        
        
            
                "unit_cost": 8.11,
            
        
    
        
        
            
                "line_total": 5.34,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "batch_code": "Alan Turing",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "quantity_received": 2.83,
            
        
    
        
        
            
                "unit_cost": 2.9,
            
        
    
        
        
            
                "line_total": 4.68,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "batch_code": "Marie Curie",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "quantity_received": 3.0,
            
        
    
        
        
            
                "unit_cost": 4.91,
            
        
    
        
        
            
                "line_total": 2.24,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SupplierInvoicesData = [
    
    {
    
        
        
            
                "invoice_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "posted",
            
        
    
        
        
            
                "matching_status": "matched",
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 2.54,
            
        
    
        
        
            
                "tax_total": 6.58,
            
        
    
        
        
            
                "total_amount": 3.01,
            
        
    
        
        
            
                "amount_paid": 8.5,
            
        
    
        
        
            
                "attachment_note": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "invoice_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "posted",
            
        
    
        
        
            
                "matching_status": "unmatched",
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 9.43,
            
        
    
        
        
            
                "tax_total": 5.22,
            
        
    
        
        
            
                "total_amount": 9.24,
            
        
    
        
        
            
                "amount_paid": 1.66,
            
        
    
        
        
            
                "attachment_note": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "invoice_number": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                "matching_status": "unmatched",
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 0.48,
            
        
    
        
        
            
                "tax_total": 5.22,
            
        
    
        
        
            
                "total_amount": 9.91,
            
        
    
        
        
            
                "amount_paid": 1.43,
            
        
    
        
        
            
                "attachment_note": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CustomersData = [
    
    {
    
        
        
            
                "customer_name": "Grace Hopper",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "customer_code": "Alan Turing",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                "credit_limit": 7.23,
            
        
    
        
        
            
                "credit_days": 5,
            
        
    
        
        
            
                "loyalty_points_balance": 6,
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "customer_name": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "customer_code": "Grace Hopper",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "credit_limit": 5.82,
            
        
    
        
        
            
                "credit_days": 1,
            
        
    
        
        
            
                "loyalty_points_balance": 5,
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "customer_name": "Marie Curie",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "customer_code": "Grace Hopper",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "credit_limit": 4.51,
            
        
    
        
        
            
                "credit_days": 1,
            
        
    
        
        
            
                "loyalty_points_balance": 2,
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LoyaltyProgramsData = [
    
    {
    
        
        
            
                "program_name": "Alan Turing",
            
        
    
        
        
            
                "earning_method": "amount_spent",
            
        
    
        
        
            
                "earn_rate": 7.9,
            
        
    
        
        
            
                "redeem_value": 3.01,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "program_name": "Marie Curie",
            
        
    
        
        
            
                "earning_method": "per_item",
            
        
    
        
        
            
                "earn_rate": 6.96,
            
        
    
        
        
            
                "redeem_value": 3.32,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "program_name": "Alan Turing",
            
        
    
        
        
            
                "earning_method": "amount_spent",
            
        
    
        
        
            
                "earn_rate": 3.09,
            
        
    
        
        
            
                "redeem_value": 2.0,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PosRegistersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "register_name": "Alan Turing",
            
        
    
        
        
            
                "register_code": "Alan Turing",
            
        
    
        
        
            
                "has_cash_drawer": true,
            
        
    
        
        
            
                "has_receipt_printer": false,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "register_name": "Grace Hopper",
            
        
    
        
        
            
                "register_code": "Ada Lovelace",
            
        
    
        
        
            
                "has_cash_drawer": false,
            
        
    
        
        
            
                "has_receipt_printer": false,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "register_name": "Ada Lovelace",
            
        
    
        
        
            
                "register_code": "Grace Hopper",
            
        
    
        
        
            
                "has_cash_drawer": false,
            
        
    
        
        
            
                "has_receipt_printer": false,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PosShiftsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_number": "Ada Lovelace",
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                "opened_at": new Date(Date.now()),
            
        
    
        
        
            
                "closed_at": new Date(Date.now()),
            
        
    
        
        
            
                "opening_cash": 7.86,
            
        
    
        
        
            
                "closing_cash_counted": 0.3,
            
        
    
        
        
            
                "expected_cash": 8.36,
            
        
    
        
        
            
                "cash_difference": 1.67,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "shift_number": "Alan Turing",
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                "opened_at": new Date(Date.now()),
            
        
    
        
        
            
                "closed_at": new Date(Date.now()),
            
        
    
        
        
            
                "opening_cash": 6.73,
            
        
    
        
        
            
                "closing_cash_counted": 6.31,
            
        
    
        
        
            
                "expected_cash": 1.16,
            
        
    
        
        
            
                "cash_difference": 5.71,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "shift_number": "Grace Hopper",
            
        
    
        
        
            
                "status": "reconciled",
            
        
    
        
        
            
                "opened_at": new Date(Date.now()),
            
        
    
        
        
            
                "closed_at": new Date(Date.now()),
            
        
    
        
        
            
                "opening_cash": 3.49,
            
        
    
        
        
            
                "closing_cash_counted": 0.43,
            
        
    
        
        
            
                "expected_cash": 1.59,
            
        
    
        
        
            
                "cash_difference": 1.31,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SalesData = [
    
    {
    
        
        
            
                "receipt_number": "Alan Turing",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "sale_type": "cash",
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "sold_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 5.82,
            
        
    
        
        
            
                "discount_total": 4.92,
            
        
    
        
        
            
                "tax_total": 9.32,
            
        
    
        
        
            
                "total_amount": 7.51,
            
        
    
        
        
            
                "amount_paid": 4.11,
            
        
    
        
        
            
                "change_due": 6.2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "void_reason": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "receipt_number": "Alan Turing",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "sale_type": "card",
            
        
    
        
        
            
                "status": "refunded",
            
        
    
        
        
            
                "sold_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 2.06,
            
        
    
        
        
            
                "discount_total": 7.54,
            
        
    
        
        
            
                "tax_total": 4.32,
            
        
    
        
        
            
                "total_amount": 9.74,
            
        
    
        
        
            
                "amount_paid": 8.36,
            
        
    
        
        
            
                "change_due": 3.33,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "void_reason": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "receipt_number": "Ada Lovelace",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "sale_type": "credit",
            
        
    
        
        
            
                "status": "voided",
            
        
    
        
        
            
                "sold_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal": 4.18,
            
        
    
        
        
            
                "discount_total": 5.27,
            
        
    
        
        
            
                "tax_total": 6.07,
            
        
    
        
        
            
                "total_amount": 8.74,
            
        
    
        
        
            
                "amount_paid": 3.36,
            
        
    
        
        
            
                "change_due": 7.48,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "void_reason": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SaleLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 5.01,
            
        
    
        
        
            
                "unit_price": 1.18,
            
        
    
        
        
            
                "discount_amount": 3.99,
            
        
    
        
        
            
                "tax_amount": 6.87,
            
        
    
        
        
            
                "line_total": 1.95,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "quantity": 9.48,
            
        
    
        
        
            
                "unit_price": 9.33,
            
        
    
        
        
            
                "discount_amount": 7.23,
            
        
    
        
        
            
                "tax_amount": 7.57,
            
        
    
        
        
            
                "line_total": 0.9,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 7.43,
            
        
    
        
        
            
                "unit_price": 1.75,
            
        
    
        
        
            
                "discount_amount": 4.09,
            
        
    
        
        
            
                "tax_amount": 0.75,
            
        
    
        
        
            
                "line_total": 9.14,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_method": "card",
            
        
    
        
        
            
                "amount": 5.65,
            
        
    
        
        
            
                "provider": "Marie Curie",
            
        
    
        
        
            
                "reference": "Alan Turing",
            
        
    
        
        
            
                "status": "initiated",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_method": "card",
            
        
    
        
        
            
                "amount": 2.92,
            
        
    
        
        
            
                "provider": "Marie Curie",
            
        
    
        
        
            
                "reference": "Marie Curie",
            
        
    
        
        
            
                "status": "refunded",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_method": "mobile_money",
            
        
    
        
        
            
                "amount": 1.98,
            
        
    
        
        
            
                "provider": "Ada Lovelace",
            
        
    
        
        
            
                "reference": "Ada Lovelace",
            
        
    
        
        
            
                "status": "refunded",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RefundsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "refund_number": "Ada Lovelace",
            
        
    
        
        
            
                "refund_method": "cash",
            
        
    
        
        
            
                "amount": 6.09,
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reason": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "refund_number": "Grace Hopper",
            
        
    
        
        
            
                "refund_method": "cash",
            
        
    
        
        
            
                "amount": 0.63,
            
        
    
        
        
            
                "status": "requested",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reason": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "refund_number": "Ada Lovelace",
            
        
    
        
        
            
                "refund_method": "card",
            
        
    
        
        
            
                "amount": 3.5,
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "approved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reason": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StoreChecklistsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "checklist_type": "opening",
            
        
    
        
        
            
                "checklist_name": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "checklist_type": "opening",
            
        
    
        
        
            
                "checklist_name": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "checklist_type": "closing",
            
        
    
        
        
            
                "checklist_name": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ChecklistItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_text": "Alan Turing",
            
        
    
        
        
            
                "sort_order": 6,
            
        
    
        
        
            
                "requires_comment": true,
            
        
    
        
        
            
                "requires_photo": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_text": "Grace Hopper",
            
        
    
        
        
            
                "sort_order": 8,
            
        
    
        
        
            
                "requires_comment": true,
            
        
    
        
        
            
                "requires_photo": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_text": "Ada Lovelace",
            
        
    
        
        
            
                "sort_order": 4,
            
        
    
        
        
            
                "requires_comment": false,
            
        
    
        
        
            
                "requires_photo": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ChecklistRunsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "general_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "general_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "run_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "in_progress",
            
        
    
        
        
            
                "general_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ChecklistRunItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_done": true,
            
        
    
        
        
            
                "comment": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_done": false,
            
        
    
        
        
            
                "comment": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_done": true,
            
        
    
        
        
            
                "comment": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RiskAlertsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "risk_type": "other",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                "detected_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title_text": "Grace Hopper",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "source_reference": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "risk_type": "refund_abuse",
            
        
    
        
        
            
                "severity": "low",
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                "detected_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title_text": "Marie Curie",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "source_reference": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "risk_type": "inventory_shrinkage",
            
        
    
        
        
            
                "severity": "low",
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                "detected_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title_text": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "source_reference": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DepartmentsData = [
    
    {
    
        
        
            
                "department_name": "Alan Turing",
            
        
    
        
        
            
                "department_code": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "department_name": "Grace Hopper",
            
        
    
        
        
            
                "department_code": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "department_name": "Ada Lovelace",
            
        
    
        
        
            
                "department_code": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const EmployeesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "employee_number": "Marie Curie",
            
        
    
        
        
            
                "job_title": "sales_attendant",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "employment_status": "on_leave",
            
        
    
        
        
            
                "base_salary": 5.74,
            
        
    
        
        
            
                "commission_eligible": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "employee_number": "Grace Hopper",
            
        
    
        
        
            
                "job_title": "finance",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "employment_status": "on_leave",
            
        
    
        
        
            
                "base_salary": 5.5,
            
        
    
        
        
            
                "commission_eligible": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "employee_number": "Grace Hopper",
            
        
    
        
        
            
                "job_title": "finance",
            
        
    
        
        
            
                "hire_date": new Date(Date.now()),
            
        
    
        
        
            
                "employment_status": "terminated",
            
        
    
        
        
            
                "base_salary": 8.33,
            
        
    
        
        
            
                "commission_eligible": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WorkShiftsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_name": "Alan Turing",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_name": "Alan Turing",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_name": "Marie Curie",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ShiftAssignmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assigned_from": new Date(Date.now()),
            
        
    
        
        
            
                "assigned_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assigned_from": new Date(Date.now()),
            
        
    
        
        
            
                "assigned_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assigned_from": new Date(Date.now()),
            
        
    
        
        
            
                "assigned_to": new Date(Date.now()),
            
        
    
        
        
            
                "status": "no_show",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AttendanceRecordsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "clock_in_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_out_at": new Date(Date.now()),
            
        
    
        
        
            
                "source": "device",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "clock_in_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_out_at": new Date(Date.now()),
            
        
    
        
        
            
                "source": "manual",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "clock_in_at": new Date(Date.now()),
            
        
    
        
        
            
                "clock_out_at": new Date(Date.now()),
            
        
    
        
        
            
                "source": "device",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PayrollRunsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payroll_name": "Grace Hopper",
            
        
    
        
        
            
                "period_start": new Date(Date.now()),
            
        
    
        
        
            
                "period_end": new Date(Date.now()),
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_gross": 1.19,
            
        
    
        
        
            
                "total_deductions": 2.17,
            
        
    
        
        
            
                "total_net": 9.08,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payroll_name": "Grace Hopper",
            
        
    
        
        
            
                "period_start": new Date(Date.now()),
            
        
    
        
        
            
                "period_end": new Date(Date.now()),
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_gross": 8.75,
            
        
    
        
        
            
                "total_deductions": 9.67,
            
        
    
        
        
            
                "total_net": 1.06,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payroll_name": "Marie Curie",
            
        
    
        
        
            
                "period_start": new Date(Date.now()),
            
        
    
        
        
            
                "period_end": new Date(Date.now()),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_gross": 2.71,
            
        
    
        
        
            
                "total_deductions": 0.57,
            
        
    
        
        
            
                "total_net": 0.64,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PayrollItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "gross_pay": 4.62,
            
        
    
        
        
            
                "deductions": 3.73,
            
        
    
        
        
            
                "net_pay": 9.62,
            
        
    
        
        
            
                "commission_amount": 5.73,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "gross_pay": 5.76,
            
        
    
        
        
            
                "deductions": 9.6,
            
        
    
        
        
            
                "net_pay": 1.52,
            
        
    
        
        
            
                "commission_amount": 7.46,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "gross_pay": 4.44,
            
        
    
        
        
            
                "deductions": 0.01,
            
        
    
        
        
            
                "net_pay": 5.4,
            
        
    
        
        
            
                "commission_amount": 7.05,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PerformanceReviewsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "review_date": new Date(Date.now()),
            
        
    
        
        
            
                "score": 2.9,
            
        
    
        
        
            
                "summary": "Ada Lovelace",
            
        
    
        
        
            
                "goals": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "review_date": new Date(Date.now()),
            
        
    
        
        
            
                "score": 8.69,
            
        
    
        
        
            
                "summary": "Grace Hopper",
            
        
    
        
        
            
                "goals": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "review_date": new Date(Date.now()),
            
        
    
        
        
            
                "score": 7.03,
            
        
    
        
        
            
                "summary": "Ada Lovelace",
            
        
    
        
        
            
                "goals": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ChartAccountsData = [
    
    {
    
        
        
            
                "account_name": "Ada Lovelace",
            
        
    
        
        
            
                "account_code": "Ada Lovelace",
            
        
    
        
        
            
                "account_type": "cogs",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "account_name": "Grace Hopper",
            
        
    
        
        
            
                "account_code": "Alan Turing",
            
        
    
        
        
            
                "account_type": "cogs",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "account_name": "Alan Turing",
            
        
    
        
        
            
                "account_code": "Marie Curie",
            
        
    
        
        
            
                "account_type": "liability",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const JournalEntriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entry_number": "Ada Lovelace",
            
        
    
        
        
            
                "entry_date": new Date(Date.now()),
            
        
    
        
        
            
                "source_module": "inventory",
            
        
    
        
        
            
                "reference": "Alan Turing",
            
        
    
        
        
            
                "total_debit": 6.07,
            
        
    
        
        
            
                "total_credit": 2.91,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "memo": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entry_number": "Ada Lovelace",
            
        
    
        
        
            
                "entry_date": new Date(Date.now()),
            
        
    
        
        
            
                "source_module": "pos",
            
        
    
        
        
            
                "reference": "Alan Turing",
            
        
    
        
        
            
                "total_debit": 8.41,
            
        
    
        
        
            
                "total_credit": 7.42,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "memo": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entry_number": "Grace Hopper",
            
        
    
        
        
            
                "entry_date": new Date(Date.now()),
            
        
    
        
        
            
                "source_module": "procurement",
            
        
    
        
        
            
                "reference": "Alan Turing",
            
        
    
        
        
            
                "total_debit": 7.92,
            
        
    
        
        
            
                "total_credit": 0.34,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "memo": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const JournalLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "dc": "debit",
            
        
    
        
        
            
                "amount": 5.05,
            
        
    
        
        
            
                "line_memo": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "dc": "credit",
            
        
    
        
        
            
                "amount": 4.89,
            
        
    
        
        
            
                "line_memo": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "dc": "debit",
            
        
    
        
        
            
                "amount": 1.31,
            
        
    
        
        
            
                "line_memo": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExpensesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_number": "Grace Hopper",
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "expense_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 6.14,
            
        
    
        
        
            
                "payee": "Alan Turing",
            
        
    
        
        
            
                "payment_method": "cash",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_number": "Marie Curie",
            
        
    
        
        
            
                "status": "paid",
            
        
    
        
        
            
                "expense_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 3.17,
            
        
    
        
        
            
                "payee": "Alan Turing",
            
        
    
        
        
            
                "payment_method": "mobile_money",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "expense_number": "Marie Curie",
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "expense_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 8.08,
            
        
    
        
        
            
                "payee": "Alan Turing",
            
        
    
        
        
            
                "payment_method": "bank_transfer",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AssetsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "asset_name": "Grace Hopper",
            
        
    
        
        
            
                "asset_tag": "Alan Turing",
            
        
    
        
        
            
                "asset_type": "other",
            
        
    
        
        
            
                "purchase_date": new Date(Date.now()),
            
        
    
        
        
            
                "purchase_cost": 1.47,
            
        
    
        
        
            
                "useful_life_months": 3,
            
        
    
        
        
            
                "salvage_value": 0.16,
            
        
    
        
        
            
                "depreciation_method": "straight_line",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "asset_name": "Marie Curie",
            
        
    
        
        
            
                "asset_tag": "Ada Lovelace",
            
        
    
        
        
            
                "asset_type": "furniture",
            
        
    
        
        
            
                "purchase_date": new Date(Date.now()),
            
        
    
        
        
            
                "purchase_cost": 0.77,
            
        
    
        
        
            
                "useful_life_months": 2,
            
        
    
        
        
            
                "salvage_value": 3.35,
            
        
    
        
        
            
                "depreciation_method": "declining_balance",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "asset_name": "Ada Lovelace",
            
        
    
        
        
            
                "asset_tag": "Grace Hopper",
            
        
    
        
        
            
                "asset_type": "computer",
            
        
    
        
        
            
                "purchase_date": new Date(Date.now()),
            
        
    
        
        
            
                "purchase_cost": 8.16,
            
        
    
        
        
            
                "useful_life_months": 5,
            
        
    
        
        
            
                "salvage_value": 3.07,
            
        
    
        
        
            
                "depreciation_method": "declining_balance",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MarketingCampaignsData = [
    
    {
    
        
        
            
                "campaign_name": "Grace Hopper",
            
        
    
        
        
            
                "channel": "sms",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "message_body": "Grace Hopper",
            
        
    
        
        
            
                "segment_type": "by_branch",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "campaign_name": "Ada Lovelace",
            
        
    
        
        
            
                "channel": "push",
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "message_body": "Marie Curie",
            
        
    
        
        
            
                "segment_type": "custom",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "campaign_name": "Grace Hopper",
            
        
    
        
        
            
                "channel": "sms",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "message_body": "Grace Hopper",
            
        
    
        
        
            
                "segment_type": "all",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CampaignRecipientsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "delivery_status": "failed",
            
        
    
        
        
            
                "delivered_at": new Date(Date.now()),
            
        
    
        
        
            
                "provider_reference": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "delivery_status": "queued",
            
        
    
        
        
            
                "delivered_at": new Date(Date.now()),
            
        
    
        
        
            
                "provider_reference": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "delivery_status": "delivered",
            
        
    
        
        
            
                "delivered_at": new Date(Date.now()),
            
        
    
        
        
            
                "provider_reference": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AiReorderSuggestionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "suggested_quantity": 9.06,
            
        
    
        
        
            
                "suggested_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "new",
            
        
    
        
        
            
                "confidence": 8.93,
            
        
    
        
        
            
                "explanation": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "suggested_quantity": 5.25,
            
        
    
        
        
            
                "suggested_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "reviewed",
            
        
    
        
        
            
                "confidence": 3.07,
            
        
    
        
        
            
                "explanation": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "suggested_quantity": 6.31,
            
        
    
        
        
            
                "suggested_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                "confidence": 4.86,
            
        
    
        
        
            
                "explanation": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




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

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCompanyWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company0 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Company0?.setOrganization)
                {
                    await
                    Company0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company1 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Company1?.setOrganization)
                {
                    await
                    Company1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company2 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Company2?.setOrganization)
                {
                    await
                    Company2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBrancheWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Branche0 = await Branches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Branche0?.setCompany)
                {
                    await
                    Branche0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Branche1 = await Branches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Branche1?.setCompany)
                {
                    await
                    Branche1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Branche2 = await Branches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Branche2?.setCompany)
                {
                    await
                    Branche2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBrancheWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Branche0 = await Branches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Branche0?.setOrganization)
                {
                    await
                    Branche0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Branche1 = await Branches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Branche1?.setOrganization)
                {
                    await
                    Branche1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Branche2 = await Branches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Branche2?.setOrganization)
                {
                    await
                    Branche2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateUserRoleWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRole0 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRole0?.setUser)
                {
                    await
                    UserRole0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRole1 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRole1?.setUser)
                {
                    await
                    UserRole1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRole2 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRole2?.setUser)
                {
                    await
                    UserRole2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
            
            async function associateUserRoleWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const UserRole0 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRole0?.setBranch)
                {
                    await
                    UserRole0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const UserRole1 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRole1?.setBranch)
                {
                    await
                    UserRole1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const UserRole2 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRole2?.setBranch)
                {
                    await
                    UserRole2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
            
            async function associateUserRoleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRole0 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRole0?.setOrganization)
                {
                    await
                    UserRole0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRole1 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRole1?.setOrganization)
                {
                    await
                    UserRole1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRole2 = await UserRoles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRole2?.setOrganization)
                {
                    await
                    UserRole2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAuditLogWithActor() {
            
                const relatedActor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setActor)
                {
                    await
                    AuditLog0.
                    setActor(relatedActor0);
                }
            
                const relatedActor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setActor)
                {
                    await
                    AuditLog1.
                    setActor(relatedActor1);
                }
            
                const relatedActor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setActor)
                {
                    await
                    AuditLog2.
                    setActor(relatedActor2);
                }
            
        }
        
    
        
            
            async function associateAuditLogWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setBranch)
                {
                    await
                    AuditLog0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setBranch)
                {
                    await
                    AuditLog1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setBranch)
                {
                    await
                    AuditLog2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAuditLogWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setOrganization)
                {
                    await
                    AuditLog0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setOrganization)
                {
                    await
                    AuditLog1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setOrganization)
                {
                    await
                    AuditLog2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
            
            async function associateProductCategoryWithParent_category() {
            
                const relatedParent_category0 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const ProductCategory0 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProductCategory0?.setParent_category)
                {
                    await
                    ProductCategory0.
                    setParent_category(relatedParent_category0);
                }
            
                const relatedParent_category1 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const ProductCategory1 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProductCategory1?.setParent_category)
                {
                    await
                    ProductCategory1.
                    setParent_category(relatedParent_category1);
                }
            
                const relatedParent_category2 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const ProductCategory2 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProductCategory2?.setParent_category)
                {
                    await
                    ProductCategory2.
                    setParent_category(relatedParent_category2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateProductCategoryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProductCategory0 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProductCategory0?.setOrganization)
                {
                    await
                    ProductCategory0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProductCategory1 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProductCategory1?.setOrganization)
                {
                    await
                    ProductCategory1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProductCategory2 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProductCategory2?.setOrganization)
                {
                    await
                    ProductCategory2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateProductWithCategory() {
            
                const relatedCategory0 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setCategory)
                {
                    await
                    Product0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setCategory)
                {
                    await
                    Product1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setCategory)
                {
                    await
                    Product2.
                    setCategory(relatedCategory2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
            
            async function associatePriceListWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PriceList0 = await PriceLists.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PriceList0?.setBranch)
                {
                    await
                    PriceList0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PriceList1 = await PriceLists.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PriceList1?.setBranch)
                {
                    await
                    PriceList1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PriceList2 = await PriceLists.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PriceList2?.setBranch)
                {
                    await
                    PriceList2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associatePriceListWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PriceList0 = await PriceLists.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PriceList0?.setOrganization)
                {
                    await
                    PriceList0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PriceList1 = await PriceLists.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PriceList1?.setOrganization)
                {
                    await
                    PriceList1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PriceList2 = await PriceLists.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PriceList2?.setOrganization)
                {
                    await
                    PriceList2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePriceListItemWithPrice_list() {
            
                const relatedPrice_list0 = await PriceLists.findOne({
                    offset: Math.floor(Math.random() * (await PriceLists.count())),
                });
                const PriceListItem0 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PriceListItem0?.setPrice_list)
                {
                    await
                    PriceListItem0.
                    setPrice_list(relatedPrice_list0);
                }
            
                const relatedPrice_list1 = await PriceLists.findOne({
                    offset: Math.floor(Math.random() * (await PriceLists.count())),
                });
                const PriceListItem1 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PriceListItem1?.setPrice_list)
                {
                    await
                    PriceListItem1.
                    setPrice_list(relatedPrice_list1);
                }
            
                const relatedPrice_list2 = await PriceLists.findOne({
                    offset: Math.floor(Math.random() * (await PriceLists.count())),
                });
                const PriceListItem2 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PriceListItem2?.setPrice_list)
                {
                    await
                    PriceListItem2.
                    setPrice_list(relatedPrice_list2);
                }
            
        }
        
    
        
            
            async function associatePriceListItemWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PriceListItem0 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PriceListItem0?.setProduct)
                {
                    await
                    PriceListItem0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PriceListItem1 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PriceListItem1?.setProduct)
                {
                    await
                    PriceListItem1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PriceListItem2 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PriceListItem2?.setProduct)
                {
                    await
                    PriceListItem2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associatePriceListItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PriceListItem0 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PriceListItem0?.setOrganization)
                {
                    await
                    PriceListItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PriceListItem1 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PriceListItem1?.setOrganization)
                {
                    await
                    PriceListItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PriceListItem2 = await PriceListItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PriceListItem2?.setOrganization)
                {
                    await
                    PriceListItem2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateWarehousWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Warehous0 = await Warehouses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Warehous0?.setBranch)
                {
                    await
                    Warehous0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Warehous1 = await Warehouses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Warehous1?.setBranch)
                {
                    await
                    Warehous1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Warehous2 = await Warehouses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Warehous2?.setBranch)
                {
                    await
                    Warehous2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
            
            async function associateInventoryBatcheWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryBatche0 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryBatche0?.setProduct)
                {
                    await
                    InventoryBatche0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryBatche1 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryBatche1?.setProduct)
                {
                    await
                    InventoryBatche1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryBatche2 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryBatche2?.setProduct)
                {
                    await
                    InventoryBatche2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
            
            async function associateInventoryBatcheWithWarehouse() {
            
                const relatedWarehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryBatche0 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryBatche0?.setWarehouse)
                {
                    await
                    InventoryBatche0.
                    setWarehouse(relatedWarehouse0);
                }
            
                const relatedWarehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryBatche1 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryBatche1?.setWarehouse)
                {
                    await
                    InventoryBatche1.
                    setWarehouse(relatedWarehouse1);
                }
            
                const relatedWarehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryBatche2 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryBatche2?.setWarehouse)
                {
                    await
                    InventoryBatche2.
                    setWarehouse(relatedWarehouse2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateInventoryBatcheWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryBatche0 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryBatche0?.setOrganization)
                {
                    await
                    InventoryBatche0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryBatche1 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryBatche1?.setOrganization)
                {
                    await
                    InventoryBatche1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryBatche2 = await InventoryBatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryBatche2?.setOrganization)
                {
                    await
                    InventoryBatche2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateInventoryTransactionWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InventoryTransaction0 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryTransaction0?.setBranch)
                {
                    await
                    InventoryTransaction0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InventoryTransaction1 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryTransaction1?.setBranch)
                {
                    await
                    InventoryTransaction1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InventoryTransaction2 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryTransaction2?.setBranch)
                {
                    await
                    InventoryTransaction2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateInventoryTransactionWithWarehouse() {
            
                const relatedWarehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryTransaction0 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryTransaction0?.setWarehouse)
                {
                    await
                    InventoryTransaction0.
                    setWarehouse(relatedWarehouse0);
                }
            
                const relatedWarehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryTransaction1 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryTransaction1?.setWarehouse)
                {
                    await
                    InventoryTransaction1.
                    setWarehouse(relatedWarehouse1);
                }
            
                const relatedWarehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InventoryTransaction2 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryTransaction2?.setWarehouse)
                {
                    await
                    InventoryTransaction2.
                    setWarehouse(relatedWarehouse2);
                }
            
        }
        
    
        
            
            async function associateInventoryTransactionWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryTransaction0 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryTransaction0?.setProduct)
                {
                    await
                    InventoryTransaction0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryTransaction1 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryTransaction1?.setProduct)
                {
                    await
                    InventoryTransaction1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InventoryTransaction2 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryTransaction2?.setProduct)
                {
                    await
                    InventoryTransaction2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
            
            async function associateInventoryTransactionWithBatch() {
            
                const relatedBatch0 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const InventoryTransaction0 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryTransaction0?.setBatch)
                {
                    await
                    InventoryTransaction0.
                    setBatch(relatedBatch0);
                }
            
                const relatedBatch1 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const InventoryTransaction1 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryTransaction1?.setBatch)
                {
                    await
                    InventoryTransaction1.
                    setBatch(relatedBatch1);
                }
            
                const relatedBatch2 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const InventoryTransaction2 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryTransaction2?.setBatch)
                {
                    await
                    InventoryTransaction2.
                    setBatch(relatedBatch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateInventoryTransactionWithPerformed_by() {
            
                const relatedPerformed_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InventoryTransaction0 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryTransaction0?.setPerformed_by)
                {
                    await
                    InventoryTransaction0.
                    setPerformed_by(relatedPerformed_by0);
                }
            
                const relatedPerformed_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InventoryTransaction1 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryTransaction1?.setPerformed_by)
                {
                    await
                    InventoryTransaction1.
                    setPerformed_by(relatedPerformed_by1);
                }
            
                const relatedPerformed_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InventoryTransaction2 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryTransaction2?.setPerformed_by)
                {
                    await
                    InventoryTransaction2.
                    setPerformed_by(relatedPerformed_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateInventoryTransactionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryTransaction0 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InventoryTransaction0?.setOrganization)
                {
                    await
                    InventoryTransaction0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryTransaction1 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InventoryTransaction1?.setOrganization)
                {
                    await
                    InventoryTransaction1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InventoryTransaction2 = await InventoryTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InventoryTransaction2?.setOrganization)
                {
                    await
                    InventoryTransaction2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStockAdjustmentWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const StockAdjustment0 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustment0?.setBranch)
                {
                    await
                    StockAdjustment0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const StockAdjustment1 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustment1?.setBranch)
                {
                    await
                    StockAdjustment1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const StockAdjustment2 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustment2?.setBranch)
                {
                    await
                    StockAdjustment2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateStockAdjustmentWithWarehouse() {
            
                const relatedWarehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const StockAdjustment0 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustment0?.setWarehouse)
                {
                    await
                    StockAdjustment0.
                    setWarehouse(relatedWarehouse0);
                }
            
                const relatedWarehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const StockAdjustment1 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustment1?.setWarehouse)
                {
                    await
                    StockAdjustment1.
                    setWarehouse(relatedWarehouse1);
                }
            
                const relatedWarehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const StockAdjustment2 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustment2?.setWarehouse)
                {
                    await
                    StockAdjustment2.
                    setWarehouse(relatedWarehouse2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateStockAdjustmentWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockAdjustment0 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustment0?.setRequested_by)
                {
                    await
                    StockAdjustment0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockAdjustment1 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustment1?.setRequested_by)
                {
                    await
                    StockAdjustment1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockAdjustment2 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustment2?.setRequested_by)
                {
                    await
                    StockAdjustment2.
                    setRequested_by(relatedRequested_by2);
                }
            
        }
        
    
        
            
            async function associateStockAdjustmentWithApproved_by() {
            
                const relatedApproved_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockAdjustment0 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustment0?.setApproved_by)
                {
                    await
                    StockAdjustment0.
                    setApproved_by(relatedApproved_by0);
                }
            
                const relatedApproved_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockAdjustment1 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustment1?.setApproved_by)
                {
                    await
                    StockAdjustment1.
                    setApproved_by(relatedApproved_by1);
                }
            
                const relatedApproved_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockAdjustment2 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustment2?.setApproved_by)
                {
                    await
                    StockAdjustment2.
                    setApproved_by(relatedApproved_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateStockAdjustmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StockAdjustment0 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustment0?.setOrganization)
                {
                    await
                    StockAdjustment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StockAdjustment1 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustment1?.setOrganization)
                {
                    await
                    StockAdjustment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StockAdjustment2 = await StockAdjustments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustment2?.setOrganization)
                {
                    await
                    StockAdjustment2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStockAdjustmentLineWithStock_adjustment() {
            
                const relatedStock_adjustment0 = await StockAdjustments.findOne({
                    offset: Math.floor(Math.random() * (await StockAdjustments.count())),
                });
                const StockAdjustmentLine0 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustmentLine0?.setStock_adjustment)
                {
                    await
                    StockAdjustmentLine0.
                    setStock_adjustment(relatedStock_adjustment0);
                }
            
                const relatedStock_adjustment1 = await StockAdjustments.findOne({
                    offset: Math.floor(Math.random() * (await StockAdjustments.count())),
                });
                const StockAdjustmentLine1 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustmentLine1?.setStock_adjustment)
                {
                    await
                    StockAdjustmentLine1.
                    setStock_adjustment(relatedStock_adjustment1);
                }
            
                const relatedStock_adjustment2 = await StockAdjustments.findOne({
                    offset: Math.floor(Math.random() * (await StockAdjustments.count())),
                });
                const StockAdjustmentLine2 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustmentLine2?.setStock_adjustment)
                {
                    await
                    StockAdjustmentLine2.
                    setStock_adjustment(relatedStock_adjustment2);
                }
            
        }
        
    
        
            
            async function associateStockAdjustmentLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const StockAdjustmentLine0 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustmentLine0?.setProduct)
                {
                    await
                    StockAdjustmentLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const StockAdjustmentLine1 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustmentLine1?.setProduct)
                {
                    await
                    StockAdjustmentLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const StockAdjustmentLine2 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustmentLine2?.setProduct)
                {
                    await
                    StockAdjustmentLine2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
            
            async function associateStockAdjustmentLineWithBatch() {
            
                const relatedBatch0 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const StockAdjustmentLine0 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustmentLine0?.setBatch)
                {
                    await
                    StockAdjustmentLine0.
                    setBatch(relatedBatch0);
                }
            
                const relatedBatch1 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const StockAdjustmentLine1 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustmentLine1?.setBatch)
                {
                    await
                    StockAdjustmentLine1.
                    setBatch(relatedBatch1);
                }
            
                const relatedBatch2 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const StockAdjustmentLine2 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustmentLine2?.setBatch)
                {
                    await
                    StockAdjustmentLine2.
                    setBatch(relatedBatch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateStockAdjustmentLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StockAdjustmentLine0 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockAdjustmentLine0?.setOrganization)
                {
                    await
                    StockAdjustmentLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StockAdjustmentLine1 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockAdjustmentLine1?.setOrganization)
                {
                    await
                    StockAdjustmentLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StockAdjustmentLine2 = await StockAdjustmentLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockAdjustmentLine2?.setOrganization)
                {
                    await
                    StockAdjustmentLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateInterbranchTransferWithFrom_branch() {
            
                const relatedFrom_branch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InterbranchTransfer0 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InterbranchTransfer0?.setFrom_branch)
                {
                    await
                    InterbranchTransfer0.
                    setFrom_branch(relatedFrom_branch0);
                }
            
                const relatedFrom_branch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InterbranchTransfer1 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InterbranchTransfer1?.setFrom_branch)
                {
                    await
                    InterbranchTransfer1.
                    setFrom_branch(relatedFrom_branch1);
                }
            
                const relatedFrom_branch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InterbranchTransfer2 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InterbranchTransfer2?.setFrom_branch)
                {
                    await
                    InterbranchTransfer2.
                    setFrom_branch(relatedFrom_branch2);
                }
            
        }
        
    
        
            
            async function associateInterbranchTransferWithTo_branch() {
            
                const relatedTo_branch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InterbranchTransfer0 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InterbranchTransfer0?.setTo_branch)
                {
                    await
                    InterbranchTransfer0.
                    setTo_branch(relatedTo_branch0);
                }
            
                const relatedTo_branch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InterbranchTransfer1 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InterbranchTransfer1?.setTo_branch)
                {
                    await
                    InterbranchTransfer1.
                    setTo_branch(relatedTo_branch1);
                }
            
                const relatedTo_branch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const InterbranchTransfer2 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InterbranchTransfer2?.setTo_branch)
                {
                    await
                    InterbranchTransfer2.
                    setTo_branch(relatedTo_branch2);
                }
            
        }
        
    
        
            
            async function associateInterbranchTransferWithFrom_warehouse() {
            
                const relatedFrom_warehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InterbranchTransfer0 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InterbranchTransfer0?.setFrom_warehouse)
                {
                    await
                    InterbranchTransfer0.
                    setFrom_warehouse(relatedFrom_warehouse0);
                }
            
                const relatedFrom_warehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InterbranchTransfer1 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InterbranchTransfer1?.setFrom_warehouse)
                {
                    await
                    InterbranchTransfer1.
                    setFrom_warehouse(relatedFrom_warehouse1);
                }
            
                const relatedFrom_warehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InterbranchTransfer2 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InterbranchTransfer2?.setFrom_warehouse)
                {
                    await
                    InterbranchTransfer2.
                    setFrom_warehouse(relatedFrom_warehouse2);
                }
            
        }
        
    
        
            
            async function associateInterbranchTransferWithTo_warehouse() {
            
                const relatedTo_warehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InterbranchTransfer0 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InterbranchTransfer0?.setTo_warehouse)
                {
                    await
                    InterbranchTransfer0.
                    setTo_warehouse(relatedTo_warehouse0);
                }
            
                const relatedTo_warehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InterbranchTransfer1 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InterbranchTransfer1?.setTo_warehouse)
                {
                    await
                    InterbranchTransfer1.
                    setTo_warehouse(relatedTo_warehouse1);
                }
            
                const relatedTo_warehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const InterbranchTransfer2 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InterbranchTransfer2?.setTo_warehouse)
                {
                    await
                    InterbranchTransfer2.
                    setTo_warehouse(relatedTo_warehouse2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateInterbranchTransferWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InterbranchTransfer0 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InterbranchTransfer0?.setRequested_by)
                {
                    await
                    InterbranchTransfer0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InterbranchTransfer1 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InterbranchTransfer1?.setRequested_by)
                {
                    await
                    InterbranchTransfer1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InterbranchTransfer2 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InterbranchTransfer2?.setRequested_by)
                {
                    await
                    InterbranchTransfer2.
                    setRequested_by(relatedRequested_by2);
                }
            
        }
        
    
        
            
            async function associateInterbranchTransferWithReceived_by() {
            
                const relatedReceived_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InterbranchTransfer0 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InterbranchTransfer0?.setReceived_by)
                {
                    await
                    InterbranchTransfer0.
                    setReceived_by(relatedReceived_by0);
                }
            
                const relatedReceived_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InterbranchTransfer1 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InterbranchTransfer1?.setReceived_by)
                {
                    await
                    InterbranchTransfer1.
                    setReceived_by(relatedReceived_by1);
                }
            
                const relatedReceived_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const InterbranchTransfer2 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InterbranchTransfer2?.setReceived_by)
                {
                    await
                    InterbranchTransfer2.
                    setReceived_by(relatedReceived_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateInterbranchTransferWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InterbranchTransfer0 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InterbranchTransfer0?.setOrganization)
                {
                    await
                    InterbranchTransfer0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InterbranchTransfer1 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InterbranchTransfer1?.setOrganization)
                {
                    await
                    InterbranchTransfer1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InterbranchTransfer2 = await InterbranchTransfers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InterbranchTransfer2?.setOrganization)
                {
                    await
                    InterbranchTransfer2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTransferLineWithTransfer() {
            
                const relatedTransfer0 = await InterbranchTransfers.findOne({
                    offset: Math.floor(Math.random() * (await InterbranchTransfers.count())),
                });
                const TransferLine0 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TransferLine0?.setTransfer)
                {
                    await
                    TransferLine0.
                    setTransfer(relatedTransfer0);
                }
            
                const relatedTransfer1 = await InterbranchTransfers.findOne({
                    offset: Math.floor(Math.random() * (await InterbranchTransfers.count())),
                });
                const TransferLine1 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TransferLine1?.setTransfer)
                {
                    await
                    TransferLine1.
                    setTransfer(relatedTransfer1);
                }
            
                const relatedTransfer2 = await InterbranchTransfers.findOne({
                    offset: Math.floor(Math.random() * (await InterbranchTransfers.count())),
                });
                const TransferLine2 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TransferLine2?.setTransfer)
                {
                    await
                    TransferLine2.
                    setTransfer(relatedTransfer2);
                }
            
        }
        
    
        
            
            async function associateTransferLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const TransferLine0 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TransferLine0?.setProduct)
                {
                    await
                    TransferLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const TransferLine1 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TransferLine1?.setProduct)
                {
                    await
                    TransferLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const TransferLine2 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TransferLine2?.setProduct)
                {
                    await
                    TransferLine2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
            
            async function associateTransferLineWithBatch() {
            
                const relatedBatch0 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const TransferLine0 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TransferLine0?.setBatch)
                {
                    await
                    TransferLine0.
                    setBatch(relatedBatch0);
                }
            
                const relatedBatch1 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const TransferLine1 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TransferLine1?.setBatch)
                {
                    await
                    TransferLine1.
                    setBatch(relatedBatch1);
                }
            
                const relatedBatch2 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const TransferLine2 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TransferLine2?.setBatch)
                {
                    await
                    TransferLine2.
                    setBatch(relatedBatch2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateTransferLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TransferLine0 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TransferLine0?.setOrganization)
                {
                    await
                    TransferLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TransferLine1 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TransferLine1?.setOrganization)
                {
                    await
                    TransferLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TransferLine2 = await TransferLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TransferLine2?.setOrganization)
                {
                    await
                    TransferLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSupplierWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Supplier0 = await Suppliers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Supplier0?.setOrganization)
                {
                    await
                    Supplier0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Supplier1 = await Suppliers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Supplier1?.setOrganization)
                {
                    await
                    Supplier1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Supplier2 = await Suppliers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Supplier2?.setOrganization)
                {
                    await
                    Supplier2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSupplierProductWithSupplier() {
            
                const relatedSupplier0 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierProduct0 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierProduct0?.setSupplier)
                {
                    await
                    SupplierProduct0.
                    setSupplier(relatedSupplier0);
                }
            
                const relatedSupplier1 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierProduct1 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierProduct1?.setSupplier)
                {
                    await
                    SupplierProduct1.
                    setSupplier(relatedSupplier1);
                }
            
                const relatedSupplier2 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierProduct2 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierProduct2?.setSupplier)
                {
                    await
                    SupplierProduct2.
                    setSupplier(relatedSupplier2);
                }
            
        }
        
    
        
            
            async function associateSupplierProductWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const SupplierProduct0 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierProduct0?.setProduct)
                {
                    await
                    SupplierProduct0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const SupplierProduct1 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierProduct1?.setProduct)
                {
                    await
                    SupplierProduct1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const SupplierProduct2 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierProduct2?.setProduct)
                {
                    await
                    SupplierProduct2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSupplierProductWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierProduct0 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierProduct0?.setOrganization)
                {
                    await
                    SupplierProduct0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierProduct1 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierProduct1?.setOrganization)
                {
                    await
                    SupplierProduct1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierProduct2 = await SupplierProducts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierProduct2?.setOrganization)
                {
                    await
                    SupplierProduct2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associatePurchaseOrderWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setBranch)
                {
                    await
                    PurchaseOrder0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setBranch)
                {
                    await
                    PurchaseOrder1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setBranch)
                {
                    await
                    PurchaseOrder2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associatePurchaseOrderWithSupplier() {
            
                const relatedSupplier0 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setSupplier)
                {
                    await
                    PurchaseOrder0.
                    setSupplier(relatedSupplier0);
                }
            
                const relatedSupplier1 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setSupplier)
                {
                    await
                    PurchaseOrder1.
                    setSupplier(relatedSupplier1);
                }
            
                const relatedSupplier2 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setSupplier)
                {
                    await
                    PurchaseOrder2.
                    setSupplier(relatedSupplier2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePurchaseOrderWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setRequested_by)
                {
                    await
                    PurchaseOrder0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setRequested_by)
                {
                    await
                    PurchaseOrder1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setRequested_by)
                {
                    await
                    PurchaseOrder2.
                    setRequested_by(relatedRequested_by2);
                }
            
        }
        
    
        
            
            async function associatePurchaseOrderWithApproved_by() {
            
                const relatedApproved_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setApproved_by)
                {
                    await
                    PurchaseOrder0.
                    setApproved_by(relatedApproved_by0);
                }
            
                const relatedApproved_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setApproved_by)
                {
                    await
                    PurchaseOrder1.
                    setApproved_by(relatedApproved_by1);
                }
            
                const relatedApproved_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setApproved_by)
                {
                    await
                    PurchaseOrder2.
                    setApproved_by(relatedApproved_by2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associatePurchaseOrderWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setOrganization)
                {
                    await
                    PurchaseOrder0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setOrganization)
                {
                    await
                    PurchaseOrder1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setOrganization)
                {
                    await
                    PurchaseOrder2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePurchaseOrderLineWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PurchaseOrderLine0 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrderLine0?.setPurchase_order)
                {
                    await
                    PurchaseOrderLine0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PurchaseOrderLine1 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrderLine1?.setPurchase_order)
                {
                    await
                    PurchaseOrderLine1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PurchaseOrderLine2 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrderLine2?.setPurchase_order)
                {
                    await
                    PurchaseOrderLine2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
        }
        
    
        
            
            async function associatePurchaseOrderLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseOrderLine0 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrderLine0?.setProduct)
                {
                    await
                    PurchaseOrderLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseOrderLine1 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrderLine1?.setProduct)
                {
                    await
                    PurchaseOrderLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseOrderLine2 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrderLine2?.setProduct)
                {
                    await
                    PurchaseOrderLine2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associatePurchaseOrderLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrderLine0 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrderLine0?.setOrganization)
                {
                    await
                    PurchaseOrderLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrderLine1 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrderLine1?.setOrganization)
                {
                    await
                    PurchaseOrderLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrderLine2 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrderLine2?.setOrganization)
                {
                    await
                    PurchaseOrderLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateGoodsReceiptWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceipt0 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceipt0?.setPurchase_order)
                {
                    await
                    GoodsReceipt0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceipt1 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceipt1?.setPurchase_order)
                {
                    await
                    GoodsReceipt1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceipt2 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceipt2?.setPurchase_order)
                {
                    await
                    GoodsReceipt2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
        }
        
    
        
            
            async function associateGoodsReceiptWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const GoodsReceipt0 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceipt0?.setBranch)
                {
                    await
                    GoodsReceipt0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const GoodsReceipt1 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceipt1?.setBranch)
                {
                    await
                    GoodsReceipt1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const GoodsReceipt2 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceipt2?.setBranch)
                {
                    await
                    GoodsReceipt2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateGoodsReceiptWithWarehouse() {
            
                const relatedWarehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const GoodsReceipt0 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceipt0?.setWarehouse)
                {
                    await
                    GoodsReceipt0.
                    setWarehouse(relatedWarehouse0);
                }
            
                const relatedWarehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const GoodsReceipt1 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceipt1?.setWarehouse)
                {
                    await
                    GoodsReceipt1.
                    setWarehouse(relatedWarehouse1);
                }
            
                const relatedWarehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const GoodsReceipt2 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceipt2?.setWarehouse)
                {
                    await
                    GoodsReceipt2.
                    setWarehouse(relatedWarehouse2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateGoodsReceiptWithReceived_by() {
            
                const relatedReceived_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceipt0 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceipt0?.setReceived_by)
                {
                    await
                    GoodsReceipt0.
                    setReceived_by(relatedReceived_by0);
                }
            
                const relatedReceived_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceipt1 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceipt1?.setReceived_by)
                {
                    await
                    GoodsReceipt1.
                    setReceived_by(relatedReceived_by1);
                }
            
                const relatedReceived_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceipt2 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceipt2?.setReceived_by)
                {
                    await
                    GoodsReceipt2.
                    setReceived_by(relatedReceived_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateGoodsReceiptWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceipt0 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceipt0?.setOrganization)
                {
                    await
                    GoodsReceipt0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceipt1 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceipt1?.setOrganization)
                {
                    await
                    GoodsReceipt1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceipt2 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceipt2?.setOrganization)
                {
                    await
                    GoodsReceipt2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateGoodsReceiptLineWithGoods_receipt() {
            
                const relatedGoods_receipt0 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const GoodsReceiptLine0 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptLine0?.setGoods_receipt)
                {
                    await
                    GoodsReceiptLine0.
                    setGoods_receipt(relatedGoods_receipt0);
                }
            
                const relatedGoods_receipt1 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const GoodsReceiptLine1 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptLine1?.setGoods_receipt)
                {
                    await
                    GoodsReceiptLine1.
                    setGoods_receipt(relatedGoods_receipt1);
                }
            
                const relatedGoods_receipt2 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const GoodsReceiptLine2 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptLine2?.setGoods_receipt)
                {
                    await
                    GoodsReceiptLine2.
                    setGoods_receipt(relatedGoods_receipt2);
                }
            
        }
        
    
        
            
            async function associateGoodsReceiptLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const GoodsReceiptLine0 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptLine0?.setProduct)
                {
                    await
                    GoodsReceiptLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const GoodsReceiptLine1 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptLine1?.setProduct)
                {
                    await
                    GoodsReceiptLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const GoodsReceiptLine2 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptLine2?.setProduct)
                {
                    await
                    GoodsReceiptLine2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateGoodsReceiptLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptLine0 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptLine0?.setOrganization)
                {
                    await
                    GoodsReceiptLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptLine1 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptLine1?.setOrganization)
                {
                    await
                    GoodsReceiptLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptLine2 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptLine2?.setOrganization)
                {
                    await
                    GoodsReceiptLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateSupplierInvoiceWithSupplier() {
            
                const relatedSupplier0 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierInvoice0 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierInvoice0?.setSupplier)
                {
                    await
                    SupplierInvoice0.
                    setSupplier(relatedSupplier0);
                }
            
                const relatedSupplier1 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierInvoice1 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierInvoice1?.setSupplier)
                {
                    await
                    SupplierInvoice1.
                    setSupplier(relatedSupplier1);
                }
            
                const relatedSupplier2 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierInvoice2 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierInvoice2?.setSupplier)
                {
                    await
                    SupplierInvoice2.
                    setSupplier(relatedSupplier2);
                }
            
        }
        
    
        
            
            async function associateSupplierInvoiceWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const SupplierInvoice0 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierInvoice0?.setPurchase_order)
                {
                    await
                    SupplierInvoice0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const SupplierInvoice1 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierInvoice1?.setPurchase_order)
                {
                    await
                    SupplierInvoice1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const SupplierInvoice2 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierInvoice2?.setPurchase_order)
                {
                    await
                    SupplierInvoice2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
        }
        
    
        
            
            async function associateSupplierInvoiceWithGoods_receipt() {
            
                const relatedGoods_receipt0 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const SupplierInvoice0 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierInvoice0?.setGoods_receipt)
                {
                    await
                    SupplierInvoice0.
                    setGoods_receipt(relatedGoods_receipt0);
                }
            
                const relatedGoods_receipt1 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const SupplierInvoice1 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierInvoice1?.setGoods_receipt)
                {
                    await
                    SupplierInvoice1.
                    setGoods_receipt(relatedGoods_receipt1);
                }
            
                const relatedGoods_receipt2 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const SupplierInvoice2 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierInvoice2?.setGoods_receipt)
                {
                    await
                    SupplierInvoice2.
                    setGoods_receipt(relatedGoods_receipt2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSupplierInvoiceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierInvoice0 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierInvoice0?.setOrganization)
                {
                    await
                    SupplierInvoice0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierInvoice1 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierInvoice1?.setOrganization)
                {
                    await
                    SupplierInvoice1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierInvoice2 = await SupplierInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierInvoice2?.setOrganization)
                {
                    await
                    SupplierInvoice2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCustomerWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Customer0 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Customer0?.setOrganization)
                {
                    await
                    Customer0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Customer1 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Customer1?.setOrganization)
                {
                    await
                    Customer1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Customer2 = await Customers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Customer2?.setOrganization)
                {
                    await
                    Customer2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateLoyaltyProgramWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LoyaltyProgram0 = await LoyaltyPrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LoyaltyProgram0?.setOrganization)
                {
                    await
                    LoyaltyProgram0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LoyaltyProgram1 = await LoyaltyPrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LoyaltyProgram1?.setOrganization)
                {
                    await
                    LoyaltyProgram1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LoyaltyProgram2 = await LoyaltyPrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LoyaltyProgram2?.setOrganization)
                {
                    await
                    LoyaltyProgram2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePosRegisterWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PosRegister0 = await PosRegisters.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PosRegister0?.setBranch)
                {
                    await
                    PosRegister0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PosRegister1 = await PosRegisters.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PosRegister1?.setBranch)
                {
                    await
                    PosRegister1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PosRegister2 = await PosRegisters.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PosRegister2?.setBranch)
                {
                    await
                    PosRegister2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePosRegisterWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PosRegister0 = await PosRegisters.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PosRegister0?.setOrganization)
                {
                    await
                    PosRegister0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PosRegister1 = await PosRegisters.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PosRegister1?.setOrganization)
                {
                    await
                    PosRegister1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PosRegister2 = await PosRegisters.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PosRegister2?.setOrganization)
                {
                    await
                    PosRegister2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePosShiftWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PosShift0 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PosShift0?.setBranch)
                {
                    await
                    PosShift0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PosShift1 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PosShift1?.setBranch)
                {
                    await
                    PosShift1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PosShift2 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PosShift2?.setBranch)
                {
                    await
                    PosShift2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associatePosShiftWithRegister() {
            
                const relatedRegister0 = await PosRegisters.findOne({
                    offset: Math.floor(Math.random() * (await PosRegisters.count())),
                });
                const PosShift0 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PosShift0?.setRegister)
                {
                    await
                    PosShift0.
                    setRegister(relatedRegister0);
                }
            
                const relatedRegister1 = await PosRegisters.findOne({
                    offset: Math.floor(Math.random() * (await PosRegisters.count())),
                });
                const PosShift1 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PosShift1?.setRegister)
                {
                    await
                    PosShift1.
                    setRegister(relatedRegister1);
                }
            
                const relatedRegister2 = await PosRegisters.findOne({
                    offset: Math.floor(Math.random() * (await PosRegisters.count())),
                });
                const PosShift2 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PosShift2?.setRegister)
                {
                    await
                    PosShift2.
                    setRegister(relatedRegister2);
                }
            
        }
        
    
        
            
            async function associatePosShiftWithCashier() {
            
                const relatedCashier0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PosShift0 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PosShift0?.setCashier)
                {
                    await
                    PosShift0.
                    setCashier(relatedCashier0);
                }
            
                const relatedCashier1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PosShift1 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PosShift1?.setCashier)
                {
                    await
                    PosShift1.
                    setCashier(relatedCashier1);
                }
            
                const relatedCashier2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PosShift2 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PosShift2?.setCashier)
                {
                    await
                    PosShift2.
                    setCashier(relatedCashier2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePosShiftWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PosShift0 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PosShift0?.setOrganization)
                {
                    await
                    PosShift0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PosShift1 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PosShift1?.setOrganization)
                {
                    await
                    PosShift1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PosShift2 = await PosShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PosShift2?.setOrganization)
                {
                    await
                    PosShift2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateSaleWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setBranch)
                {
                    await
                    Sale0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setBranch)
                {
                    await
                    Sale1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setBranch)
                {
                    await
                    Sale2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateSaleWithRegister() {
            
                const relatedRegister0 = await PosRegisters.findOne({
                    offset: Math.floor(Math.random() * (await PosRegisters.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setRegister)
                {
                    await
                    Sale0.
                    setRegister(relatedRegister0);
                }
            
                const relatedRegister1 = await PosRegisters.findOne({
                    offset: Math.floor(Math.random() * (await PosRegisters.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setRegister)
                {
                    await
                    Sale1.
                    setRegister(relatedRegister1);
                }
            
                const relatedRegister2 = await PosRegisters.findOne({
                    offset: Math.floor(Math.random() * (await PosRegisters.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setRegister)
                {
                    await
                    Sale2.
                    setRegister(relatedRegister2);
                }
            
        }
        
    
        
            
            async function associateSaleWithShift() {
            
                const relatedShift0 = await PosShifts.findOne({
                    offset: Math.floor(Math.random() * (await PosShifts.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setShift)
                {
                    await
                    Sale0.
                    setShift(relatedShift0);
                }
            
                const relatedShift1 = await PosShifts.findOne({
                    offset: Math.floor(Math.random() * (await PosShifts.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setShift)
                {
                    await
                    Sale1.
                    setShift(relatedShift1);
                }
            
                const relatedShift2 = await PosShifts.findOne({
                    offset: Math.floor(Math.random() * (await PosShifts.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setShift)
                {
                    await
                    Sale2.
                    setShift(relatedShift2);
                }
            
        }
        
    
        
            
            async function associateSaleWithCashier() {
            
                const relatedCashier0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setCashier)
                {
                    await
                    Sale0.
                    setCashier(relatedCashier0);
                }
            
                const relatedCashier1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setCashier)
                {
                    await
                    Sale1.
                    setCashier(relatedCashier1);
                }
            
                const relatedCashier2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setCashier)
                {
                    await
                    Sale2.
                    setCashier(relatedCashier2);
                }
            
        }
        
    
        
            
            async function associateSaleWithCustomer() {
            
                const relatedCustomer0 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setCustomer)
                {
                    await
                    Sale0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setCustomer)
                {
                    await
                    Sale1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setCustomer)
                {
                    await
                    Sale2.
                    setCustomer(relatedCustomer2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSaleWithDiscount_approved_by() {
            
                const relatedDiscount_approved_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setDiscount_approved_by)
                {
                    await
                    Sale0.
                    setDiscount_approved_by(relatedDiscount_approved_by0);
                }
            
                const relatedDiscount_approved_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setDiscount_approved_by)
                {
                    await
                    Sale1.
                    setDiscount_approved_by(relatedDiscount_approved_by1);
                }
            
                const relatedDiscount_approved_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setDiscount_approved_by)
                {
                    await
                    Sale2.
                    setDiscount_approved_by(relatedDiscount_approved_by2);
                }
            
        }
        
    
        
            
            async function associateSaleWithVoided_by() {
            
                const relatedVoided_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setVoided_by)
                {
                    await
                    Sale0.
                    setVoided_by(relatedVoided_by0);
                }
            
                const relatedVoided_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setVoided_by)
                {
                    await
                    Sale1.
                    setVoided_by(relatedVoided_by1);
                }
            
                const relatedVoided_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setVoided_by)
                {
                    await
                    Sale2.
                    setVoided_by(relatedVoided_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateSaleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Sale0 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Sale0?.setOrganization)
                {
                    await
                    Sale0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Sale1 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Sale1?.setOrganization)
                {
                    await
                    Sale1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Sale2 = await Sales.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Sale2?.setOrganization)
                {
                    await
                    Sale2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSaleLineWithSale() {
            
                const relatedSale0 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const SaleLine0 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SaleLine0?.setSale)
                {
                    await
                    SaleLine0.
                    setSale(relatedSale0);
                }
            
                const relatedSale1 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const SaleLine1 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SaleLine1?.setSale)
                {
                    await
                    SaleLine1.
                    setSale(relatedSale1);
                }
            
                const relatedSale2 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const SaleLine2 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SaleLine2?.setSale)
                {
                    await
                    SaleLine2.
                    setSale(relatedSale2);
                }
            
        }
        
    
        
            
            async function associateSaleLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const SaleLine0 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SaleLine0?.setProduct)
                {
                    await
                    SaleLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const SaleLine1 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SaleLine1?.setProduct)
                {
                    await
                    SaleLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const SaleLine2 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SaleLine2?.setProduct)
                {
                    await
                    SaleLine2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
            
            async function associateSaleLineWithBatch() {
            
                const relatedBatch0 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const SaleLine0 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SaleLine0?.setBatch)
                {
                    await
                    SaleLine0.
                    setBatch(relatedBatch0);
                }
            
                const relatedBatch1 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const SaleLine1 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SaleLine1?.setBatch)
                {
                    await
                    SaleLine1.
                    setBatch(relatedBatch1);
                }
            
                const relatedBatch2 = await InventoryBatches.findOne({
                    offset: Math.floor(Math.random() * (await InventoryBatches.count())),
                });
                const SaleLine2 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SaleLine2?.setBatch)
                {
                    await
                    SaleLine2.
                    setBatch(relatedBatch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSaleLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SaleLine0 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SaleLine0?.setOrganization)
                {
                    await
                    SaleLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SaleLine1 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SaleLine1?.setOrganization)
                {
                    await
                    SaleLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SaleLine2 = await SaleLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SaleLine2?.setOrganization)
                {
                    await
                    SaleLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePaymentWithSale() {
            
                const relatedSale0 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setSale)
                {
                    await
                    Payment0.
                    setSale(relatedSale0);
                }
            
                const relatedSale1 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setSale)
                {
                    await
                    Payment1.
                    setSale(relatedSale1);
                }
            
                const relatedSale2 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setSale)
                {
                    await
                    Payment2.
                    setSale(relatedSale2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
            
            async function associateRefundWithSale() {
            
                const relatedSale0 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const Refund0 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Refund0?.setSale)
                {
                    await
                    Refund0.
                    setSale(relatedSale0);
                }
            
                const relatedSale1 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const Refund1 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Refund1?.setSale)
                {
                    await
                    Refund1.
                    setSale(relatedSale1);
                }
            
                const relatedSale2 = await Sales.findOne({
                    offset: Math.floor(Math.random() * (await Sales.count())),
                });
                const Refund2 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Refund2?.setSale)
                {
                    await
                    Refund2.
                    setSale(relatedSale2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateRefundWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Refund0 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Refund0?.setRequested_by)
                {
                    await
                    Refund0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Refund1 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Refund1?.setRequested_by)
                {
                    await
                    Refund1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Refund2 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Refund2?.setRequested_by)
                {
                    await
                    Refund2.
                    setRequested_by(relatedRequested_by2);
                }
            
        }
        
    
        
            
            async function associateRefundWithApproved_by() {
            
                const relatedApproved_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Refund0 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Refund0?.setApproved_by)
                {
                    await
                    Refund0.
                    setApproved_by(relatedApproved_by0);
                }
            
                const relatedApproved_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Refund1 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Refund1?.setApproved_by)
                {
                    await
                    Refund1.
                    setApproved_by(relatedApproved_by1);
                }
            
                const relatedApproved_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Refund2 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Refund2?.setApproved_by)
                {
                    await
                    Refund2.
                    setApproved_by(relatedApproved_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateRefundWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Refund0 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Refund0?.setOrganization)
                {
                    await
                    Refund0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Refund1 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Refund1?.setOrganization)
                {
                    await
                    Refund1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Refund2 = await Refunds.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Refund2?.setOrganization)
                {
                    await
                    Refund2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStoreChecklistWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const StoreChecklist0 = await StoreChecklists.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StoreChecklist0?.setBranch)
                {
                    await
                    StoreChecklist0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const StoreChecklist1 = await StoreChecklists.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StoreChecklist1?.setBranch)
                {
                    await
                    StoreChecklist1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const StoreChecklist2 = await StoreChecklists.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StoreChecklist2?.setBranch)
                {
                    await
                    StoreChecklist2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateStoreChecklistWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StoreChecklist0 = await StoreChecklists.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StoreChecklist0?.setOrganization)
                {
                    await
                    StoreChecklist0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StoreChecklist1 = await StoreChecklists.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StoreChecklist1?.setOrganization)
                {
                    await
                    StoreChecklist1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StoreChecklist2 = await StoreChecklists.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StoreChecklist2?.setOrganization)
                {
                    await
                    StoreChecklist2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateChecklistItemWithChecklist() {
            
                const relatedChecklist0 = await StoreChecklists.findOne({
                    offset: Math.floor(Math.random() * (await StoreChecklists.count())),
                });
                const ChecklistItem0 = await ChecklistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistItem0?.setChecklist)
                {
                    await
                    ChecklistItem0.
                    setChecklist(relatedChecklist0);
                }
            
                const relatedChecklist1 = await StoreChecklists.findOne({
                    offset: Math.floor(Math.random() * (await StoreChecklists.count())),
                });
                const ChecklistItem1 = await ChecklistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistItem1?.setChecklist)
                {
                    await
                    ChecklistItem1.
                    setChecklist(relatedChecklist1);
                }
            
                const relatedChecklist2 = await StoreChecklists.findOne({
                    offset: Math.floor(Math.random() * (await StoreChecklists.count())),
                });
                const ChecklistItem2 = await ChecklistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistItem2?.setChecklist)
                {
                    await
                    ChecklistItem2.
                    setChecklist(relatedChecklist2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateChecklistItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistItem0 = await ChecklistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistItem0?.setOrganization)
                {
                    await
                    ChecklistItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistItem1 = await ChecklistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistItem1?.setOrganization)
                {
                    await
                    ChecklistItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistItem2 = await ChecklistItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistItem2?.setOrganization)
                {
                    await
                    ChecklistItem2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateChecklistRunWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const ChecklistRun0 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistRun0?.setBranch)
                {
                    await
                    ChecklistRun0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const ChecklistRun1 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistRun1?.setBranch)
                {
                    await
                    ChecklistRun1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const ChecklistRun2 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistRun2?.setBranch)
                {
                    await
                    ChecklistRun2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateChecklistRunWithChecklist() {
            
                const relatedChecklist0 = await StoreChecklists.findOne({
                    offset: Math.floor(Math.random() * (await StoreChecklists.count())),
                });
                const ChecklistRun0 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistRun0?.setChecklist)
                {
                    await
                    ChecklistRun0.
                    setChecklist(relatedChecklist0);
                }
            
                const relatedChecklist1 = await StoreChecklists.findOne({
                    offset: Math.floor(Math.random() * (await StoreChecklists.count())),
                });
                const ChecklistRun1 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistRun1?.setChecklist)
                {
                    await
                    ChecklistRun1.
                    setChecklist(relatedChecklist1);
                }
            
                const relatedChecklist2 = await StoreChecklists.findOne({
                    offset: Math.floor(Math.random() * (await StoreChecklists.count())),
                });
                const ChecklistRun2 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistRun2?.setChecklist)
                {
                    await
                    ChecklistRun2.
                    setChecklist(relatedChecklist2);
                }
            
        }
        
    
        
    
        
            
            async function associateChecklistRunWithCompleted_by() {
            
                const relatedCompleted_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChecklistRun0 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistRun0?.setCompleted_by)
                {
                    await
                    ChecklistRun0.
                    setCompleted_by(relatedCompleted_by0);
                }
            
                const relatedCompleted_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChecklistRun1 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistRun1?.setCompleted_by)
                {
                    await
                    ChecklistRun1.
                    setCompleted_by(relatedCompleted_by1);
                }
            
                const relatedCompleted_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ChecklistRun2 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistRun2?.setCompleted_by)
                {
                    await
                    ChecklistRun2.
                    setCompleted_by(relatedCompleted_by2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateChecklistRunWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistRun0 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistRun0?.setOrganization)
                {
                    await
                    ChecklistRun0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistRun1 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistRun1?.setOrganization)
                {
                    await
                    ChecklistRun1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistRun2 = await ChecklistRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistRun2?.setOrganization)
                {
                    await
                    ChecklistRun2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateChecklistRunItemWithChecklist_run() {
            
                const relatedChecklist_run0 = await ChecklistRuns.findOne({
                    offset: Math.floor(Math.random() * (await ChecklistRuns.count())),
                });
                const ChecklistRunItem0 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistRunItem0?.setChecklist_run)
                {
                    await
                    ChecklistRunItem0.
                    setChecklist_run(relatedChecklist_run0);
                }
            
                const relatedChecklist_run1 = await ChecklistRuns.findOne({
                    offset: Math.floor(Math.random() * (await ChecklistRuns.count())),
                });
                const ChecklistRunItem1 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistRunItem1?.setChecklist_run)
                {
                    await
                    ChecklistRunItem1.
                    setChecklist_run(relatedChecklist_run1);
                }
            
                const relatedChecklist_run2 = await ChecklistRuns.findOne({
                    offset: Math.floor(Math.random() * (await ChecklistRuns.count())),
                });
                const ChecklistRunItem2 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistRunItem2?.setChecklist_run)
                {
                    await
                    ChecklistRunItem2.
                    setChecklist_run(relatedChecklist_run2);
                }
            
        }
        
    
        
            
            async function associateChecklistRunItemWithChecklist_item() {
            
                const relatedChecklist_item0 = await ChecklistItems.findOne({
                    offset: Math.floor(Math.random() * (await ChecklistItems.count())),
                });
                const ChecklistRunItem0 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistRunItem0?.setChecklist_item)
                {
                    await
                    ChecklistRunItem0.
                    setChecklist_item(relatedChecklist_item0);
                }
            
                const relatedChecklist_item1 = await ChecklistItems.findOne({
                    offset: Math.floor(Math.random() * (await ChecklistItems.count())),
                });
                const ChecklistRunItem1 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistRunItem1?.setChecklist_item)
                {
                    await
                    ChecklistRunItem1.
                    setChecklist_item(relatedChecklist_item1);
                }
            
                const relatedChecklist_item2 = await ChecklistItems.findOne({
                    offset: Math.floor(Math.random() * (await ChecklistItems.count())),
                });
                const ChecklistRunItem2 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistRunItem2?.setChecklist_item)
                {
                    await
                    ChecklistRunItem2.
                    setChecklist_item(relatedChecklist_item2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateChecklistRunItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistRunItem0 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChecklistRunItem0?.setOrganization)
                {
                    await
                    ChecklistRunItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistRunItem1 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChecklistRunItem1?.setOrganization)
                {
                    await
                    ChecklistRunItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChecklistRunItem2 = await ChecklistRunItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChecklistRunItem2?.setOrganization)
                {
                    await
                    ChecklistRunItem2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateRiskAlertWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const RiskAlert0 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RiskAlert0?.setBranch)
                {
                    await
                    RiskAlert0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const RiskAlert1 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RiskAlert1?.setBranch)
                {
                    await
                    RiskAlert1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const RiskAlert2 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RiskAlert2?.setBranch)
                {
                    await
                    RiskAlert2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateRiskAlertWithAssigned_to() {
            
                const relatedAssigned_to0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const RiskAlert0 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RiskAlert0?.setAssigned_to)
                {
                    await
                    RiskAlert0.
                    setAssigned_to(relatedAssigned_to0);
                }
            
                const relatedAssigned_to1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const RiskAlert1 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RiskAlert1?.setAssigned_to)
                {
                    await
                    RiskAlert1.
                    setAssigned_to(relatedAssigned_to1);
                }
            
                const relatedAssigned_to2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const RiskAlert2 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RiskAlert2?.setAssigned_to)
                {
                    await
                    RiskAlert2.
                    setAssigned_to(relatedAssigned_to2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateRiskAlertWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RiskAlert0 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RiskAlert0?.setOrganization)
                {
                    await
                    RiskAlert0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RiskAlert1 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RiskAlert1?.setOrganization)
                {
                    await
                    RiskAlert1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RiskAlert2 = await RiskAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RiskAlert2?.setOrganization)
                {
                    await
                    RiskAlert2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateDepartmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department0 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Department0?.setOrganization)
                {
                    await
                    Department0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department1 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Department1?.setOrganization)
                {
                    await
                    Department1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department2 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Department2?.setOrganization)
                {
                    await
                    Department2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateEmployeeWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setUser)
                {
                    await
                    Employee0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setUser)
                {
                    await
                    Employee1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setUser)
                {
                    await
                    Employee2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setBranch)
                {
                    await
                    Employee0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setBranch)
                {
                    await
                    Employee1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setBranch)
                {
                    await
                    Employee2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateEmployeeWithDepartment() {
            
                const relatedDepartment0 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setDepartment)
                {
                    await
                    Employee0.
                    setDepartment(relatedDepartment0);
                }
            
                const relatedDepartment1 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setDepartment)
                {
                    await
                    Employee1.
                    setDepartment(relatedDepartment1);
                }
            
                const relatedDepartment2 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setDepartment)
                {
                    await
                    Employee2.
                    setDepartment(relatedDepartment2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateEmployeeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Employee0 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Employee0?.setOrganization)
                {
                    await
                    Employee0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Employee1 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Employee1?.setOrganization)
                {
                    await
                    Employee1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Employee2 = await Employees.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Employee2?.setOrganization)
                {
                    await
                    Employee2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateWorkShiftWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const WorkShift0 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkShift0?.setBranch)
                {
                    await
                    WorkShift0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const WorkShift1 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkShift1?.setBranch)
                {
                    await
                    WorkShift1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const WorkShift2 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkShift2?.setBranch)
                {
                    await
                    WorkShift2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateWorkShiftWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkShift0 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkShift0?.setOrganization)
                {
                    await
                    WorkShift0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkShift1 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkShift1?.setOrganization)
                {
                    await
                    WorkShift1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkShift2 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkShift2?.setOrganization)
                {
                    await
                    WorkShift2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateShiftAssignmentWithWork_shift() {
            
                const relatedWork_shift0 = await WorkShifts.findOne({
                    offset: Math.floor(Math.random() * (await WorkShifts.count())),
                });
                const ShiftAssignment0 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ShiftAssignment0?.setWork_shift)
                {
                    await
                    ShiftAssignment0.
                    setWork_shift(relatedWork_shift0);
                }
            
                const relatedWork_shift1 = await WorkShifts.findOne({
                    offset: Math.floor(Math.random() * (await WorkShifts.count())),
                });
                const ShiftAssignment1 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ShiftAssignment1?.setWork_shift)
                {
                    await
                    ShiftAssignment1.
                    setWork_shift(relatedWork_shift1);
                }
            
                const relatedWork_shift2 = await WorkShifts.findOne({
                    offset: Math.floor(Math.random() * (await WorkShifts.count())),
                });
                const ShiftAssignment2 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ShiftAssignment2?.setWork_shift)
                {
                    await
                    ShiftAssignment2.
                    setWork_shift(relatedWork_shift2);
                }
            
        }
        
    
        
            
            async function associateShiftAssignmentWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ShiftAssignment0 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ShiftAssignment0?.setEmployee)
                {
                    await
                    ShiftAssignment0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ShiftAssignment1 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ShiftAssignment1?.setEmployee)
                {
                    await
                    ShiftAssignment1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const ShiftAssignment2 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ShiftAssignment2?.setEmployee)
                {
                    await
                    ShiftAssignment2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateShiftAssignmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ShiftAssignment0 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ShiftAssignment0?.setOrganization)
                {
                    await
                    ShiftAssignment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ShiftAssignment1 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ShiftAssignment1?.setOrganization)
                {
                    await
                    ShiftAssignment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ShiftAssignment2 = await ShiftAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ShiftAssignment2?.setOrganization)
                {
                    await
                    ShiftAssignment2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAttendanceRecordWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setEmployee)
                {
                    await
                    AttendanceRecord0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setEmployee)
                {
                    await
                    AttendanceRecord1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setEmployee)
                {
                    await
                    AttendanceRecord2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
            
            async function associateAttendanceRecordWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setBranch)
                {
                    await
                    AttendanceRecord0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setBranch)
                {
                    await
                    AttendanceRecord1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setBranch)
                {
                    await
                    AttendanceRecord2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAttendanceRecordWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setOrganization)
                {
                    await
                    AttendanceRecord0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setOrganization)
                {
                    await
                    AttendanceRecord1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setOrganization)
                {
                    await
                    AttendanceRecord2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePayrollRunWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PayrollRun0 = await PayrollRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollRun0?.setBranch)
                {
                    await
                    PayrollRun0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PayrollRun1 = await PayrollRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollRun1?.setBranch)
                {
                    await
                    PayrollRun1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const PayrollRun2 = await PayrollRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollRun2?.setBranch)
                {
                    await
                    PayrollRun2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePayrollRunWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollRun0 = await PayrollRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollRun0?.setOrganization)
                {
                    await
                    PayrollRun0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollRun1 = await PayrollRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollRun1?.setOrganization)
                {
                    await
                    PayrollRun1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollRun2 = await PayrollRuns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollRun2?.setOrganization)
                {
                    await
                    PayrollRun2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePayrollItemWithPayroll_run() {
            
                const relatedPayroll_run0 = await PayrollRuns.findOne({
                    offset: Math.floor(Math.random() * (await PayrollRuns.count())),
                });
                const PayrollItem0 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollItem0?.setPayroll_run)
                {
                    await
                    PayrollItem0.
                    setPayroll_run(relatedPayroll_run0);
                }
            
                const relatedPayroll_run1 = await PayrollRuns.findOne({
                    offset: Math.floor(Math.random() * (await PayrollRuns.count())),
                });
                const PayrollItem1 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollItem1?.setPayroll_run)
                {
                    await
                    PayrollItem1.
                    setPayroll_run(relatedPayroll_run1);
                }
            
                const relatedPayroll_run2 = await PayrollRuns.findOne({
                    offset: Math.floor(Math.random() * (await PayrollRuns.count())),
                });
                const PayrollItem2 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollItem2?.setPayroll_run)
                {
                    await
                    PayrollItem2.
                    setPayroll_run(relatedPayroll_run2);
                }
            
        }
        
    
        
            
            async function associatePayrollItemWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PayrollItem0 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollItem0?.setEmployee)
                {
                    await
                    PayrollItem0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PayrollItem1 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollItem1?.setEmployee)
                {
                    await
                    PayrollItem1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PayrollItem2 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollItem2?.setEmployee)
                {
                    await
                    PayrollItem2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePayrollItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollItem0 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PayrollItem0?.setOrganization)
                {
                    await
                    PayrollItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollItem1 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PayrollItem1?.setOrganization)
                {
                    await
                    PayrollItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PayrollItem2 = await PayrollItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PayrollItem2?.setOrganization)
                {
                    await
                    PayrollItem2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePerformanceReviewWithEmployee() {
            
                const relatedEmployee0 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PerformanceReview0 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PerformanceReview0?.setEmployee)
                {
                    await
                    PerformanceReview0.
                    setEmployee(relatedEmployee0);
                }
            
                const relatedEmployee1 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PerformanceReview1 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PerformanceReview1?.setEmployee)
                {
                    await
                    PerformanceReview1.
                    setEmployee(relatedEmployee1);
                }
            
                const relatedEmployee2 = await Employees.findOne({
                    offset: Math.floor(Math.random() * (await Employees.count())),
                });
                const PerformanceReview2 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PerformanceReview2?.setEmployee)
                {
                    await
                    PerformanceReview2.
                    setEmployee(relatedEmployee2);
                }
            
        }
        
    
        
            
            async function associatePerformanceReviewWithReviewer() {
            
                const relatedReviewer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PerformanceReview0 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PerformanceReview0?.setReviewer)
                {
                    await
                    PerformanceReview0.
                    setReviewer(relatedReviewer0);
                }
            
                const relatedReviewer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PerformanceReview1 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PerformanceReview1?.setReviewer)
                {
                    await
                    PerformanceReview1.
                    setReviewer(relatedReviewer1);
                }
            
                const relatedReviewer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PerformanceReview2 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PerformanceReview2?.setReviewer)
                {
                    await
                    PerformanceReview2.
                    setReviewer(relatedReviewer2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePerformanceReviewWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PerformanceReview0 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PerformanceReview0?.setOrganization)
                {
                    await
                    PerformanceReview0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PerformanceReview1 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PerformanceReview1?.setOrganization)
                {
                    await
                    PerformanceReview1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PerformanceReview2 = await PerformanceReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PerformanceReview2?.setOrganization)
                {
                    await
                    PerformanceReview2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateChartAccountWithParent_account() {
            
                const relatedParent_account0 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const ChartAccount0 = await ChartAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChartAccount0?.setParent_account)
                {
                    await
                    ChartAccount0.
                    setParent_account(relatedParent_account0);
                }
            
                const relatedParent_account1 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const ChartAccount1 = await ChartAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChartAccount1?.setParent_account)
                {
                    await
                    ChartAccount1.
                    setParent_account(relatedParent_account1);
                }
            
                const relatedParent_account2 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const ChartAccount2 = await ChartAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChartAccount2?.setParent_account)
                {
                    await
                    ChartAccount2.
                    setParent_account(relatedParent_account2);
                }
            
        }
        
    
        
    
        
            
            async function associateChartAccountWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChartAccount0 = await ChartAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChartAccount0?.setOrganization)
                {
                    await
                    ChartAccount0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChartAccount1 = await ChartAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChartAccount1?.setOrganization)
                {
                    await
                    ChartAccount1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChartAccount2 = await ChartAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChartAccount2?.setOrganization)
                {
                    await
                    ChartAccount2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateJournalEntryWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const JournalEntry0 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalEntry0?.setBranch)
                {
                    await
                    JournalEntry0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const JournalEntry1 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalEntry1?.setBranch)
                {
                    await
                    JournalEntry1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const JournalEntry2 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalEntry2?.setBranch)
                {
                    await
                    JournalEntry2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateJournalEntryWithPosted_by() {
            
                const relatedPosted_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const JournalEntry0 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalEntry0?.setPosted_by)
                {
                    await
                    JournalEntry0.
                    setPosted_by(relatedPosted_by0);
                }
            
                const relatedPosted_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const JournalEntry1 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalEntry1?.setPosted_by)
                {
                    await
                    JournalEntry1.
                    setPosted_by(relatedPosted_by1);
                }
            
                const relatedPosted_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const JournalEntry2 = await JournalEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalEntry2?.setPosted_by)
                {
                    await
                    JournalEntry2.
                    setPosted_by(relatedPosted_by2);
                }
            
        }
        
    
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
            
            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);
                }
            
        }
        
    
        
            
            async function associateJournalLineWithAccount() {
            
                const relatedAccount0 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const JournalLine0 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (JournalLine0?.setAccount)
                {
                    await
                    JournalLine0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const JournalLine1 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (JournalLine1?.setAccount)
                {
                    await
                    JournalLine1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const JournalLine2 = await JournalLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (JournalLine2?.setAccount)
                {
                    await
                    JournalLine2.
                    setAccount(relatedAccount2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExpensWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setBranch)
                {
                    await
                    Expens0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setBranch)
                {
                    await
                    Expens1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setBranch)
                {
                    await
                    Expens2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateExpensWithExpense_account() {
            
                const relatedExpense_account0 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setExpense_account)
                {
                    await
                    Expens0.
                    setExpense_account(relatedExpense_account0);
                }
            
                const relatedExpense_account1 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setExpense_account)
                {
                    await
                    Expens1.
                    setExpense_account(relatedExpense_account1);
                }
            
                const relatedExpense_account2 = await ChartAccounts.findOne({
                    offset: Math.floor(Math.random() * (await ChartAccounts.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setExpense_account)
                {
                    await
                    Expens2.
                    setExpense_account(relatedExpense_account2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExpensWithSubmitted_by() {
            
                const relatedSubmitted_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setSubmitted_by)
                {
                    await
                    Expens0.
                    setSubmitted_by(relatedSubmitted_by0);
                }
            
                const relatedSubmitted_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setSubmitted_by)
                {
                    await
                    Expens1.
                    setSubmitted_by(relatedSubmitted_by1);
                }
            
                const relatedSubmitted_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setSubmitted_by)
                {
                    await
                    Expens2.
                    setSubmitted_by(relatedSubmitted_by2);
                }
            
        }
        
    
        
            
            async function associateExpensWithApproved_by() {
            
                const relatedApproved_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Expens0 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Expens0?.setApproved_by)
                {
                    await
                    Expens0.
                    setApproved_by(relatedApproved_by0);
                }
            
                const relatedApproved_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Expens1 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Expens1?.setApproved_by)
                {
                    await
                    Expens1.
                    setApproved_by(relatedApproved_by1);
                }
            
                const relatedApproved_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Expens2 = await Expenses.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Expens2?.setApproved_by)
                {
                    await
                    Expens2.
                    setApproved_by(relatedApproved_by2);
                }
            
        }
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAssetWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Asset0 = await Assets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Asset0?.setBranch)
                {
                    await
                    Asset0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Asset1 = await Assets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Asset1?.setBranch)
                {
                    await
                    Asset1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Asset2 = await Assets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Asset2?.setBranch)
                {
                    await
                    Asset2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAssetWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Asset0 = await Assets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Asset0?.setOrganization)
                {
                    await
                    Asset0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Asset1 = await Assets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Asset1?.setOrganization)
                {
                    await
                    Asset1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Asset2 = await Assets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Asset2?.setOrganization)
                {
                    await
                    Asset2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMarketingCampaignWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const MarketingCampaign0 = await MarketingCampaigns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MarketingCampaign0?.setBranch)
                {
                    await
                    MarketingCampaign0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const MarketingCampaign1 = await MarketingCampaigns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MarketingCampaign1?.setBranch)
                {
                    await
                    MarketingCampaign1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const MarketingCampaign2 = await MarketingCampaigns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MarketingCampaign2?.setBranch)
                {
                    await
                    MarketingCampaign2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateMarketingCampaignWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MarketingCampaign0 = await MarketingCampaigns.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MarketingCampaign0?.setOrganization)
                {
                    await
                    MarketingCampaign0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MarketingCampaign1 = await MarketingCampaigns.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MarketingCampaign1?.setOrganization)
                {
                    await
                    MarketingCampaign1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MarketingCampaign2 = await MarketingCampaigns.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MarketingCampaign2?.setOrganization)
                {
                    await
                    MarketingCampaign2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCampaignRecipientWithCampaign() {
            
                const relatedCampaign0 = await MarketingCampaigns.findOne({
                    offset: Math.floor(Math.random() * (await MarketingCampaigns.count())),
                });
                const CampaignRecipient0 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CampaignRecipient0?.setCampaign)
                {
                    await
                    CampaignRecipient0.
                    setCampaign(relatedCampaign0);
                }
            
                const relatedCampaign1 = await MarketingCampaigns.findOne({
                    offset: Math.floor(Math.random() * (await MarketingCampaigns.count())),
                });
                const CampaignRecipient1 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CampaignRecipient1?.setCampaign)
                {
                    await
                    CampaignRecipient1.
                    setCampaign(relatedCampaign1);
                }
            
                const relatedCampaign2 = await MarketingCampaigns.findOne({
                    offset: Math.floor(Math.random() * (await MarketingCampaigns.count())),
                });
                const CampaignRecipient2 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CampaignRecipient2?.setCampaign)
                {
                    await
                    CampaignRecipient2.
                    setCampaign(relatedCampaign2);
                }
            
        }
        
    
        
            
            async function associateCampaignRecipientWithCustomer() {
            
                const relatedCustomer0 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const CampaignRecipient0 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CampaignRecipient0?.setCustomer)
                {
                    await
                    CampaignRecipient0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const CampaignRecipient1 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CampaignRecipient1?.setCustomer)
                {
                    await
                    CampaignRecipient1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Customers.findOne({
                    offset: Math.floor(Math.random() * (await Customers.count())),
                });
                const CampaignRecipient2 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CampaignRecipient2?.setCustomer)
                {
                    await
                    CampaignRecipient2.
                    setCustomer(relatedCustomer2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateCampaignRecipientWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CampaignRecipient0 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CampaignRecipient0?.setOrganization)
                {
                    await
                    CampaignRecipient0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CampaignRecipient1 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CampaignRecipient1?.setOrganization)
                {
                    await
                    CampaignRecipient1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CampaignRecipient2 = await CampaignRecipients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CampaignRecipient2?.setOrganization)
                {
                    await
                    CampaignRecipient2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAiReorderSuggestionWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AiReorderSuggestion0 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiReorderSuggestion0?.setBranch)
                {
                    await
                    AiReorderSuggestion0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AiReorderSuggestion1 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiReorderSuggestion1?.setBranch)
                {
                    await
                    AiReorderSuggestion1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const AiReorderSuggestion2 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiReorderSuggestion2?.setBranch)
                {
                    await
                    AiReorderSuggestion2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateAiReorderSuggestionWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const AiReorderSuggestion0 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiReorderSuggestion0?.setProduct)
                {
                    await
                    AiReorderSuggestion0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const AiReorderSuggestion1 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiReorderSuggestion1?.setProduct)
                {
                    await
                    AiReorderSuggestion1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const AiReorderSuggestion2 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiReorderSuggestion2?.setProduct)
                {
                    await
                    AiReorderSuggestion2.
                    setProduct(relatedProduct2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAiReorderSuggestionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiReorderSuggestion0 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiReorderSuggestion0?.setOrganization)
                {
                    await
                    AiReorderSuggestion0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiReorderSuggestion1 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiReorderSuggestion1?.setOrganization)
                {
                    await
                    AiReorderSuggestion1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiReorderSuggestion2 = await AiReorderSuggestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiReorderSuggestion2?.setOrganization)
                {
                    await
                    AiReorderSuggestion2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Companies.bulkCreate(CompaniesData);
                
            
            
                
                await Branches.bulkCreate(BranchesData);
                
            
            
                
                await UserRoles.bulkCreate(UserRolesData);
                
            
            
                
                await AuditLogs.bulkCreate(AuditLogsData);
                
            
            
                
                await ProductCategories.bulkCreate(ProductCategoriesData);
                
            
            
                
                await Products.bulkCreate(ProductsData);
                
            
            
                
                await PriceLists.bulkCreate(PriceListsData);
                
            
            
                
                await PriceListItems.bulkCreate(PriceListItemsData);
                
            
            
                
                await Warehouses.bulkCreate(WarehousesData);
                
            
            
                
                await InventoryBatches.bulkCreate(InventoryBatchesData);
                
            
            
                
                await InventoryTransactions.bulkCreate(InventoryTransactionsData);
                
            
            
                
                await StockAdjustments.bulkCreate(StockAdjustmentsData);
                
            
            
                
                await StockAdjustmentLines.bulkCreate(StockAdjustmentLinesData);
                
            
            
                
                await InterbranchTransfers.bulkCreate(InterbranchTransfersData);
                
            
            
                
                await TransferLines.bulkCreate(TransferLinesData);
                
            
            
                
                await Suppliers.bulkCreate(SuppliersData);
                
            
            
                
                await SupplierProducts.bulkCreate(SupplierProductsData);
                
            
            
                
                await PurchaseOrders.bulkCreate(PurchaseOrdersData);
                
            
            
                
                await PurchaseOrderLines.bulkCreate(PurchaseOrderLinesData);
                
            
            
                
                await GoodsReceipts.bulkCreate(GoodsReceiptsData);
                
            
            
                
                await GoodsReceiptLines.bulkCreate(GoodsReceiptLinesData);
                
            
            
                
                await SupplierInvoices.bulkCreate(SupplierInvoicesData);
                
            
            
                
                await Customers.bulkCreate(CustomersData);
                
            
            
                
                await LoyaltyPrograms.bulkCreate(LoyaltyProgramsData);
                
            
            
                
                await PosRegisters.bulkCreate(PosRegistersData);
                
            
            
                
                await PosShifts.bulkCreate(PosShiftsData);
                
            
            
                
                await Sales.bulkCreate(SalesData);
                
            
            
                
                await SaleLines.bulkCreate(SaleLinesData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await Refunds.bulkCreate(RefundsData);
                
            
            
                
                await StoreChecklists.bulkCreate(StoreChecklistsData);
                
            
            
                
                await ChecklistItems.bulkCreate(ChecklistItemsData);
                
            
            
                
                await ChecklistRuns.bulkCreate(ChecklistRunsData);
                
            
            
                
                await ChecklistRunItems.bulkCreate(ChecklistRunItemsData);
                
            
            
                
                await RiskAlerts.bulkCreate(RiskAlertsData);
                
            
            
                
                await Departments.bulkCreate(DepartmentsData);
                
            
            
                
                await Employees.bulkCreate(EmployeesData);
                
            
            
                
                await WorkShifts.bulkCreate(WorkShiftsData);
                
            
            
                
                await ShiftAssignments.bulkCreate(ShiftAssignmentsData);
                
            
            
                
                await AttendanceRecords.bulkCreate(AttendanceRecordsData);
                
            
            
                
                await PayrollRuns.bulkCreate(PayrollRunsData);
                
            
            
                
                await PayrollItems.bulkCreate(PayrollItemsData);
                
            
            
                
                await PerformanceReviews.bulkCreate(PerformanceReviewsData);
                
            
            
                
                await ChartAccounts.bulkCreate(ChartAccountsData);
                
            
            
                
                await JournalEntries.bulkCreate(JournalEntriesData);
                
            
            
                
                await JournalLines.bulkCreate(JournalLinesData);
                
            
            
                
                await Expenses.bulkCreate(ExpensesData);
                
            
            
                
                await Assets.bulkCreate(AssetsData);
                
            
            
                
                await MarketingCampaigns.bulkCreate(MarketingCampaignsData);
                
            
            
                
                await CampaignRecipients.bulkCreate(CampaignRecipientsData);
                
            
            
                
                await AiReorderSuggestions.bulkCreate(AiReorderSuggestionsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCompanyWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBrancheWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBrancheWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateUserRoleWithUser(),
                    
                
                    
                
                    
                        
                        await associateUserRoleWithBranch(),
                    
                
                    
                
                    
                        
                        await associateUserRoleWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAuditLogWithActor(),
                    
                
                    
                        
                        await associateAuditLogWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAuditLogWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                        
                        await associateProductCategoryWithParent_category(),
                    
                
                    
                
                    
                
                    
                        
                        await associateProductCategoryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateProductWithCategory(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProductWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                        
                        await associatePriceListWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePriceListWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePriceListItemWithPrice_list(),
                    
                
                    
                        
                        await associatePriceListItemWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePriceListItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWarehousWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWarehousWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateInventoryBatcheWithProduct(),
                    
                
                    
                        
                        await associateInventoryBatcheWithWarehouse(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInventoryBatcheWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateInventoryTransactionWithBranch(),
                    
                
                    
                        
                        await associateInventoryTransactionWithWarehouse(),
                    
                
                    
                        
                        await associateInventoryTransactionWithProduct(),
                    
                
                    
                        
                        await associateInventoryTransactionWithBatch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInventoryTransactionWithPerformed_by(),
                    
                
                    
                
                    
                        
                        await associateInventoryTransactionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateStockAdjustmentWithBranch(),
                    
                
                    
                        
                        await associateStockAdjustmentWithWarehouse(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateStockAdjustmentWithRequested_by(),
                    
                
                    
                        
                        await associateStockAdjustmentWithApproved_by(),
                    
                
                    
                
                    
                        
                        await associateStockAdjustmentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateStockAdjustmentLineWithStock_adjustment(),
                    
                
                    
                        
                        await associateStockAdjustmentLineWithProduct(),
                    
                
                    
                        
                        await associateStockAdjustmentLineWithBatch(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateStockAdjustmentLineWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateInterbranchTransferWithFrom_branch(),
                    
                
                    
                        
                        await associateInterbranchTransferWithTo_branch(),
                    
                
                    
                        
                        await associateInterbranchTransferWithFrom_warehouse(),
                    
                
                    
                        
                        await associateInterbranchTransferWithTo_warehouse(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInterbranchTransferWithRequested_by(),
                    
                
                    
                        
                        await associateInterbranchTransferWithReceived_by(),
                    
                
                    
                
                    
                        
                        await associateInterbranchTransferWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTransferLineWithTransfer(),
                    
                
                    
                        
                        await associateTransferLineWithProduct(),
                    
                
                    
                        
                        await associateTransferLineWithBatch(),
                    
                
                    
                
                    
                
                    
                        
                        await associateTransferLineWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSupplierWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSupplierProductWithSupplier(),
                    
                
                    
                        
                        await associateSupplierProductWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSupplierProductWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associatePurchaseOrderWithBranch(),
                    
                
                    
                        
                        await associatePurchaseOrderWithSupplier(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseOrderWithRequested_by(),
                    
                
                    
                        
                        await associatePurchaseOrderWithApproved_by(),
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseOrderWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePurchaseOrderLineWithPurchase_order(),
                    
                
                    
                        
                        await associatePurchaseOrderLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseOrderLineWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateGoodsReceiptWithPurchase_order(),
                    
                
                    
                        
                        await associateGoodsReceiptWithBranch(),
                    
                
                    
                        
                        await associateGoodsReceiptWithWarehouse(),
                    
                
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptWithReceived_by(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateGoodsReceiptLineWithGoods_receipt(),
                    
                
                    
                        
                        await associateGoodsReceiptLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptLineWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateSupplierInvoiceWithSupplier(),
                    
                
                    
                        
                        await associateSupplierInvoiceWithPurchase_order(),
                    
                
                    
                        
                        await associateSupplierInvoiceWithGoods_receipt(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSupplierInvoiceWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCustomerWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLoyaltyProgramWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePosRegisterWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePosRegisterWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePosShiftWithBranch(),
                    
                
                    
                        
                        await associatePosShiftWithRegister(),
                    
                
                    
                        
                        await associatePosShiftWithCashier(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePosShiftWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateSaleWithBranch(),
                    
                
                    
                        
                        await associateSaleWithRegister(),
                    
                
                    
                        
                        await associateSaleWithShift(),
                    
                
                    
                        
                        await associateSaleWithCashier(),
                    
                
                    
                        
                        await associateSaleWithCustomer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSaleWithDiscount_approved_by(),
                    
                
                    
                        
                        await associateSaleWithVoided_by(),
                    
                
                    
                
                    
                        
                        await associateSaleWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSaleLineWithSale(),
                    
                
                    
                        
                        await associateSaleLineWithProduct(),
                    
                
                    
                        
                        await associateSaleLineWithBatch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSaleLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePaymentWithSale(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePaymentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateRefundWithSale(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRefundWithRequested_by(),
                    
                
                    
                        
                        await associateRefundWithApproved_by(),
                    
                
                    
                
                    
                        
                        await associateRefundWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateStoreChecklistWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateStoreChecklistWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateChecklistItemWithChecklist(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateChecklistItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateChecklistRunWithBranch(),
                    
                
                    
                        
                        await associateChecklistRunWithChecklist(),
                    
                
                    
                
                    
                        
                        await associateChecklistRunWithCompleted_by(),
                    
                
                    
                
                    
                
                    
                        
                        await associateChecklistRunWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateChecklistRunItemWithChecklist_run(),
                    
                
                    
                        
                        await associateChecklistRunItemWithChecklist_item(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateChecklistRunItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateRiskAlertWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRiskAlertWithAssigned_to(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRiskAlertWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDepartmentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateEmployeeWithUser(),
                    
                
                    
                        
                        await associateEmployeeWithBranch(),
                    
                
                    
                        
                        await associateEmployeeWithDepartment(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEmployeeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWorkShiftWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWorkShiftWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateShiftAssignmentWithWork_shift(),
                    
                
                    
                        
                        await associateShiftAssignmentWithEmployee(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateShiftAssignmentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAttendanceRecordWithEmployee(),
                    
                
                    
                        
                        await associateAttendanceRecordWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAttendanceRecordWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePayrollRunWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePayrollRunWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePayrollItemWithPayroll_run(),
                    
                
                    
                        
                        await associatePayrollItemWithEmployee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePayrollItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePerformanceReviewWithEmployee(),
                    
                
                    
                        
                        await associatePerformanceReviewWithReviewer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePerformanceReviewWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateChartAccountWithParent_account(),
                    
                
                    
                
                    
                        
                        await associateChartAccountWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateJournalEntryWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateJournalEntryWithPosted_by(),
                    
                
                    
                
                    
                
                    
                        
                        await associateJournalEntryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateJournalLineWithJournal_entry(),
                    
                
                    
                        
                        await associateJournalLineWithAccount(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateJournalLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateExpensWithBranch(),
                    
                
                    
                        
                        await associateExpensWithExpense_account(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExpensWithSubmitted_by(),
                    
                
                    
                        
                        await associateExpensWithApproved_by(),
                    
                
                    
                
                    
                        
                        await associateExpensWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAssetWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAssetWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMarketingCampaignWithBranch(),
                    
                
                    
                        
                        await associateMarketingCampaignWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCampaignRecipientWithCampaign(),
                    
                
                    
                        
                        await associateCampaignRecipientWithCustomer(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCampaignRecipientWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAiReorderSuggestionWithBranch(),
                    
                
                    
                        
                        await associateAiReorderSuggestionWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAiReorderSuggestionWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('companies', null, {});
            
            
            await queryInterface.bulkDelete('branches', null, {});
            
            
            await queryInterface.bulkDelete('user_roles', null, {});
            
            
            await queryInterface.bulkDelete('audit_logs', null, {});
            
            
            await queryInterface.bulkDelete('product_categories', null, {});
            
            
            await queryInterface.bulkDelete('products', null, {});
            
            
            await queryInterface.bulkDelete('price_lists', null, {});
            
            
            await queryInterface.bulkDelete('price_list_items', null, {});
            
            
            await queryInterface.bulkDelete('warehouses', null, {});
            
            
            await queryInterface.bulkDelete('inventory_batches', null, {});
            
            
            await queryInterface.bulkDelete('inventory_transactions', null, {});
            
            
            await queryInterface.bulkDelete('stock_adjustments', null, {});
            
            
            await queryInterface.bulkDelete('stock_adjustment_lines', null, {});
            
            
            await queryInterface.bulkDelete('interbranch_transfers', null, {});
            
            
            await queryInterface.bulkDelete('transfer_lines', null, {});
            
            
            await queryInterface.bulkDelete('suppliers', null, {});
            
            
            await queryInterface.bulkDelete('supplier_products', null, {});
            
            
            await queryInterface.bulkDelete('purchase_orders', null, {});
            
            
            await queryInterface.bulkDelete('purchase_order_lines', null, {});
            
            
            await queryInterface.bulkDelete('goods_receipts', null, {});
            
            
            await queryInterface.bulkDelete('goods_receipt_lines', null, {});
            
            
            await queryInterface.bulkDelete('supplier_invoices', null, {});
            
            
            await queryInterface.bulkDelete('customers', null, {});
            
            
            await queryInterface.bulkDelete('loyalty_programs', null, {});
            
            
            await queryInterface.bulkDelete('pos_registers', null, {});
            
            
            await queryInterface.bulkDelete('pos_shifts', null, {});
            
            
            await queryInterface.bulkDelete('sales', null, {});
            
            
            await queryInterface.bulkDelete('sale_lines', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('refunds', null, {});
            
            
            await queryInterface.bulkDelete('store_checklists', null, {});
            
            
            await queryInterface.bulkDelete('checklist_items', null, {});
            
            
            await queryInterface.bulkDelete('checklist_runs', null, {});
            
            
            await queryInterface.bulkDelete('checklist_run_items', null, {});
            
            
            await queryInterface.bulkDelete('risk_alerts', null, {});
            
            
            await queryInterface.bulkDelete('departments', null, {});
            
            
            await queryInterface.bulkDelete('employees', null, {});
            
            
            await queryInterface.bulkDelete('work_shifts', null, {});
            
            
            await queryInterface.bulkDelete('shift_assignments', null, {});
            
            
            await queryInterface.bulkDelete('attendance_records', null, {});
            
            
            await queryInterface.bulkDelete('payroll_runs', null, {});
            
            
            await queryInterface.bulkDelete('payroll_items', null, {});
            
            
            await queryInterface.bulkDelete('performance_reviews', null, {});
            
            
            await queryInterface.bulkDelete('chart_accounts', null, {});
            
            
            await queryInterface.bulkDelete('journal_entries', null, {});
            
            
            await queryInterface.bulkDelete('journal_lines', null, {});
            
            
            await queryInterface.bulkDelete('expenses', null, {});
            
            
            await queryInterface.bulkDelete('assets', null, {});
            
            
            await queryInterface.bulkDelete('marketing_campaigns', null, {});
            
            
            await queryInterface.bulkDelete('campaign_recipients', null, {});
            
            
            await queryInterface.bulkDelete('ai_reorder_suggestions', null, {});
            
        
    },
};