Closed begedin closed 6 years ago
These two really go together, so we likely need to add them together.
We should not deal with changesets as part of this issue, as we really aren't sure yet what they might look like.
The idea is that a project can start a message with a user. This creates a Message record, with the following fields
Message
initiated_by: "admin"
author
project
A Conversation record is then also created
Conversation
From the other side, a user can also message a project. This, again, creates a Message record, with the following fields:
initiated_by: "user"
Again, a Conversation is also created
In both cases, any side can then post further messages to the same conversation. This creates ConversationPart records
ConversationPart
status
"open"
"closed"
read_at
null
belongs_to :message
belongs_to :user
has_many :conversation_parts
body
belongs_to :author
belongs_to :conversation
"conversations"
"conversation_parts"
lib/code_corps/model/conversation.ex
lib/code_corps/model/conversation_part.ex
Stressing the fact that this issue should not deal with changesets, it should be done in 1-2 hours.
What needs clarification here?
@joshsmith Sorry, that was supposed to be "needs code review"
Problem
These two really go together, so we likely need to add them together.
We should not deal with changesets as part of this issue, as we really aren't sure yet what they might look like.
The idea is that a project can start a message with a user. This creates a
Message
record, with the following fieldsinitiated_by: "admin"
author
- the project member who created it,project
- the project the author is creating the message in the name ofA
Conversation
record is then also createdFrom the other side, a user can also message a project. This, again, creates a
Message
record, with the following fields:initiated_by: "user"
author
- the outside user who messaged the projectproject
- the project that gotmessagedAgain, a
Conversation
is also createdIn both cases, any side can then post further messages to the same conversation. This creates
ConversationPart
recordsConversation fields
status
-"open"
/"closed"
- string, defaults to"open"
read_at
- timestamp, defaults tonull
belongs_to :message
- cannot benull
belongs_to :user
- cannot benull
has_many :conversation_parts
ConversationPart
fieldsbody
read_at
(by admin in project if author is user, otherwise by user)belongs_to :author
belongs_to :conversation
Subtasks
"conversations"
and"conversation_parts"
tableslib/code_corps/model/conversation.ex
lib/code_corps/model/conversation_part.ex
References
Message
model to linkConversation
with