asm-helpful/helpful-web — pull request #79 by vanstee (2013-12-27 22:22:52+00:00)
Title: Track conversation response time

:warning: This is not yet ready to be merged

https://assemblymade.com/helpful/wips/68

Started out with a refactor to move some of the logic out of the messages controllers by adding message author and message composer objects. So far I think we should be able to track the response times by storing a timestamp on customer messages. When a non-customer posts a message, we can check to see if there are any outstanding messages (customer messages without an `agent_responded_at` timestamp) and then set it. To calculate the average response times for a conversation we can grab the duration between message creation and the response timestamp possibly and possibly cache the result in the conversation record depending on how quick it is.