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()