





















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






const Organizations = db.organizations;

const Companies = db.companies;

const Branches = db.branches;

const VehicleCategories = db.vehicle_categories;

const Vehicles = db.vehicles;

const RatePlans = db.rate_plans;

const RateRules = db.rate_rules;

const Extras = db.extras;

const InsurancePlans = db.insurance_plans;

const PromoCodes = db.promo_codes;

const Bookings = db.bookings;

const BookingExtras = db.booking_extras;

const Payments = db.payments;

const Invoices = db.invoices;

const Messages = db.messages;

const NotificationTemplates = db.notification_templates;

const Tasks = db.tasks;

const MaintenanceRecords = db.maintenance_records;

const CustomerDocuments = db.customer_documents;

const AuditEvents = db.audit_events;







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



const CompaniesData = [
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "legal_name": "Marie Curie",
            
        
    
        
        
            
                "tax_number": "Grace Hopper",
            
        
    
        
        
            
                "support_email": "Ada Lovelace",
            
        
    
        
        
            
                "support_phone": "Marie Curie",
            
        
    
        
        
            
                "website": "Grace Hopper",
            
        
    
        
        
            
                "timezone": "Alan Turing",
            
        
    
        
        
            
                "default_currency": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "legal_name": "Grace Hopper",
            
        
    
        
        
            
                "tax_number": "Marie Curie",
            
        
    
        
        
            
                "support_email": "Grace Hopper",
            
        
    
        
        
            
                "support_phone": "Marie Curie",
            
        
    
        
        
            
                "website": "Alan Turing",
            
        
    
        
        
            
                "timezone": "Alan Turing",
            
        
    
        
        
            
                "default_currency": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "legal_name": "Alan Turing",
            
        
    
        
        
            
                "tax_number": "Grace Hopper",
            
        
    
        
        
            
                "support_email": "Marie Curie",
            
        
    
        
        
            
                "support_phone": "Grace Hopper",
            
        
    
        
        
            
                "website": "Marie Curie",
            
        
    
        
        
            
                "timezone": "Alan Turing",
            
        
    
        
        
            
                "default_currency": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BranchesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "address_line1": "Ada Lovelace",
            
        
    
        
        
            
                "address_line2": "Marie Curie",
            
        
    
        
        
            
                "city": "Ada Lovelace",
            
        
    
        
        
            
                "state": "Alan Turing",
            
        
    
        
        
            
                "postal_code": "Alan Turing",
            
        
    
        
        
            
                "country": "Grace Hopper",
            
        
    
        
        
            
                "latitude": 9.12,
            
        
    
        
        
            
                "longitude": 9.46,
            
        
    
        
        
            
                "opening_hours": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "phone": "Marie Curie",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "address_line1": "Grace Hopper",
            
        
    
        
        
            
                "address_line2": "Alan Turing",
            
        
    
        
        
            
                "city": "Marie Curie",
            
        
    
        
        
            
                "state": "Grace Hopper",
            
        
    
        
        
            
                "postal_code": "Marie Curie",
            
        
    
        
        
            
                "country": "Alan Turing",
            
        
    
        
        
            
                "latitude": 6.64,
            
        
    
        
        
            
                "longitude": 9.42,
            
        
    
        
        
            
                "opening_hours": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "phone": "Ada Lovelace",
            
        
    
        
        
            
                "email": "Ada Lovelace",
            
        
    
        
        
            
                "address_line1": "Ada Lovelace",
            
        
    
        
        
            
                "address_line2": "Marie Curie",
            
        
    
        
        
            
                "city": "Marie Curie",
            
        
    
        
        
            
                "state": "Alan Turing",
            
        
    
        
        
            
                "postal_code": "Ada Lovelace",
            
        
    
        
        
            
                "country": "Alan Turing",
            
        
    
        
        
            
                "latitude": 1.27,
            
        
    
        
        
            
                "longitude": 6.05,
            
        
    
        
        
            
                "opening_hours": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const VehicleCategoriesData = [
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "transmission": "manual",
            
        
    
        
        
            
                "fuel_type": "any",
            
        
    
        
        
            
                "seats": 2,
            
        
    
        
        
            
                "doors": 5,
            
        
    
        
        
            
                "large_bags": 2,
            
        
    
        
        
            
                "small_bags": 9,
            
        
    
        
        
            
                "has_air_conditioning": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "transmission": "automatic",
            
        
    
        
        
            
                "fuel_type": "diesel",
            
        
    
        
        
            
                "seats": 3,
            
        
    
        
        
            
                "doors": 5,
            
        
    
        
        
            
                "large_bags": 4,
            
        
    
        
        
            
                "small_bags": 7,
            
        
    
        
        
            
                "has_air_conditioning": true,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "transmission": "manual",
            
        
    
        
        
            
                "fuel_type": "diesel",
            
        
    
        
        
            
                "seats": 9,
            
        
    
        
        
            
                "doors": 2,
            
        
    
        
        
            
                "large_bags": 8,
            
        
    
        
        
            
                "small_bags": 3,
            
        
    
        
        
            
                "has_air_conditioning": false,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const VehiclesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "display_name": "Marie Curie",
            
        
    
        
        
            
                "make": "Marie Curie",
            
        
    
        
        
            
                "model": "Ada Lovelace",
            
        
    
        
        
            
                "year_label": "Marie Curie",
            
        
    
        
        
            
                "vin": "Alan Turing",
            
        
    
        
        
            
                "license_plate": "Alan Turing",
            
        
    
        
        
            
                "status": "rented",
            
        
    
        
        
            
                "odometer_km": 1,
            
        
    
        
        
            
                "fuel_policy": "full_to_full",
            
        
    
        
        
            
                "color": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "features": "Marie Curie",
            
        
    
        
        
            
                "next_service_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_listed": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "display_name": "Marie Curie",
            
        
    
        
        
            
                "make": "Grace Hopper",
            
        
    
        
        
            
                "model": "Marie Curie",
            
        
    
        
        
            
                "year_label": "Marie Curie",
            
        
    
        
        
            
                "vin": "Marie Curie",
            
        
    
        
        
            
                "license_plate": "Marie Curie",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                "odometer_km": 4,
            
        
    
        
        
            
                "fuel_policy": "free_tank",
            
        
    
        
        
            
                "color": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "features": "Grace Hopper",
            
        
    
        
        
            
                "next_service_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_listed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "display_name": "Marie Curie",
            
        
    
        
        
            
                "make": "Alan Turing",
            
        
    
        
        
            
                "model": "Marie Curie",
            
        
    
        
        
            
                "year_label": "Marie Curie",
            
        
    
        
        
            
                "vin": "Ada Lovelace",
            
        
    
        
        
            
                "license_plate": "Marie Curie",
            
        
    
        
        
            
                "status": "available",
            
        
    
        
        
            
                "odometer_km": 5,
            
        
    
        
        
            
                "fuel_policy": "free_tank",
            
        
    
        
        
            
                "color": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "features": "Alan Turing",
            
        
    
        
        
            
                "next_service_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_listed": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RatePlansData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "pricing_model": "daily",
            
        
    
        
        
            
                "base_rate": 7.52,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "included_km_per_day": 7,
            
        
    
        
        
            
                "extra_km_fee": 9.65,
            
        
    
        
        
            
                "deposit_amount": 2.88,
            
        
    
        
        
            
                "requires_deposit": false,
            
        
    
        
        
            
                "terms": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "pricing_model": "hourly",
            
        
    
        
        
            
                "base_rate": 3.22,
            
        
    
        
        
            
                "currency": "Marie Curie",
            
        
    
        
        
            
                "included_km_per_day": 5,
            
        
    
        
        
            
                "extra_km_fee": 2.04,
            
        
    
        
        
            
                "deposit_amount": 8.3,
            
        
    
        
        
            
                "requires_deposit": true,
            
        
    
        
        
            
                "terms": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "pricing_model": "weekly",
            
        
    
        
        
            
                "base_rate": 2.22,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "included_km_per_day": 1,
            
        
    
        
        
            
                "extra_km_fee": 4.34,
            
        
    
        
        
            
                "deposit_amount": 5.31,
            
        
    
        
        
            
                "requires_deposit": true,
            
        
    
        
        
            
                "terms": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RateRulesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "day_type": "holiday",
            
        
    
        
        
            
                "rate_override": 3.66,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "day_type": "weekend",
            
        
    
        
        
            
                "rate_override": 0.58,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "day_type": "weekday",
            
        
    
        
        
            
                "rate_override": 0.41,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExtrasData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "billing_type": "per_rental",
            
        
    
        
        
            
                "price": 1.36,
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                "max_quantity": 1,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "billing_type": "per_hour",
            
        
    
        
        
            
                "price": 1.16,
            
        
    
        
        
            
                "currency": "Alan Turing",
            
        
    
        
        
            
                "max_quantity": 2,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "billing_type": "per_day",
            
        
    
        
        
            
                "price": 6.44,
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                "max_quantity": 6,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const InsurancePlansData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "billing_type": "per_rental",
            
        
    
        
        
            
                "price": 0.59,
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                "deductible_amount": 9.26,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "billing_type": "per_day",
            
        
    
        
        
            
                "price": 8.2,
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                "deductible_amount": 9.46,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "billing_type": "per_day",
            
        
    
        
        
            
                "price": 9.77,
            
        
    
        
        
            
                "currency": "Marie Curie",
            
        
    
        
        
            
                "deductible_amount": 6.64,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PromoCodesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "Alan Turing",
            
        
    
        
        
            
                "discount_type": "percent",
            
        
    
        
        
            
                "discount_value": 9.89,
            
        
    
        
        
            
                "min_subtotal": 6.1,
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "usage_limit": 3,
            
        
    
        
        
            
                "usage_count": 5,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "discount_type": "percent",
            
        
    
        
        
            
                "discount_value": 1.5,
            
        
    
        
        
            
                "min_subtotal": 1.5,
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "usage_limit": 1,
            
        
    
        
        
            
                "usage_count": 2,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "code": "Marie Curie",
            
        
    
        
        
            
                "discount_type": "fixed_amount",
            
        
    
        
        
            
                "discount_value": 6.95,
            
        
    
        
        
            
                "min_subtotal": 3.13,
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "usage_limit": 3,
            
        
    
        
        
            
                "usage_count": 1,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BookingsData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "pickup_at": new Date(Date.now()),
            
        
    
        
        
            
                "dropoff_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "pending_payment",
            
        
    
        
        
            
                "payment_status": "failed",
            
        
    
        
        
            
                "subtotal_amount": 7.02,
            
        
    
        
        
            
                "extras_amount": 6.37,
            
        
    
        
        
            
                "insurance_amount": 5.03,
            
        
    
        
        
            
                "discount_amount": 9.04,
            
        
    
        
        
            
                "tax_amount": 0.1,
            
        
    
        
        
            
                "total_amount": 2.33,
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                "customer_notes": "Ada Lovelace",
            
        
    
        
        
            
                "internal_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "pickup_at": new Date(Date.now()),
            
        
    
        
        
            
                "dropoff_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "pending_payment",
            
        
    
        
        
            
                "payment_status": "failed",
            
        
    
        
        
            
                "subtotal_amount": 9.71,
            
        
    
        
        
            
                "extras_amount": 6.95,
            
        
    
        
        
            
                "insurance_amount": 1.37,
            
        
    
        
        
            
                "discount_amount": 0.19,
            
        
    
        
        
            
                "tax_amount": 6.84,
            
        
    
        
        
            
                "total_amount": 5.24,
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                "customer_notes": "Ada Lovelace",
            
        
    
        
        
            
                "internal_notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "pickup_at": new Date(Date.now()),
            
        
    
        
        
            
                "dropoff_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "no_show",
            
        
    
        
        
            
                "payment_status": "paid",
            
        
    
        
        
            
                "subtotal_amount": 5.19,
            
        
    
        
        
            
                "extras_amount": 8.85,
            
        
    
        
        
            
                "insurance_amount": 8.15,
            
        
    
        
        
            
                "discount_amount": 4.78,
            
        
    
        
        
            
                "tax_amount": 0.78,
            
        
    
        
        
            
                "total_amount": 4.39,
            
        
    
        
        
            
                "currency": "Alan Turing",
            
        
    
        
        
            
                "customer_notes": "Ada Lovelace",
            
        
    
        
        
            
                "internal_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BookingExtrasData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 4,
            
        
    
        
        
            
                "unit_price": 7.5,
            
        
    
        
        
            
                "line_total": 0.56,
            
        
    
        
        
            
                "currency": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 7,
            
        
    
        
        
            
                "unit_price": 7.81,
            
        
    
        
        
            
                "line_total": 5.13,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 6,
            
        
    
        
        
            
                "unit_price": 7.77,
            
        
    
        
        
            
                "line_total": 9.88,
            
        
    
        
        
            
                "currency": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "bank_transfer",
            
        
    
        
        
            
                "payment_type": "authorization",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "amount": 6.96,
            
        
    
        
        
            
                "currency": "Alan Turing",
            
        
    
        
        
            
                "provider_reference": "Grace Hopper",
            
        
    
        
        
            
                "processed_at": new Date(Date.now()),
            
        
    
        
        
            
                "failure_reason": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "bank_transfer",
            
        
    
        
        
            
                "payment_type": "refund",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "amount": 4.44,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "provider_reference": "Alan Turing",
            
        
    
        
        
            
                "processed_at": new Date(Date.now()),
            
        
    
        
        
            
                "failure_reason": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "cash",
            
        
    
        
        
            
                "payment_type": "charge",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "amount": 1.01,
            
        
    
        
        
            
                "currency": "Marie Curie",
            
        
    
        
        
            
                "provider_reference": "Ada Lovelace",
            
        
    
        
        
            
                "processed_at": new Date(Date.now()),
            
        
    
        
        
            
                "failure_reason": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const InvoicesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Ada Lovelace",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal_amount": 0.12,
            
        
    
        
        
            
                "tax_amount": 3.91,
            
        
    
        
        
            
                "total_amount": 6.91,
            
        
    
        
        
            
                "currency": "Marie Curie",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Grace Hopper",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal_amount": 0.13,
            
        
    
        
        
            
                "tax_amount": 2.66,
            
        
    
        
        
            
                "total_amount": 8.55,
            
        
    
        
        
            
                "currency": "Marie Curie",
            
        
    
        
        
            
                "status": "void",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "Marie Curie",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "subtotal_amount": 9.74,
            
        
    
        
        
            
                "tax_amount": 4.71,
            
        
    
        
        
            
                "total_amount": 6.96,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "status": "issued",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "direction": "inbound",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "subject": "Marie Curie",
            
        
    
        
        
            
                "body": "Alan Turing",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "provider_message_reference": "Marie Curie",
            
        
    
        
        
            
                "error_details": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "whatsapp",
            
        
    
        
        
            
                "direction": "inbound",
            
        
    
        
        
            
                "status": "delivered",
            
        
    
        
        
            
                "subject": "Grace Hopper",
            
        
    
        
        
            
                "body": "Marie Curie",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "provider_message_reference": "Ada Lovelace",
            
        
    
        
        
            
                "error_details": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "whatsapp",
            
        
    
        
        
            
                "direction": "inbound",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "subject": "Grace Hopper",
            
        
    
        
        
            
                "body": "Grace Hopper",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "provider_message_reference": "Grace Hopper",
            
        
    
        
        
            
                "error_details": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const NotificationTemplatesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "channel": "whatsapp",
            
        
    
        
        
            
                "event_key": "payment_succeeded",
            
        
    
        
        
            
                "subject_template": "Marie Curie",
            
        
    
        
        
            
                "body_template": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "channel": "sms",
            
        
    
        
        
            
                "event_key": "pickup_reminder",
            
        
    
        
        
            
                "subject_template": "Ada Lovelace",
            
        
    
        
        
            
                "body_template": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "channel": "whatsapp",
            
        
    
        
        
            
                "event_key": "dropoff_reminder",
            
        
    
        
        
            
                "subject_template": "Grace Hopper",
            
        
    
        
        
            
                "body_template": "Marie Curie",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TasksData = [
    
    {
    
        
        
            
                // 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
            
        
    
        
        
            
                "task_type": "customer_support",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "task_type": "cleaning",
            
        
    
        
        
            
                "status": "blocked",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "task_type": "delivery",
            
        
    
        
        
            
                "status": "in_progress",
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MaintenanceRecordsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "maintenance_type": "other",
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "odometer_km": 8,
            
        
    
        
        
            
                "cost_amount": 1.49,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "maintenance_type": "tire_change",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "odometer_km": 4,
            
        
    
        
        
            
                "cost_amount": 2.08,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "maintenance_type": "inspection",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "odometer_km": 7,
            
        
    
        
        
            
                "cost_amount": 4.22,
            
        
    
        
        
            
                "currency": "Ada Lovelace",
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CustomerDocumentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_type": "passport",
            
        
    
        
        
            
                "document_number": "Ada Lovelace",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "verification_status": "rejected",
            
        
    
        
        
            
                "verification_notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_type": "passport",
            
        
    
        
        
            
                "document_number": "Marie Curie",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "verification_status": "pending",
            
        
    
        
        
            
                "verification_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "document_type": "other",
            
        
    
        
        
            
                "document_number": "Alan Turing",
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "verification_status": "verified",
            
        
    
        
        
            
                "verification_notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AuditEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "message",
            
        
    
        
        
            
                "entity_reference": "Grace Hopper",
            
        
    
        
        
            
                "action": "logout",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "vehicle",
            
        
    
        
        
            
                "entity_reference": "Marie Curie",
            
        
    
        
        
            
                "action": "logout",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "entity_type": "vehicle",
            
        
    
        
        
            
                "entity_reference": "Marie Curie",
            
        
    
        
        
            
                "action": "logout",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




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

    
    
    
    
    
        
    

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

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

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateVehicleCategoryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VehicleCategory0 = await VehicleCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VehicleCategory0?.setOrganization)
                {
                    await
                    VehicleCategory0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VehicleCategory1 = await VehicleCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VehicleCategory1?.setOrganization)
                {
                    await
                    VehicleCategory1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const VehicleCategory2 = await VehicleCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VehicleCategory2?.setOrganization)
                {
                    await
                    VehicleCategory2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateVehicleWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vehicle0 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vehicle0?.setCompany)
                {
                    await
                    Vehicle0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vehicle1 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vehicle1?.setCompany)
                {
                    await
                    Vehicle1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Vehicle2 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vehicle2?.setCompany)
                {
                    await
                    Vehicle2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateVehicleWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Vehicle0 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vehicle0?.setBranch)
                {
                    await
                    Vehicle0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Vehicle1 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vehicle1?.setBranch)
                {
                    await
                    Vehicle1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Vehicle2 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vehicle2?.setBranch)
                {
                    await
                    Vehicle2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
            
            async function associateVehicleWithCategory() {
            
                const relatedCategory0 = await VehicleCategories.findOne({
                    offset: Math.floor(Math.random() * (await VehicleCategories.count())),
                });
                const Vehicle0 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vehicle0?.setCategory)
                {
                    await
                    Vehicle0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await VehicleCategories.findOne({
                    offset: Math.floor(Math.random() * (await VehicleCategories.count())),
                });
                const Vehicle1 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vehicle1?.setCategory)
                {
                    await
                    Vehicle1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await VehicleCategories.findOne({
                    offset: Math.floor(Math.random() * (await VehicleCategories.count())),
                });
                const Vehicle2 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vehicle2?.setCategory)
                {
                    await
                    Vehicle2.
                    setCategory(relatedCategory2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateVehicleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vehicle0 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Vehicle0?.setOrganization)
                {
                    await
                    Vehicle0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vehicle1 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Vehicle1?.setOrganization)
                {
                    await
                    Vehicle1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Vehicle2 = await Vehicles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Vehicle2?.setOrganization)
                {
                    await
                    Vehicle2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateRatePlanWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const RatePlan0 = await RatePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RatePlan0?.setCompany)
                {
                    await
                    RatePlan0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const RatePlan1 = await RatePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RatePlan1?.setCompany)
                {
                    await
                    RatePlan1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const RatePlan2 = await RatePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RatePlan2?.setCompany)
                {
                    await
                    RatePlan2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateRatePlanWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RatePlan0 = await RatePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RatePlan0?.setOrganization)
                {
                    await
                    RatePlan0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RatePlan1 = await RatePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RatePlan1?.setOrganization)
                {
                    await
                    RatePlan1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RatePlan2 = await RatePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RatePlan2?.setOrganization)
                {
                    await
                    RatePlan2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateRateRuleWithRate_plan() {
            
                const relatedRate_plan0 = await RatePlans.findOne({
                    offset: Math.floor(Math.random() * (await RatePlans.count())),
                });
                const RateRule0 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RateRule0?.setRate_plan)
                {
                    await
                    RateRule0.
                    setRate_plan(relatedRate_plan0);
                }
            
                const relatedRate_plan1 = await RatePlans.findOne({
                    offset: Math.floor(Math.random() * (await RatePlans.count())),
                });
                const RateRule1 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RateRule1?.setRate_plan)
                {
                    await
                    RateRule1.
                    setRate_plan(relatedRate_plan1);
                }
            
                const relatedRate_plan2 = await RatePlans.findOne({
                    offset: Math.floor(Math.random() * (await RatePlans.count())),
                });
                const RateRule2 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RateRule2?.setRate_plan)
                {
                    await
                    RateRule2.
                    setRate_plan(relatedRate_plan2);
                }
            
        }
        
    
        
            
            async function associateRateRuleWithCategory() {
            
                const relatedCategory0 = await VehicleCategories.findOne({
                    offset: Math.floor(Math.random() * (await VehicleCategories.count())),
                });
                const RateRule0 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RateRule0?.setCategory)
                {
                    await
                    RateRule0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await VehicleCategories.findOne({
                    offset: Math.floor(Math.random() * (await VehicleCategories.count())),
                });
                const RateRule1 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RateRule1?.setCategory)
                {
                    await
                    RateRule1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await VehicleCategories.findOne({
                    offset: Math.floor(Math.random() * (await VehicleCategories.count())),
                });
                const RateRule2 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RateRule2?.setCategory)
                {
                    await
                    RateRule2.
                    setCategory(relatedCategory2);
                }
            
        }
        
    
        
            
            async function associateRateRuleWithBranch() {
            
                const relatedBranch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const RateRule0 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RateRule0?.setBranch)
                {
                    await
                    RateRule0.
                    setBranch(relatedBranch0);
                }
            
                const relatedBranch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const RateRule1 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RateRule1?.setBranch)
                {
                    await
                    RateRule1.
                    setBranch(relatedBranch1);
                }
            
                const relatedBranch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const RateRule2 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RateRule2?.setBranch)
                {
                    await
                    RateRule2.
                    setBranch(relatedBranch2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateRateRuleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RateRule0 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RateRule0?.setOrganization)
                {
                    await
                    RateRule0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RateRule1 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RateRule1?.setOrganization)
                {
                    await
                    RateRule1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RateRule2 = await RateRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RateRule2?.setOrganization)
                {
                    await
                    RateRule2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExtraWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Extra0 = await Extras.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Extra0?.setCompany)
                {
                    await
                    Extra0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Extra1 = await Extras.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Extra1?.setCompany)
                {
                    await
                    Extra1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Extra2 = await Extras.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Extra2?.setCompany)
                {
                    await
                    Extra2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExtraWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Extra0 = await Extras.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Extra0?.setOrganization)
                {
                    await
                    Extra0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Extra1 = await Extras.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Extra1?.setOrganization)
                {
                    await
                    Extra1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Extra2 = await Extras.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Extra2?.setOrganization)
                {
                    await
                    Extra2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateInsurancePlanWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const InsurancePlan0 = await InsurancePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InsurancePlan0?.setCompany)
                {
                    await
                    InsurancePlan0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const InsurancePlan1 = await InsurancePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InsurancePlan1?.setCompany)
                {
                    await
                    InsurancePlan1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const InsurancePlan2 = await InsurancePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InsurancePlan2?.setCompany)
                {
                    await
                    InsurancePlan2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateInsurancePlanWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InsurancePlan0 = await InsurancePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (InsurancePlan0?.setOrganization)
                {
                    await
                    InsurancePlan0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InsurancePlan1 = await InsurancePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (InsurancePlan1?.setOrganization)
                {
                    await
                    InsurancePlan1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const InsurancePlan2 = await InsurancePlans.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (InsurancePlan2?.setOrganization)
                {
                    await
                    InsurancePlan2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePromoCodeWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PromoCode0 = await PromoCodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PromoCode0?.setCompany)
                {
                    await
                    PromoCode0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PromoCode1 = await PromoCodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PromoCode1?.setCompany)
                {
                    await
                    PromoCode1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const PromoCode2 = await PromoCodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PromoCode2?.setCompany)
                {
                    await
                    PromoCode2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePromoCodeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromoCode0 = await PromoCodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PromoCode0?.setOrganization)
                {
                    await
                    PromoCode0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromoCode1 = await PromoCodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PromoCode1?.setOrganization)
                {
                    await
                    PromoCode1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromoCode2 = await PromoCodes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PromoCode2?.setOrganization)
                {
                    await
                    PromoCode2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBookingWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setCompany)
                {
                    await
                    Booking0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setCompany)
                {
                    await
                    Booking1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setCompany)
                {
                    await
                    Booking2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateBookingWithCustomer() {
            
                const relatedCustomer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setCustomer)
                {
                    await
                    Booking0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setCustomer)
                {
                    await
                    Booking1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setCustomer)
                {
                    await
                    Booking2.
                    setCustomer(relatedCustomer2);
                }
            
        }
        
    
        
            
            async function associateBookingWithVehicle() {
            
                const relatedVehicle0 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setVehicle)
                {
                    await
                    Booking0.
                    setVehicle(relatedVehicle0);
                }
            
                const relatedVehicle1 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setVehicle)
                {
                    await
                    Booking1.
                    setVehicle(relatedVehicle1);
                }
            
                const relatedVehicle2 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setVehicle)
                {
                    await
                    Booking2.
                    setVehicle(relatedVehicle2);
                }
            
        }
        
    
        
            
            async function associateBookingWithPickup_branch() {
            
                const relatedPickup_branch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setPickup_branch)
                {
                    await
                    Booking0.
                    setPickup_branch(relatedPickup_branch0);
                }
            
                const relatedPickup_branch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setPickup_branch)
                {
                    await
                    Booking1.
                    setPickup_branch(relatedPickup_branch1);
                }
            
                const relatedPickup_branch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setPickup_branch)
                {
                    await
                    Booking2.
                    setPickup_branch(relatedPickup_branch2);
                }
            
        }
        
    
        
            
            async function associateBookingWithDropoff_branch() {
            
                const relatedDropoff_branch0 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setDropoff_branch)
                {
                    await
                    Booking0.
                    setDropoff_branch(relatedDropoff_branch0);
                }
            
                const relatedDropoff_branch1 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setDropoff_branch)
                {
                    await
                    Booking1.
                    setDropoff_branch(relatedDropoff_branch1);
                }
            
                const relatedDropoff_branch2 = await Branches.findOne({
                    offset: Math.floor(Math.random() * (await Branches.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setDropoff_branch)
                {
                    await
                    Booking2.
                    setDropoff_branch(relatedDropoff_branch2);
                }
            
        }
        
    
        
            
            async function associateBookingWithRate_plan() {
            
                const relatedRate_plan0 = await RatePlans.findOne({
                    offset: Math.floor(Math.random() * (await RatePlans.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setRate_plan)
                {
                    await
                    Booking0.
                    setRate_plan(relatedRate_plan0);
                }
            
                const relatedRate_plan1 = await RatePlans.findOne({
                    offset: Math.floor(Math.random() * (await RatePlans.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setRate_plan)
                {
                    await
                    Booking1.
                    setRate_plan(relatedRate_plan1);
                }
            
                const relatedRate_plan2 = await RatePlans.findOne({
                    offset: Math.floor(Math.random() * (await RatePlans.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setRate_plan)
                {
                    await
                    Booking2.
                    setRate_plan(relatedRate_plan2);
                }
            
        }
        
    
        
            
            async function associateBookingWithInsurance_plan() {
            
                const relatedInsurance_plan0 = await InsurancePlans.findOne({
                    offset: Math.floor(Math.random() * (await InsurancePlans.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setInsurance_plan)
                {
                    await
                    Booking0.
                    setInsurance_plan(relatedInsurance_plan0);
                }
            
                const relatedInsurance_plan1 = await InsurancePlans.findOne({
                    offset: Math.floor(Math.random() * (await InsurancePlans.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setInsurance_plan)
                {
                    await
                    Booking1.
                    setInsurance_plan(relatedInsurance_plan1);
                }
            
                const relatedInsurance_plan2 = await InsurancePlans.findOne({
                    offset: Math.floor(Math.random() * (await InsurancePlans.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setInsurance_plan)
                {
                    await
                    Booking2.
                    setInsurance_plan(relatedInsurance_plan2);
                }
            
        }
        
    
        
            
            async function associateBookingWithPromo_code() {
            
                const relatedPromo_code0 = await PromoCodes.findOne({
                    offset: Math.floor(Math.random() * (await PromoCodes.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setPromo_code)
                {
                    await
                    Booking0.
                    setPromo_code(relatedPromo_code0);
                }
            
                const relatedPromo_code1 = await PromoCodes.findOne({
                    offset: Math.floor(Math.random() * (await PromoCodes.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setPromo_code)
                {
                    await
                    Booking1.
                    setPromo_code(relatedPromo_code1);
                }
            
                const relatedPromo_code2 = await PromoCodes.findOne({
                    offset: Math.floor(Math.random() * (await PromoCodes.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setPromo_code)
                {
                    await
                    Booking2.
                    setPromo_code(relatedPromo_code2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBookingWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Booking0 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Booking0?.setOrganization)
                {
                    await
                    Booking0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Booking1 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Booking1?.setOrganization)
                {
                    await
                    Booking1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Booking2 = await Bookings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Booking2?.setOrganization)
                {
                    await
                    Booking2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBookingExtraWithBooking() {
            
                const relatedBooking0 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const BookingExtra0 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BookingExtra0?.setBooking)
                {
                    await
                    BookingExtra0.
                    setBooking(relatedBooking0);
                }
            
                const relatedBooking1 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const BookingExtra1 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BookingExtra1?.setBooking)
                {
                    await
                    BookingExtra1.
                    setBooking(relatedBooking1);
                }
            
                const relatedBooking2 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const BookingExtra2 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BookingExtra2?.setBooking)
                {
                    await
                    BookingExtra2.
                    setBooking(relatedBooking2);
                }
            
        }
        
    
        
            
            async function associateBookingExtraWithExtra() {
            
                const relatedExtra0 = await Extras.findOne({
                    offset: Math.floor(Math.random() * (await Extras.count())),
                });
                const BookingExtra0 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BookingExtra0?.setExtra)
                {
                    await
                    BookingExtra0.
                    setExtra(relatedExtra0);
                }
            
                const relatedExtra1 = await Extras.findOne({
                    offset: Math.floor(Math.random() * (await Extras.count())),
                });
                const BookingExtra1 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BookingExtra1?.setExtra)
                {
                    await
                    BookingExtra1.
                    setExtra(relatedExtra1);
                }
            
                const relatedExtra2 = await Extras.findOne({
                    offset: Math.floor(Math.random() * (await Extras.count())),
                });
                const BookingExtra2 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BookingExtra2?.setExtra)
                {
                    await
                    BookingExtra2.
                    setExtra(relatedExtra2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBookingExtraWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BookingExtra0 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BookingExtra0?.setOrganization)
                {
                    await
                    BookingExtra0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BookingExtra1 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BookingExtra1?.setOrganization)
                {
                    await
                    BookingExtra1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BookingExtra2 = await BookingExtras.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BookingExtra2?.setOrganization)
                {
                    await
                    BookingExtra2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePaymentWithBooking() {
            
                const relatedBooking0 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setBooking)
                {
                    await
                    Payment0.
                    setBooking(relatedBooking0);
                }
            
                const relatedBooking1 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setBooking)
                {
                    await
                    Payment1.
                    setBooking(relatedBooking1);
                }
            
                const relatedBooking2 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setBooking)
                {
                    await
                    Payment2.
                    setBooking(relatedBooking2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePaymentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setOrganization)
                {
                    await
                    Payment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setOrganization)
                {
                    await
                    Payment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setOrganization)
                {
                    await
                    Payment2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateInvoiceWithBooking() {
            
                const relatedBooking0 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setBooking)
                {
                    await
                    Invoice0.
                    setBooking(relatedBooking0);
                }
            
                const relatedBooking1 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setBooking)
                {
                    await
                    Invoice1.
                    setBooking(relatedBooking1);
                }
            
                const relatedBooking2 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setBooking)
                {
                    await
                    Invoice2.
                    setBooking(relatedBooking2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateInvoiceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setOrganization)
                {
                    await
                    Invoice0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setOrganization)
                {
                    await
                    Invoice1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setOrganization)
                {
                    await
                    Invoice2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMessageWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setCompany)
                {
                    await
                    Message0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setCompany)
                {
                    await
                    Message1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setCompany)
                {
                    await
                    Message2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateMessageWithBooking() {
            
                const relatedBooking0 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setBooking)
                {
                    await
                    Message0.
                    setBooking(relatedBooking0);
                }
            
                const relatedBooking1 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setBooking)
                {
                    await
                    Message1.
                    setBooking(relatedBooking1);
                }
            
                const relatedBooking2 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setBooking)
                {
                    await
                    Message2.
                    setBooking(relatedBooking2);
                }
            
        }
        
    
        
            
            async function associateMessageWithRecipient() {
            
                const relatedRecipient0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setRecipient)
                {
                    await
                    Message0.
                    setRecipient(relatedRecipient0);
                }
            
                const relatedRecipient1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setRecipient)
                {
                    await
                    Message1.
                    setRecipient(relatedRecipient1);
                }
            
                const relatedRecipient2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setRecipient)
                {
                    await
                    Message2.
                    setRecipient(relatedRecipient2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMessageWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Message0 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Message0?.setOrganization)
                {
                    await
                    Message0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Message1 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Message1?.setOrganization)
                {
                    await
                    Message1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Message2 = await Messages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Message2?.setOrganization)
                {
                    await
                    Message2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateNotificationTemplateWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const NotificationTemplate0 = await NotificationTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationTemplate0?.setCompany)
                {
                    await
                    NotificationTemplate0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const NotificationTemplate1 = await NotificationTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationTemplate1?.setCompany)
                {
                    await
                    NotificationTemplate1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const NotificationTemplate2 = await NotificationTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationTemplate2?.setCompany)
                {
                    await
                    NotificationTemplate2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateNotificationTemplateWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationTemplate0 = await NotificationTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationTemplate0?.setOrganization)
                {
                    await
                    NotificationTemplate0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationTemplate1 = await NotificationTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationTemplate1?.setOrganization)
                {
                    await
                    NotificationTemplate1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationTemplate2 = await NotificationTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationTemplate2?.setOrganization)
                {
                    await
                    NotificationTemplate2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTaskWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setCompany)
                {
                    await
                    Task0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setCompany)
                {
                    await
                    Task1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setCompany)
                {
                    await
                    Task2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            async function associateTaskWithBooking() {
            
                const relatedBooking0 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setBooking)
                {
                    await
                    Task0.
                    setBooking(relatedBooking0);
                }
            
                const relatedBooking1 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setBooking)
                {
                    await
                    Task1.
                    setBooking(relatedBooking1);
                }
            
                const relatedBooking2 = await Bookings.findOne({
                    offset: Math.floor(Math.random() * (await Bookings.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setBooking)
                {
                    await
                    Task2.
                    setBooking(relatedBooking2);
                }
            
        }
        
    
        
            
            async function associateTaskWithVehicle() {
            
                const relatedVehicle0 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setVehicle)
                {
                    await
                    Task0.
                    setVehicle(relatedVehicle0);
                }
            
                const relatedVehicle1 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setVehicle)
                {
                    await
                    Task1.
                    setVehicle(relatedVehicle1);
                }
            
                const relatedVehicle2 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setVehicle)
                {
                    await
                    Task2.
                    setVehicle(relatedVehicle2);
                }
            
        }
        
    
        
            
            async function associateTaskWithAssignee() {
            
                const relatedAssignee0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setAssignee)
                {
                    await
                    Task0.
                    setAssignee(relatedAssignee0);
                }
            
                const relatedAssignee1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setAssignee)
                {
                    await
                    Task1.
                    setAssignee(relatedAssignee1);
                }
            
                const relatedAssignee2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setAssignee)
                {
                    await
                    Task2.
                    setAssignee(relatedAssignee2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateTaskWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Task0 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Task0?.setOrganization)
                {
                    await
                    Task0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Task1 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Task1?.setOrganization)
                {
                    await
                    Task1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Task2 = await Tasks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Task2?.setOrganization)
                {
                    await
                    Task2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMaintenanceRecordWithVehicle() {
            
                const relatedVehicle0 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const MaintenanceRecord0 = await MaintenanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MaintenanceRecord0?.setVehicle)
                {
                    await
                    MaintenanceRecord0.
                    setVehicle(relatedVehicle0);
                }
            
                const relatedVehicle1 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const MaintenanceRecord1 = await MaintenanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MaintenanceRecord1?.setVehicle)
                {
                    await
                    MaintenanceRecord1.
                    setVehicle(relatedVehicle1);
                }
            
                const relatedVehicle2 = await Vehicles.findOne({
                    offset: Math.floor(Math.random() * (await Vehicles.count())),
                });
                const MaintenanceRecord2 = await MaintenanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MaintenanceRecord2?.setVehicle)
                {
                    await
                    MaintenanceRecord2.
                    setVehicle(relatedVehicle2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMaintenanceRecordWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MaintenanceRecord0 = await MaintenanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MaintenanceRecord0?.setOrganization)
                {
                    await
                    MaintenanceRecord0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MaintenanceRecord1 = await MaintenanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MaintenanceRecord1?.setOrganization)
                {
                    await
                    MaintenanceRecord1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MaintenanceRecord2 = await MaintenanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MaintenanceRecord2?.setOrganization)
                {
                    await
                    MaintenanceRecord2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCustomerDocumentWithCustomer() {
            
                const relatedCustomer0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CustomerDocument0 = await CustomerDocuments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CustomerDocument0?.setCustomer)
                {
                    await
                    CustomerDocument0.
                    setCustomer(relatedCustomer0);
                }
            
                const relatedCustomer1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CustomerDocument1 = await CustomerDocuments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CustomerDocument1?.setCustomer)
                {
                    await
                    CustomerDocument1.
                    setCustomer(relatedCustomer1);
                }
            
                const relatedCustomer2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CustomerDocument2 = await CustomerDocuments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CustomerDocument2?.setCustomer)
                {
                    await
                    CustomerDocument2.
                    setCustomer(relatedCustomer2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCustomerDocumentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CustomerDocument0 = await CustomerDocuments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CustomerDocument0?.setOrganization)
                {
                    await
                    CustomerDocument0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CustomerDocument1 = await CustomerDocuments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CustomerDocument1?.setOrganization)
                {
                    await
                    CustomerDocument1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CustomerDocument2 = await CustomerDocuments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CustomerDocument2?.setOrganization)
                {
                    await
                    CustomerDocument2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAuditEventWithCompany() {
            
                const relatedCompany0 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AuditEvent0 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditEvent0?.setCompany)
                {
                    await
                    AuditEvent0.
                    setCompany(relatedCompany0);
                }
            
                const relatedCompany1 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AuditEvent1 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditEvent1?.setCompany)
                {
                    await
                    AuditEvent1.
                    setCompany(relatedCompany1);
                }
            
                const relatedCompany2 = await Companies.findOne({
                    offset: Math.floor(Math.random() * (await Companies.count())),
                });
                const AuditEvent2 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditEvent2?.setCompany)
                {
                    await
                    AuditEvent2.
                    setCompany(relatedCompany2);
                }
            
        }
        
    
        
            
            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);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await Companies.bulkCreate(CompaniesData);
                
            
            
                
                await Branches.bulkCreate(BranchesData);
                
            
            
                
                await VehicleCategories.bulkCreate(VehicleCategoriesData);
                
            
            
                
                await Vehicles.bulkCreate(VehiclesData);
                
            
            
                
                await RatePlans.bulkCreate(RatePlansData);
                
            
            
                
                await RateRules.bulkCreate(RateRulesData);
                
            
            
                
                await Extras.bulkCreate(ExtrasData);
                
            
            
                
                await InsurancePlans.bulkCreate(InsurancePlansData);
                
            
            
                
                await PromoCodes.bulkCreate(PromoCodesData);
                
            
            
                
                await Bookings.bulkCreate(BookingsData);
                
            
            
                
                await BookingExtras.bulkCreate(BookingExtrasData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await Invoices.bulkCreate(InvoicesData);
                
            
            
                
                await Messages.bulkCreate(MessagesData);
                
            
            
                
                await NotificationTemplates.bulkCreate(NotificationTemplatesData);
                
            
            
                
                await Tasks.bulkCreate(TasksData);
                
            
            
                
                await MaintenanceRecords.bulkCreate(MaintenanceRecordsData);
                
            
            
                
                await CustomerDocuments.bulkCreate(CustomerDocumentsData);
                
            
            
                
                await AuditEvents.bulkCreate(AuditEventsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCompanyWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBrancheWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBrancheWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateVehicleCategoryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateVehicleWithCompany(),
                    
                
                    
                        
                        await associateVehicleWithBranch(),
                    
                
                    
                        
                        await associateVehicleWithCategory(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateVehicleWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateRatePlanWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRatePlanWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateRateRuleWithRate_plan(),
                    
                
                    
                        
                        await associateRateRuleWithCategory(),
                    
                
                    
                        
                        await associateRateRuleWithBranch(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRateRuleWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateExtraWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExtraWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateInsurancePlanWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInsurancePlanWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePromoCodeWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePromoCodeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBookingWithCompany(),
                    
                
                    
                        
                        await associateBookingWithCustomer(),
                    
                
                    
                        
                        await associateBookingWithVehicle(),
                    
                
                    
                        
                        await associateBookingWithPickup_branch(),
                    
                
                    
                        
                        await associateBookingWithDropoff_branch(),
                    
                
                    
                        
                        await associateBookingWithRate_plan(),
                    
                
                    
                        
                        await associateBookingWithInsurance_plan(),
                    
                
                    
                        
                        await associateBookingWithPromo_code(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBookingWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBookingExtraWithBooking(),
                    
                
                    
                        
                        await associateBookingExtraWithExtra(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBookingExtraWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePaymentWithBooking(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePaymentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateInvoiceWithBooking(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateInvoiceWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMessageWithCompany(),
                    
                
                    
                        
                        await associateMessageWithBooking(),
                    
                
                    
                        
                        await associateMessageWithRecipient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMessageWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateNotificationTemplateWithCompany(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNotificationTemplateWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTaskWithCompany(),
                    
                
                    
                        
                        await associateTaskWithBooking(),
                    
                
                    
                        
                        await associateTaskWithVehicle(),
                    
                
                    
                        
                        await associateTaskWithAssignee(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateTaskWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMaintenanceRecordWithVehicle(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMaintenanceRecordWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCustomerDocumentWithCustomer(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCustomerDocumentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAuditEventWithCompany(),
                    
                
                    
                        
                        await associateAuditEventWithActor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAuditEventWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('companies', null, {});
            
            
            await queryInterface.bulkDelete('branches', null, {});
            
            
            await queryInterface.bulkDelete('vehicle_categories', null, {});
            
            
            await queryInterface.bulkDelete('vehicles', null, {});
            
            
            await queryInterface.bulkDelete('rate_plans', null, {});
            
            
            await queryInterface.bulkDelete('rate_rules', null, {});
            
            
            await queryInterface.bulkDelete('extras', null, {});
            
            
            await queryInterface.bulkDelete('insurance_plans', null, {});
            
            
            await queryInterface.bulkDelete('promo_codes', null, {});
            
            
            await queryInterface.bulkDelete('bookings', null, {});
            
            
            await queryInterface.bulkDelete('booking_extras', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('invoices', null, {});
            
            
            await queryInterface.bulkDelete('messages', null, {});
            
            
            await queryInterface.bulkDelete('notification_templates', null, {});
            
            
            await queryInterface.bulkDelete('tasks', null, {});
            
            
            await queryInterface.bulkDelete('maintenance_records', null, {});
            
            
            await queryInterface.bulkDelete('customer_documents', null, {});
            
            
            await queryInterface.bulkDelete('audit_events', null, {});
            
        
    },
};