Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app/tmp
#app/vendor

#Container volume
data
./data/

#Tests results
test-results
Expand Down
3 changes: 3 additions & 0 deletions db/data/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are lists of actions users will be able to take in Arbol to track their Cool Climate goals.
- id: commute
- id: telecommute
62 changes: 62 additions & 0 deletions db/data/arbol_questions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# These are questions Arbol users will answer in goal configuration and action forms.
# When these questions' answers are reported to Cool Climate user API,
# they will be wrapped in Action modules, which translates these answers to Cool Climate
# calculator API keys and values. They can thus be used to return a result for the action.
- id: commute_mode
type: string
validation:
options:
- car
- motorcycle
- bicycle
- plane
- train
- public_transit
- id: carpool_car_type
type: string
validation:
options:
- small_car
- medium_car
- large_car
- truck_suv
- minivan
- id: commute_car_age
type: float
validation:
min: 0
max: 100
- id: commute_car_efficiency
type: float
unit: miles / gallon
validation:
min: 0
max: 999
- id: commute_distance
type: integer
unit: meters
validation:
min: 0
- id: commute_carpool
type: bool
- id: commute_fees_avoided
type: float
unit: 'usd'
- id: commute_carpool_passengers
type: integer
validation:
min: 0
- id: commute_work_distance
type: float
unit: meters
- id: commute_work_time
type: float
unit: seconds
- id: time_value
type: float
unit: 'usd / hr'
validation:
min: 0



80 changes: 80 additions & 0 deletions db/data/goals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# List of Cool Climate goals
# NOTE: API key = 'input_takeaction_' + id.
- id: carpool
configuration:
- id: commute_car_type
- id: commute_car_age
- id: commute_car_efficiency
actions:
- id: commute
questions:
- id: commute_mode
- id: commute_distance
- id: commute_carpool
parent:
id: commute_mode
logic:
'==': car
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is JSON logic: http://jsonlogic.com/

Basically it means we will compare the answer for compute_mode and then:

if (jsonLogic.apply( { "==" : ['car', answers.commute_mode] } )){
  // show question commute_carpool
}

- id: commute_fees_avoided
parent:
id: commute_carpool
logic:
'==': true
- id: commute_carpool_passengers
parent:
id: commute_carpool
logic:
'==': true
- id: commute_car_efficiency
parent:
id: commute_mode
logic:
'==': car
- id: telecommute
configuration:
- id: commute_mode
- id: commute_car_efficiency
parent:
id: commute_mode
logic:
'==': car
- id: time_value
actions:
- id: telecommute
questions:
- id: commute_fees_avoided
- id: commute_work_distance
- id: commute_work_time
- id: go_organic
- id: low_carbon_diet
- id: ride_my_bike
- id: plant_trees
- id: take_public_transportation
- id: reduce_air_travel
- id: turn_off_lights
- id: practice_eco_driving
- id: thermostat_winter
- id: rechargeable_batteries
- id: low_flow_faucets
- id: maintain_my_vehicles
- id: install_solar_heating
- id: alternativefuel_vehicle
- id: switch_to_cfl
- id: water_efficient_landscaping
- id: purchase_green_electricity
- id: low_flow_toilet
- id: power_mgmt_comp
- id: T12toT8
- id: energy_star_fridge
- id: thermostat_summer
- id: low_flow_showerheads
- id: more_efficient_vehicle
- id: reduce_comm_waste
- id: tankless_water_heater
- id: hybrid_vehicle
- id: install_PV_panels
- id: line_dry_clothing
- id: energy_star_desktops
- id: energy_star_printers
- id: energy_star_copiers
- id: print_double_sided
1 change: 1 addition & 0 deletions db/data/swagger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
swagger.yml