See #1286 for an explanation of how a Message system works.
Once we have created a Message and it's associated Conversation, any side of the conversation can post a reply.
Each of these replies then creates a ConversationPart containing its contents
To be able to fetch ConversationPart records from the client asynchronously, we need a working index endpoint
Subtasks
[ ] Implement Policy.ConversationPart.scope/2
scopes to ConversationPart records belonging to Conversation records defined by Policy.Conversation.scope/2
# Example implementation
def scope(query, current_user) do
conversation_scope = Conversation |> Policy.Conversation.scope(current_user)
query
|> join(:right, [cp], c in subquery(conversation_scope), cp.conversation_id == c.id)
end
[ ] add tests for Policy.ConversationPart.scope
[ ] Implement :index endpoint
needs to support coalesced id filter - we will be fetching conversation.conversationParts in the client
might need to support filtering by conversation_id, but not sure yet
Problem
See #1286 for an explanation of how a Message system works.
Once we have created a
Message
and it's associatedConversation
, any side of the conversation can post a reply.Each of these replies then creates a
ConversationPart
containing its contentsTo be able to fetch
ConversationPart
records from the client asynchronously, we need a working index endpointSubtasks
Policy.ConversationPart.scope/2
ConversationPart
records belonging toConversation
records defined byPolicy.Conversation.scope/2
Policy.ConversationPart.scope
:index
endpointconversation.conversationParts
in the clientconversation_id
, but not sure yet:index
endpoint