Preliminary finance endpoint
Created by: adarsh-murthy
There are changes in both financial-inputs and preliminary-finance.
- financial-inputs:
- Add growth rate model and store growth rate
- Update frontend to show warning message about changing fund when cursor is over the fund.
- Update frontend to make sure to reload the loan options table only is fund is changed.
- preliminary-finance:
- Create endpoint.
- Create Scenario, CostEstimation and SavingsEstimation models.
- Frontend displays a tab asking scenario name. Display cost and savings estimation tables.
- Save scenario triggers preliminary analysis.
- Backend fetches all relevant data from database and calls BP Fin code to perform preliminary analysis and sends the Project Economics and graph data to frontend.
- Frontend shows the Project Economics table and the Energy Expense Savings graph.
Notes:
- Scenario and it's details in the tab currently not being saved. Once all components of this table is complete, those components have to be done for multiple tabs. Will be developed later.
- Currently, scenario can be saved without filling out all the details on financial-inputs. This will be modified to be disabled later.
- After merging this PR, a lot of refactoring of existing code will take place so don't be too critical with this one.
To test:
- RUN
python manage.py migrate. - RUN
python manage.py runserver. - go to
http://127.0.0.1:8000/buildings/<building_id>/financial-inputs/and fill out all the forms and save them. - go to
http://127.0.0.1:8000/buildings/<building_id>/preliminary-finance/and input scenario name and fill cost and saving estimation tables and save to see the output table and graph.