Key Information

Register
Submit
The challenge is finished.

Challenge Overview

We are giving out bonus payments to every participant that submits and has a score +80. Thus, if you submit and you don't win but your score is +80, we will still pay you a bonus for your efforts.

Challenge Overview

The Enlighten Systems API is a JSON-based API that provides access to performance data for a PV (Photovoltaic) system.

The goal of this challenge is to refactor, test and make a few updates to the provided Ruby code.

Challenge Requirements

Technology Stack

  • Ruby on Rails 3.2

  • Ruby 2.1.5

  • Postgres 9.4

Demo Page

Create simple ruby on rails page that has the following :

  • An authorization button to retrieve user_id authorization.

  • Add a panel for each method implemented in data_harvest.rb with fields needed as input arguments to the method.

    • It will have button to submit a request.

    • It will have a text area to render response.

Here is sample of page, with Get Enphase Feed panel, you will create same panel for rest of the methods.

Functions Requirement

We have the following functions in data_harvest that will be in scope of the challenge :

  • get_enphase_feed

  • get_enphase_summary

  • get_enphase_last_7_day_summaries

    • EnphaseSummary and Job create statements are commented out, you will uncomment and get it working

  • get_enphase_last_7_day_stats

    • this is commented out but you will uncomment and get it working

  • get_enphase_today_stats

  • get_enphase_historical_stats

    • this is commented out but you will uncomment and get it working

  • get_enphase_energy_lifetime

You will apply the following to all functions :

  • Change code to read enphase_key from configuration.

  • Change enphase_user_id to be passed as input parameter

  • Read enphase_url from configuration.

  • All hard coded parameters in the API request should be passed as input parameters.

  • Add parameter validations.

  • Add error/exception handling.

  • Document the code, and provide in-line comments.

  • Refactor code by moving common code to reusable helper functions.

  • remove select1 and select1000 functions.

  • Write unit tests for all functions.

DB Schema

  • The DB schema can be viewed in this pdf.

  • The Ruby model name is identical to table name, it is obvious in the pdf what table relates to what model. If there is something not clear, please ask in forums.

Ruby API Client Framework

You will use Faraday to communicate with the EnPhase API.

Abstracting

Please make sure to create mixin to include the common code/functionality.

Writing Tests

All of your code should be test covered (RSpec preferred).

You will include sample test data required for tests, including test users in enphase.

Documentation

Because other programmers will be working with your code, and incorporating it into their projects, all functions must be documented in detail in the code (TomDoc preferred - In order to generate HTML properly you will need to use Yard TomDoc).

Coding Standard

Follow coding standards listed here:

https://github.com/copycopter/style-guide

Readme

Provide a detailed readme file using Markdown language with following information :

  • Overview

  • Setup Prerequisites

  • How to install

  • Usage Example

  • How to run Demo and Verify results.

  • Reference to Enphase API Documentation

  • Reference this Ruby Gem Documentation

  • Any details about any limitations of your solution.

Please note, we're judging this competition not just on the code, but also on the quality of the documentation, test coverage, and ease of use.

References

Documents

The existing source code is provided in challenge forums.



Final Submission Guidelines

Deliverable

  • All source code files and scripts that address the challenge requirement.

  • Detailed readme file as clarified above.

ELIGIBLE EVENTS:

2015 topcoder Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30049436