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

#281 - Add a count for customers created per day #314

Conversation

jonathanyeong
Copy link
Contributor

Description

Adds methods in Reporting to get the number of customers created per day.

Also:

  • Add a customer test_changeset. This allows us to modify the inserted_at column in tests.
  • Add tests for count_customers_by_date methods. Separated from the other test blocks because
    we don't need to create a customer during the setup.

Issue

#281

Checklist

  • Everything passes when running mix test
  • Ran mix format
  • No frontend compilation warnings

Also:

- Add a customer test_changeset. This allows us to modify the `inserted_at` column in tests.
- Add tests for count_customers_by_date methods. Separated from the other test blocks because
  we don't need to create a customer during the setup.
Also, add specs to new customer reporting methods
Copy link
Collaborator

@reichert621 reichert621 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great @jonathanyeong! :)

just one small nitpick and then should be good to merge 🎉

@@ -102,4 +102,10 @@ defmodule ChatApi.Customers.Customer do
:time_zone
])
end

def test_changeset(message, attrs) do
message
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit -- let's change message to customer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh copy and paste error. Good catch thanks!

Darn copy and paste error.
@m1ome m1ome mentioned this pull request Oct 13, 2020
3 tasks
Copy link
Collaborator

@reichert621 reichert621 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jonathanyeong! 😄

@reichert621 reichert621 merged commit a4088dd into papercups-io:master Oct 13, 2020
@jonathanyeong jonathanyeong deleted the 281-add-customers-created-per-day branch October 13, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants