[2ff88f42] Finalize SuperOffice Integration: Enhanced Persona model with Influencer role, switched Matrix Generator to Gemini, implemented Noise Reduction for Webhooks, and added E2E test scenarios.

This commit is contained in:
2026-02-20 10:55:57 +00:00
parent d345539051
commit ec3933585c
11 changed files with 609 additions and 107 deletions

View File

@@ -130,7 +130,42 @@ class SuperOfficeClient:
return None
return all_results
def create_project(self, name: str, contact_id: int, person_id: int = None):
"""Creates a new project linked to a contact, and optionally adds a person."""
payload = {
"Name": name,
"Contact": {"ContactId": contact_id}
}
if person_id:
# Adding a person to a project requires a ProjectMember object
payload["ProjectMembers"] = [
{
"Person": {"PersonId": person_id},
"Role": "Member" # Default role, can be configured if needed
}
]
print(f"Creating new project: {name}...")
return self._post("Project", payload)
def create_appointment(self, subject: str, description: str, contact_id: int, person_id: int = None):
"""Creates a new appointment (to simulate a sent activity)."""
import datetime
now = datetime.datetime.utcnow().isoformat() + "Z"
payload = {
"Description": f"{subject}\n\n{description}",
"Contact": {"ContactId": contact_id},
"StartDate": now,
"EndDate": now,
"Task": {"Id": 1} # Usually 'Follow-up' or similar, depending on SO config
}
if person_id:
payload["Person"] = {"PersonId": person_id}
print(f"Creating new appointment: {subject}...")
return self._post("Appointment", payload)
def update_entity_udfs(self, entity_id: int, entity_type: str, udf_data: dict):
"""
Updates UDFs for a given entity (Contact or Person).