





















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






const Organizations = db.organizations;

const Tenants = db.tenants;

const Departments = db.departments;

const Projects = db.projects;

const BudgetLines = db.budget_lines;

const WorkflowRules = db.workflow_rules;

const CurrencyRates = db.currency_rates;

const Requisitions = db.requisitions;

const ApprovalSteps = db.approval_steps;

const ProcurementCases = db.procurement_cases;

const Suppliers = db.suppliers;

const SupplierCategories = db.supplier_categories;

const SupplierDiligenceChecks = db.supplier_diligence_checks;

const TenderEvents = db.tender_events;

const SupplierOffers = db.supplier_offers;

const BidCriteria = db.bid_criteria;

const OfferScores = db.offer_scores;

const Awards = db.awards;

const PurchaseOrders = db.purchase_orders;

const PoLines = db.po_lines;

const GoodsReceiptNotes = db.goods_receipt_notes;

const GrnLines = db.grn_lines;

const ServiceAcceptanceNotes = db.service_acceptance_notes;

const DiscrepancyCases = db.discrepancy_cases;

const ArchiveItems = db.archive_items;

const AccessLogs = db.access_logs;

const Notifications = db.notifications;

const AuditEvents = db.audit_events;

const ExportJobs = db.export_jobs;

const Sessions = db.sessions;







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



