Tinker
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Home
Epics
Create SendChatMessageService for support session chat
Edit
Create SendChatMessageService for support session chat
Cancel
Save
Title
*
Project
*
Choose an option
alpha
tinker
Create new project
Description
## Task Create service objects for sending messages in support sessions, handling both operator and guest message creation. ## Service: RemoteSupport::SendChatMessageService ```ruby module RemoteSupport class SendChatMessageService < BaseService option :session option :content option :participant_type # :operator or :guest option :user, optional: true # present for operators option :guest_name, optional: true # present for guests def call # Validate session is active/pending (not ended) # Create message record # Trigger broadcast (will be consumed by WebSocket channel) # Return Success(message) or Failure end end end ``` ## Broadcast Mechanism After message creation, trigger a broadcast that: 1. For operators: publishes to NATS `tenants.{tenant}.support_sessions.{id}.messages` 2. For guests: triggers ActionCable broadcast to session channel ## Files to Create - `app/services/remote_support/send_chat_message_service.rb` - `spec/services/remote_support/send_chat_message_service_spec.rb`
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel