Files
Brancheneinstufung2/connector-superoffice/tools/blind_check_associates.py

46 lines
1.5 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import sys
import os
import json
# Absolute path setup
current_dir = os.path.dirname(os.path.abspath(__file__))
connector_dir = os.path.abspath(os.path.join(current_dir, '..'))
sys.path.insert(0, connector_dir)
from superoffice_client import SuperOfficeClient
def blind_check():
print("🕵️ Testing Manuel's Filter: contactAssociate/contactFullName eq 'RoboPlanet GmbH'")
client = SuperOfficeClient()
if not client.access_token:
print("❌ Auth failed.")
return
# Manuel's filter logic with Count
endpoint = "Contact?$filter=contactAssociate/contactFullName eq 'RoboPlanet GmbH'&$top=0&$count=true"
print(f"📡 Querying: {endpoint}")
try:
resp = client._get(endpoint)
count = resp.get('@odata.count')
print(f"\n🎯 RESULT: Manuel's Filter found {count} accounts.")
if count == 17014:
print("✅ PERFECT MATCH! Manuel's filter matches your UI count exactly.")
else:
print(f" Delta to UI: {17014 - (count or 0)}")
except Exception as e:
print(f"❌ Manuel's filter failed: {e}")
# Try without spaces encoded
print("Trying with encoded spaces...")
try:
endpoint_enc = "Contact?$filter=contactAssociate/contactFullName eq 'RoboPlanet+GmbH'&$top=0&$count=true"
resp = client._get(endpoint_enc)
print(f"🎯 Encoded Result: {resp.get('@odata.count')}")
except:
pass
if __name__ == "__main__":
blind_check()