## Description Adds a backend endpoint that powers an account-wide calls dashboard, letting users list and filter all calls in the account. ## Linear Ticket - https://linear.app/chatwoot/issue/UPM-28/voice-call-dashboard-view ## Type of change - [ ] New feature (non-breaking change which adds functionality) ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules
41 lines
954 B
Ruby
41 lines
954 B
Ruby
json.id call.id
|
|
json.call_id call.provider_call_id
|
|
json.provider call.provider
|
|
json.status call.display_status
|
|
json.direction call.direction_label
|
|
json.duration_seconds call.duration_seconds
|
|
json.end_reason call.end_reason
|
|
json.started_at call.started_at&.to_i
|
|
json.created_at call.created_at.to_i
|
|
json.message_id call.message_id
|
|
json.recording_url call.recording_url
|
|
json.transcript call.transcript
|
|
|
|
json.conversation do
|
|
json.id call.conversation_id
|
|
json.display_id call.conversation.display_id
|
|
end
|
|
|
|
json.inbox do
|
|
json.id call.inbox_id
|
|
json.name call.inbox.name
|
|
end
|
|
|
|
if call.accepted_by_agent
|
|
json.agent do
|
|
json.id call.accepted_by_agent.id
|
|
json.name call.accepted_by_agent.available_name
|
|
json.avatar call.accepted_by_agent.avatar_url
|
|
end
|
|
else
|
|
json.agent nil
|
|
end
|
|
|
|
contact = call.contact
|
|
json.contact do
|
|
json.id contact.id
|
|
json.name contact.name
|
|
json.phone_number contact.phone_number
|
|
json.avatar contact.avatar_url
|
|
end
|