fix(tests): backend test suite - app version, DB roles, admin RBAC, companies route, field names, DeletionLog, ABAC, imports
This commit is contained in:
@@ -75,6 +75,25 @@ class CreateContactCommand(BaseCommand):
|
||||
self._created_contact_id = uuid.UUID(serialized["id"])
|
||||
self._serialized = serialized
|
||||
|
||||
# Handle company_ids — create ContactPerson links
|
||||
company_ids = self.data.get("company_ids")
|
||||
if company_ids:
|
||||
from app.models.contact import ContactPerson
|
||||
for cid in company_ids:
|
||||
cp = ContactPerson(
|
||||
tenant_id=tenant_id,
|
||||
contact_id=uuid.UUID(cid),
|
||||
displayname=serialized.get("displayname", ""),
|
||||
firstname=self.data.get("firstname"),
|
||||
lastname=self.data.get("surname"),
|
||||
email=self.data.get("email_1"),
|
||||
phone=self.data.get("phone_1"),
|
||||
created_by=user_id,
|
||||
updated_by=user_id,
|
||||
)
|
||||
db.add(cp)
|
||||
await db.flush()
|
||||
|
||||
# Enqueue outbox events
|
||||
events: list[dict] = []
|
||||
await enqueue_outbox_event(db, tenant_id, "contact.created", {
|
||||
|
||||
Reference in New Issue
Block a user