mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-12 04:14:59 +03:00
Handoff (ADR-HUB-0003): the live runtime instructs the model to append a <<HANDOFF>> token when a human is needed (asks for a person, out-of-scope, discount/invoice/legal, complaint). Ingest strips the token, switches the conversation to PAUSED (expected: operator), posts a system note and notifies operators — verified the token fires on 'счёт на юрлицо' and not on a price question. Binding: integrations now carry a channel; the integration form shows a 'Канал обработки' select for messenger connections and the list shows the bound channel. Backend create/update/serialize/select handle channel_id. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
12 lines
490 B
Python
12 lines
490 B
Python
from django.db.models import QuerySet
|
|
|
|
from hub_platform.integrations.models import Integration
|
|
|
|
|
|
def integrations_for_organization(organization_id: int) -> QuerySet[Integration]:
|
|
return Integration.objects.filter(organization_id=organization_id).select_related("channel").order_by("provider", "name")
|
|
|
|
|
|
def integration_for_organization(*, organization_id: int, integration_id: int) -> Integration:
|
|
return Integration.objects.get(id=integration_id, organization_id=organization_id)
|