codeforboston / cambridge_energy_app

EnerSave is designed to help and encourage Cambridge residents to reduce their electric bills.
https://www.enersaveapp.org/
MIT License
33 stars 25 forks source link

Eversource XML Upload - 1st pass #243

Closed kvotolato3 closed 8 years ago

kvotolato3 commented 8 years ago

This will allow users to upload their "Download My Data" xml files from Eversource. These are files that contain the previous 12 months of meter readings and bills belonging to a particular customer.

Parsing is done with Nokogiri, and we are storing both the full xml content and jsonified content in the database. As of now, files aren't being stored anywhere.

Since I am an Eversource customer myself, I have been using a personal file to test the upload functionality. There wasn't a "Download My Data" sample file on the Green Button developer site, only the Subscription Feeds, so that's why.

Things that still need to be done after this pull request:

kvotolato3 commented 8 years ago

I can see the Travis build is failing because when it tries to run the migration that adds the jsonb column, there is an error: ActiveRecord::StatementInvalid: PG::UndefinedObject: ERROR: type "jsonb" does not exist

My first suspicion is that PostgreSQL may be out of date. I know I had to update my PostgreSQL to 9.4 (or later) before rails would let me run the migration, so maybe it is the same issue here.

Assuming that's the issue, I think everyone needs to be aware that once we merge this, anyone who works on the app should have Postgres version 9.4 or later.

@mzagaja Do you know how to check the Postgres version that TravisCI uses? And, do you think we might have an issue in production?

mzagaja commented 8 years ago

You should be able to set it by updating .travis.yml as described at: https://docs.travis-ci.com/user/database-setup/#Using-a-different-PostgreSQL-Version. I'll review this after you try that.

kvotolato3 commented 8 years ago

That worked!

mzagaja commented 8 years ago

This looks great. As we discussed I think we're just going to make the following changes:

kvotolato3 commented 8 years ago

Ready for review!

mzagaja commented 8 years ago

This is awesome! Great work.