refactor(so-connector): optimize api calls with $select and filtering [31188f42]
This commit is contained in:
@@ -20,12 +20,12 @@ sys.path.append(connector_dir)
|
||||
# Note: backend.app needs to be importable. If backend is a package.
|
||||
try:
|
||||
from backend.app import app, get_db
|
||||
from backend.database import Base, Industry, Persona, MarketingMatrix, JobRoleMapping, Company, Contact, init_db
|
||||
from backend.database import Base, Industry, Persona, MarketingMatrix, JobRolePattern, Company, Contact, init_db
|
||||
except ImportError:
|
||||
# Try alternate import if running from root
|
||||
sys.path.append(os.path.abspath("company-explorer"))
|
||||
from backend.app import app, get_db
|
||||
from backend.database import Base, Industry, Persona, MarketingMatrix, JobRoleMapping, Company, Contact, init_db
|
||||
from backend.database import Base, Industry, Persona, MarketingMatrix, JobRolePattern, Company, Contact, init_db
|
||||
|
||||
# Import Worker Logic
|
||||
from worker import process_job
|
||||
@@ -56,10 +56,10 @@ class MockSuperOfficeClient:
|
||||
self.contacts = {} # id -> data
|
||||
self.persons = {} # id -> data
|
||||
|
||||
def get_contact(self, contact_id):
|
||||
def get_contact(self, contact_id, select=None):
|
||||
return self.contacts.get(int(contact_id))
|
||||
|
||||
def get_person(self, person_id):
|
||||
def get_person(self, person_id, select=None):
|
||||
return self.persons.get(int(person_id))
|
||||
|
||||
def update_entity_udfs(self, entity_id, entity_type, udfs):
|
||||
@@ -152,7 +152,7 @@ class TestE2EFlow(unittest.TestCase):
|
||||
)
|
||||
db.add(matrix2)
|
||||
|
||||
mapping = JobRoleMapping(pattern="%Head of Operations%", role="Operativer Entscheider")
|
||||
mapping = JobRolePattern(pattern_value="Head of Operations", role="Operativer Entscheider", pattern_type="exact")
|
||||
db.add(mapping)
|
||||
|
||||
db.commit()
|
||||
|
||||
Reference in New Issue
Block a user