--- DEBUG HIERARCHY V3 --- Target Users: [ { "user_id": 1, "username": "testuser1", "parent_staff_id": null, "parent_owner_id": 1 } ] Company1 is STAFF: { "staff_id": 1, "username": "company1", "email": null, "password": "$2b$12$xdxSEiprY1/qvGWYczdN4ePUXH7wDkBDY33TNJCTSTNv0E23Qf1re", "role_id": 2, "role": "COMPANY", "level": "L1", "parent_staff_id": null, "parent_owner_id": 1, "percentage": "90.00", "active": true, "betting_allowed": true, "createdAt": "2025-12-10T12:44:54.056Z", "updatedAt": "2025-12-11T10:05:06.463Z", "deletedAt": null } Company1 is NOT in Owners table Real Owner Details: { "owner_id": 1, "username": "bpexch", "website_name": "bpexch", "domain_name": "bpexch.bet", "website_ui": "light", "country": "India", "logo": "/uploads/logos/bpexch.png", "favicon": "/uploads/favicon/bpexch.ico", "game_providers": [ "Evolution", "Ezugi", "Pragmatic Play", "Supernowa" ], "subscription_plan": "enterprise", "platform_configurations": { "currency": "INR", "language": "en", "theme": "light", "odds_format": "decimal" }, "payment_methods": [ "UPI", "PhonePe", "Google Pay", "Bank Transfer", "Crypto" ], "site_email_address": "owner@bpexch.bet", "password": "$2b$12$gFIs5vBZaXQ2dWKFwbn8QOcXFwlzwgeYWIaGKBulIzomg3lcrcY8a", "platform_name": "bpexch", "role": "OWNER", "account_status": true, "percentage": 100, "createdAt": "2025-12-10T11:11:15.999Z", "updatedAt": "2025-12-10T11:11:15.999Z" }