-
Notifications
You must be signed in to change notification settings - Fork 3
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
Reservation Rate excel export #52
Reservation Rate excel export #52
Conversation
611fb14
to
c65626e
Compare
c65626e
to
5bed312
Compare
Most of the tests that were failing were due to a translation mismatch. So nothing critical and doesn't have to be bothered with in this PR. I did however remove another test that was failing due to code changes from a ~year ago that made the test void. |
37df651
to
5293c56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a lot of things going on here, but I will approve this. I don't know the business logic here or if the data itself is the correct one, I mainly looked at the code in general.
Add new endpoint where you can download an excel report that contains a separate sheet for each unit. Each sheet will have a summary that contains unit name, time filters, reservation rate. Below summary a list of resources with their sums of reserved time per each resource. Below this will be listings of reservation details per resource. The endpoint will take parameters that will be used for filtering the queries. Required filters are: list of units, begin date and end date. Times are optional, but will default to 08:00 and 16:00. Create serializers for the purpose of having a simple top-down data structure. Use the BaseReport base class for the new view. Create a custom excel renderer.
Test kept failing due to it testing that an exception should be raised. But the code that it tests is now wrapped in a try except block which swallows the raised exception so it can not be passed to the test.
5293c56
to
eefaf92
Compare
Added translations to API error messages for fields that the user selects on the frontend. |
Changes are well documented in commit messages and code!
Not to be merged quite yet!
To be done:
See frontend PR: City-of-Helsinki/huvaja#338
Example of generated excel file.