import { ID } from './Conversation'; export declare const CONVERSATION_ASSIGNMENT_EVENTS_COLLECTION = "conversation_assignment_events"; export type ConversationAssignmentEventType = 'enqueued' | 'routing_started' | 'offered' | 'assigned' | 'accepted' | 'transferred' | 'released' | 'timed_out' | 'requeued'; export type ConversationAssignmentReason = 'conversation_created' | 'routing_selected' | 'manual_assignment' | 'manual_transfer' | 'flow_routing' | 'offer_timeout' | 'assignment_timeout' | 'agent_accepted' | 'agent_released' | 'supervisor_released' | 'capacity_rebalance' | 'sla_escalation' | 'system_recovery'; export type AssignmentOwnerReference = { type: 'none'; id?: never; } | { type: 'user' | 'bot' | 'flow'; id: ID; }; export type AssignmentStateReference = { status: 'unrouted'; assignmentId?: never; queueId?: never; owner: { type: 'none'; id?: never; } | { type: 'bot' | 'flow'; id: ID; }; } | { status: 'queued' | 'routing'; assignmentId: ID; queueId: ID; owner: { type: 'none'; id?: never; }; } | { status: 'offered' | 'assigned' | 'accepted'; assignmentId: ID; queueId: ID; owner: { type: 'user'; id: ID; }; }; export type AssignmentActorReference = { type: 'system'; id?: never; } | { type: 'user' | 'bot' | 'flow'; id: ID; }; /** * Immutable domain event stored in conversation_assignment_events. * * Events must only be inserted. Corrections are represented by a new event. */ export interface ConversationAssignmentEvent { id: ID; spaceId: ID; conversationId: ID; /** * Monotonic order within a conversation. */ sequence: number; eventType: ConversationAssignmentEventType; reason: ConversationAssignmentReason; /** * Undefined only when no previous assignment state existed. */ previous?: AssignmentStateReference; current: AssignmentStateReference; actor: AssignmentActorReference; routingDecisionId?: ID; /** * Version of conversations after applying the transition. */ conversationVersion: number; correlationId?: ID; causationId?: ID; idempotencyKey: string; /** * Domain time and persistence time, respectively. */ occurredAt: Date; recordedAt: Date; }