





















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






const Organizations = db.organizations;

const Companies = db.companies;

const UserRoleAssignments = db.user_role_assignments;

const RolePermissionMappings = db.role_permission_mappings;

const Vendors = db.vendors;

const Warehouses = db.warehouses;

const ProductCategories = db.product_categories;

const Products = db.products;

const PurchaseRequisitions = db.purchase_requisitions;

const PurchaseRequisitionLines = db.purchase_requisition_lines;

const PurchaseOrders = db.purchase_orders;

const PurchaseOrderLines = db.purchase_order_lines;

const GoodsReceipts = db.goods_receipts;

const GoodsReceiptLines = db.goods_receipt_lines;

const VendorInvoices = db.vendor_invoices;

const InvoiceLines = db.invoice_lines;

const Payments = db.payments;

const Departments = db.departments;

const DocumentTypes = db.document_types;

const Documents = db.documents;

const DocumentLinks = db.document_links;

const ApprovalWorkflows = db.approval_workflows;

const ApprovalSteps = db.approval_steps;

const Approvals = db.approvals;

const ActivityLogs = db.activity_logs;

const UiAnnouncements = db.ui_announcements;







const OrganizationsData = [
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
];



const CompaniesData = [
    
    {
    
        
        
            
                "company_name": "Ada Lovelace",
            
        
    
        
        
            
                "legal_name": "Marie Curie",
            
        
    
        
        
            
                "tax_number": "Alan Turing",
            
        
    
        
        
            
                "website": "Alan Turing",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "address_line1": "Marie Curie",
            
        
    
        
        
            
                "address_line2": "Alan Turing",
            
        
    
        
        
            
                "city": "Ada Lovelace",
            
        
    
        
        
            
                "state": "Alan Turing",
            
        
    
        
        
            
                "postal_code": "Alan Turing",
            
        
    
        
        
            
                "country": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "company_name": "Marie Curie",
            
        
    
        
        
            
                "legal_name": "Ada Lovelace",
            
        
    
        
        
            
                "tax_number": "Alan Turing",
            
        
    
        
        
            
                "website": "Marie Curie",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Marie Curie",
            
        
    
        
        
            
                "address_line1": "Alan Turing",
            
        
    
        
        
            
                "address_line2": "Alan Turing",
            
        
    
        
        
            
                "city": "Alan Turing",
            
        
    
        
        
            
                "state": "Ada Lovelace",
            
        
    
        
        
            
                "postal_code": "Alan Turing",
            
        
    
        
        
            
                "country": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "company_name": "Ada Lovelace",
            
        
    
        
        
            
                "legal_name": "Grace Hopper",
            
        
    
        
        
            
                "tax_number": "Ada Lovelace",
            
        
    
        
        
            
                "website": "Alan Turing",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "email": "Grace Hopper",
            
        
    
        
        
            
                "address_line1": "Alan Turing",
            
        
    
        
        
            
                "address_line2": "Grace Hopper",
            
        
    
        
        
            
                "city": "Grace Hopper",
            
        
    
        
        
            
                "state": "Alan Turing",
            
        
    
        
        
            
                "postal_code": "Grace Hopper",
            
        
    
        
        
            
                "country": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "company_name": "Ada Lovelace",
            
        
    
        
        
            
                "legal_name": "Ada Lovelace",
            
        
    
        
        
            
                "tax_number": "Ada Lovelace",
            
        
    
        
        
            
                "website": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "address_line1": "Marie Curie",
            
        
    
        
        
            
                "address_line2": "Ada Lovelace",
            
        
    
        
        
            
                "city": "Marie Curie",
            
        
    
        
        
            
                "state": "Marie Curie",
            
        
    
        
        
            
                "postal_code": "Ada Lovelace",
            
        
    
        
        
            
                "country": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "company_name": "Ada Lovelace",
            
        
    
        
        
            
                "legal_name": "Grace Hopper",
            
        
    
        
        
            
                "tax_number": "Grace Hopper",
            
        
    
        
        
            
                "website": "Marie Curie",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "address_line1": "Ada Lovelace",
            
        
    
        
        
            
                "address_line2": "Ada Lovelace",
            
        
    
        
        
            
                "city": "Grace Hopper",
            
        
    
        
        
            
                "state": "Ada Lovelace",
            
        
    
        
        
            
                "postal_code": "Grace Hopper",
            
        
    
        
        
            
                "country": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const UserRoleAssignmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "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
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "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
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "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
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "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
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_primary": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RolePermissionMappingsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_allowed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_allowed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_allowed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_allowed": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_allowed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const VendorsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Marie Curie",
            
        
    
        
        
            
                "vendor_code": "Marie Curie",
            
        
    
        
        
            
                "contact_name": "Grace Hopper",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "address": "Grace Hopper",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "payment_terms": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Alan Turing",
            
        
    
        
        
            
                "vendor_code": "Ada Lovelace",
            
        
    
        
        
            
                "contact_name": "Marie Curie",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "status": "on_hold",
            
        
    
        
        
            
                "payment_terms": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Marie Curie",
            
        
    
        
        
            
                "vendor_code": "Ada Lovelace",
            
        
    
        
        
            
                "contact_name": "Alan Turing",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "payment_terms": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Marie Curie",
            
        
    
        
        
            
                "vendor_code": "Alan Turing",
            
        
    
        
        
            
                "contact_name": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "payment_terms": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vendor_name": "Marie Curie",
            
        
    
        
        
            
                "vendor_code": "Marie Curie",
            
        
    
        
        
            
                "contact_name": "Marie Curie",
            
        
    
        
        
            
                "email": "Alan Turing",
            
        
    
        
        
            
                "phone": "Alan Turing",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "status": "on_hold",
            
        
    
        
        
            
                "payment_terms": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WarehousesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "warehouse_name": "Grace Hopper",
            
        
    
        
        
            
                "warehouse_code": "Marie Curie",
            
        
    
        
        
            
                "address": "Grace Hopper",
            
        
    
        
        
            
                "is_default": false,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "warehouse_name": "Marie Curie",
            
        
    
        
        
            
                "warehouse_code": "Marie Curie",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "is_default": true,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "warehouse_name": "Grace Hopper",
            
        
    
        
        
            
                "warehouse_code": "Alan Turing",
            
        
    
        
        
            
                "address": "Grace Hopper",
            
        
    
        
        
            
                "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": "Marie Curie",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "is_default": true,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "warehouse_name": "Alan Turing",
            
        
    
        
        
            
                "warehouse_code": "Ada Lovelace",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "is_default": true,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



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



const ProductsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "product_name": "Grace Hopper",
            
        
    
        
        
            
                "sku": "Marie Curie",
            
        
    
        
        
            
                "barcode": "Grace Hopper",
            
        
    
        
        
            
                "product_type": "consumable",
            
        
    
        
        
            
                "uom": "Alan Turing",
            
        
    
        
        
            
                "standard_cost": 2.18,
            
        
    
        
        
            
                "purchase_price": 4.61,
            
        
    
        
        
            
                "sales_price": 4.68,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "images" 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
            
        
    
        
        
            
                "product_name": "Marie Curie",
            
        
    
        
        
            
                "sku": "Marie Curie",
            
        
    
        
        
            
                "barcode": "Alan Turing",
            
        
    
        
        
            
                "product_type": "service",
            
        
    
        
        
            
                "uom": "Alan Turing",
            
        
    
        
        
            
                "standard_cost": 6.19,
            
        
    
        
        
            
                "purchase_price": 4.49,
            
        
    
        
        
            
                "sales_price": 6.89,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // 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",
            
        
    
        
        
            
                "uom": "Marie Curie",
            
        
    
        
        
            
                "standard_cost": 5.92,
            
        
    
        
        
            
                "purchase_price": 6.78,
            
        
    
        
        
            
                "sales_price": 3.36,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "product_name": "Marie Curie",
            
        
    
        
        
            
                "sku": "Alan Turing",
            
        
    
        
        
            
                "barcode": "Alan Turing",
            
        
    
        
        
            
                "product_type": "stock",
            
        
    
        
        
            
                "uom": "Ada Lovelace",
            
        
    
        
        
            
                "standard_cost": 6.83,
            
        
    
        
        
            
                "purchase_price": 4.7,
            
        
    
        
        
            
                "sales_price": 7.48,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "product_name": "Grace Hopper",
            
        
    
        
        
            
                "sku": "Ada Lovelace",
            
        
    
        
        
            
                "barcode": "Grace Hopper",
            
        
    
        
        
            
                "product_type": "service",
            
        
    
        
        
            
                "uom": "Ada Lovelace",
            
        
    
        
        
            
                "standard_cost": 3.18,
            
        
    
        
        
            
                "purchase_price": 5.76,
            
        
    
        
        
            
                "sales_price": 3.17,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PurchaseRequisitionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requisition_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_date": new Date(Date.now()),
            
        
    
        
        
            
                "needed_by": new Date(Date.now()),
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "reason": "Alan Turing",
            
        
    
        
        
            
                "estimated_total": 5.67,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requisition_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_date": new Date(Date.now()),
            
        
    
        
        
            
                "needed_by": new Date(Date.now()),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "reason": "Marie Curie",
            
        
    
        
        
            
                "estimated_total": 4.87,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requisition_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_date": new Date(Date.now()),
            
        
    
        
        
            
                "needed_by": new Date(Date.now()),
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "reason": "Ada Lovelace",
            
        
    
        
        
            
                "estimated_total": 1.21,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requisition_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_date": new Date(Date.now()),
            
        
    
        
        
            
                "needed_by": new Date(Date.now()),
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                "reason": "Alan Turing",
            
        
    
        
        
            
                "estimated_total": 1.92,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requisition_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "requested_date": new Date(Date.now()),
            
        
    
        
        
            
                "needed_by": new Date(Date.now()),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "reason": "Alan Turing",
            
        
    
        
        
            
                "estimated_total": 2.86,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PurchaseRequisitionLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "quantity": 8.88,
            
        
    
        
        
            
                "unit_price_estimate": 3.69,
            
        
    
        
        
            
                "line_total_estimate": 6.5,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "quantity": 8.56,
            
        
    
        
        
            
                "unit_price_estimate": 4.35,
            
        
    
        
        
            
                "line_total_estimate": 0.6,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "quantity": 4.63,
            
        
    
        
        
            
                "unit_price_estimate": 0.29,
            
        
    
        
        
            
                "line_total_estimate": 7.5,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "quantity": 9.19,
            
        
    
        
        
            
                "unit_price_estimate": 2.39,
            
        
    
        
        
            
                "line_total_estimate": 2.36,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "quantity": 8.91,
            
        
    
        
        
            
                "unit_price_estimate": 1.42,
            
        
    
        
        
            
                "line_total_estimate": 0.41,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PurchaseOrdersData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "subtotal": 7.17,
            
        
    
        
        
            
                "tax_total": 8.68,
            
        
    
        
        
            
                "discount_total": 8.06,
            
        
    
        
        
            
                "grand_total": 3.8,
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "subtotal": 3.21,
            
        
    
        
        
            
                "tax_total": 5.57,
            
        
    
        
        
            
                "discount_total": 3.7,
            
        
    
        
        
            
                "grand_total": 6.86,
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "po_number": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "confirmed",
            
        
    
        
        
            
                "currency": "INR",
            
        
    
        
        
            
                "subtotal": 9.71,
            
        
    
        
        
            
                "tax_total": 6.19,
            
        
    
        
        
            
                "discount_total": 6.97,
            
        
    
        
        
            
                "grand_total": 4.45,
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "sent",
            
        
    
        
        
            
                "currency": "AED",
            
        
    
        
        
            
                "subtotal": 9.94,
            
        
    
        
        
            
                "tax_total": 2.42,
            
        
    
        
        
            
                "discount_total": 7.02,
            
        
    
        
        
            
                "grand_total": 4.77,
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_date": new Date(Date.now()),
            
        
    
        
        
            
                "expected_delivery_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "confirmed",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "subtotal": 1.56,
            
        
    
        
        
            
                "tax_total": 4.71,
            
        
    
        
        
            
                "discount_total": 3.37,
            
        
    
        
        
            
                "grand_total": 9.46,
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PurchaseOrderLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "quantity": 7.67,
            
        
    
        
        
            
                "unit_price": 8.82,
            
        
    
        
        
            
                "tax_rate": 1.12,
            
        
    
        
        
            
                "discount_rate": 7.97,
            
        
    
        
        
            
                "line_total": 9.19,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "quantity": 0.94,
            
        
    
        
        
            
                "unit_price": 9.18,
            
        
    
        
        
            
                "tax_rate": 7.52,
            
        
    
        
        
            
                "discount_rate": 2.29,
            
        
    
        
        
            
                "line_total": 1.65,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "quantity": 3.89,
            
        
    
        
        
            
                "unit_price": 1.41,
            
        
    
        
        
            
                "tax_rate": 2.41,
            
        
    
        
        
            
                "discount_rate": 0.56,
            
        
    
        
        
            
                "line_total": 8.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
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "quantity": 0.93,
            
        
    
        
        
            
                "unit_price": 4.66,
            
        
    
        
        
            
                "tax_rate": 8.36,
            
        
    
        
        
            
                "discount_rate": 0.06,
            
        
    
        
        
            
                "line_total": 3.24,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "quantity": 9.3,
            
        
    
        
        
            
                "unit_price": 3.41,
            
        
    
        
        
            
                "tax_rate": 1.06,
            
        
    
        
        
            
                "discount_rate": 6.4,
            
        
    
        
        
            
                "line_total": 5.19,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GoodsReceiptsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "grn_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_date": new Date(Date.now()),
            
        
    
        
        
            
                "posted_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "remarks": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "receipt_date": new Date(Date.now()),
            
        
    
        
        
            
                "posted_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "remarks": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "grn_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_date": new Date(Date.now()),
            
        
    
        
        
            
                "posted_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "remarks": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "grn_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_date": new Date(Date.now()),
            
        
    
        
        
            
                "posted_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "posted",
            
        
    
        
        
            
                "remarks": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "grn_number": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "receipt_date": new Date(Date.now()),
            
        
    
        
        
            
                "posted_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "remarks": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GoodsReceiptLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_received": 7.99,
            
        
    
        
        
            
                "quantity_accepted": 4.15,
            
        
    
        
        
            
                "quantity_rejected": 7.45,
            
        
    
        
        
            
                "quality_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_received": 8.43,
            
        
    
        
        
            
                "quantity_accepted": 1.23,
            
        
    
        
        
            
                "quantity_rejected": 6.62,
            
        
    
        
        
            
                "quality_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_received": 4.87,
            
        
    
        
        
            
                "quantity_accepted": 0.59,
            
        
    
        
        
            
                "quantity_rejected": 2.39,
            
        
    
        
        
            
                "quality_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_received": 7.03,
            
        
    
        
        
            
                "quantity_accepted": 3.83,
            
        
    
        
        
            
                "quantity_rejected": 8.8,
            
        
    
        
        
            
                "quality_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
            
        
    
        
        
            
                "quantity_received": 3.44,
            
        
    
        
        
            
                "quantity_accepted": 9.36,
            
        
    
        
        
            
                "quantity_rejected": 4.22,
            
        
    
        
        
            
                "quality_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const VendorInvoicesData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "subtotal": 8.7,
            
        
    
        
        
            
                "tax_total": 6.05,
            
        
    
        
        
            
                "grand_total": 2.85,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" 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
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "subtotal": 2.36,
            
        
    
        
        
            
                "tax_total": 9.07,
            
        
    
        
        
            
                "grand_total": 1.12,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                "currency": "INR",
            
        
    
        
        
            
                "subtotal": 5.1,
            
        
    
        
        
            
                "tax_total": 9.66,
            
        
    
        
        
            
                "grand_total": 1.74,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                "currency": "SAR",
            
        
    
        
        
            
                "subtotal": 3.48,
            
        
    
        
        
            
                "tax_total": 9.89,
            
        
    
        
        
            
                "grand_total": 8.58,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_date": new Date(Date.now()),
            
        
    
        
        
            
                "due_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "subtotal": 8.05,
            
        
    
        
        
            
                "tax_total": 7.62,
            
        
    
        
        
            
                "grand_total": 7.29,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const InvoiceLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "quantity": 8.95,
            
        
    
        
        
            
                "unit_price": 5.95,
            
        
    
        
        
            
                "tax_rate": 8.36,
            
        
    
        
        
            
                "line_total": 3.33,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "quantity": 5.33,
            
        
    
        
        
            
                "unit_price": 0.41,
            
        
    
        
        
            
                "tax_rate": 0.88,
            
        
    
        
        
            
                "line_total": 9.51,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "quantity": 5.5,
            
        
    
        
        
            
                "unit_price": 4.76,
            
        
    
        
        
            
                "tax_rate": 3.06,
            
        
    
        
        
            
                "line_total": 6.36,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "quantity": 4.14,
            
        
    
        
        
            
                "unit_price": 2.03,
            
        
    
        
        
            
                "tax_rate": 3.64,
            
        
    
        
        
            
                "line_total": 6.4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "quantity": 4.52,
            
        
    
        
        
            
                "unit_price": 0.71,
            
        
    
        
        
            
                "tax_rate": 0.01,
            
        
    
        
        
            
                "line_total": 9.74,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_reference": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 1.93,
            
        
    
        
        
            
                "method": "cheque",
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_reference": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 0.45,
            
        
    
        
        
            
                "method": "cheque",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_reference": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 6.07,
            
        
    
        
        
            
                "method": "cheque",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_reference": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 4.02,
            
        
    
        
        
            
                "method": "cheque",
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_reference": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_date": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 0.0,
            
        
    
        
        
            
                "method": "cash",
            
        
    
        
        
            
                "status": "processing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



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



const DocumentTypesData = [
    
    {
    
        
        
            
                "type_name": "Grace Hopper",
            
        
    
        
        
            
                "type_code": "Ada Lovelace",
            
        
    
        
        
            
                "module": "inventory",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "type_name": "Marie Curie",
            
        
    
        
        
            
                "type_code": "Grace Hopper",
            
        
    
        
        
            
                "module": "general",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "type_name": "Ada Lovelace",
            
        
    
        
        
            
                "type_code": "Marie Curie",
            
        
    
        
        
            
                "module": "procurement",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "type_name": "Ada Lovelace",
            
        
    
        
        
            
                "type_code": "Grace Hopper",
            
        
    
        
        
            
                "module": "general",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "type_name": "Alan Turing",
            
        
    
        
        
            
                "type_code": "Marie Curie",
            
        
    
        
        
            
                "module": "finance",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DocumentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_number": "Alan Turing",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "priority": "low",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date(Date.now()),
            
        
    
        
        
            
                "review_due_date": new Date(Date.now()),
            
        
    
        
        
            
                "summary": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "tags": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_number": "Ada Lovelace",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "priority": "high",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date(Date.now()),
            
        
    
        
        
            
                "review_due_date": new Date(Date.now()),
            
        
    
        
        
            
                "summary": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "tags": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_number": "Alan Turing",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "status": "in_review",
            
        
    
        
        
            
                "priority": "normal",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date(Date.now()),
            
        
    
        
        
            
                "review_due_date": new Date(Date.now()),
            
        
    
        
        
            
                "summary": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "tags": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_number": "Marie Curie",
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                "priority": "high",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date(Date.now()),
            
        
    
        
        
            
                "review_due_date": new Date(Date.now()),
            
        
    
        
        
            
                "summary": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "tags": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_number": "Ada Lovelace",
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "priority": "urgent",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_date": new Date(Date.now()),
            
        
    
        
        
            
                "review_due_date": new Date(Date.now()),
            
        
    
        
        
            
                "summary": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "tags": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DocumentLinksData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "vendor_invoice",
            
        
    
        
        
            
                "source_reference": "Ada Lovelace",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "goods_receipt",
            
        
    
        
        
            
                "source_reference": "Alan Turing",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "goods_receipt",
            
        
    
        
        
            
                "source_reference": "Ada Lovelace",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "goods_receipt",
            
        
    
        
        
            
                "source_reference": "Grace Hopper",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "source_type": "vendor_invoice",
            
        
    
        
        
            
                "source_reference": "Marie Curie",
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ApprovalWorkflowsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "workflow_name": "Ada Lovelace",
            
        
    
        
        
            
                "applies_to": "vendor_invoice",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "workflow_name": "Marie Curie",
            
        
    
        
        
            
                "applies_to": "purchase_order",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "workflow_name": "Marie Curie",
            
        
    
        
        
            
                "applies_to": "purchase_requisition",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "workflow_name": "Ada Lovelace",
            
        
    
        
        
            
                "applies_to": "document",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "workflow_name": "Grace Hopper",
            
        
    
        
        
            
                "applies_to": "purchase_requisition",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ApprovalStepsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "step_order": 3,
            
        
    
        
        
            
                "step_name": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "min_amount": 7.14,
            
        
    
        
        
            
                "max_amount": 7.96,
            
        
    
        
        
            
                "is_required": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "step_order": 5,
            
        
    
        
        
            
                "step_name": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "min_amount": 2.21,
            
        
    
        
        
            
                "max_amount": 8.04,
            
        
    
        
        
            
                "is_required": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "step_order": 2,
            
        
    
        
        
            
                "step_name": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "min_amount": 4.88,
            
        
    
        
        
            
                "max_amount": 7.63,
            
        
    
        
        
            
                "is_required": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "step_order": 1,
            
        
    
        
        
            
                "step_name": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "min_amount": 7.53,
            
        
    
        
        
            
                "max_amount": 4.22,
            
        
    
        
        
            
                "is_required": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "step_order": 2,
            
        
    
        
        
            
                "step_name": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "min_amount": 0.79,
            
        
    
        
        
            
                "max_amount": 3.69,
            
        
    
        
        
            
                "is_required": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ApprovalsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "vendor_invoice",
            
        
    
        
        
            
                "entity_reference": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "decided_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "purchase_requisition",
            
        
    
        
        
            
                "entity_reference": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "decided_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "document",
            
        
    
        
        
            
                "entity_reference": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "decided_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "document",
            
        
    
        
        
            
                "entity_reference": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "decided_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "document",
            
        
    
        
        
            
                "entity_reference": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "decided_at": new Date(Date.now()),
            
        
    
        
        
            
                "decision_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ActivityLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "document",
            
        
    
        
        
            
                "entity_reference": "Ada Lovelace",
            
        
    
        
        
            
                "action": "approved",
            
        
    
        
        
            
                "event_time": new Date(Date.now()),
            
        
    
        
        
            
                "message": "Ada Lovelace",
            
        
    
        
        
            
                "ip_address": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "goods_receipt",
            
        
    
        
        
            
                "entity_reference": "Ada Lovelace",
            
        
    
        
        
            
                "action": "attached_file",
            
        
    
        
        
            
                "event_time": new Date(Date.now()),
            
        
    
        
        
            
                "message": "Grace Hopper",
            
        
    
        
        
            
                "ip_address": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "document",
            
        
    
        
        
            
                "entity_reference": "Alan Turing",
            
        
    
        
        
            
                "action": "rejected",
            
        
    
        
        
            
                "event_time": new Date(Date.now()),
            
        
    
        
        
            
                "message": "Ada Lovelace",
            
        
    
        
        
            
                "ip_address": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "purchase_order",
            
        
    
        
        
            
                "entity_reference": "Alan Turing",
            
        
    
        
        
            
                "action": "commented",
            
        
    
        
        
            
                "event_time": new Date(Date.now()),
            
        
    
        
        
            
                "message": "Ada Lovelace",
            
        
    
        
        
            
                "ip_address": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "vendor",
            
        
    
        
        
            
                "entity_reference": "Marie Curie",
            
        
    
        
        
            
                "action": "created",
            
        
    
        
        
            
                "event_time": new Date(Date.now()),
            
        
    
        
        
            
                "message": "Marie Curie",
            
        
    
        
        
            
                "ip_address": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const UiAnnouncementsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "headline": "Alan Turing",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "audience": "warehouse",
            
        
    
        
        
            
                "publish_from": new Date(Date.now()),
            
        
    
        
        
            
                "publish_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "headline": "Alan Turing",
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "audience": "admins",
            
        
    
        
        
            
                "publish_from": new Date(Date.now()),
            
        
    
        
        
            
                "publish_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "headline": "Grace Hopper",
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "audience": "all_users",
            
        
    
        
        
            
                "publish_from": new Date(Date.now()),
            
        
    
        
        
            
                "publish_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "headline": "Marie Curie",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "audience": "buyers",
            
        
    
        
        
            
                "publish_from": new Date(Date.now()),
            
        
    
        
        
            
                "publish_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "headline": "Alan Turing",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "audience": "admins",
            
        
    
        
        
            
                "publish_from": new Date(Date.now()),
            
        
    
        
        
            
                "publish_to": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




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

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company3 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Company3?.setOrganization)
                {
                    await
                    Company3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Company4 = await Companies.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Company4?.setOrganization)
                {
                    await
                    Company4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateUserRoleAssignmentWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRoleAssignment0 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRoleAssignment0?.setUser)
                {
                    await
                    UserRoleAssignment0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRoleAssignment1 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRoleAssignment1?.setUser)
                {
                    await
                    UserRoleAssignment1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRoleAssignment2 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRoleAssignment2?.setUser)
                {
                    await
                    UserRoleAssignment2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRoleAssignment3 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (UserRoleAssignment3?.setUser)
                {
                    await
                    UserRoleAssignment3.
                    setUser(relatedUser3);
                }
            
                const relatedUser4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UserRoleAssignment4 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (UserRoleAssignment4?.setUser)
                {
                    await
                    UserRoleAssignment4.
                    setUser(relatedUser4);
                }
            
        }
        
    
        
    
        
            
            async function associateUserRoleAssignmentWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UserRoleAssignment0 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRoleAssignment0?.setCompany)
                {
                    await
                    UserRoleAssignment0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UserRoleAssignment1 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRoleAssignment1?.setCompany)
                {
                    await
                    UserRoleAssignment1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UserRoleAssignment2 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRoleAssignment2?.setCompany)
                {
                    await
                    UserRoleAssignment2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UserRoleAssignment3 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (UserRoleAssignment3?.setCompany)
                {
                    await
                    UserRoleAssignment3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UserRoleAssignment4 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (UserRoleAssignment4?.setCompany)
                {
                    await
                    UserRoleAssignment4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateUserRoleAssignmentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRoleAssignment0 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UserRoleAssignment0?.setOrganization)
                {
                    await
                    UserRoleAssignment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRoleAssignment1 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UserRoleAssignment1?.setOrganization)
                {
                    await
                    UserRoleAssignment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRoleAssignment2 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UserRoleAssignment2?.setOrganization)
                {
                    await
                    UserRoleAssignment2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRoleAssignment3 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (UserRoleAssignment3?.setOrganization)
                {
                    await
                    UserRoleAssignment3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UserRoleAssignment4 = await UserRoleAssignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (UserRoleAssignment4?.setOrganization)
                {
                    await
                    UserRoleAssignment4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
    
        
            
            async function associateRolePermissionMappingWithPermission() {
            
                const relatedPermission0 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermissionMapping0 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RolePermissionMapping0?.setPermission)
                {
                    await
                    RolePermissionMapping0.
                    setPermission(relatedPermission0);
                }
            
                const relatedPermission1 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermissionMapping1 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RolePermissionMapping1?.setPermission)
                {
                    await
                    RolePermissionMapping1.
                    setPermission(relatedPermission1);
                }
            
                const relatedPermission2 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermissionMapping2 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RolePermissionMapping2?.setPermission)
                {
                    await
                    RolePermissionMapping2.
                    setPermission(relatedPermission2);
                }
            
                const relatedPermission3 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermissionMapping3 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (RolePermissionMapping3?.setPermission)
                {
                    await
                    RolePermissionMapping3.
                    setPermission(relatedPermission3);
                }
            
                const relatedPermission4 = await Permissions.findOne({
                    offset: Math.floor(Math.random() * (await Permissions.count())),
                });
                const RolePermissionMapping4 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (RolePermissionMapping4?.setPermission)
                {
                    await
                    RolePermissionMapping4.
                    setPermission(relatedPermission4);
                }
            
        }
        
    
        
    
        
            
            async function associateRolePermissionMappingWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermissionMapping0 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RolePermissionMapping0?.setOrganization)
                {
                    await
                    RolePermissionMapping0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermissionMapping1 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RolePermissionMapping1?.setOrganization)
                {
                    await
                    RolePermissionMapping1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermissionMapping2 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RolePermissionMapping2?.setOrganization)
                {
                    await
                    RolePermissionMapping2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermissionMapping3 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (RolePermissionMapping3?.setOrganization)
                {
                    await
                    RolePermissionMapping3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermissionMapping4 = await RolePermissionMappings.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (RolePermissionMapping4?.setOrganization)
                {
                    await
                    RolePermissionMapping4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateVendorWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vendor0 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vendor0?.setCompany)
                {
                    await
                    Vendor0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vendor1 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vendor1?.setCompany)
                {
                    await
                    Vendor1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vendor2 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vendor2?.setCompany)
                {
                    await
                    Vendor2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vendor3 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Vendor3?.setCompany)
                {
                    await
                    Vendor3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vendor4 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Vendor4?.setCompany)
                {
                    await
                    Vendor4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateVendorWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor0 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vendor0?.setOrganization)
                {
                    await
                    Vendor0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor1 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vendor1?.setOrganization)
                {
                    await
                    Vendor1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor2 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vendor2?.setOrganization)
                {
                    await
                    Vendor2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor3 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Vendor3?.setOrganization)
                {
                    await
                    Vendor3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vendor4 = await Vendors.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Vendor4?.setOrganization)
                {
                    await
                    Vendor4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

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

    
    
    
        
            
            async function associateProductCategoryWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ProductCategory0 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProductCategory0?.setCompany)
                {
                    await
                    ProductCategory0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ProductCategory1 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProductCategory1?.setCompany)
                {
                    await
                    ProductCategory1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ProductCategory2 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProductCategory2?.setCompany)
                {
                    await
                    ProductCategory2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ProductCategory3 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ProductCategory3?.setCompany)
                {
                    await
                    ProductCategory3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ProductCategory4 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ProductCategory4?.setCompany)
                {
                    await
                    ProductCategory4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProductCategory3 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ProductCategory3?.setOrganization)
                {
                    await
                    ProductCategory3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProductCategory4 = await ProductCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ProductCategory4?.setOrganization)
                {
                    await
                    ProductCategory4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateProductWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setCompany)
                {
                    await
                    Product0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setCompany)
                {
                    await
                    Product1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setCompany)
                {
                    await
                    Product2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setCompany)
                {
                    await
                    Product3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Product4 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Product4?.setCompany)
                {
                    await
                    Product4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
            
            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);
                }
            
                const relatedCategory3 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setCategory)
                {
                    await
                    Product3.
                    setCategory(relatedCategory3);
                }
            
                const relatedCategory4 = await ProductCategories.findOne({
                    offset: Math.floor(Math.random() * (await ProductCategories.count())),
                });
                const Product4 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Product4?.setCategory)
                {
                    await
                    Product4.
                    setCategory(relatedCategory4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateProductWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product0 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Product0?.setOrganization)
                {
                    await
                    Product0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product1 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Product1?.setOrganization)
                {
                    await
                    Product1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product2 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Product2?.setOrganization)
                {
                    await
                    Product2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product3 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Product3?.setOrganization)
                {
                    await
                    Product3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Product4 = await Products.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Product4?.setOrganization)
                {
                    await
                    Product4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePurchaseRequisitionWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseRequisition0 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisition0?.setCompany)
                {
                    await
                    PurchaseRequisition0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseRequisition1 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisition1?.setCompany)
                {
                    await
                    PurchaseRequisition1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseRequisition2 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisition2?.setCompany)
                {
                    await
                    PurchaseRequisition2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseRequisition3 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisition3?.setCompany)
                {
                    await
                    PurchaseRequisition3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseRequisition4 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisition4?.setCompany)
                {
                    await
                    PurchaseRequisition4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
            
            async function associatePurchaseRequisitionWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseRequisition0 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisition0?.setRequested_by)
                {
                    await
                    PurchaseRequisition0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseRequisition1 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisition1?.setRequested_by)
                {
                    await
                    PurchaseRequisition1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseRequisition2 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisition2?.setRequested_by)
                {
                    await
                    PurchaseRequisition2.
                    setRequested_by(relatedRequested_by2);
                }
            
                const relatedRequested_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseRequisition3 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisition3?.setRequested_by)
                {
                    await
                    PurchaseRequisition3.
                    setRequested_by(relatedRequested_by3);
                }
            
                const relatedRequested_by4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseRequisition4 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisition4?.setRequested_by)
                {
                    await
                    PurchaseRequisition4.
                    setRequested_by(relatedRequested_by4);
                }
            
        }
        
    
        
            
            async function associatePurchaseRequisitionWithDepartment() {
            
                const relatedDepartment0 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const PurchaseRequisition0 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisition0?.setDepartment)
                {
                    await
                    PurchaseRequisition0.
                    setDepartment(relatedDepartment0);
                }
            
                const relatedDepartment1 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const PurchaseRequisition1 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisition1?.setDepartment)
                {
                    await
                    PurchaseRequisition1.
                    setDepartment(relatedDepartment1);
                }
            
                const relatedDepartment2 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const PurchaseRequisition2 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisition2?.setDepartment)
                {
                    await
                    PurchaseRequisition2.
                    setDepartment(relatedDepartment2);
                }
            
                const relatedDepartment3 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const PurchaseRequisition3 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisition3?.setDepartment)
                {
                    await
                    PurchaseRequisition3.
                    setDepartment(relatedDepartment3);
                }
            
                const relatedDepartment4 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const PurchaseRequisition4 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisition4?.setDepartment)
                {
                    await
                    PurchaseRequisition4.
                    setDepartment(relatedDepartment4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePurchaseRequisitionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisition0 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisition0?.setOrganization)
                {
                    await
                    PurchaseRequisition0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisition1 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisition1?.setOrganization)
                {
                    await
                    PurchaseRequisition1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisition2 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisition2?.setOrganization)
                {
                    await
                    PurchaseRequisition2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisition3 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisition3?.setOrganization)
                {
                    await
                    PurchaseRequisition3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisition4 = await PurchaseRequisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisition4?.setOrganization)
                {
                    await
                    PurchaseRequisition4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePurchaseRequisitionLineWithPurchase_requisition() {
            
                const relatedPurchase_requisition0 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseRequisitionLine0 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisitionLine0?.setPurchase_requisition)
                {
                    await
                    PurchaseRequisitionLine0.
                    setPurchase_requisition(relatedPurchase_requisition0);
                }
            
                const relatedPurchase_requisition1 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseRequisitionLine1 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisitionLine1?.setPurchase_requisition)
                {
                    await
                    PurchaseRequisitionLine1.
                    setPurchase_requisition(relatedPurchase_requisition1);
                }
            
                const relatedPurchase_requisition2 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseRequisitionLine2 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisitionLine2?.setPurchase_requisition)
                {
                    await
                    PurchaseRequisitionLine2.
                    setPurchase_requisition(relatedPurchase_requisition2);
                }
            
                const relatedPurchase_requisition3 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseRequisitionLine3 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisitionLine3?.setPurchase_requisition)
                {
                    await
                    PurchaseRequisitionLine3.
                    setPurchase_requisition(relatedPurchase_requisition3);
                }
            
                const relatedPurchase_requisition4 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseRequisitionLine4 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisitionLine4?.setPurchase_requisition)
                {
                    await
                    PurchaseRequisitionLine4.
                    setPurchase_requisition(relatedPurchase_requisition4);
                }
            
        }
        
    
        
            
            async function associatePurchaseRequisitionLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseRequisitionLine0 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisitionLine0?.setProduct)
                {
                    await
                    PurchaseRequisitionLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseRequisitionLine1 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisitionLine1?.setProduct)
                {
                    await
                    PurchaseRequisitionLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseRequisitionLine2 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisitionLine2?.setProduct)
                {
                    await
                    PurchaseRequisitionLine2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseRequisitionLine3 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisitionLine3?.setProduct)
                {
                    await
                    PurchaseRequisitionLine3.
                    setProduct(relatedProduct3);
                }
            
                const relatedProduct4 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseRequisitionLine4 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisitionLine4?.setProduct)
                {
                    await
                    PurchaseRequisitionLine4.
                    setProduct(relatedProduct4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePurchaseRequisitionLineWithWarehouse() {
            
                const relatedWarehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseRequisitionLine0 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisitionLine0?.setWarehouse)
                {
                    await
                    PurchaseRequisitionLine0.
                    setWarehouse(relatedWarehouse0);
                }
            
                const relatedWarehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseRequisitionLine1 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisitionLine1?.setWarehouse)
                {
                    await
                    PurchaseRequisitionLine1.
                    setWarehouse(relatedWarehouse1);
                }
            
                const relatedWarehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseRequisitionLine2 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisitionLine2?.setWarehouse)
                {
                    await
                    PurchaseRequisitionLine2.
                    setWarehouse(relatedWarehouse2);
                }
            
                const relatedWarehouse3 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseRequisitionLine3 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisitionLine3?.setWarehouse)
                {
                    await
                    PurchaseRequisitionLine3.
                    setWarehouse(relatedWarehouse3);
                }
            
                const relatedWarehouse4 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseRequisitionLine4 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisitionLine4?.setWarehouse)
                {
                    await
                    PurchaseRequisitionLine4.
                    setWarehouse(relatedWarehouse4);
                }
            
        }
        
    
        
            
            async function associatePurchaseRequisitionLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisitionLine0 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseRequisitionLine0?.setOrganization)
                {
                    await
                    PurchaseRequisitionLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisitionLine1 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseRequisitionLine1?.setOrganization)
                {
                    await
                    PurchaseRequisitionLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisitionLine2 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseRequisitionLine2?.setOrganization)
                {
                    await
                    PurchaseRequisitionLine2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisitionLine3 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseRequisitionLine3?.setOrganization)
                {
                    await
                    PurchaseRequisitionLine3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseRequisitionLine4 = await PurchaseRequisitionLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseRequisitionLine4?.setOrganization)
                {
                    await
                    PurchaseRequisitionLine4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePurchaseOrderWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setCompany)
                {
                    await
                    PurchaseOrder0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setCompany)
                {
                    await
                    PurchaseOrder1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setCompany)
                {
                    await
                    PurchaseOrder2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseOrder3 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrder3?.setCompany)
                {
                    await
                    PurchaseOrder3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PurchaseOrder4 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrder4?.setCompany)
                {
                    await
                    PurchaseOrder4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
            
            async function associatePurchaseOrderWithVendor() {
            
                const relatedVendor0 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setVendor)
                {
                    await
                    PurchaseOrder0.
                    setVendor(relatedVendor0);
                }
            
                const relatedVendor1 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setVendor)
                {
                    await
                    PurchaseOrder1.
                    setVendor(relatedVendor1);
                }
            
                const relatedVendor2 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setVendor)
                {
                    await
                    PurchaseOrder2.
                    setVendor(relatedVendor2);
                }
            
                const relatedVendor3 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const PurchaseOrder3 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrder3?.setVendor)
                {
                    await
                    PurchaseOrder3.
                    setVendor(relatedVendor3);
                }
            
                const relatedVendor4 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const PurchaseOrder4 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrder4?.setVendor)
                {
                    await
                    PurchaseOrder4.
                    setVendor(relatedVendor4);
                }
            
        }
        
    
        
            
            async function associatePurchaseOrderWithBuyer() {
            
                const relatedBuyer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setBuyer)
                {
                    await
                    PurchaseOrder0.
                    setBuyer(relatedBuyer0);
                }
            
                const relatedBuyer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setBuyer)
                {
                    await
                    PurchaseOrder1.
                    setBuyer(relatedBuyer1);
                }
            
                const relatedBuyer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setBuyer)
                {
                    await
                    PurchaseOrder2.
                    setBuyer(relatedBuyer2);
                }
            
                const relatedBuyer3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder3 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrder3?.setBuyer)
                {
                    await
                    PurchaseOrder3.
                    setBuyer(relatedBuyer3);
                }
            
                const relatedBuyer4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PurchaseOrder4 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrder4?.setBuyer)
                {
                    await
                    PurchaseOrder4.
                    setBuyer(relatedBuyer4);
                }
            
        }
        
    
        
            
            async function associatePurchaseOrderWithSource_requisition() {
            
                const relatedSource_requisition0 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setSource_requisition)
                {
                    await
                    PurchaseOrder0.
                    setSource_requisition(relatedSource_requisition0);
                }
            
                const relatedSource_requisition1 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setSource_requisition)
                {
                    await
                    PurchaseOrder1.
                    setSource_requisition(relatedSource_requisition1);
                }
            
                const relatedSource_requisition2 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setSource_requisition)
                {
                    await
                    PurchaseOrder2.
                    setSource_requisition(relatedSource_requisition2);
                }
            
                const relatedSource_requisition3 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseOrder3 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrder3?.setSource_requisition)
                {
                    await
                    PurchaseOrder3.
                    setSource_requisition(relatedSource_requisition3);
                }
            
                const relatedSource_requisition4 = await PurchaseRequisitions.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseRequisitions.count())),
                });
                const PurchaseOrder4 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrder4?.setSource_requisition)
                {
                    await
                    PurchaseOrder4.
                    setSource_requisition(relatedSource_requisition4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder3 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrder3?.setOrganization)
                {
                    await
                    PurchaseOrder3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder4 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrder4?.setOrganization)
                {
                    await
                    PurchaseOrder4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            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);
                }
            
                const relatedPurchase_order3 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PurchaseOrderLine3 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrderLine3?.setPurchase_order)
                {
                    await
                    PurchaseOrderLine3.
                    setPurchase_order(relatedPurchase_order3);
                }
            
                const relatedPurchase_order4 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PurchaseOrderLine4 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrderLine4?.setPurchase_order)
                {
                    await
                    PurchaseOrderLine4.
                    setPurchase_order(relatedPurchase_order4);
                }
            
        }
        
    
        
            
            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);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseOrderLine3 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrderLine3?.setProduct)
                {
                    await
                    PurchaseOrderLine3.
                    setProduct(relatedProduct3);
                }
            
                const relatedProduct4 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const PurchaseOrderLine4 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrderLine4?.setProduct)
                {
                    await
                    PurchaseOrderLine4.
                    setProduct(relatedProduct4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePurchaseOrderLineWithWarehouse() {
            
                const relatedWarehouse0 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseOrderLine0 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrderLine0?.setWarehouse)
                {
                    await
                    PurchaseOrderLine0.
                    setWarehouse(relatedWarehouse0);
                }
            
                const relatedWarehouse1 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseOrderLine1 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrderLine1?.setWarehouse)
                {
                    await
                    PurchaseOrderLine1.
                    setWarehouse(relatedWarehouse1);
                }
            
                const relatedWarehouse2 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseOrderLine2 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrderLine2?.setWarehouse)
                {
                    await
                    PurchaseOrderLine2.
                    setWarehouse(relatedWarehouse2);
                }
            
                const relatedWarehouse3 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseOrderLine3 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrderLine3?.setWarehouse)
                {
                    await
                    PurchaseOrderLine3.
                    setWarehouse(relatedWarehouse3);
                }
            
                const relatedWarehouse4 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const PurchaseOrderLine4 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrderLine4?.setWarehouse)
                {
                    await
                    PurchaseOrderLine4.
                    setWarehouse(relatedWarehouse4);
                }
            
        }
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrderLine3 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PurchaseOrderLine3?.setOrganization)
                {
                    await
                    PurchaseOrderLine3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrderLine4 = await PurchaseOrderLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PurchaseOrderLine4?.setOrganization)
                {
                    await
                    PurchaseOrderLine4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateGoodsReceiptWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const GoodsReceipt0 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceipt0?.setCompany)
                {
                    await
                    GoodsReceipt0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const GoodsReceipt1 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceipt1?.setCompany)
                {
                    await
                    GoodsReceipt1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const GoodsReceipt2 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceipt2?.setCompany)
                {
                    await
                    GoodsReceipt2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const GoodsReceipt3 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceipt3?.setCompany)
                {
                    await
                    GoodsReceipt3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const GoodsReceipt4 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceipt4?.setCompany)
                {
                    await
                    GoodsReceipt4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
            
            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);
                }
            
                const relatedPurchase_order3 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceipt3 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceipt3?.setPurchase_order)
                {
                    await
                    GoodsReceipt3.
                    setPurchase_order(relatedPurchase_order3);
                }
            
                const relatedPurchase_order4 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceipt4 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceipt4?.setPurchase_order)
                {
                    await
                    GoodsReceipt4.
                    setPurchase_order(relatedPurchase_order4);
                }
            
        }
        
    
        
            
            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);
                }
            
                const relatedReceived_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceipt3 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceipt3?.setReceived_by)
                {
                    await
                    GoodsReceipt3.
                    setReceived_by(relatedReceived_by3);
                }
            
                const relatedReceived_by4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceipt4 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceipt4?.setReceived_by)
                {
                    await
                    GoodsReceipt4.
                    setReceived_by(relatedReceived_by4);
                }
            
        }
        
    
        
            
            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);
                }
            
                const relatedWarehouse3 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const GoodsReceipt3 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceipt3?.setWarehouse)
                {
                    await
                    GoodsReceipt3.
                    setWarehouse(relatedWarehouse3);
                }
            
                const relatedWarehouse4 = await Warehouses.findOne({
                    offset: Math.floor(Math.random() * (await Warehouses.count())),
                });
                const GoodsReceipt4 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceipt4?.setWarehouse)
                {
                    await
                    GoodsReceipt4.
                    setWarehouse(relatedWarehouse4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceipt3 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceipt3?.setOrganization)
                {
                    await
                    GoodsReceipt3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceipt4 = await GoodsReceipts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceipt4?.setOrganization)
                {
                    await
                    GoodsReceipt4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            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);
                }
            
                const relatedGoods_receipt3 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const GoodsReceiptLine3 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceiptLine3?.setGoods_receipt)
                {
                    await
                    GoodsReceiptLine3.
                    setGoods_receipt(relatedGoods_receipt3);
                }
            
                const relatedGoods_receipt4 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const GoodsReceiptLine4 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceiptLine4?.setGoods_receipt)
                {
                    await
                    GoodsReceiptLine4.
                    setGoods_receipt(relatedGoods_receipt4);
                }
            
        }
        
    
        
            
            async function associateGoodsReceiptLineWithPurchase_order_line() {
            
                const relatedPurchase_order_line0 = await PurchaseOrderLines.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrderLines.count())),
                });
                const GoodsReceiptLine0 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptLine0?.setPurchase_order_line)
                {
                    await
                    GoodsReceiptLine0.
                    setPurchase_order_line(relatedPurchase_order_line0);
                }
            
                const relatedPurchase_order_line1 = await PurchaseOrderLines.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrderLines.count())),
                });
                const GoodsReceiptLine1 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptLine1?.setPurchase_order_line)
                {
                    await
                    GoodsReceiptLine1.
                    setPurchase_order_line(relatedPurchase_order_line1);
                }
            
                const relatedPurchase_order_line2 = await PurchaseOrderLines.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrderLines.count())),
                });
                const GoodsReceiptLine2 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptLine2?.setPurchase_order_line)
                {
                    await
                    GoodsReceiptLine2.
                    setPurchase_order_line(relatedPurchase_order_line2);
                }
            
                const relatedPurchase_order_line3 = await PurchaseOrderLines.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrderLines.count())),
                });
                const GoodsReceiptLine3 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceiptLine3?.setPurchase_order_line)
                {
                    await
                    GoodsReceiptLine3.
                    setPurchase_order_line(relatedPurchase_order_line3);
                }
            
                const relatedPurchase_order_line4 = await PurchaseOrderLines.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrderLines.count())),
                });
                const GoodsReceiptLine4 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceiptLine4?.setPurchase_order_line)
                {
                    await
                    GoodsReceiptLine4.
                    setPurchase_order_line(relatedPurchase_order_line4);
                }
            
        }
        
    
        
            
            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);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const GoodsReceiptLine3 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceiptLine3?.setProduct)
                {
                    await
                    GoodsReceiptLine3.
                    setProduct(relatedProduct3);
                }
            
                const relatedProduct4 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const GoodsReceiptLine4 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceiptLine4?.setProduct)
                {
                    await
                    GoodsReceiptLine4.
                    setProduct(relatedProduct4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptLine3 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GoodsReceiptLine3?.setOrganization)
                {
                    await
                    GoodsReceiptLine3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptLine4 = await GoodsReceiptLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (GoodsReceiptLine4?.setOrganization)
                {
                    await
                    GoodsReceiptLine4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateVendorInvoiceWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const VendorInvoice0 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VendorInvoice0?.setCompany)
                {
                    await
                    VendorInvoice0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const VendorInvoice1 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VendorInvoice1?.setCompany)
                {
                    await
                    VendorInvoice1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const VendorInvoice2 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VendorInvoice2?.setCompany)
                {
                    await
                    VendorInvoice2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const VendorInvoice3 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VendorInvoice3?.setCompany)
                {
                    await
                    VendorInvoice3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const VendorInvoice4 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VendorInvoice4?.setCompany)
                {
                    await
                    VendorInvoice4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
            
            async function associateVendorInvoiceWithVendor() {
            
                const relatedVendor0 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const VendorInvoice0 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VendorInvoice0?.setVendor)
                {
                    await
                    VendorInvoice0.
                    setVendor(relatedVendor0);
                }
            
                const relatedVendor1 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const VendorInvoice1 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VendorInvoice1?.setVendor)
                {
                    await
                    VendorInvoice1.
                    setVendor(relatedVendor1);
                }
            
                const relatedVendor2 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const VendorInvoice2 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VendorInvoice2?.setVendor)
                {
                    await
                    VendorInvoice2.
                    setVendor(relatedVendor2);
                }
            
                const relatedVendor3 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const VendorInvoice3 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VendorInvoice3?.setVendor)
                {
                    await
                    VendorInvoice3.
                    setVendor(relatedVendor3);
                }
            
                const relatedVendor4 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const VendorInvoice4 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VendorInvoice4?.setVendor)
                {
                    await
                    VendorInvoice4.
                    setVendor(relatedVendor4);
                }
            
        }
        
    
        
            
            async function associateVendorInvoiceWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const VendorInvoice0 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VendorInvoice0?.setPurchase_order)
                {
                    await
                    VendorInvoice0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const VendorInvoice1 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VendorInvoice1?.setPurchase_order)
                {
                    await
                    VendorInvoice1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const VendorInvoice2 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VendorInvoice2?.setPurchase_order)
                {
                    await
                    VendorInvoice2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
                const relatedPurchase_order3 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const VendorInvoice3 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VendorInvoice3?.setPurchase_order)
                {
                    await
                    VendorInvoice3.
                    setPurchase_order(relatedPurchase_order3);
                }
            
                const relatedPurchase_order4 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const VendorInvoice4 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VendorInvoice4?.setPurchase_order)
                {
                    await
                    VendorInvoice4.
                    setPurchase_order(relatedPurchase_order4);
                }
            
        }
        
    
        
            
            async function associateVendorInvoiceWithGoods_receipt() {
            
                const relatedGoods_receipt0 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const VendorInvoice0 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VendorInvoice0?.setGoods_receipt)
                {
                    await
                    VendorInvoice0.
                    setGoods_receipt(relatedGoods_receipt0);
                }
            
                const relatedGoods_receipt1 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const VendorInvoice1 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VendorInvoice1?.setGoods_receipt)
                {
                    await
                    VendorInvoice1.
                    setGoods_receipt(relatedGoods_receipt1);
                }
            
                const relatedGoods_receipt2 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const VendorInvoice2 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VendorInvoice2?.setGoods_receipt)
                {
                    await
                    VendorInvoice2.
                    setGoods_receipt(relatedGoods_receipt2);
                }
            
                const relatedGoods_receipt3 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const VendorInvoice3 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VendorInvoice3?.setGoods_receipt)
                {
                    await
                    VendorInvoice3.
                    setGoods_receipt(relatedGoods_receipt3);
                }
            
                const relatedGoods_receipt4 = await GoodsReceipts.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceipts.count())),
                });
                const VendorInvoice4 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VendorInvoice4?.setGoods_receipt)
                {
                    await
                    VendorInvoice4.
                    setGoods_receipt(relatedGoods_receipt4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateVendorInvoiceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VendorInvoice0 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VendorInvoice0?.setOrganization)
                {
                    await
                    VendorInvoice0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VendorInvoice1 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VendorInvoice1?.setOrganization)
                {
                    await
                    VendorInvoice1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VendorInvoice2 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VendorInvoice2?.setOrganization)
                {
                    await
                    VendorInvoice2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VendorInvoice3 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VendorInvoice3?.setOrganization)
                {
                    await
                    VendorInvoice3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VendorInvoice4 = await VendorInvoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VendorInvoice4?.setOrganization)
                {
                    await
                    VendorInvoice4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateInvoiceLineWithVendor_invoice() {
            
                const relatedVendor_invoice0 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const InvoiceLine0 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InvoiceLine0?.setVendor_invoice)
                {
                    await
                    InvoiceLine0.
                    setVendor_invoice(relatedVendor_invoice0);
                }
            
                const relatedVendor_invoice1 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const InvoiceLine1 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InvoiceLine1?.setVendor_invoice)
                {
                    await
                    InvoiceLine1.
                    setVendor_invoice(relatedVendor_invoice1);
                }
            
                const relatedVendor_invoice2 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const InvoiceLine2 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InvoiceLine2?.setVendor_invoice)
                {
                    await
                    InvoiceLine2.
                    setVendor_invoice(relatedVendor_invoice2);
                }
            
                const relatedVendor_invoice3 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const InvoiceLine3 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InvoiceLine3?.setVendor_invoice)
                {
                    await
                    InvoiceLine3.
                    setVendor_invoice(relatedVendor_invoice3);
                }
            
                const relatedVendor_invoice4 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const InvoiceLine4 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (InvoiceLine4?.setVendor_invoice)
                {
                    await
                    InvoiceLine4.
                    setVendor_invoice(relatedVendor_invoice4);
                }
            
        }
        
    
        
            
            async function associateInvoiceLineWithProduct() {
            
                const relatedProduct0 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine0 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InvoiceLine0?.setProduct)
                {
                    await
                    InvoiceLine0.
                    setProduct(relatedProduct0);
                }
            
                const relatedProduct1 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine1 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InvoiceLine1?.setProduct)
                {
                    await
                    InvoiceLine1.
                    setProduct(relatedProduct1);
                }
            
                const relatedProduct2 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine2 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InvoiceLine2?.setProduct)
                {
                    await
                    InvoiceLine2.
                    setProduct(relatedProduct2);
                }
            
                const relatedProduct3 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine3 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InvoiceLine3?.setProduct)
                {
                    await
                    InvoiceLine3.
                    setProduct(relatedProduct3);
                }
            
                const relatedProduct4 = await Products.findOne({
                    offset: Math.floor(Math.random() * (await Products.count())),
                });
                const InvoiceLine4 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (InvoiceLine4?.setProduct)
                {
                    await
                    InvoiceLine4.
                    setProduct(relatedProduct4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateInvoiceLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine0 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InvoiceLine0?.setOrganization)
                {
                    await
                    InvoiceLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine1 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InvoiceLine1?.setOrganization)
                {
                    await
                    InvoiceLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine2 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InvoiceLine2?.setOrganization)
                {
                    await
                    InvoiceLine2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine3 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (InvoiceLine3?.setOrganization)
                {
                    await
                    InvoiceLine3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InvoiceLine4 = await InvoiceLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (InvoiceLine4?.setOrganization)
                {
                    await
                    InvoiceLine4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePaymentWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setCompany)
                {
                    await
                    Payment0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setCompany)
                {
                    await
                    Payment1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setCompany)
                {
                    await
                    Payment2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setCompany)
                {
                    await
                    Payment3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Payment4 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Payment4?.setCompany)
                {
                    await
                    Payment4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
            
            async function associatePaymentWithVendor() {
            
                const relatedVendor0 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setVendor)
                {
                    await
                    Payment0.
                    setVendor(relatedVendor0);
                }
            
                const relatedVendor1 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setVendor)
                {
                    await
                    Payment1.
                    setVendor(relatedVendor1);
                }
            
                const relatedVendor2 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setVendor)
                {
                    await
                    Payment2.
                    setVendor(relatedVendor2);
                }
            
                const relatedVendor3 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setVendor)
                {
                    await
                    Payment3.
                    setVendor(relatedVendor3);
                }
            
                const relatedVendor4 = await Vendors.findOne({
                    offset: Math.floor(Math.random() * (await Vendors.count())),
                });
                const Payment4 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Payment4?.setVendor)
                {
                    await
                    Payment4.
                    setVendor(relatedVendor4);
                }
            
        }
        
    
        
            
            async function associatePaymentWithVendor_invoice() {
            
                const relatedVendor_invoice0 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setVendor_invoice)
                {
                    await
                    Payment0.
                    setVendor_invoice(relatedVendor_invoice0);
                }
            
                const relatedVendor_invoice1 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setVendor_invoice)
                {
                    await
                    Payment1.
                    setVendor_invoice(relatedVendor_invoice1);
                }
            
                const relatedVendor_invoice2 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setVendor_invoice)
                {
                    await
                    Payment2.
                    setVendor_invoice(relatedVendor_invoice2);
                }
            
                const relatedVendor_invoice3 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setVendor_invoice)
                {
                    await
                    Payment3.
                    setVendor_invoice(relatedVendor_invoice3);
                }
            
                const relatedVendor_invoice4 = await VendorInvoices.findOne({
                    offset: Math.floor(Math.random() * (await VendorInvoices.count())),
                });
                const Payment4 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Payment4?.setVendor_invoice)
                {
                    await
                    Payment4.
                    setVendor_invoice(relatedVendor_invoice4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePaymentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setOrganization)
                {
                    await
                    Payment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setOrganization)
                {
                    await
                    Payment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setOrganization)
                {
                    await
                    Payment2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setOrganization)
                {
                    await
                    Payment3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment4 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Payment4?.setOrganization)
                {
                    await
                    Payment4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDepartmentWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department0 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Department0?.setCompany)
                {
                    await
                    Department0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department1 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Department1?.setCompany)
                {
                    await
                    Department1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department2 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Department2?.setCompany)
                {
                    await
                    Department2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department3 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Department3?.setCompany)
                {
                    await
                    Department3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Department4 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Department4?.setCompany)
                {
                    await
                    Department4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateDepartmentWithManager() {
            
                const relatedManager0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Department0 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Department0?.setManager)
                {
                    await
                    Department0.
                    setManager(relatedManager0);
                }
            
                const relatedManager1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Department1 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Department1?.setManager)
                {
                    await
                    Department1.
                    setManager(relatedManager1);
                }
            
                const relatedManager2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Department2 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Department2?.setManager)
                {
                    await
                    Department2.
                    setManager(relatedManager2);
                }
            
                const relatedManager3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Department3 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Department3?.setManager)
                {
                    await
                    Department3.
                    setManager(relatedManager3);
                }
            
                const relatedManager4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Department4 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Department4?.setManager)
                {
                    await
                    Department4.
                    setManager(relatedManager4);
                }
            
        }
        
    
        
    
        
            
            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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department3 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Department3?.setOrganization)
                {
                    await
                    Department3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Department4 = await Departments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Department4?.setOrganization)
                {
                    await
                    Department4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDocumentTypeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentType0 = await DocumentTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DocumentType0?.setOrganization)
                {
                    await
                    DocumentType0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentType1 = await DocumentTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DocumentType1?.setOrganization)
                {
                    await
                    DocumentType1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentType2 = await DocumentTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DocumentType2?.setOrganization)
                {
                    await
                    DocumentType2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentType3 = await DocumentTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DocumentType3?.setOrganization)
                {
                    await
                    DocumentType3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentType4 = await DocumentTypes.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (DocumentType4?.setOrganization)
                {
                    await
                    DocumentType4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDocumentWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setCompany)
                {
                    await
                    Document0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setCompany)
                {
                    await
                    Document1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setCompany)
                {
                    await
                    Document2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setCompany)
                {
                    await
                    Document3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Document4 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Document4?.setCompany)
                {
                    await
                    Document4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
            
            async function associateDocumentWithDocument_type() {
            
                const relatedDocument_type0 = await DocumentTypes.findOne({
                    offset: Math.floor(Math.random() * (await DocumentTypes.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setDocument_type)
                {
                    await
                    Document0.
                    setDocument_type(relatedDocument_type0);
                }
            
                const relatedDocument_type1 = await DocumentTypes.findOne({
                    offset: Math.floor(Math.random() * (await DocumentTypes.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setDocument_type)
                {
                    await
                    Document1.
                    setDocument_type(relatedDocument_type1);
                }
            
                const relatedDocument_type2 = await DocumentTypes.findOne({
                    offset: Math.floor(Math.random() * (await DocumentTypes.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setDocument_type)
                {
                    await
                    Document2.
                    setDocument_type(relatedDocument_type2);
                }
            
                const relatedDocument_type3 = await DocumentTypes.findOne({
                    offset: Math.floor(Math.random() * (await DocumentTypes.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setDocument_type)
                {
                    await
                    Document3.
                    setDocument_type(relatedDocument_type3);
                }
            
                const relatedDocument_type4 = await DocumentTypes.findOne({
                    offset: Math.floor(Math.random() * (await DocumentTypes.count())),
                });
                const Document4 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Document4?.setDocument_type)
                {
                    await
                    Document4.
                    setDocument_type(relatedDocument_type4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDocumentWithOwner() {
            
                const relatedOwner0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setOwner)
                {
                    await
                    Document0.
                    setOwner(relatedOwner0);
                }
            
                const relatedOwner1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setOwner)
                {
                    await
                    Document1.
                    setOwner(relatedOwner1);
                }
            
                const relatedOwner2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setOwner)
                {
                    await
                    Document2.
                    setOwner(relatedOwner2);
                }
            
                const relatedOwner3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setOwner)
                {
                    await
                    Document3.
                    setOwner(relatedOwner3);
                }
            
                const relatedOwner4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Document4 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Document4?.setOwner)
                {
                    await
                    Document4.
                    setOwner(relatedOwner4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDocumentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document0 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Document0?.setOrganization)
                {
                    await
                    Document0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document1 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Document1?.setOrganization)
                {
                    await
                    Document1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document2 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Document2?.setOrganization)
                {
                    await
                    Document2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document3 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Document3?.setOrganization)
                {
                    await
                    Document3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Document4 = await Documents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Document4?.setOrganization)
                {
                    await
                    Document4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDocumentLinkWithDocument() {
            
                const relatedDocument0 = await Documents.findOne({
                    offset: Math.floor(Math.random() * (await Documents.count())),
                });
                const DocumentLink0 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DocumentLink0?.setDocument)
                {
                    await
                    DocumentLink0.
                    setDocument(relatedDocument0);
                }
            
                const relatedDocument1 = await Documents.findOne({
                    offset: Math.floor(Math.random() * (await Documents.count())),
                });
                const DocumentLink1 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DocumentLink1?.setDocument)
                {
                    await
                    DocumentLink1.
                    setDocument(relatedDocument1);
                }
            
                const relatedDocument2 = await Documents.findOne({
                    offset: Math.floor(Math.random() * (await Documents.count())),
                });
                const DocumentLink2 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DocumentLink2?.setDocument)
                {
                    await
                    DocumentLink2.
                    setDocument(relatedDocument2);
                }
            
                const relatedDocument3 = await Documents.findOne({
                    offset: Math.floor(Math.random() * (await Documents.count())),
                });
                const DocumentLink3 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DocumentLink3?.setDocument)
                {
                    await
                    DocumentLink3.
                    setDocument(relatedDocument3);
                }
            
                const relatedDocument4 = await Documents.findOne({
                    offset: Math.floor(Math.random() * (await Documents.count())),
                });
                const DocumentLink4 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (DocumentLink4?.setDocument)
                {
                    await
                    DocumentLink4.
                    setDocument(relatedDocument4);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateDocumentLinkWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentLink0 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DocumentLink0?.setOrganization)
                {
                    await
                    DocumentLink0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentLink1 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DocumentLink1?.setOrganization)
                {
                    await
                    DocumentLink1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentLink2 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DocumentLink2?.setOrganization)
                {
                    await
                    DocumentLink2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentLink3 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (DocumentLink3?.setOrganization)
                {
                    await
                    DocumentLink3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DocumentLink4 = await DocumentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (DocumentLink4?.setOrganization)
                {
                    await
                    DocumentLink4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateApprovalWorkflowWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApprovalWorkflow0 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApprovalWorkflow0?.setCompany)
                {
                    await
                    ApprovalWorkflow0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApprovalWorkflow1 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApprovalWorkflow1?.setCompany)
                {
                    await
                    ApprovalWorkflow1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApprovalWorkflow2 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApprovalWorkflow2?.setCompany)
                {
                    await
                    ApprovalWorkflow2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApprovalWorkflow3 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ApprovalWorkflow3?.setCompany)
                {
                    await
                    ApprovalWorkflow3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const ApprovalWorkflow4 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ApprovalWorkflow4?.setCompany)
                {
                    await
                    ApprovalWorkflow4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateApprovalWorkflowWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalWorkflow0 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApprovalWorkflow0?.setOrganization)
                {
                    await
                    ApprovalWorkflow0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalWorkflow1 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApprovalWorkflow1?.setOrganization)
                {
                    await
                    ApprovalWorkflow1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalWorkflow2 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApprovalWorkflow2?.setOrganization)
                {
                    await
                    ApprovalWorkflow2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalWorkflow3 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ApprovalWorkflow3?.setOrganization)
                {
                    await
                    ApprovalWorkflow3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalWorkflow4 = await ApprovalWorkflows.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ApprovalWorkflow4?.setOrganization)
                {
                    await
                    ApprovalWorkflow4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateApprovalStepWithApproval_workflow() {
            
                const relatedApproval_workflow0 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const ApprovalStep0 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApprovalStep0?.setApproval_workflow)
                {
                    await
                    ApprovalStep0.
                    setApproval_workflow(relatedApproval_workflow0);
                }
            
                const relatedApproval_workflow1 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const ApprovalStep1 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApprovalStep1?.setApproval_workflow)
                {
                    await
                    ApprovalStep1.
                    setApproval_workflow(relatedApproval_workflow1);
                }
            
                const relatedApproval_workflow2 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const ApprovalStep2 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApprovalStep2?.setApproval_workflow)
                {
                    await
                    ApprovalStep2.
                    setApproval_workflow(relatedApproval_workflow2);
                }
            
                const relatedApproval_workflow3 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const ApprovalStep3 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ApprovalStep3?.setApproval_workflow)
                {
                    await
                    ApprovalStep3.
                    setApproval_workflow(relatedApproval_workflow3);
                }
            
                const relatedApproval_workflow4 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const ApprovalStep4 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ApprovalStep4?.setApproval_workflow)
                {
                    await
                    ApprovalStep4.
                    setApproval_workflow(relatedApproval_workflow4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateApprovalStepWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalStep0 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApprovalStep0?.setOrganization)
                {
                    await
                    ApprovalStep0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalStep1 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApprovalStep1?.setOrganization)
                {
                    await
                    ApprovalStep1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalStep2 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApprovalStep2?.setOrganization)
                {
                    await
                    ApprovalStep2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalStep3 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ApprovalStep3?.setOrganization)
                {
                    await
                    ApprovalStep3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ApprovalStep4 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ApprovalStep4?.setOrganization)
                {
                    await
                    ApprovalStep4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateApprovalWithApproval_workflow() {
            
                const relatedApproval_workflow0 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const Approval0 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Approval0?.setApproval_workflow)
                {
                    await
                    Approval0.
                    setApproval_workflow(relatedApproval_workflow0);
                }
            
                const relatedApproval_workflow1 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const Approval1 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Approval1?.setApproval_workflow)
                {
                    await
                    Approval1.
                    setApproval_workflow(relatedApproval_workflow1);
                }
            
                const relatedApproval_workflow2 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const Approval2 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Approval2?.setApproval_workflow)
                {
                    await
                    Approval2.
                    setApproval_workflow(relatedApproval_workflow2);
                }
            
                const relatedApproval_workflow3 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const Approval3 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Approval3?.setApproval_workflow)
                {
                    await
                    Approval3.
                    setApproval_workflow(relatedApproval_workflow3);
                }
            
                const relatedApproval_workflow4 = await ApprovalWorkflows.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalWorkflows.count())),
                });
                const Approval4 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Approval4?.setApproval_workflow)
                {
                    await
                    Approval4.
                    setApproval_workflow(relatedApproval_workflow4);
                }
            
        }
        
    
        
            
            async function associateApprovalWithApproval_step() {
            
                const relatedApproval_step0 = await ApprovalSteps.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalSteps.count())),
                });
                const Approval0 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Approval0?.setApproval_step)
                {
                    await
                    Approval0.
                    setApproval_step(relatedApproval_step0);
                }
            
                const relatedApproval_step1 = await ApprovalSteps.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalSteps.count())),
                });
                const Approval1 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Approval1?.setApproval_step)
                {
                    await
                    Approval1.
                    setApproval_step(relatedApproval_step1);
                }
            
                const relatedApproval_step2 = await ApprovalSteps.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalSteps.count())),
                });
                const Approval2 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Approval2?.setApproval_step)
                {
                    await
                    Approval2.
                    setApproval_step(relatedApproval_step2);
                }
            
                const relatedApproval_step3 = await ApprovalSteps.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalSteps.count())),
                });
                const Approval3 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Approval3?.setApproval_step)
                {
                    await
                    Approval3.
                    setApproval_step(relatedApproval_step3);
                }
            
                const relatedApproval_step4 = await ApprovalSteps.findOne({
                    offset: Math.floor(Math.random() * (await ApprovalSteps.count())),
                });
                const Approval4 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Approval4?.setApproval_step)
                {
                    await
                    Approval4.
                    setApproval_step(relatedApproval_step4);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateApprovalWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval0 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Approval0?.setRequested_by)
                {
                    await
                    Approval0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval1 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Approval1?.setRequested_by)
                {
                    await
                    Approval1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval2 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Approval2?.setRequested_by)
                {
                    await
                    Approval2.
                    setRequested_by(relatedRequested_by2);
                }
            
                const relatedRequested_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval3 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Approval3?.setRequested_by)
                {
                    await
                    Approval3.
                    setRequested_by(relatedRequested_by3);
                }
            
                const relatedRequested_by4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval4 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Approval4?.setRequested_by)
                {
                    await
                    Approval4.
                    setRequested_by(relatedRequested_by4);
                }
            
        }
        
    
        
            
            async function associateApprovalWithAssigned_to() {
            
                const relatedAssigned_to0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval0 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Approval0?.setAssigned_to)
                {
                    await
                    Approval0.
                    setAssigned_to(relatedAssigned_to0);
                }
            
                const relatedAssigned_to1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval1 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Approval1?.setAssigned_to)
                {
                    await
                    Approval1.
                    setAssigned_to(relatedAssigned_to1);
                }
            
                const relatedAssigned_to2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval2 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Approval2?.setAssigned_to)
                {
                    await
                    Approval2.
                    setAssigned_to(relatedAssigned_to2);
                }
            
                const relatedAssigned_to3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval3 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Approval3?.setAssigned_to)
                {
                    await
                    Approval3.
                    setAssigned_to(relatedAssigned_to3);
                }
            
                const relatedAssigned_to4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Approval4 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Approval4?.setAssigned_to)
                {
                    await
                    Approval4.
                    setAssigned_to(relatedAssigned_to4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateApprovalWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Approval0 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Approval0?.setOrganization)
                {
                    await
                    Approval0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Approval1 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Approval1?.setOrganization)
                {
                    await
                    Approval1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Approval2 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Approval2?.setOrganization)
                {
                    await
                    Approval2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Approval3 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Approval3?.setOrganization)
                {
                    await
                    Approval3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Approval4 = await Approvals.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Approval4?.setOrganization)
                {
                    await
                    Approval4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateActivityLogWithActor() {
            
                const relatedActor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ActivityLog0 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ActivityLog0?.setActor)
                {
                    await
                    ActivityLog0.
                    setActor(relatedActor0);
                }
            
                const relatedActor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ActivityLog1 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ActivityLog1?.setActor)
                {
                    await
                    ActivityLog1.
                    setActor(relatedActor1);
                }
            
                const relatedActor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ActivityLog2 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ActivityLog2?.setActor)
                {
                    await
                    ActivityLog2.
                    setActor(relatedActor2);
                }
            
                const relatedActor3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ActivityLog3 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ActivityLog3?.setActor)
                {
                    await
                    ActivityLog3.
                    setActor(relatedActor3);
                }
            
                const relatedActor4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ActivityLog4 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ActivityLog4?.setActor)
                {
                    await
                    ActivityLog4.
                    setActor(relatedActor4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateActivityLogWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ActivityLog0 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ActivityLog0?.setOrganization)
                {
                    await
                    ActivityLog0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ActivityLog1 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ActivityLog1?.setOrganization)
                {
                    await
                    ActivityLog1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ActivityLog2 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ActivityLog2?.setOrganization)
                {
                    await
                    ActivityLog2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ActivityLog3 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ActivityLog3?.setOrganization)
                {
                    await
                    ActivityLog3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ActivityLog4 = await ActivityLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ActivityLog4?.setOrganization)
                {
                    await
                    ActivityLog4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateUiAnnouncementWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UiAnnouncement0 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UiAnnouncement0?.setCompany)
                {
                    await
                    UiAnnouncement0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UiAnnouncement1 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UiAnnouncement1?.setCompany)
                {
                    await
                    UiAnnouncement1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UiAnnouncement2 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UiAnnouncement2?.setCompany)
                {
                    await
                    UiAnnouncement2.
                    setCompany(relatedCompany2);
                }
            
                const relatedCompany3 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UiAnnouncement3 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (UiAnnouncement3?.setCompany)
                {
                    await
                    UiAnnouncement3.
                    setCompany(relatedCompany3);
                }
            
                const relatedCompany4 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const UiAnnouncement4 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (UiAnnouncement4?.setCompany)
                {
                    await
                    UiAnnouncement4.
                    setCompany(relatedCompany4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateUiAnnouncementWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UiAnnouncement0 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UiAnnouncement0?.setOrganization)
                {
                    await
                    UiAnnouncement0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UiAnnouncement1 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UiAnnouncement1?.setOrganization)
                {
                    await
                    UiAnnouncement1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UiAnnouncement2 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UiAnnouncement2?.setOrganization)
                {
                    await
                    UiAnnouncement2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UiAnnouncement3 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (UiAnnouncement3?.setOrganization)
                {
                    await
                    UiAnnouncement3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UiAnnouncement4 = await UiAnnouncements.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (UiAnnouncement4?.setOrganization)
                {
                    await
                    UiAnnouncement4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Companies.bulkCreate(CompaniesData);
                
            
            
                
                await UserRoleAssignments.bulkCreate(UserRoleAssignmentsData);
                
            
            
                
                await RolePermissionMappings.bulkCreate(RolePermissionMappingsData);
                
            
            
                
                await Vendors.bulkCreate(VendorsData);
                
            
            
                
                await Warehouses.bulkCreate(WarehousesData);
                
            
            
                
                await ProductCategories.bulkCreate(ProductCategoriesData);
                
            
            
                
                await Products.bulkCreate(ProductsData);
                
            
            
                
                await PurchaseRequisitions.bulkCreate(PurchaseRequisitionsData);
                
            
            
                
                await PurchaseRequisitionLines.bulkCreate(PurchaseRequisitionLinesData);
                
            
            
                
                await PurchaseOrders.bulkCreate(PurchaseOrdersData);
                
            
            
                
                await PurchaseOrderLines.bulkCreate(PurchaseOrderLinesData);
                
            
            
                
                await GoodsReceipts.bulkCreate(GoodsReceiptsData);
                
            
            
                
                await GoodsReceiptLines.bulkCreate(GoodsReceiptLinesData);
                
            
            
                
                await VendorInvoices.bulkCreate(VendorInvoicesData);
                
            
            
                
                await InvoiceLines.bulkCreate(InvoiceLinesData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await Departments.bulkCreate(DepartmentsData);
                
            
            
                
                await DocumentTypes.bulkCreate(DocumentTypesData);
                
            
            
                
                await Documents.bulkCreate(DocumentsData);
                
            
            
                
                await DocumentLinks.bulkCreate(DocumentLinksData);
                
            
            
                
                await ApprovalWorkflows.bulkCreate(ApprovalWorkflowsData);
                
            
            
                
                await ApprovalSteps.bulkCreate(ApprovalStepsData);
                
            
            
                
                await Approvals.bulkCreate(ApprovalsData);
                
            
            
                
                await ActivityLogs.bulkCreate(ActivityLogsData);
                
            
            
                
                await UiAnnouncements.bulkCreate(UiAnnouncementsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCompanyWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateUserRoleAssignmentWithUser(),
                    
                
                    
                
                    
                        
                        await associateUserRoleAssignmentWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateUserRoleAssignmentWithOrganization(),
                    
                
            
                
                
                    
                
                    
                        
                        await associateRolePermissionMappingWithPermission(),
                    
                
                    
                
                    
                        
                        await associateRolePermissionMappingWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateVendorWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateVendorWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWarehousWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWarehousWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateProductCategoryWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProductCategoryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateProductWithCompany(),
                    
                
                    
                        
                        await associateProductWithCategory(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProductWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePurchaseRequisitionWithCompany(),
                    
                
                    
                
                    
                        
                        await associatePurchaseRequisitionWithRequested_by(),
                    
                
                    
                        
                        await associatePurchaseRequisitionWithDepartment(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseRequisitionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePurchaseRequisitionLineWithPurchase_requisition(),
                    
                
                    
                        
                        await associatePurchaseRequisitionLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseRequisitionLineWithWarehouse(),
                    
                
                    
                        
                        await associatePurchaseRequisitionLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePurchaseOrderWithCompany(),
                    
                
                    
                
                    
                        
                        await associatePurchaseOrderWithVendor(),
                    
                
                    
                        
                        await associatePurchaseOrderWithBuyer(),
                    
                
                    
                        
                        await associatePurchaseOrderWithSource_requisition(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseOrderWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePurchaseOrderLineWithPurchase_order(),
                    
                
                    
                        
                        await associatePurchaseOrderLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseOrderLineWithWarehouse(),
                    
                
                    
                        
                        await associatePurchaseOrderLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateGoodsReceiptWithCompany(),
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptWithPurchase_order(),
                    
                
                    
                        
                        await associateGoodsReceiptWithReceived_by(),
                    
                
                    
                        
                        await associateGoodsReceiptWithWarehouse(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateGoodsReceiptLineWithGoods_receipt(),
                    
                
                    
                        
                        await associateGoodsReceiptLineWithPurchase_order_line(),
                    
                
                    
                        
                        await associateGoodsReceiptLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateVendorInvoiceWithCompany(),
                    
                
                    
                
                    
                        
                        await associateVendorInvoiceWithVendor(),
                    
                
                    
                        
                        await associateVendorInvoiceWithPurchase_order(),
                    
                
                    
                        
                        await associateVendorInvoiceWithGoods_receipt(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateVendorInvoiceWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateInvoiceLineWithVendor_invoice(),
                    
                
                    
                        
                        await associateInvoiceLineWithProduct(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInvoiceLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePaymentWithCompany(),
                    
                
                    
                
                    
                        
                        await associatePaymentWithVendor(),
                    
                
                    
                        
                        await associatePaymentWithVendor_invoice(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePaymentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDepartmentWithCompany(),
                    
                
                    
                
                    
                
                    
                        
                        await associateDepartmentWithManager(),
                    
                
                    
                
                    
                        
                        await associateDepartmentWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDocumentTypeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDocumentWithCompany(),
                    
                
                    
                        
                        await associateDocumentWithDocument_type(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDocumentWithOwner(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDocumentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDocumentLinkWithDocument(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDocumentLinkWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateApprovalWorkflowWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateApprovalWorkflowWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateApprovalStepWithApproval_workflow(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateApprovalStepWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateApprovalWithApproval_workflow(),
                    
                
                    
                        
                        await associateApprovalWithApproval_step(),
                    
                
                    
                
                    
                
                    
                        
                        await associateApprovalWithRequested_by(),
                    
                
                    
                        
                        await associateApprovalWithAssigned_to(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateApprovalWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateActivityLogWithActor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateActivityLogWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateUiAnnouncementWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateUiAnnouncementWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('companies', null, {});
            
            
            await queryInterface.bulkDelete('user_role_assignments', null, {});
            
            
            await queryInterface.bulkDelete('role_permission_mappings', null, {});
            
            
            await queryInterface.bulkDelete('vendors', null, {});
            
            
            await queryInterface.bulkDelete('warehouses', null, {});
            
            
            await queryInterface.bulkDelete('product_categories', null, {});
            
            
            await queryInterface.bulkDelete('products', null, {});
            
            
            await queryInterface.bulkDelete('purchase_requisitions', null, {});
            
            
            await queryInterface.bulkDelete('purchase_requisition_lines', 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('vendor_invoices', null, {});
            
            
            await queryInterface.bulkDelete('invoice_lines', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('departments', null, {});
            
            
            await queryInterface.bulkDelete('document_types', null, {});
            
            
            await queryInterface.bulkDelete('documents', null, {});
            
            
            await queryInterface.bulkDelete('document_links', null, {});
            
            
            await queryInterface.bulkDelete('approval_workflows', null, {});
            
            
            await queryInterface.bulkDelete('approval_steps', null, {});
            
            
            await queryInterface.bulkDelete('approvals', null, {});
            
            
            await queryInterface.bulkDelete('activity_logs', null, {});
            
            
            await queryInterface.bulkDelete('ui_announcements', null, {});
            
        
    },
};