const TenantsData = [
    
    {
    
        
        
            
                "name": "WWF-DRC",
            
        
    
        
        
            
                "subdomain": "wwfdrc",
            
        
    
        
        
            
                "status": "suspended",
            
        
    
        
        
            
                "tagline": "De la requisition a la reception. Trace, valide, archive.",
            
        
    
        
        
            
                "primary_color": "#1F4E79",
            
        
    
        
        
            
                "secondary_color": "#388E3C",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "default_language": "fr",
            
        
    
        
        
            
                "primary_currency": "CDF",
            
        
    
        
        
            
                "secondary_currency": "USD",
            
        
    
        
        
            
                "sso_enabled": true,
            
        
    
        
        
            
                "suspended_on": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "data_retention_policy": "7 years logs retention",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "UNDP-DRC",
            
        
    
        
        
            
                "subdomain": "undpdrc",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "tagline": "Procurements tracked end to end.",
            
        
    
        
        
            
                "primary_color": "#0B4F9E",
            
        
    
        
        
            
                "secondary_color": "#00AEEF",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "default_language": "en",
            
        
    
        
        
            
                "primary_currency": "CDF",
            
        
    
        
        
            
                "secondary_currency": "GBP",
            
        
    
        
        
            
                "sso_enabled": true,
            
        
    
        
        
            
                "suspended_on": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "data_retention_policy": "7 years logs retention",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "WWF-Kenya",
            
        
    
        
        
            
                "subdomain": "wwfke",
            
        
    
        
        
            
                "status": "suspended",
            
        
    
        
        
            
                "tagline": "From request to receipt, audited.",
            
        
    
        
        
            
                "primary_color": "#1F4E79",
            
        
    
        
        
            
                "secondary_color": "#388E3C",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "default_language": "en",
            
        
    
        
        
            
                "primary_currency": "USD",
            
        
    
        
        
            
                "secondary_currency": "USD",
            
        
    
        
        
            
                "sso_enabled": true,
            
        
    
        
        
            
                "suspended_on": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "data_retention_policy": "7 years logs retention",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DepartmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "IT",
            
        
    
        
        
            
                "name": "Informatique",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "FIN",
            
        
    
        
        
            
                "name": "Finance",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "OPS",
            
        
    
        
        
            
                "name": "Operations",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ProjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "IT-PRO-01",
            
        
    
        
        
            
                "name": "Modernisation SI",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "FIN-PRO-01",
            
        
    
        
        
            
                "name": "Renforcement controle interne",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "OPS-PRO-01",
            
        
    
        
        
            
                "name": "Logistique terrain Kivu",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BudgetLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "ITM-2605",
            
        
    
        
        
            
                "name": "Materiel informatique",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "LOG-1102",
            
        
    
        
        
            
                "name": "Transport et logistique",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "SRV-2201",
            
        
    
        
        
            
                "name": "Prestations de services",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WorkflowRulesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "l1_threshold_usd": 5000,
            
        
    
        
        
            
                "l2_threshold_usd": 25000,
            
        
    
        
        
            
                "l3_threshold_usd": 100000,
            
        
    
        
        
            
                "l4_threshold_usd": 100000.01,
            
        
    
        
        
            
                "sla_approval_hours": 48,
            
        
    
        
        
            
                "sla_procurement_hours": 120,
            
        
    
        
        
            
                "sla_reception_hours": 168,
            
        
    
        
        
            
                "rate_limit_profile": "standard",
            
        
    
        
        
            
                "require_reject_reason": true,
            
        
    
        
        
            
                "require_return_comment": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "l1_threshold_usd": 3000,
            
        
    
        
        
            
                "l2_threshold_usd": 20000,
            
        
    
        
        
            
                "l3_threshold_usd": 80000,
            
        
    
        
        
            
                "l4_threshold_usd": 80000.01,
            
        
    
        
        
            
                "sla_approval_hours": 72,
            
        
    
        
        
            
                "sla_procurement_hours": 144,
            
        
    
        
        
            
                "sla_reception_hours": 192,
            
        
    
        
        
            
                "rate_limit_profile": "strict",
            
        
    
        
        
            
                "require_reject_reason": true,
            
        
    
        
        
            
                "require_return_comment": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "l1_threshold_usd": 7000,
            
        
    
        
        
            
                "l2_threshold_usd": 30000,
            
        
    
        
        
            
                "l3_threshold_usd": 120000,
            
        
    
        
        
            
                "l4_threshold_usd": 120000.01,
            
        
    
        
        
            
                "sla_approval_hours": 48,
            
        
    
        
        
            
                "sla_procurement_hours": 120,
            
        
    
        
        
            
                "sla_reception_hours": 168,
            
        
    
        
        
            
                "rate_limit_profile": "strict",
            
        
    
        
        
            
                "require_reject_reason": true,
            
        
    
        
        
            
                "require_return_comment": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CurrencyRatesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "base_currency": "GBP",
            
        
    
        
        
            
                "quote_currency": "GBP",
            
        
    
        
        
            
                "rate": 2850.5,
            
        
    
        
        
            
                "effective_at": new Date('2026-05-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "base_currency": "EUR",
            
        
    
        
        
            
                "quote_currency": "EUR",
            
        
    
        
        
            
                "rate": 0.00035,
            
        
    
        
        
            
                "effective_at": new Date('2026-05-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "base_currency": "CDF",
            
        
    
        
        
            
                "quote_currency": "CDF",
            
        
    
        
        
            
                "rate": 0.92,
            
        
    
        
        
            
                "effective_at": new Date('2026-05-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RequisitionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "req_number": "REQ-2026-0001",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Laptops pour equipe terrain",
            
        
    
        
        
            
                "description": "Achat de 5 laptops robustes pour missions terrain avec accessoires essentiels.",
            
        
    
        
        
            
                "quantity": 5,
            
        
    
        
        
            
                "estimated_budget_usd": 9500,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "estimated_budget_original": 9500,
            
        
    
        
        
            
                "fx_rate_to_usd": 1,
            
        
    
        
        
            
                "status": "in_approval",
            
        
    
        
        
            
                "submitted_at": new Date('2026-04-10T09:00:00Z'),
            
        
    
        
        
            
                "approved_at": new Date('2026-04-12T14:30:00Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-05-02T11:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "return_reason": "None",
            
        
    
        
        
            
                "reject_reason": "None",
            
        
    
        
        
            
                "is_high_value": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "req_number": "REQ-2026-0002",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Location camion pour logistique",
            
        
    
        
        
            
                "description": "Location camion 10T pour acheminement materiels vers site projet Kivu.",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "estimated_budget_usd": 18000,
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "estimated_budget_original": 18000,
            
        
    
        
        
            
                "fx_rate_to_usd": 1,
            
        
    
        
        
            
                "status": "in_procurement",
            
        
    
        
        
            
                "submitted_at": new Date('2026-04-20T08:30:00Z'),
            
        
    
        
        
            
                "approved_at": new Date('2026-04-22T10:15:00Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "return_reason": "None",
            
        
    
        
        
            
                "reject_reason": "None",
            
        
    
        
        
            
                "is_high_value": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "req_number": "REQ-2026-0003",
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "title": "Consultance etude biodiversite",
            
        
    
        
        
            
                "description": "Consultant senior pour etude biodiversite et rapport final avec ateliers.",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "estimated_budget_usd": 52000,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "estimated_budget_original": 52000,
            
        
    
        
        
            
                "fx_rate_to_usd": 1,
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "submitted_at": new Date('2026-05-01T13:20:00Z'),
            
        
    
        
        
            
                "approved_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "return_reason": "None",
            
        
    
        
        
            
                "reject_reason": "None",
            
        
    
        
        
            
                "is_high_value": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ApprovalStepsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "L3",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "decision": "approved",
            
        
    
        
        
            
                "comment": "OK selon budget IT.",
            
        
    
        
        
            
                "assigned_at": new Date('2026-04-10T09:05:00Z'),
            
        
    
        
        
            
                "decided_at": new Date('2026-04-11T10:00:00Z'),
            
        
    
        
        
            
                "sla_due_at": new Date('2026-04-12T09:05:00Z'),
            
        
    
        
        
            
                "sla_breached": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "L4",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "decision": "returned",
            
        
    
        
        
            
                "comment": "Approuve, merci de respecter les specs.",
            
        
    
        
        
            
                "assigned_at": new Date('2026-04-11T10:05:00Z'),
            
        
    
        
        
            
                "decided_at": new Date('2026-04-12T14:30:00Z'),
            
        
    
        
        
            
                "sla_due_at": new Date('2026-04-13T10:05:00Z'),
            
        
    
        
        
            
                "sla_breached": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "L3",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "decision": "rejected",
            
        
    
        
        
            
                "comment": "Besoin operations valide.",
            
        
    
        
        
            
                "assigned_at": new Date('2026-04-20T08:40:00Z'),
            
        
    
        
        
            
                "decided_at": new Date('2026-04-21T09:20:00Z'),
            
        
    
        
        
            
                "sla_due_at": new Date('2026-04-22T08:40:00Z'),
            
        
    
        
        
            
                "sla_breached": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ProcurementCasesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "classification": "direct_purchase",
            
        
    
        
        
            
                "classification_justification": "Montant entre 5000 et 25000 USD, comparaison de devis.",
            
        
    
        
        
            
                "pipeline_stage": "analyse_offres",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date('2026-04-13T09:00:00Z'),
            
        
    
        
        
            
                "sla_due_at": new Date('2026-04-18T09:00:00Z'),
            
        
    
        
        
            
                "awarded_at": new Date('2026-04-16T15:00:00Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-05-02T11:00:00Z'),
            
        
    
        
        
            
                "admin_override_single_source": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "classification": "pre_qualified",
            
        
    
        
        
            
                "classification_justification": "Montant entre 5000 et 25000 USD, sollicitation de 3 fournisseurs.",
            
        
    
        
        
            
                "pipeline_stage": "cloturee",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date('2026-04-23T08:00:00Z'),
            
        
    
        
        
            
                "sla_due_at": new Date('2026-04-28T08:00:00Z'),
            
        
    
        
        
            
                "awarded_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "admin_override_single_source": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "classification": "pre_qualified",
            
        
    
        
        
            
                "classification_justification": "Montant entre 25000 et 100000 USD, appel d offres public.",
            
        
    
        
        
            
                "pipeline_stage": "attribuee",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date('2026-05-02T08:30:00Z'),
            
        
    
        
        
            
                "sla_due_at": new Date('2026-05-07T08:30:00Z'),
            
        
    
        
        
            
                "awarded_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "admin_override_single_source": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SuppliersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "legal_name": "Kivu Tech Solutions SARL",
            
        
    
        
        
            
                "commercial_name": "KivuTech",
            
        
    
        
        
            
                "rccm_number": "CDKIN RCCM 21-B-1234",
            
        
    
        
        
            
                "tax_id": "NIF 01-9-1234567",
            
        
    
        
        
            
                "country": "BE",
            
        
    
        
        
            
                "address": "Gombe, Avenue du Port 12, Kinshasa",
            
        
    
        
        
            
                "primary_contact_name": "Jean Mbuyi",
            
        
    
        
        
            
                "primary_contact_email": "contact@kivutech.cd",
            
        
    
        
        
            
                "primary_contact_phone": "+243800000001",
            
        
    
        
        
            
                "bank_name": "Rawbank",
            
        
    
        
        
            
                "bank_account_number": "CD1234567890",
            
        
    
        
        
            
                "bank_swift": "RAWBCDKI",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "prequalification_status": "validated",
            
        
    
        
        
            
                "performance_score": 92.5,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "legal_name": "Equateur Logistics SPRL",
            
        
    
        
        
            
                "commercial_name": "EquaLog",
            
        
    
        
        
            
                "rccm_number": "CDKIN RCCM 20-A-5678",
            
        
    
        
        
            
                "tax_id": "NIF 01-9-7654321",
            
        
    
        
        
            
                "country": "TZ",
            
        
    
        
        
            
                "address": "Limete, Boulevard Lumumba 45, Kinshasa",
            
        
    
        
        
            
                "primary_contact_name": "Claudine Mabanza",
            
        
    
        
        
            
                "primary_contact_email": "sales@equalog.cd",
            
        
    
        
        
            
                "primary_contact_phone": "+243800000002",
            
        
    
        
        
            
                "bank_name": "TMB",
            
        
    
        
        
            
                "bank_account_number": "CD0987654321",
            
        
    
        
        
            
                "bank_swift": "TMBCDKI",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "prequalification_status": "validated",
            
        
    
        
        
            
                "performance_score": 84.2,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "legal_name": "Salonga Services Ltd",
            
        
    
        
        
            
                "commercial_name": "Salonga Services",
            
        
    
        
        
            
                "rccm_number": "CDKIN RCCM 19-C-2468",
            
        
    
        
        
            
                "tax_id": "NIF 01-9-2468246",
            
        
    
        
        
            
                "country": "BE",
            
        
    
        
        
            
                "address": "Ngaliema, Route de Matadi 88, Kinshasa",
            
        
    
        
        
            
                "primary_contact_name": "Patrick Kabasele",
            
        
    
        
        
            
                "primary_contact_email": "info@salongaservices.cd",
            
        
    
        
        
            
                "primary_contact_phone": "+243800000003",
            
        
    
        
        
            
                "bank_name": "BCDC",
            
        
    
        
        
            
                "bank_account_number": "CD2468246824",
            
        
    
        
        
            
                "bank_swift": "BCDCCDKI",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "prequalification_status": "validated",
            
        
    
        
        
            
                "performance_score": 0,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SupplierCategoriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "IT",
            
        
    
        
        
            
                "description": "Materiel informatique, logiciels et services IT.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Logistique",
            
        
    
        
        
            
                "description": "Transport, stockage, transit et distribution.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Construction",
            
        
    
        
        
            
                "description": "Travaux, renovation, maintenance et batiments.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SupplierDiligenceChecksData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "check_type": "site_visit",
            
        
    
        
        
            
                "status": "passed",
            
        
    
        
        
            
                "notes": "Aucun resultat sur listes de sanctions.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "checked_at": new Date('2026-03-01T09:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "check_type": "references",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "notes": "Etats financiers coherents, liquidite adequate.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "checked_at": new Date('2026-03-02T11:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "check_type": "references",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "notes": "En attente de confirmation de deux references.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "checked_at": new Date('2026-04-05T15:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TenderEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reference": "TND-2026-001",
            
        
    
        
        
            
                "title": "Consultance etude biodiversite",
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                "published_at": new Date('2026-05-03T08:00:00Z'),
            
        
    
        
        
            
                "submission_deadline": new Date('2026-05-20T17:00:00Z'),
            
        
    
        
        
            
                "opened_at": new Date('2026-05-21T09:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reference": "RFQ-2026-014",
            
        
    
        
        
            
                "title": "Devis location camion 10T",
            
        
    
        
        
            
                "status": "closed",
            
        
    
        
        
            
                "published_at": new Date('2026-04-24T09:00:00Z'),
            
        
    
        
        
            
                "submission_deadline": new Date('2026-04-28T16:00:00Z'),
            
        
    
        
        
            
                "opened_at": new Date('2026-04-29T09:30:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reference": "RFQ-2026-009",
            
        
    
        
        
            
                "title": "Devis laptops robustes",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "published_at": new Date('2026-04-13T10:00:00Z'),
            
        
    
        
        
            
                "submission_deadline": new Date('2026-04-15T15:00:00Z'),
            
        
    
        
        
            
                "opened_at": new Date('2026-04-15T16:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SupplierOffersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "amount": 9200,
            
        
    
        
        
            
                "currency": "EUR",
            
        
    
        
        
            
                "amount_usd": 9200,
            
        
    
        
        
            
                "delivery_lead_time": "14 days",
            
        
    
        
        
            
                "warranty_terms": "Garantie 12 mois pieces et main d oeuvre.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "received_at": new Date('2026-04-14T11:00:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "amount": 9800,
            
        
    
        
        
            
                "currency": "GBP",
            
        
    
        
        
            
                "amount_usd": 9800,
            
        
    
        
        
            
                "delivery_lead_time": "21 days",
            
        
    
        
        
            
                "warranty_terms": "Garantie 12 mois.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "shortlisted",
            
        
    
        
        
            
                "received_at": new Date('2026-04-14T12:30:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "amount": 17500,
            
        
    
        
        
            
                "currency": "EUR",
            
        
    
        
        
            
                "amount_usd": 17500,
            
        
    
        
        
            
                "delivery_lead_time": "Immediate",
            
        
    
        
        
            
                "warranty_terms": "Assurance incluse selon contrat.",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "status": "rejected",
            
        
    
        
        
            
                "received_at": new Date('2026-04-27T09:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BidCriteriaData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Prix",
            
        
    
        
        
            
                "weight": 0.4,
            
        
    
        
        
            
                "description": "Competitivite du prix total.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Delai",
            
        
    
        
        
            
                "weight": 0.2,
            
        
    
        
        
            
                "description": "Delai de livraison propose.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Qualite technique",
            
        
    
        
        
            
                "weight": 0.3,
            
        
    
        
        
            
                "description": "Conformite aux specifications et robustesse.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const OfferScoresData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 95,
            
        
    
        
        
            
                "comment": "Prix competitif par rapport au marche.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scored_at": new Date('2026-04-15T09:00:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "score": 90,
            
        
    
        
        
            
                "comment": "Delai acceptable pour terrain.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scored_at": new Date('2026-04-15T09:10:00Z'),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "score": 92,
            
        
    
        
        
            
                "comment": "Specs conformes, modele robuste.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "scored_at": new Date('2026-04-15T09:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AwardsData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "awarded_amount_usd": 9200,
            
        
    
        
        
            
                "award_rationale": "Meilleur rapport qualite prix et delai conforme.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "awarded_at": new Date('2026-04-16T15:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "awarded_amount_usd": 0,
            
        
    
        
        
            
                "award_rationale": "Dossier cloture apres rejet requisition, aucune attribution.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "awarded_at": new Date('2026-03-22T12:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "awarded_amount_usd": 17500,
            
        
    
        
        
            
                "award_rationale": "Offre conforme, disponibilite immediate.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "awarded_at": new Date('2026-04-30T10:00:00Z'),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PurchaseOrdersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "po_number": "PO-2026-0101",
            
        
    
        
        
            
                "total_amount_usd": 9200,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "total_amount_original": 9200,
            
        
    
        
        
            
                "issued_at": new Date('2026-04-17T09:00:00Z'),
            
        
    
        
        
            
                "expected_delivery_at": new Date('2026-05-01T17:00:00Z'),
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "po_number": "PO-2026-0102",
            
        
    
        
        
            
                "total_amount_usd": 17500,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "total_amount_original": 17500,
            
        
    
        
        
            
                "issued_at": new Date('2026-05-01T10:00:00Z'),
            
        
    
        
        
            
                "expected_delivery_at": new Date('2026-05-15T17:00:00Z'),
            
        
    
        
        
            
                "status": "issued",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "po_number": "PO-2026-0103",
            
        
    
        
        
            
                "total_amount_usd": 7600,
            
        
    
        
        
            
                "currency": "USD",
            
        
    
        
        
            
                "total_amount_original": 7600,
            
        
    
        
        
            
                "issued_at": new Date('2026-05-09T09:30:00Z'),
            
        
    
        
        
            
                "expected_delivery_at": new Date('2026-05-14T17:00:00Z'),
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PoLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_name": "Laptop robuste 14 pouces",
            
        
    
        
        
            
                "description": "Processeur i7, 16GB RAM, SSD 512GB, chassis renforce.",
            
        
    
        
        
            
                "quantity_ordered": 5,
            
        
    
        
        
            
                "unit_price": 1700,
            
        
    
        
        
            
                "line_total": 8500,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_name": "Souris et sac de transport",
            
        
    
        
        
            
                "description": "Accessoires pour chaque laptop.",
            
        
    
        
        
            
                "quantity_ordered": 5,
            
        
    
        
        
            
                "unit_price": 60,
            
        
    
        
        
            
                "line_total": 300,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "item_name": "Extension garantie",
            
        
    
        
        
            
                "description": "Extension garantie 12 mois supplementaires.",
            
        
    
        
        
            
                "quantity_ordered": 5,
            
        
    
        
        
            
                "unit_price": 80,
            
        
    
        
        
            
                "line_total": 400,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GoodsReceiptNotesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "grn_number": "GRN-2026-0201",
            
        
    
        
        
            
                "received_at": new Date('2026-05-01T10:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quality_check": "pass",
            
        
    
        
        
            
                "observations": "Materiels recus en bon etat, conformes.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "receiver_signature": "sig_rachel_0201",
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "grn_number": "GRN-2026-0202",
            
        
    
        
        
            
                "received_at": new Date('2026-05-12T09:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quality_check": "partial",
            
        
    
        
        
            
                "observations": "Documents de support manquants pour 5 participants.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "receiver_signature": "sig_rachel_0202",
            
        
    
        
        
            
                "status": "accepted",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "grn_number": "GRN-2026-0203",
            
        
    
        
        
            
                "received_at": new Date('2026-05-06T07:15:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quality_check": "pass",
            
        
    
        
        
            
                "observations": "Service de transport demarre, premier trajet effectue.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "receiver_signature": "sig_rachel_0203",
            
        
    
        
        
            
                "status": "accepted",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GrnLinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity_received": 5,
            
        
    
        
        
            
                "quantity_rejected": 0,
            
        
    
        
        
            
                "remarks": "OK",
            
        
    
        
        
            
                // 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": 5,
            
        
    
        
        
            
                "quantity_rejected": 0,
            
        
    
        
        
            
                "remarks": "OK",
            
        
    
        
        
            
                // 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": 5,
            
        
    
        
        
            
                "quantity_rejected": 0,
            
        
    
        
        
            
                "remarks": "OK",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ServiceAcceptanceNotesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "san_number": "SAN-2026-0301",
            
        
    
        
        
            
                "acceptance_date": new Date('2026-05-16T12:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "deliverable_checklist": "Trajet 1 effectue, documents livraison fournis.",
            
        
    
        
        
            
                "acceptance_criteria": "Respect du calendrier et zero incident.",
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "san_number": "SAN-2026-0302",
            
        
    
        
        
            
                "acceptance_date": new Date('2026-07-28T10:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "deliverable_checklist": "Rapport final, ateliers, fichiers sources.",
            
        
    
        
        
            
                "acceptance_criteria": "Validation technique par equipe projet.",
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "san_number": "SAN-2026-0303",
            
        
    
        
        
            
                "acceptance_date": new Date('2026-05-14T17:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "deliverable_checklist": "Session terminee, evaluation participants recueillie.",
            
        
    
        
        
            
                "acceptance_criteria": "Presence minimum 90 pourcent, satisfaction moyenne 4 sur 5.",
            
        
    
        
        
            
                "status": "submitted",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DiscrepancyCasesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "other",
            
        
    
        
        
            
                "description": "Supports de formation manquants pour 5 participants.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reported_at": new Date('2026-05-12T09:30:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "resolution_notes": "En attente envoi supports.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "documentation_issue",
            
        
    
        
        
            
                "description": "Carton externe legerement endommage, materiel intact.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "in_review",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reported_at": new Date('2026-05-01T10:45:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-05-01T11:10:00Z'),
            
        
    
        
        
            
                "resolution_notes": "Aucune action requise, note au dossier.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "documentation_issue",
            
        
    
        
        
            
                "description": "Changement d itineraire pour raison securite, conforme au plan.",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reported_at": new Date('2026-05-06T07:45:00Z'),
            
        
    
        
        
            
                "resolved_at": new Date('2026-05-06T08:00:00Z'),
            
        
    
        
        
            
                "resolution_notes": "Valide par operations.",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ArchiveItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "resource_type": "san",
            
        
    
        
        
            
                "resource_reference": "REQ-2026-0001",
            
        
    
        
        
            
                "visibility_scope": "department",
            
        
    
        
        
            
                "title": "Dossier REQ-2026-0001 laptops",
            
        
    
        
        
            
                "keywords": "laptops IT terrain achats",
            
        
    
        
        
            
                "amount_usd": 9500,
            
        
    
        
        
            
                "status": "sealed",
            
        
    
        
        
            
                "archived_at": new Date('2026-05-03T09:30:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "resource_type": "supplier",
            
        
    
        
        
            
                "resource_reference": "PO-2026-0101",
            
        
    
        
        
            
                "visibility_scope": "restricted",
            
        
    
        
        
            
                "title": "PO-2026-0101 KivuTech laptops",
            
        
    
        
        
            
                "keywords": "PO laptops KivuTech",
            
        
    
        
        
            
                "amount_usd": 9200,
            
        
    
        
        
            
                "status": "sealed",
            
        
    
        
        
            
                "archived_at": new Date('2026-05-03T09:45:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "resource_type": "purchase_order",
            
        
    
        
        
            
                "resource_reference": "GRN-2026-0201",
            
        
    
        
        
            
                "visibility_scope": "department",
            
        
    
        
        
            
                "title": "GRN-2026-0201 reception laptops",
            
        
    
        
        
            
                "keywords": "GRN reception IT",
            
        
    
        
        
            
                "amount_usd": 9200,
            
        
    
        
        
            
                "status": "sealed",
            
        
    
        
        
            
                "archived_at": new Date('2026-05-03T10:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AccessLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "view",
            
        
    
        
        
            
                "resource_type": "archive_item",
            
        
    
        
        
            
                "resource_reference": "REQ-2026-0001",
            
        
    
        
        
            
                "ip_address": "41.243.10.21",
            
        
    
        
        
            
                "user_agent": "Chrome on Windows",
            
        
    
        
        
            
                "occurred_at": new Date('2026-05-05T13:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "view",
            
        
    
        
        
            
                "resource_type": "requisition",
            
        
    
        
        
            
                "resource_reference": "archive_req_0001.zip",
            
        
    
        
        
            
                "ip_address": "41.243.10.21",
            
        
    
        
        
            
                "user_agent": "Chrome on Windows",
            
        
    
        
        
            
                "occurred_at": new Date('2026-05-05T13:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "view",
            
        
    
        
        
            
                "resource_type": "audit_pack",
            
        
    
        
        
            
                "resource_reference": "REQ-2026-0004",
            
        
    
        
        
            
                "ip_address": "41.243.11.44",
            
        
    
        
        
            
                "user_agent": "Firefox on Linux",
            
        
    
        
        
            
                "occurred_at": new Date('2026-04-29T09:20:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const NotificationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "subject": "Requisition retournee",
            
        
    
        
        
            
                "message": "Votre requisition REQ-2026-0004 a ete retournee pour correction.",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "sent_at": new Date('2026-04-29T09:05:00Z'),
            
        
    
        
        
            
                "read_at": new Date('2026-04-29T09:25:00Z'),
            
        
    
        
        
            
                "related_reference": "REQ-2026-0004",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "subject": "Nouvelle requisition approuvee",
            
        
    
        
        
            
                "message": "La requisition REQ-2026-0002 est approuvee et prete pour sourcing.",
            
        
    
        
        
            
                "status": "read",
            
        
    
        
        
            
                "sent_at": new Date('2026-04-22T10:20:00Z'),
            
        
    
        
        
            
                "read_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "related_reference": "REQ-2026-0002",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "in_app",
            
        
    
        
        
            
                "subject": "PO emis",
            
        
    
        
        
            
                "message": "Le bon de commande PO-2026-0103 est emis, planifier la reception.",
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "sent_at": new Date('2026-05-09T10:00:00Z'),
            
        
    
        
        
            
                "read_at": new Date('2026-05-09T10:05:00Z'),
            
        
    
        
        
            
                "related_reference": "PO-2026-0103",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AuditEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_id": "EVT-2026-000001",
            
        
    
        
        
            
                "occurred_at": new Date('2026-04-10T09:00:05Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "export_generated",
            
        
    
        
        
            
                "resource_type": "tenant",
            
        
    
        
        
            
                "resource_reference": "REQ-2026-0001",
            
        
    
        
        
            
                "summary": "Soumission requisition pour laptops terrain.",
            
        
    
        
        
            
                "ip_address": "41.243.11.44",
            
        
    
        
        
            
                "integrity_hash": "hash_000001",
            
        
    
        
        
            
                "previous_hash": "hash_000000",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_id": "EVT-2026-000002",
            
        
    
        
        
            
                "occurred_at": new Date('2026-04-12T14:30:10Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "auth_failed_login",
            
        
    
        
        
            
                "resource_type": "user",
            
        
    
        
        
            
                "resource_reference": "REQ-2026-0001",
            
        
    
        
        
            
                "summary": "Approbation finale conforme seuils.",
            
        
    
        
        
            
                "ip_address": "41.243.10.22",
            
        
    
        
        
            
                "integrity_hash": "hash_000002",
            
        
    
        
        
            
                "previous_hash": "hash_000001",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_id": "EVT-2026-000003",
            
        
    
        
        
            
                "occurred_at": new Date('2026-04-16T15:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "requisition_rejected",
            
        
    
        
        
            
                "resource_type": "requisition",
            
        
    
        
        
            
                "resource_reference": "REQ-2026-0001",
            
        
    
        
        
            
                "summary": "Attribution a KivuTech apres analyse offres.",
            
        
    
        
        
            
                "ip_address": "41.243.12.55",
            
        
    
        
        
            
                "integrity_hash": "hash_000003",
            
        
    
        
        
            
                "previous_hash": "hash_000002",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExportJobsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "audit_pack",
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "parameters_json": "scope audit month 2026-04",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "requested_at": new Date('2026-05-03T15:50:00Z'),
            
        
    
        
        
            
                "completed_at": new Date('2026-05-03T16:05:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "zip",
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "parameters_json": "audit pack with requisitions and approvals",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "requested_at": new Date('2026-05-03T16:00:00Z'),
            
        
    
        
        
            
                "completed_at": new Date('2026-05-03T16:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "pdf",
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "parameters_json": "requisition summary REQ-2026-0003",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "requested_at": new Date('2026-05-01T14:00:00Z'),
            
        
    
        
        
            
                "completed_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "refresh_token_hash": "rt_hash_001",
            
        
    
        
        
            
                "created_at_time": new Date('2026-05-01T08:15:10Z'),
            
        
    
        
        
            
                "expires_at": new Date('2026-05-08T08:15:10Z'),
            
        
    
        
        
            
                "revoked_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "ip_address": "41.243.11.44",
            
        
    
        
        
            
                "user_agent": "Firefox on Linux",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "refresh_token_hash": "rt_hash_002",
            
        
    
        
        
            
                "created_at_time": new Date('2026-05-02T10:05:05Z'),
            
        
    
        
        
            
                "expires_at": new Date('2026-05-09T10:05:05Z'),
            
        
    
        
        
            
                "revoked_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "ip_address": "41.243.12.55",
            
        
    
        
        
            
                "user_agent": "Edge on Windows",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "refresh_token_hash": "rt_hash_003",
            
        
    
        
        
            
                "created_at_time": new Date('2026-05-03T07:40:12Z'),
            
        
    
        
        
            
                "expires_at": new Date('2026-05-10T07:40:12Z'),
            
        
    
        
        
            
                "revoked_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "ip_address": "41.243.10.22",
            
        
    
        
        
            
                "user_agent": "Chrome on macOS",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




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

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateTenantWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Tenant0 = await Tenants.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Tenant0?.setOrganization)
                {
                    await
                    Tenant0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Tenant1 = await Tenants.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Tenant1?.setOrganization)
                {
                    await
                    Tenant1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Tenant2 = await Tenants.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Tenant2?.setOrganization)
                {
                    await
                    Tenant2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

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

    
    
    
        
            
            async function associateProjectWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Project0 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Project0?.setTenant)
                {
                    await
                    Project0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Project1 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Project1?.setTenant)
                {
                    await
                    Project1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Project2 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Project2?.setTenant)
                {
                    await
                    Project2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateProjectWithDepartment() {
            
                const relatedDepartment0 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Project0 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Project0?.setDepartment)
                {
                    await
                    Project0.
                    setDepartment(relatedDepartment0);
                }
            
                const relatedDepartment1 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Project1 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Project1?.setDepartment)
                {
                    await
                    Project1.
                    setDepartment(relatedDepartment1);
                }
            
                const relatedDepartment2 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Project2 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Project2?.setDepartment)
                {
                    await
                    Project2.
                    setDepartment(relatedDepartment2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateProjectWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project0 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Project0?.setOrganization)
                {
                    await
                    Project0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project1 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Project1?.setOrganization)
                {
                    await
                    Project1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project2 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Project2?.setOrganization)
                {
                    await
                    Project2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBudgetLineWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const BudgetLine0 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BudgetLine0?.setTenant)
                {
                    await
                    BudgetLine0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const BudgetLine1 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BudgetLine1?.setTenant)
                {
                    await
                    BudgetLine1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const BudgetLine2 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BudgetLine2?.setTenant)
                {
                    await
                    BudgetLine2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateBudgetLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BudgetLine0 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BudgetLine0?.setOrganization)
                {
                    await
                    BudgetLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BudgetLine1 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BudgetLine1?.setOrganization)
                {
                    await
                    BudgetLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BudgetLine2 = await BudgetLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BudgetLine2?.setOrganization)
                {
                    await
                    BudgetLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateWorkflowRuleWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const WorkflowRule0 = await WorkflowRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkflowRule0?.setTenant)
                {
                    await
                    WorkflowRule0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const WorkflowRule1 = await WorkflowRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkflowRule1?.setTenant)
                {
                    await
                    WorkflowRule1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const WorkflowRule2 = await WorkflowRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkflowRule2?.setTenant)
                {
                    await
                    WorkflowRule2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateWorkflowRuleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkflowRule0 = await WorkflowRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkflowRule0?.setOrganization)
                {
                    await
                    WorkflowRule0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkflowRule1 = await WorkflowRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkflowRule1?.setOrganization)
                {
                    await
                    WorkflowRule1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WorkflowRule2 = await WorkflowRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkflowRule2?.setOrganization)
                {
                    await
                    WorkflowRule2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCurrencyRateWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const CurrencyRate0 = await CurrencyRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CurrencyRate0?.setTenant)
                {
                    await
                    CurrencyRate0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const CurrencyRate1 = await CurrencyRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CurrencyRate1?.setTenant)
                {
                    await
                    CurrencyRate1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const CurrencyRate2 = await CurrencyRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CurrencyRate2?.setTenant)
                {
                    await
                    CurrencyRate2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCurrencyRateWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CurrencyRate0 = await CurrencyRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CurrencyRate0?.setOrganization)
                {
                    await
                    CurrencyRate0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CurrencyRate1 = await CurrencyRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CurrencyRate1?.setOrganization)
                {
                    await
                    CurrencyRate1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CurrencyRate2 = await CurrencyRates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CurrencyRate2?.setOrganization)
                {
                    await
                    CurrencyRate2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateRequisitionWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Requisition0 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Requisition0?.setTenant)
                {
                    await
                    Requisition0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Requisition1 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Requisition1?.setTenant)
                {
                    await
                    Requisition1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Requisition2 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Requisition2?.setTenant)
                {
                    await
                    Requisition2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
    
        
            
            async function associateRequisitionWithRequester() {
            
                const relatedRequester0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Requisition0 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Requisition0?.setRequester)
                {
                    await
                    Requisition0.
                    setRequester(relatedRequester0);
                }
            
                const relatedRequester1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Requisition1 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Requisition1?.setRequester)
                {
                    await
                    Requisition1.
                    setRequester(relatedRequester1);
                }
            
                const relatedRequester2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Requisition2 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Requisition2?.setRequester)
                {
                    await
                    Requisition2.
                    setRequester(relatedRequester2);
                }
            
        }
        
    
        
            
            async function associateRequisitionWithDepartment() {
            
                const relatedDepartment0 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Requisition0 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Requisition0?.setDepartment)
                {
                    await
                    Requisition0.
                    setDepartment(relatedDepartment0);
                }
            
                const relatedDepartment1 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Requisition1 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Requisition1?.setDepartment)
                {
                    await
                    Requisition1.
                    setDepartment(relatedDepartment1);
                }
            
                const relatedDepartment2 = await Departments.findOne({
                    offset: Math.floor(Math.random() * (await Departments.count())),
                });
                const Requisition2 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Requisition2?.setDepartment)
                {
                    await
                    Requisition2.
                    setDepartment(relatedDepartment2);
                }
            
        }
        
    
        
            
            async function associateRequisitionWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Requisition0 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Requisition0?.setProject)
                {
                    await
                    Requisition0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Requisition1 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Requisition1?.setProject)
                {
                    await
                    Requisition1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Requisition2 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Requisition2?.setProject)
                {
                    await
                    Requisition2.
                    setProject(relatedProject2);
                }
            
        }
        
    
        
            
            async function associateRequisitionWithBudget_line() {
            
                const relatedBudget_line0 = await BudgetLines.findOne({
                    offset: Math.floor(Math.random() * (await BudgetLines.count())),
                });
                const Requisition0 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Requisition0?.setBudget_line)
                {
                    await
                    Requisition0.
                    setBudget_line(relatedBudget_line0);
                }
            
                const relatedBudget_line1 = await BudgetLines.findOne({
                    offset: Math.floor(Math.random() * (await BudgetLines.count())),
                });
                const Requisition1 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Requisition1?.setBudget_line)
                {
                    await
                    Requisition1.
                    setBudget_line(relatedBudget_line1);
                }
            
                const relatedBudget_line2 = await BudgetLines.findOne({
                    offset: Math.floor(Math.random() * (await BudgetLines.count())),
                });
                const Requisition2 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Requisition2?.setBudget_line)
                {
                    await
                    Requisition2.
                    setBudget_line(relatedBudget_line2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateRequisitionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Requisition0 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Requisition0?.setOrganization)
                {
                    await
                    Requisition0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Requisition1 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Requisition1?.setOrganization)
                {
                    await
                    Requisition1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Requisition2 = await Requisitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Requisition2?.setOrganization)
                {
                    await
                    Requisition2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateApprovalStepWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ApprovalStep0 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApprovalStep0?.setTenant)
                {
                    await
                    ApprovalStep0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ApprovalStep1 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApprovalStep1?.setTenant)
                {
                    await
                    ApprovalStep1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ApprovalStep2 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApprovalStep2?.setTenant)
                {
                    await
                    ApprovalStep2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateApprovalStepWithRequisition() {
            
                const relatedRequisition0 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const ApprovalStep0 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApprovalStep0?.setRequisition)
                {
                    await
                    ApprovalStep0.
                    setRequisition(relatedRequisition0);
                }
            
                const relatedRequisition1 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const ApprovalStep1 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApprovalStep1?.setRequisition)
                {
                    await
                    ApprovalStep1.
                    setRequisition(relatedRequisition1);
                }
            
                const relatedRequisition2 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const ApprovalStep2 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApprovalStep2?.setRequisition)
                {
                    await
                    ApprovalStep2.
                    setRequisition(relatedRequisition2);
                }
            
        }
        
    
        
    
        
            
            async function associateApprovalStepWithAssigned_approver() {
            
                const relatedAssigned_approver0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ApprovalStep0 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApprovalStep0?.setAssigned_approver)
                {
                    await
                    ApprovalStep0.
                    setAssigned_approver(relatedAssigned_approver0);
                }
            
                const relatedAssigned_approver1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ApprovalStep1 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApprovalStep1?.setAssigned_approver)
                {
                    await
                    ApprovalStep1.
                    setAssigned_approver(relatedAssigned_approver1);
                }
            
                const relatedAssigned_approver2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ApprovalStep2 = await ApprovalSteps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApprovalStep2?.setAssigned_approver)
                {
                    await
                    ApprovalStep2.
                    setAssigned_approver(relatedAssigned_approver2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            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);
                }
            
        }
        
    

    
    
    
        
            
            async function associateProcurementCasWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ProcurementCas0 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProcurementCas0?.setTenant)
                {
                    await
                    ProcurementCas0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ProcurementCas1 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProcurementCas1?.setTenant)
                {
                    await
                    ProcurementCas1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ProcurementCas2 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProcurementCas2?.setTenant)
                {
                    await
                    ProcurementCas2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateProcurementCasWithRequisition() {
            
                const relatedRequisition0 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const ProcurementCas0 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProcurementCas0?.setRequisition)
                {
                    await
                    ProcurementCas0.
                    setRequisition(relatedRequisition0);
                }
            
                const relatedRequisition1 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const ProcurementCas1 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProcurementCas1?.setRequisition)
                {
                    await
                    ProcurementCas1.
                    setRequisition(relatedRequisition1);
                }
            
                const relatedRequisition2 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const ProcurementCas2 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProcurementCas2?.setRequisition)
                {
                    await
                    ProcurementCas2.
                    setRequisition(relatedRequisition2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateProcurementCasWithOwner() {
            
                const relatedOwner0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ProcurementCas0 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProcurementCas0?.setOwner)
                {
                    await
                    ProcurementCas0.
                    setOwner(relatedOwner0);
                }
            
                const relatedOwner1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ProcurementCas1 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProcurementCas1?.setOwner)
                {
                    await
                    ProcurementCas1.
                    setOwner(relatedOwner1);
                }
            
                const relatedOwner2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ProcurementCas2 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProcurementCas2?.setOwner)
                {
                    await
                    ProcurementCas2.
                    setOwner(relatedOwner2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateProcurementCasWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProcurementCas0 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ProcurementCas0?.setOrganization)
                {
                    await
                    ProcurementCas0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProcurementCas1 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ProcurementCas1?.setOrganization)
                {
                    await
                    ProcurementCas1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ProcurementCas2 = await ProcurementCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ProcurementCas2?.setOrganization)
                {
                    await
                    ProcurementCas2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

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

    
    
    
        
            
            async function associateSupplierCategoryWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierCategory0 = await SupplierCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierCategory0?.setTenant)
                {
                    await
                    SupplierCategory0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierCategory1 = await SupplierCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierCategory1?.setTenant)
                {
                    await
                    SupplierCategory1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierCategory2 = await SupplierCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierCategory2?.setTenant)
                {
                    await
                    SupplierCategory2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateSupplierCategoryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierCategory0 = await SupplierCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierCategory0?.setOrganization)
                {
                    await
                    SupplierCategory0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierCategory1 = await SupplierCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierCategory1?.setOrganization)
                {
                    await
                    SupplierCategory1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierCategory2 = await SupplierCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierCategory2?.setOrganization)
                {
                    await
                    SupplierCategory2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSupplierDiligenceCheckWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierDiligenceCheck0 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierDiligenceCheck0?.setTenant)
                {
                    await
                    SupplierDiligenceCheck0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierDiligenceCheck1 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierDiligenceCheck1?.setTenant)
                {
                    await
                    SupplierDiligenceCheck1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierDiligenceCheck2 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierDiligenceCheck2?.setTenant)
                {
                    await
                    SupplierDiligenceCheck2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateSupplierDiligenceCheckWithSupplier() {
            
                const relatedSupplier0 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierDiligenceCheck0 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierDiligenceCheck0?.setSupplier)
                {
                    await
                    SupplierDiligenceCheck0.
                    setSupplier(relatedSupplier0);
                }
            
                const relatedSupplier1 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierDiligenceCheck1 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierDiligenceCheck1?.setSupplier)
                {
                    await
                    SupplierDiligenceCheck1.
                    setSupplier(relatedSupplier1);
                }
            
                const relatedSupplier2 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierDiligenceCheck2 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierDiligenceCheck2?.setSupplier)
                {
                    await
                    SupplierDiligenceCheck2.
                    setSupplier(relatedSupplier2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSupplierDiligenceCheckWithChecked_by() {
            
                const relatedChecked_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SupplierDiligenceCheck0 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierDiligenceCheck0?.setChecked_by)
                {
                    await
                    SupplierDiligenceCheck0.
                    setChecked_by(relatedChecked_by0);
                }
            
                const relatedChecked_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SupplierDiligenceCheck1 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierDiligenceCheck1?.setChecked_by)
                {
                    await
                    SupplierDiligenceCheck1.
                    setChecked_by(relatedChecked_by1);
                }
            
                const relatedChecked_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SupplierDiligenceCheck2 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierDiligenceCheck2?.setChecked_by)
                {
                    await
                    SupplierDiligenceCheck2.
                    setChecked_by(relatedChecked_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateSupplierDiligenceCheckWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierDiligenceCheck0 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierDiligenceCheck0?.setOrganization)
                {
                    await
                    SupplierDiligenceCheck0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierDiligenceCheck1 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierDiligenceCheck1?.setOrganization)
                {
                    await
                    SupplierDiligenceCheck1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierDiligenceCheck2 = await SupplierDiligenceChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierDiligenceCheck2?.setOrganization)
                {
                    await
                    SupplierDiligenceCheck2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTenderEventWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const TenderEvent0 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TenderEvent0?.setTenant)
                {
                    await
                    TenderEvent0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const TenderEvent1 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TenderEvent1?.setTenant)
                {
                    await
                    TenderEvent1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const TenderEvent2 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TenderEvent2?.setTenant)
                {
                    await
                    TenderEvent2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateTenderEventWithProcurement_case() {
            
                const relatedProcurement_case0 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const TenderEvent0 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TenderEvent0?.setProcurement_case)
                {
                    await
                    TenderEvent0.
                    setProcurement_case(relatedProcurement_case0);
                }
            
                const relatedProcurement_case1 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const TenderEvent1 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TenderEvent1?.setProcurement_case)
                {
                    await
                    TenderEvent1.
                    setProcurement_case(relatedProcurement_case1);
                }
            
                const relatedProcurement_case2 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const TenderEvent2 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TenderEvent2?.setProcurement_case)
                {
                    await
                    TenderEvent2.
                    setProcurement_case(relatedProcurement_case2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateTenderEventWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TenderEvent0 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TenderEvent0?.setOrganization)
                {
                    await
                    TenderEvent0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TenderEvent1 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TenderEvent1?.setOrganization)
                {
                    await
                    TenderEvent1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const TenderEvent2 = await TenderEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TenderEvent2?.setOrganization)
                {
                    await
                    TenderEvent2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSupplierOfferWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierOffer0 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierOffer0?.setTenant)
                {
                    await
                    SupplierOffer0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierOffer1 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierOffer1?.setTenant)
                {
                    await
                    SupplierOffer1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const SupplierOffer2 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierOffer2?.setTenant)
                {
                    await
                    SupplierOffer2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateSupplierOfferWithProcurement_case() {
            
                const relatedProcurement_case0 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const SupplierOffer0 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierOffer0?.setProcurement_case)
                {
                    await
                    SupplierOffer0.
                    setProcurement_case(relatedProcurement_case0);
                }
            
                const relatedProcurement_case1 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const SupplierOffer1 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierOffer1?.setProcurement_case)
                {
                    await
                    SupplierOffer1.
                    setProcurement_case(relatedProcurement_case1);
                }
            
                const relatedProcurement_case2 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const SupplierOffer2 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierOffer2?.setProcurement_case)
                {
                    await
                    SupplierOffer2.
                    setProcurement_case(relatedProcurement_case2);
                }
            
        }
        
    
        
            
            async function associateSupplierOfferWithSupplier() {
            
                const relatedSupplier0 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierOffer0 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierOffer0?.setSupplier)
                {
                    await
                    SupplierOffer0.
                    setSupplier(relatedSupplier0);
                }
            
                const relatedSupplier1 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierOffer1 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierOffer1?.setSupplier)
                {
                    await
                    SupplierOffer1.
                    setSupplier(relatedSupplier1);
                }
            
                const relatedSupplier2 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const SupplierOffer2 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierOffer2?.setSupplier)
                {
                    await
                    SupplierOffer2.
                    setSupplier(relatedSupplier2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSupplierOfferWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierOffer0 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SupplierOffer0?.setOrganization)
                {
                    await
                    SupplierOffer0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierOffer1 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SupplierOffer1?.setOrganization)
                {
                    await
                    SupplierOffer1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SupplierOffer2 = await SupplierOffers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SupplierOffer2?.setOrganization)
                {
                    await
                    SupplierOffer2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBidCriteriaWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const BidCriteria0 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BidCriteria0?.setTenant)
                {
                    await
                    BidCriteria0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const BidCriteria1 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BidCriteria1?.setTenant)
                {
                    await
                    BidCriteria1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const BidCriteria2 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BidCriteria2?.setTenant)
                {
                    await
                    BidCriteria2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateBidCriteriaWithProcurement_case() {
            
                const relatedProcurement_case0 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const BidCriteria0 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BidCriteria0?.setProcurement_case)
                {
                    await
                    BidCriteria0.
                    setProcurement_case(relatedProcurement_case0);
                }
            
                const relatedProcurement_case1 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const BidCriteria1 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BidCriteria1?.setProcurement_case)
                {
                    await
                    BidCriteria1.
                    setProcurement_case(relatedProcurement_case1);
                }
            
                const relatedProcurement_case2 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const BidCriteria2 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BidCriteria2?.setProcurement_case)
                {
                    await
                    BidCriteria2.
                    setProcurement_case(relatedProcurement_case2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateBidCriteriaWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BidCriteria0 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BidCriteria0?.setOrganization)
                {
                    await
                    BidCriteria0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BidCriteria1 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BidCriteria1?.setOrganization)
                {
                    await
                    BidCriteria1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BidCriteria2 = await BidCriteria.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BidCriteria2?.setOrganization)
                {
                    await
                    BidCriteria2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateOfferScoreWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const OfferScore0 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OfferScore0?.setTenant)
                {
                    await
                    OfferScore0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const OfferScore1 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OfferScore1?.setTenant)
                {
                    await
                    OfferScore1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const OfferScore2 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OfferScore2?.setTenant)
                {
                    await
                    OfferScore2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateOfferScoreWithSupplier_offer() {
            
                const relatedSupplier_offer0 = await SupplierOffers.findOne({
                    offset: Math.floor(Math.random() * (await SupplierOffers.count())),
                });
                const OfferScore0 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OfferScore0?.setSupplier_offer)
                {
                    await
                    OfferScore0.
                    setSupplier_offer(relatedSupplier_offer0);
                }
            
                const relatedSupplier_offer1 = await SupplierOffers.findOne({
                    offset: Math.floor(Math.random() * (await SupplierOffers.count())),
                });
                const OfferScore1 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OfferScore1?.setSupplier_offer)
                {
                    await
                    OfferScore1.
                    setSupplier_offer(relatedSupplier_offer1);
                }
            
                const relatedSupplier_offer2 = await SupplierOffers.findOne({
                    offset: Math.floor(Math.random() * (await SupplierOffers.count())),
                });
                const OfferScore2 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OfferScore2?.setSupplier_offer)
                {
                    await
                    OfferScore2.
                    setSupplier_offer(relatedSupplier_offer2);
                }
            
        }
        
    
        
            
            async function associateOfferScoreWithBid_criterion() {
            
                const relatedBid_criterion0 = await BidCriteria.findOne({
                    offset: Math.floor(Math.random() * (await BidCriteria.count())),
                });
                const OfferScore0 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OfferScore0?.setBid_criterion)
                {
                    await
                    OfferScore0.
                    setBid_criterion(relatedBid_criterion0);
                }
            
                const relatedBid_criterion1 = await BidCriteria.findOne({
                    offset: Math.floor(Math.random() * (await BidCriteria.count())),
                });
                const OfferScore1 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OfferScore1?.setBid_criterion)
                {
                    await
                    OfferScore1.
                    setBid_criterion(relatedBid_criterion1);
                }
            
                const relatedBid_criterion2 = await BidCriteria.findOne({
                    offset: Math.floor(Math.random() * (await BidCriteria.count())),
                });
                const OfferScore2 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OfferScore2?.setBid_criterion)
                {
                    await
                    OfferScore2.
                    setBid_criterion(relatedBid_criterion2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateOfferScoreWithScored_by() {
            
                const relatedScored_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OfferScore0 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OfferScore0?.setScored_by)
                {
                    await
                    OfferScore0.
                    setScored_by(relatedScored_by0);
                }
            
                const relatedScored_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OfferScore1 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OfferScore1?.setScored_by)
                {
                    await
                    OfferScore1.
                    setScored_by(relatedScored_by1);
                }
            
                const relatedScored_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OfferScore2 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OfferScore2?.setScored_by)
                {
                    await
                    OfferScore2.
                    setScored_by(relatedScored_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateOfferScoreWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OfferScore0 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OfferScore0?.setOrganization)
                {
                    await
                    OfferScore0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OfferScore1 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OfferScore1?.setOrganization)
                {
                    await
                    OfferScore1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OfferScore2 = await OfferScores.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OfferScore2?.setOrganization)
                {
                    await
                    OfferScore2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAwardWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Award0 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Award0?.setTenant)
                {
                    await
                    Award0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Award1 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Award1?.setTenant)
                {
                    await
                    Award1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Award2 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Award2?.setTenant)
                {
                    await
                    Award2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateAwardWithProcurement_case() {
            
                const relatedProcurement_case0 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const Award0 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Award0?.setProcurement_case)
                {
                    await
                    Award0.
                    setProcurement_case(relatedProcurement_case0);
                }
            
                const relatedProcurement_case1 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const Award1 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Award1?.setProcurement_case)
                {
                    await
                    Award1.
                    setProcurement_case(relatedProcurement_case1);
                }
            
                const relatedProcurement_case2 = await ProcurementCases.findOne({
                    offset: Math.floor(Math.random() * (await ProcurementCases.count())),
                });
                const Award2 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Award2?.setProcurement_case)
                {
                    await
                    Award2.
                    setProcurement_case(relatedProcurement_case2);
                }
            
        }
        
    
        
            
            async function associateAwardWithWinning_offer() {
            
                const relatedWinning_offer0 = await SupplierOffers.findOne({
                    offset: Math.floor(Math.random() * (await SupplierOffers.count())),
                });
                const Award0 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Award0?.setWinning_offer)
                {
                    await
                    Award0.
                    setWinning_offer(relatedWinning_offer0);
                }
            
                const relatedWinning_offer1 = await SupplierOffers.findOne({
                    offset: Math.floor(Math.random() * (await SupplierOffers.count())),
                });
                const Award1 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Award1?.setWinning_offer)
                {
                    await
                    Award1.
                    setWinning_offer(relatedWinning_offer1);
                }
            
                const relatedWinning_offer2 = await SupplierOffers.findOne({
                    offset: Math.floor(Math.random() * (await SupplierOffers.count())),
                });
                const Award2 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Award2?.setWinning_offer)
                {
                    await
                    Award2.
                    setWinning_offer(relatedWinning_offer2);
                }
            
        }
        
    
        
            
            async function associateAwardWithAwarded_supplier() {
            
                const relatedAwarded_supplier0 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const Award0 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Award0?.setAwarded_supplier)
                {
                    await
                    Award0.
                    setAwarded_supplier(relatedAwarded_supplier0);
                }
            
                const relatedAwarded_supplier1 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const Award1 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Award1?.setAwarded_supplier)
                {
                    await
                    Award1.
                    setAwarded_supplier(relatedAwarded_supplier1);
                }
            
                const relatedAwarded_supplier2 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const Award2 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Award2?.setAwarded_supplier)
                {
                    await
                    Award2.
                    setAwarded_supplier(relatedAwarded_supplier2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateAwardWithAwarded_by() {
            
                const relatedAwarded_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Award0 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Award0?.setAwarded_by)
                {
                    await
                    Award0.
                    setAwarded_by(relatedAwarded_by0);
                }
            
                const relatedAwarded_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Award1 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Award1?.setAwarded_by)
                {
                    await
                    Award1.
                    setAwarded_by(relatedAwarded_by1);
                }
            
                const relatedAwarded_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Award2 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Award2?.setAwarded_by)
                {
                    await
                    Award2.
                    setAwarded_by(relatedAwarded_by2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateAwardWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Award0 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Award0?.setOrganization)
                {
                    await
                    Award0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Award1 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Award1?.setOrganization)
                {
                    await
                    Award1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Award2 = await Awards.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Award2?.setOrganization)
                {
                    await
                    Award2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePurchaseOrderWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setTenant)
                {
                    await
                    PurchaseOrder0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setTenant)
                {
                    await
                    PurchaseOrder1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setTenant)
                {
                    await
                    PurchaseOrder2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associatePurchaseOrderWithRequisition() {
            
                const relatedRequisition0 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setRequisition)
                {
                    await
                    PurchaseOrder0.
                    setRequisition(relatedRequisition0);
                }
            
                const relatedRequisition1 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setRequisition)
                {
                    await
                    PurchaseOrder1.
                    setRequisition(relatedRequisition1);
                }
            
                const relatedRequisition2 = await Requisitions.findOne({
                    offset: Math.floor(Math.random() * (await Requisitions.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setRequisition)
                {
                    await
                    PurchaseOrder2.
                    setRequisition(relatedRequisition2);
                }
            
        }
        
    
        
            
            async function associatePurchaseOrderWithSupplier() {
            
                const relatedSupplier0 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setSupplier)
                {
                    await
                    PurchaseOrder0.
                    setSupplier(relatedSupplier0);
                }
            
                const relatedSupplier1 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setSupplier)
                {
                    await
                    PurchaseOrder1.
                    setSupplier(relatedSupplier1);
                }
            
                const relatedSupplier2 = await Suppliers.findOne({
                    offset: Math.floor(Math.random() * (await Suppliers.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setSupplier)
                {
                    await
                    PurchaseOrder2.
                    setSupplier(relatedSupplier2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePurchaseOrderWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder0 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PurchaseOrder0?.setOrganization)
                {
                    await
                    PurchaseOrder0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder1 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PurchaseOrder1?.setOrganization)
                {
                    await
                    PurchaseOrder1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PurchaseOrder2 = await PurchaseOrders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PurchaseOrder2?.setOrganization)
                {
                    await
                    PurchaseOrder2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePoLineWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const PoLine0 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PoLine0?.setTenant)
                {
                    await
                    PoLine0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const PoLine1 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PoLine1?.setTenant)
                {
                    await
                    PoLine1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const PoLine2 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PoLine2?.setTenant)
                {
                    await
                    PoLine2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associatePoLineWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PoLine0 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PoLine0?.setPurchase_order)
                {
                    await
                    PoLine0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PoLine1 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PoLine1?.setPurchase_order)
                {
                    await
                    PoLine1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const PoLine2 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PoLine2?.setPurchase_order)
                {
                    await
                    PoLine2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePoLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PoLine0 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PoLine0?.setOrganization)
                {
                    await
                    PoLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PoLine1 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PoLine1?.setOrganization)
                {
                    await
                    PoLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PoLine2 = await PoLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PoLine2?.setOrganization)
                {
                    await
                    PoLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateGoodsReceiptNoteWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const GoodsReceiptNote0 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptNote0?.setTenant)
                {
                    await
                    GoodsReceiptNote0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const GoodsReceiptNote1 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptNote1?.setTenant)
                {
                    await
                    GoodsReceiptNote1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const GoodsReceiptNote2 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptNote2?.setTenant)
                {
                    await
                    GoodsReceiptNote2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateGoodsReceiptNoteWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceiptNote0 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptNote0?.setPurchase_order)
                {
                    await
                    GoodsReceiptNote0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceiptNote1 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptNote1?.setPurchase_order)
                {
                    await
                    GoodsReceiptNote1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const GoodsReceiptNote2 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptNote2?.setPurchase_order)
                {
                    await
                    GoodsReceiptNote2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateGoodsReceiptNoteWithReceived_by() {
            
                const relatedReceived_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceiptNote0 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptNote0?.setReceived_by)
                {
                    await
                    GoodsReceiptNote0.
                    setReceived_by(relatedReceived_by0);
                }
            
                const relatedReceived_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceiptNote1 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptNote1?.setReceived_by)
                {
                    await
                    GoodsReceiptNote1.
                    setReceived_by(relatedReceived_by1);
                }
            
                const relatedReceived_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GoodsReceiptNote2 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptNote2?.setReceived_by)
                {
                    await
                    GoodsReceiptNote2.
                    setReceived_by(relatedReceived_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateGoodsReceiptNoteWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptNote0 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GoodsReceiptNote0?.setOrganization)
                {
                    await
                    GoodsReceiptNote0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptNote1 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GoodsReceiptNote1?.setOrganization)
                {
                    await
                    GoodsReceiptNote1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GoodsReceiptNote2 = await GoodsReceiptNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GoodsReceiptNote2?.setOrganization)
                {
                    await
                    GoodsReceiptNote2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateGrnLineWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const GrnLine0 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GrnLine0?.setTenant)
                {
                    await
                    GrnLine0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const GrnLine1 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GrnLine1?.setTenant)
                {
                    await
                    GrnLine1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const GrnLine2 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GrnLine2?.setTenant)
                {
                    await
                    GrnLine2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateGrnLineWithGoods_receipt_note() {
            
                const relatedGoods_receipt_note0 = await GoodsReceiptNotes.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceiptNotes.count())),
                });
                const GrnLine0 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GrnLine0?.setGoods_receipt_note)
                {
                    await
                    GrnLine0.
                    setGoods_receipt_note(relatedGoods_receipt_note0);
                }
            
                const relatedGoods_receipt_note1 = await GoodsReceiptNotes.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceiptNotes.count())),
                });
                const GrnLine1 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GrnLine1?.setGoods_receipt_note)
                {
                    await
                    GrnLine1.
                    setGoods_receipt_note(relatedGoods_receipt_note1);
                }
            
                const relatedGoods_receipt_note2 = await GoodsReceiptNotes.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceiptNotes.count())),
                });
                const GrnLine2 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GrnLine2?.setGoods_receipt_note)
                {
                    await
                    GrnLine2.
                    setGoods_receipt_note(relatedGoods_receipt_note2);
                }
            
        }
        
    
        
            
            async function associateGrnLineWithPo_line() {
            
                const relatedPo_line0 = await PoLines.findOne({
                    offset: Math.floor(Math.random() * (await PoLines.count())),
                });
                const GrnLine0 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GrnLine0?.setPo_line)
                {
                    await
                    GrnLine0.
                    setPo_line(relatedPo_line0);
                }
            
                const relatedPo_line1 = await PoLines.findOne({
                    offset: Math.floor(Math.random() * (await PoLines.count())),
                });
                const GrnLine1 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GrnLine1?.setPo_line)
                {
                    await
                    GrnLine1.
                    setPo_line(relatedPo_line1);
                }
            
                const relatedPo_line2 = await PoLines.findOne({
                    offset: Math.floor(Math.random() * (await PoLines.count())),
                });
                const GrnLine2 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GrnLine2?.setPo_line)
                {
                    await
                    GrnLine2.
                    setPo_line(relatedPo_line2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateGrnLineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GrnLine0 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GrnLine0?.setOrganization)
                {
                    await
                    GrnLine0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GrnLine1 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GrnLine1?.setOrganization)
                {
                    await
                    GrnLine1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const GrnLine2 = await GrnLines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GrnLine2?.setOrganization)
                {
                    await
                    GrnLine2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateServiceAcceptanceNoteWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ServiceAcceptanceNote0 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceAcceptanceNote0?.setTenant)
                {
                    await
                    ServiceAcceptanceNote0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ServiceAcceptanceNote1 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceAcceptanceNote1?.setTenant)
                {
                    await
                    ServiceAcceptanceNote1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ServiceAcceptanceNote2 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceAcceptanceNote2?.setTenant)
                {
                    await
                    ServiceAcceptanceNote2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateServiceAcceptanceNoteWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const ServiceAcceptanceNote0 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceAcceptanceNote0?.setPurchase_order)
                {
                    await
                    ServiceAcceptanceNote0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const ServiceAcceptanceNote1 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceAcceptanceNote1?.setPurchase_order)
                {
                    await
                    ServiceAcceptanceNote1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const ServiceAcceptanceNote2 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceAcceptanceNote2?.setPurchase_order)
                {
                    await
                    ServiceAcceptanceNote2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateServiceAcceptanceNoteWithAccepted_by() {
            
                const relatedAccepted_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ServiceAcceptanceNote0 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceAcceptanceNote0?.setAccepted_by)
                {
                    await
                    ServiceAcceptanceNote0.
                    setAccepted_by(relatedAccepted_by0);
                }
            
                const relatedAccepted_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ServiceAcceptanceNote1 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceAcceptanceNote1?.setAccepted_by)
                {
                    await
                    ServiceAcceptanceNote1.
                    setAccepted_by(relatedAccepted_by1);
                }
            
                const relatedAccepted_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ServiceAcceptanceNote2 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceAcceptanceNote2?.setAccepted_by)
                {
                    await
                    ServiceAcceptanceNote2.
                    setAccepted_by(relatedAccepted_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateServiceAcceptanceNoteWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ServiceAcceptanceNote0 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ServiceAcceptanceNote0?.setOrganization)
                {
                    await
                    ServiceAcceptanceNote0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ServiceAcceptanceNote1 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ServiceAcceptanceNote1?.setOrganization)
                {
                    await
                    ServiceAcceptanceNote1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ServiceAcceptanceNote2 = await ServiceAcceptanceNotes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ServiceAcceptanceNote2?.setOrganization)
                {
                    await
                    ServiceAcceptanceNote2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDiscrepancyCasWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const DiscrepancyCas0 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DiscrepancyCas0?.setTenant)
                {
                    await
                    DiscrepancyCas0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const DiscrepancyCas1 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DiscrepancyCas1?.setTenant)
                {
                    await
                    DiscrepancyCas1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const DiscrepancyCas2 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DiscrepancyCas2?.setTenant)
                {
                    await
                    DiscrepancyCas2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateDiscrepancyCasWithPurchase_order() {
            
                const relatedPurchase_order0 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const DiscrepancyCas0 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DiscrepancyCas0?.setPurchase_order)
                {
                    await
                    DiscrepancyCas0.
                    setPurchase_order(relatedPurchase_order0);
                }
            
                const relatedPurchase_order1 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const DiscrepancyCas1 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DiscrepancyCas1?.setPurchase_order)
                {
                    await
                    DiscrepancyCas1.
                    setPurchase_order(relatedPurchase_order1);
                }
            
                const relatedPurchase_order2 = await PurchaseOrders.findOne({
                    offset: Math.floor(Math.random() * (await PurchaseOrders.count())),
                });
                const DiscrepancyCas2 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DiscrepancyCas2?.setPurchase_order)
                {
                    await
                    DiscrepancyCas2.
                    setPurchase_order(relatedPurchase_order2);
                }
            
        }
        
    
        
            
            async function associateDiscrepancyCasWithGoods_receipt_note() {
            
                const relatedGoods_receipt_note0 = await GoodsReceiptNotes.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceiptNotes.count())),
                });
                const DiscrepancyCas0 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DiscrepancyCas0?.setGoods_receipt_note)
                {
                    await
                    DiscrepancyCas0.
                    setGoods_receipt_note(relatedGoods_receipt_note0);
                }
            
                const relatedGoods_receipt_note1 = await GoodsReceiptNotes.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceiptNotes.count())),
                });
                const DiscrepancyCas1 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DiscrepancyCas1?.setGoods_receipt_note)
                {
                    await
                    DiscrepancyCas1.
                    setGoods_receipt_note(relatedGoods_receipt_note1);
                }
            
                const relatedGoods_receipt_note2 = await GoodsReceiptNotes.findOne({
                    offset: Math.floor(Math.random() * (await GoodsReceiptNotes.count())),
                });
                const DiscrepancyCas2 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DiscrepancyCas2?.setGoods_receipt_note)
                {
                    await
                    DiscrepancyCas2.
                    setGoods_receipt_note(relatedGoods_receipt_note2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDiscrepancyCasWithReported_by() {
            
                const relatedReported_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const DiscrepancyCas0 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DiscrepancyCas0?.setReported_by)
                {
                    await
                    DiscrepancyCas0.
                    setReported_by(relatedReported_by0);
                }
            
                const relatedReported_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const DiscrepancyCas1 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DiscrepancyCas1?.setReported_by)
                {
                    await
                    DiscrepancyCas1.
                    setReported_by(relatedReported_by1);
                }
            
                const relatedReported_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const DiscrepancyCas2 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DiscrepancyCas2?.setReported_by)
                {
                    await
                    DiscrepancyCas2.
                    setReported_by(relatedReported_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateDiscrepancyCasWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DiscrepancyCas0 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DiscrepancyCas0?.setOrganization)
                {
                    await
                    DiscrepancyCas0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DiscrepancyCas1 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DiscrepancyCas1?.setOrganization)
                {
                    await
                    DiscrepancyCas1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DiscrepancyCas2 = await DiscrepancyCases.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DiscrepancyCas2?.setOrganization)
                {
                    await
                    DiscrepancyCas2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateArchiveItemWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ArchiveItem0 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArchiveItem0?.setTenant)
                {
                    await
                    ArchiveItem0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ArchiveItem1 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArchiveItem1?.setTenant)
                {
                    await
                    ArchiveItem1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ArchiveItem2 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArchiveItem2?.setTenant)
                {
                    await
                    ArchiveItem2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateArchiveItemWithArchived_by() {
            
                const relatedArchived_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ArchiveItem0 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArchiveItem0?.setArchived_by)
                {
                    await
                    ArchiveItem0.
                    setArchived_by(relatedArchived_by0);
                }
            
                const relatedArchived_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ArchiveItem1 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArchiveItem1?.setArchived_by)
                {
                    await
                    ArchiveItem1.
                    setArchived_by(relatedArchived_by1);
                }
            
                const relatedArchived_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ArchiveItem2 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArchiveItem2?.setArchived_by)
                {
                    await
                    ArchiveItem2.
                    setArchived_by(relatedArchived_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateArchiveItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ArchiveItem0 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArchiveItem0?.setOrganization)
                {
                    await
                    ArchiveItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ArchiveItem1 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArchiveItem1?.setOrganization)
                {
                    await
                    ArchiveItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ArchiveItem2 = await ArchiveItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArchiveItem2?.setOrganization)
                {
                    await
                    ArchiveItem2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAccessLogWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const AccessLog0 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccessLog0?.setTenant)
                {
                    await
                    AccessLog0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const AccessLog1 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccessLog1?.setTenant)
                {
                    await
                    AccessLog1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const AccessLog2 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccessLog2?.setTenant)
                {
                    await
                    AccessLog2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateAccessLogWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccessLog0 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccessLog0?.setUser)
                {
                    await
                    AccessLog0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccessLog1 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccessLog1?.setUser)
                {
                    await
                    AccessLog1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccessLog2 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccessLog2?.setUser)
                {
                    await
                    AccessLog2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAccessLogWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AccessLog0 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccessLog0?.setOrganization)
                {
                    await
                    AccessLog0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AccessLog1 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccessLog1?.setOrganization)
                {
                    await
                    AccessLog1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AccessLog2 = await AccessLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccessLog2?.setOrganization)
                {
                    await
                    AccessLog2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateNotificationWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setTenant)
                {
                    await
                    Notification0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setTenant)
                {
                    await
                    Notification1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setTenant)
                {
                    await
                    Notification2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateNotificationWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setUser)
                {
                    await
                    Notification0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setUser)
                {
                    await
                    Notification1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setUser)
                {
                    await
                    Notification2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateNotificationWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setOrganization)
                {
                    await
                    Notification0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setOrganization)
                {
                    await
                    Notification1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setOrganization)
                {
                    await
                    Notification2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

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

    
    
    
        
            
            async function associateExportJobWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ExportJob0 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExportJob0?.setTenant)
                {
                    await
                    ExportJob0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ExportJob1 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExportJob1?.setTenant)
                {
                    await
                    ExportJob1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const ExportJob2 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExportJob2?.setTenant)
                {
                    await
                    ExportJob2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateExportJobWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ExportJob0 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExportJob0?.setRequested_by)
                {
                    await
                    ExportJob0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ExportJob1 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExportJob1?.setRequested_by)
                {
                    await
                    ExportJob1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ExportJob2 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExportJob2?.setRequested_by)
                {
                    await
                    ExportJob2.
                    setRequested_by(relatedRequested_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExportJobWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExportJob0 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExportJob0?.setOrganization)
                {
                    await
                    ExportJob0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExportJob1 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExportJob1?.setOrganization)
                {
                    await
                    ExportJob1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ExportJob2 = await ExportJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExportJob2?.setOrganization)
                {
                    await
                    ExportJob2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSessionWithTenant() {
            
                const relatedTenant0 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Session0 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Session0?.setTenant)
                {
                    await
                    Session0.
                    setTenant(relatedTenant0);
                }
            
                const relatedTenant1 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Session1 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Session1?.setTenant)
                {
                    await
                    Session1.
                    setTenant(relatedTenant1);
                }
            
                const relatedTenant2 = await Tenants.findOne({
                    offset: Math.floor(Math.random() * (await Tenants.count())),
                });
                const Session2 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Session2?.setTenant)
                {
                    await
                    Session2.
                    setTenant(relatedTenant2);
                }
            
        }
        
    
        
            
            async function associateSessionWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Session0 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Session0?.setUser)
                {
                    await
                    Session0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Session1 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Session1?.setUser)
                {
                    await
                    Session1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Session2 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Session2?.setUser)
                {
                    await
                    Session2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSessionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Session0 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Session0?.setOrganization)
                {
                    await
                    Session0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Session1 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Session1?.setOrganization)
                {
                    await
                    Session1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Session2 = await Sessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Session2?.setOrganization)
                {
                    await
                    Session2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Tenants.bulkCreate(TenantsData);
                
            
            
                
                await Departments.bulkCreate(DepartmentsData);
                
            
            
                
                await Projects.bulkCreate(ProjectsData);
                
            
            
                
                await BudgetLines.bulkCreate(BudgetLinesData);
                
            
            
                
                await WorkflowRules.bulkCreate(WorkflowRulesData);
                
            
            
                
                await CurrencyRates.bulkCreate(CurrencyRatesData);
                
            
            
                
                await Requisitions.bulkCreate(RequisitionsData);
                
            
            
                
                await ApprovalSteps.bulkCreate(ApprovalStepsData);
                
            
            
                
                await ProcurementCases.bulkCreate(ProcurementCasesData);
                
            
            
                
                await Suppliers.bulkCreate(SuppliersData);
                
            
            
                
                await SupplierCategories.bulkCreate(SupplierCategoriesData);
                
            
            
                
                await SupplierDiligenceChecks.bulkCreate(SupplierDiligenceChecksData);
                
            
            
                
                await TenderEvents.bulkCreate(TenderEventsData);
                
            
            
                
                await SupplierOffers.bulkCreate(SupplierOffersData);
                
            
            
                
                await BidCriteria.bulkCreate(BidCriteriaData);
                
            
            
                
                await OfferScores.bulkCreate(OfferScoresData);
                
            
            
                
                await Awards.bulkCreate(AwardsData);
                
            
            
                
                await PurchaseOrders.bulkCreate(PurchaseOrdersData);
                
            
            
                
                await PoLines.bulkCreate(PoLinesData);
                
            
            
                
                await GoodsReceiptNotes.bulkCreate(GoodsReceiptNotesData);
                
            
            
                
                await GrnLines.bulkCreate(GrnLinesData);
                
            
            
                
                await ServiceAcceptanceNotes.bulkCreate(ServiceAcceptanceNotesData);
                
            
            
                
                await DiscrepancyCases.bulkCreate(DiscrepancyCasesData);
                
            
            
                
                await ArchiveItems.bulkCreate(ArchiveItemsData);
                
            
            
                
                await AccessLogs.bulkCreate(AccessLogsData);
                
            
            
                
                await Notifications.bulkCreate(NotificationsData);
                
            
            
                
                await AuditEvents.bulkCreate(AuditEventsData);
                
            
            
                
                await ExportJobs.bulkCreate(ExportJobsData);
                
            
            
                
                await Sessions.bulkCreate(SessionsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateTenantWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDepartmentWithTenant(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDepartmentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateProjectWithTenant(),
                    
                
                    
                        
                        await associateProjectWithDepartment(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProjectWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBudgetLineWithTenant(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBudgetLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWorkflowRuleWithTenant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWorkflowRuleWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCurrencyRateWithTenant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCurrencyRateWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateRequisitionWithTenant(),
                    
                
                    
                
                    
                        
                        await associateRequisitionWithRequester(),
                    
                
                    
                        
                        await associateRequisitionWithDepartment(),
                    
                
                    
                        
                        await associateRequisitionWithProject(),
                    
                
                    
                        
                        await associateRequisitionWithBudget_line(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRequisitionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateApprovalStepWithTenant(),
                    
                
                    
                        
                        await associateApprovalStepWithRequisition(),
                    
                
                    
                
                    
                        
                        await associateApprovalStepWithAssigned_approver(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateApprovalStepWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateProcurementCasWithTenant(),
                    
                
                    
                        
                        await associateProcurementCasWithRequisition(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProcurementCasWithOwner(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateProcurementCasWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSupplierWithTenant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSupplierWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSupplierCategoryWithTenant(),
                    
                
                    
                
                    
                
                    
                        
                        await associateSupplierCategoryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSupplierDiligenceCheckWithTenant(),
                    
                
                    
                        
                        await associateSupplierDiligenceCheckWithSupplier(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSupplierDiligenceCheckWithChecked_by(),
                    
                
                    
                
                    
                        
                        await associateSupplierDiligenceCheckWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTenderEventWithTenant(),
                    
                
                    
                        
                        await associateTenderEventWithProcurement_case(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateTenderEventWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSupplierOfferWithTenant(),
                    
                
                    
                        
                        await associateSupplierOfferWithProcurement_case(),
                    
                
                    
                        
                        await associateSupplierOfferWithSupplier(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSupplierOfferWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBidCriteriaWithTenant(),
                    
                
                    
                        
                        await associateBidCriteriaWithProcurement_case(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBidCriteriaWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateOfferScoreWithTenant(),
                    
                
                    
                        
                        await associateOfferScoreWithSupplier_offer(),
                    
                
                    
                        
                        await associateOfferScoreWithBid_criterion(),
                    
                
                    
                
                    
                
                    
                        
                        await associateOfferScoreWithScored_by(),
                    
                
                    
                
                    
                        
                        await associateOfferScoreWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAwardWithTenant(),
                    
                
                    
                        
                        await associateAwardWithProcurement_case(),
                    
                
                    
                        
                        await associateAwardWithWinning_offer(),
                    
                
                    
                        
                        await associateAwardWithAwarded_supplier(),
                    
                
                    
                
                    
                
                    
                        
                        await associateAwardWithAwarded_by(),
                    
                
                    
                
                    
                
                    
                        
                        await associateAwardWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePurchaseOrderWithTenant(),
                    
                
                    
                        
                        await associatePurchaseOrderWithRequisition(),
                    
                
                    
                        
                        await associatePurchaseOrderWithSupplier(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePurchaseOrderWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePoLineWithTenant(),
                    
                
                    
                        
                        await associatePoLineWithPurchase_order(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePoLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateGoodsReceiptNoteWithTenant(),
                    
                
                    
                        
                        await associateGoodsReceiptNoteWithPurchase_order(),
                    
                
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptNoteWithReceived_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGoodsReceiptNoteWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateGrnLineWithTenant(),
                    
                
                    
                        
                        await associateGrnLineWithGoods_receipt_note(),
                    
                
                    
                        
                        await associateGrnLineWithPo_line(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGrnLineWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateServiceAcceptanceNoteWithTenant(),
                    
                
                    
                        
                        await associateServiceAcceptanceNoteWithPurchase_order(),
                    
                
                    
                
                    
                
                    
                        
                        await associateServiceAcceptanceNoteWithAccepted_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateServiceAcceptanceNoteWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDiscrepancyCasWithTenant(),
                    
                
                    
                        
                        await associateDiscrepancyCasWithPurchase_order(),
                    
                
                    
                        
                        await associateDiscrepancyCasWithGoods_receipt_note(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDiscrepancyCasWithReported_by(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDiscrepancyCasWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateArchiveItemWithTenant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateArchiveItemWithArchived_by(),
                    
                
                    
                
                    
                        
                        await associateArchiveItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAccessLogWithTenant(),
                    
                
                    
                        
                        await associateAccessLogWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAccessLogWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateNotificationWithTenant(),
                    
                
                    
                        
                        await associateNotificationWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNotificationWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAuditEventWithTenant(),
                    
                
                    
                
                    
                
                    
                        
                        await associateAuditEventWithActor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAuditEventWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateExportJobWithTenant(),
                    
                
                    
                        
                        await associateExportJobWithRequested_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExportJobWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSessionWithTenant(),
                    
                
                    
                        
                        await associateSessionWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSessionWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('tenants', null, {});
            
            
            await queryInterface.bulkDelete('departments', null, {});
            
            
            await queryInterface.bulkDelete('projects', null, {});
            
            
            await queryInterface.bulkDelete('budget_lines', null, {});
            
            
            await queryInterface.bulkDelete('workflow_rules', null, {});
            
            
            await queryInterface.bulkDelete('currency_rates', null, {});
            
            
            await queryInterface.bulkDelete('requisitions', null, {});
            
            
            await queryInterface.bulkDelete('approval_steps', null, {});
            
            
            await queryInterface.bulkDelete('procurement_cases', null, {});
            
            
            await queryInterface.bulkDelete('suppliers', null, {});
            
            
            await queryInterface.bulkDelete('supplier_categories', null, {});
            
            
            await queryInterface.bulkDelete('supplier_diligence_checks', null, {});
            
            
            await queryInterface.bulkDelete('tender_events', null, {});
            
            
            await queryInterface.bulkDelete('supplier_offers', null, {});
            
            
            await queryInterface.bulkDelete('bid_criteria', null, {});
            
            
            await queryInterface.bulkDelete('offer_scores', null, {});
            
            
            await queryInterface.bulkDelete('awards', null, {});
            
            
            await queryInterface.bulkDelete('purchase_orders', null, {});
            
            
            await queryInterface.bulkDelete('po_lines', null, {});
            
            
            await queryInterface.bulkDelete('goods_receipt_notes', null, {});
            
            
            await queryInterface.bulkDelete('grn_lines', null, {});
            
            
            await queryInterface.bulkDelete('service_acceptance_notes', null, {});
            
            
            await queryInterface.bulkDelete('discrepancy_cases', null, {});
            
            
            await queryInterface.bulkDelete('archive_items', null, {});
            
            
            await queryInterface.bulkDelete('access_logs', null, {});
            
            
            await queryInterface.bulkDelete('notifications', null, {});
            
            
            await queryInterface.bulkDelete('audit_events', null, {});
            
            
            await queryInterface.bulkDelete('export_jobs', null, {});
            
            
            await queryInterface.bulkDelete('sessions', null, {});
            
        
    },
};