Skip to content

GAQs: Carpool, Telecommute#10

Open
erichulburd wants to merge 1 commit intodevelopfrom
config/commute
Open

GAQs: Carpool, Telecommute#10
erichulburd wants to merge 1 commit intodevelopfrom
config/commute

Conversation

@erichulburd
Copy link
Copy Markdown

@erichulburd erichulburd commented Nov 21, 2016

Task
https://trello.com/c/tE68iV00/125-specs-actions-goals-arbol-integration

Summary

  • Begin defining static goals, actions, and questions (GAQs).
  • See schematic of how GAQs are sent from Arbol and processed by guide.
    • In this case, cc-user-api (guide) will then take answers, process them into Cool Climate carbon calculator API input keys, and return estimation for how much carbon the user saved in that single action.
  • Form logic (ie when to show/hide questions) will be defined with JSON logic: http://jsonlogic.com/
  • Unit conversion will be based on mathjs: https://github.com/josdejong/mathjs/blob/master/docs/datatypes/units.md
    • NOTE: This library accepts compound strings (en 'miles / gallon'), but we may have to define some unit types (eg math.createUnit('gallons', '3.78541 liters')).
  • We will do work through the goals 1-2 per PR. Let's do them deliberately. When thinking about how define actions and questions for a goal, remember:
    • We will want actions to be shared amongst several platforms. They should be generic. Not specific to a single guide's platform.
    • Questions may be shared across several goals. So these two should be generic.

Smoke Test
None yet. We are first defining goal/actions/questions in yml. We will later seed these into a database and they will be used for communication between Arbol and Cool Climate.

Notes

  • Once we have a good sample of GAQs in the configuration files, I will fill out swagger documentation for Arbol and Cool Climate with the necessary calls.
  • All of the UI strings for these questions will be kept separately in translations files.
  • @manue1 @DKbyo Just take a look at these. Let me know if you have any general questions about what is going on here. I will do a few other PRs to configure more GAQs - then I will ask you guys to help me out).

@erichulburd erichulburd changed the title include db/data GAQs: Carpool, Telecommute Nov 21, 2016
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
}

@manue1 manue1 removed their assignment May 22, 2023
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.

3 participants