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

PR for Database changes #632

Merged
merged 33 commits into from
May 5, 2021

Conversation

wadoodalam
Copy link
Contributor

@wadoodalam wadoodalam commented Apr 29, 2021

Description

This PR modifies the database by making changes to meters, maps, and groups. Additional attributes for meters are added which allows to check if the given reading is the cumulative sum or not and if and when the pipeline needs reset. Other changes include the timestamps, variation, and length of the reading associated with the meter. It also allows for checking if the reading overlaps to the previous day or not. This PR is also a step towards determining the start time of the reading if not provided. Additionally, The PR allows for the storage of some additional data with regards to groups. Another thing addressed in this PR is to allow for storing the circle size of the meter on the map and the angle with which the image has been rotated with respect to the north. Test code for these changes and changes to the script of test data has also been implemented.

Fixes #634. It begins to address issue #211.

(Check the ones that apply by placing an "x" instead of the space in the [ ] so it becomes [x])

  • Note merging this changes the node modules
  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

(Note what you have done by placing an "x" instead of the space in the [ ] so it becomes [x]. It is hoped you do all of them.)

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request

Limitations

Test code associated with OED/src/server/test/web/meters.js and OED/src/server/test/web/groups.js still needs fixes. Additional attributes which are added in this PR are not returned by the relevant route from the server to the aforementioned files.

by @huss: The test code has been updated and no longer fails. I have the new values so they are returned by the route to allow testing but they have not been added to Redux state at this point. It is assumed that will happen as the code that will use these values are added. As such, this PR updates the DB to hold state OED is planning to use so future developers can add that code.

@wadoodalam wadoodalam closed this Apr 29, 2021
@wadoodalam wadoodalam changed the title PR for Database changes for meters, maps, and groups. Models are modified to accommodate the DB changes. Additionally, test code and test date script was modified/created(1). PR for Database changes for meters, maps, and groups. Models are modified to accommodate the DB changes. Additionally, test code and test date script was modified/created(1 test in web/groups.js needs a fix). Apr 29, 2021
@wadoodalam wadoodalam reopened this Apr 29, 2021
@wadoodalam wadoodalam changed the title PR for Database changes for meters, maps, and groups. Models are modified to accommodate the DB changes. Additionally, test code and test date script was modified/created(1 test in web/groups.js needs a fix). PR for Database changes Apr 29, 2021
Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

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

There are a fair number of issues that need to be carefully addressed in this PR. I have not yet tested the code functions properly but wanted to get these comments to the author.

src/server/test/web/groups.js Outdated Show resolved Hide resolved
src/server/test/web/maps.js Outdated Show resolved Hide resolved
src/server/test/web/maps.js Outdated Show resolved Hide resolved
src/server/test/web/meters.js Outdated Show resolved Hide resolved
src/server/test/web/meters.js Outdated Show resolved Hide resolved
wadoodalam and others added 9 commits May 3, 2021 18:33
This is an arbitrary time so I think it best to best at midnight.
Fixed date format.
Made group and meter names, notes different
Fixed one space issue
Made enter identifier names consistent
I messed up year in my edits and am putting back
huss added 7 commits May 4, 2021 12:00
Also made time tests use Meter object used to create meter to do tests.
- The route for maps needed to return the two new values.
- A previous bug stopped test loop from executing. This likely is why
broken tests were not noticed.
- The modifiedDate test was wrong and fixed.
- The new tests for the new properties was wrong.
- Made new values unique to each map so test was stronger.
- The new DB items for meters were added to what the route returns.
Only area is being returned for non-admin to see.
- Refactored code to make testing of meters easier.
- Added tests for all new DB values.
- Make values in each meter more unique for stronger testing.
Takes into account removing previous day and renaming of meters/groups.
@huss
Copy link
Member

huss commented May 5, 2021

I have pushed a number of commits to the PR to address:

  • A few issues not completed by @wadoodalam that are in the review including removal of previous day per design document
  • Remove .DS_Store Mac file that should not be in repo (seems added via this PR) and caused check failure
  • Improved/fixed some existing testing and add tests for some new DB items in the PR. This includes fixing the test that failed and noted in the PR description (now edited)
  • I note that there are a lot of instances of creating meters, groups & maps that do not pass the new arguments. I have created issue update code for new meters, groups & maps #635 so it can be addressed at some point.

@huss
Copy link
Member

huss commented May 5, 2021

I have completed local testing and it seems to run fun. I believe this is ready to merge.

@huss huss merged commit dd25835 into OpenEnergyDashboard:development May 5, 2021
@huss huss mentioned this pull request May 11, 2021
5 tasks
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.

Database Changes
2 participants