Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reporting - API] Add method to count messages sent/received by date #255

Closed
reichert621 opened this issue Sep 29, 2020 · 10 comments
Closed
Assignees
Labels

Comments

@reichert621
Copy link
Collaborator

reichert621 commented Sep 29, 2020

Problem
Users should be able to see a breakdown of messages sent vs received in the reporting dashboard.

Solution
Let's create two methods in the Reporting context (https://github.com/papercups-io/papercups/blob/master/lib/chat_api/reporting.ex)

  • One should retrieve daily counts of "sent" messages
    • "Sent" messages are messages where user_id is not null (i.e. it was sent by a signed-in user)
  • The other should retrieve daily counts of "received" messages
    • "Received" messages are messages where customer_id is not null (i.e. it was sent by a customer through the chat widget)

The responses should look something like this:

[
  %{date: "2020-09-01", count: 7},
  %{date: "2020-09-02", count: 12}, 
  %{date: "2020-09-03", count: 4}
]

Testing
Please add tests to test/chat_api/reporting_test.exs and make sure they pass with mix test :)

Context
See #252

Questions, or need help getting started?
Feel free to ask below, or ping us on Slack :)

(You can also check out our CONTRIBUTING.md)

@eikooc
Copy link
Contributor

eikooc commented Oct 1, 2020

As mentioned in #254 I'd like to pick this up 👍

@reichert621
Copy link
Collaborator Author

sure @eikooc! once #254 is completed i'll assign this one to you :)

@WLSF
Copy link
Contributor

WLSF commented Oct 4, 2020

I'd like to help with this one, is it available? I saw that there was nos activity over the past 4 days.

@reichert621
Copy link
Collaborator Author

sure! i'll reassign it to you since i think @eikooc still hasn't finished #254 👍

(cc @eikooc let me know if you have any updates!)

@WLSF
Copy link
Contributor

WLSF commented Oct 5, 2020

Wow ok, thanks!

@eikooc
Copy link
Contributor

eikooc commented Oct 5, 2020

Totally fine. It is taking me some time to set up the Elixir development environment for some reason, so I am still working on #254 :-)

@WLSF
Copy link
Contributor

WLSF commented Oct 5, 2020

@eikooc If you need some help, you can call me and we can pair or something to set the environment and discuss about the task... 😸

@reichert621
Copy link
Collaborator Author

btw we also have a shared slack channel if you guys want to chat there :) https://github.com/papercups-io/papercups#get-in-touch

@eikooc
Copy link
Contributor

eikooc commented Oct 5, 2020

@WLSF that would be fun! join the slack channel and let's coordinate! 🐈

@reichert621
Copy link
Collaborator Author

done in #272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants