Create SendChatMessageService for support session chat
Cancelled
Subtask
High
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`
Working Memory
{
"blocked_reason": "Waiting for dependencies: 101"
}
Ticket Stats
Status:
Cancelled
Priority:
High
Type:
Subtask
Comments
0 commentsAdd a Comment
No Subtasks Yet
Break down this ticket into smaller, manageable subtasks