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 SupportSessionMessage model and migration
Edit
Create SupportSessionMessage model and migration
Cancel
Save
Title
*
Project
*
Choose an option
alpha
tinker
Create new project
Description
## Task Create the `SupportSessionMessage` model and database migration for storing chat messages in remote support sessions. ## Schema Design ```ruby create_table :support_session_messages do |t| t.references :support_session, null: false, foreign_key: true, index: true t.references :user, null: true, foreign_key: true # null for guest messages t.string :participant_type, null: false # 'operator' or 'guest' t.string :participant_name, null: false # display name t.text :content, null: false t.jsonb :metadata, default: {} t.timestamps end add_index :support_session_messages, [:support_session_id, :created_at] ``` ## Model Implementation - Belongs to `support_session` - Belongs to `user` (optional - null for guests) - Enum for `participant_type`: `[:operator, :guest]` - Validates content presence and length (max 5000 chars) - Method `to_broadcast_payload` returning hash for frontend consumption ## Files to Create/Modify - `db/migrate/xxx_create_support_session_messages.rb` - `app/models/support_session_message.rb` - `app/models/support_session.rb` (add association) - `spec/models/support_session_message_spec.rb` - `spec/factories/support_session_messages.rb`
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel