Slide 1

Slide 1 text

@codescrum Application Example based on Gov.uk public code This talk shows how we can implement a custom customer service flow based on the SmartAnswers module from the GOV.UK project. Jairo Diaz @codescrum

Slide 2

Slide 2 text

@codescrum Requirement ● Implement a pension advice tool: Start Question 1 Question 2 Oucome 1 Question 4 Oucome 2 Oucome 3 Oucome 4

Slide 3

Slide 3 text

@codescrum GOV.UK ● https://www.gov.uk/which-finance-is-right-for-your-business/

Slide 4

Slide 4 text

@codescrum Can we reuse? 1. Spike: Install and implement a simple flow 2. Review code 3. Reuse code

Slide 5

Slide 5 text

@codescrum Step 1. Test Simple Flow ● Github project: alphagov / smart-answers-stack ● Check Readme.md

Slide 6

Slide 6 text

@codescrum Dependencies for Smart-answers Smart-anwers (5001) Static (5000) GovUk_Content_API (5002) MongoDb (27017) Local URL: http://smartanswers.dev.gov.uk/which-finance-is-right-for-your-business

Slide 7

Slide 7 text

@codescrum Smart-answers DSL (flow.rb) multiple_choice :have_you_got_a_letter? do option :yes => :what_does_your_letter_say? option :no => :workplace_pension_good_idea end multiple_choice :what_does_your_letter_say? {...} outcome :workplace_pension_good_idea outcome :no_outcome

Slide 8

Slide 8 text

@codescrum Smart-answers Text (flow.yml) en: test-flow: flow: have_you_got_a_letter?: title: Have you received a letter ... options: "yes": "Yes" "no": "No" workplace_pension_good_idea: body: “the advice is here”

Slide 9

Slide 9 text

@codescrum Step 2. Review Code CodeClimate Metrics: Duplication / Complex Method / Complex Class

Slide 10

Slide 10 text

@codescrum Test Coverage

Slide 11

Slide 11 text

@codescrum Rails App SmartAnswers Controller SmartAnswers Presenter Show.html.erb Look up translations Controls UI elements Find Flow Control user interaction Controls Display for a multiple choice question with “options” MultipleChoice QuestionPresenter Renders UI

Slide 12

Slide 12 text

@codescrum Library Interface SmartAnswers Presenter FlowRegistry MultipleChoice MultipleChoice QuestionPresenter Method instance Method find Flow Method name Method process Method node Method path SmartAnswers Controller Method name Method process Method node Method path Method name Method options Method to_response

Slide 13

Slide 13 text

@codescrum Library Implementation State Node Question::Base SmartAnswers Presenter FlowRegistry MultipleChoice MultipleChoice QuestionPresenter Flow SmartAnswers Controller

Slide 14

Slide 14 text

@codescrum Step 3. Reuse Code FlowStatePresenter QuestionPresenter Flows Controller SmartAnswers Presenter MultipleChoice QuestionPresenter SmartAnswers Controller FlowRegistry MultipleChoice Flow

Slide 15

Slide 15 text

@codescrum Additional elements ● Custom Javascript application ● Localisation for an additional language ● Cucumber / RSpec testbed ● Google Analytics configuration ● Deployment ● Service monitoring

Slide 16

Slide 16 text

@codescrum Workplace pension advice tool https://www.moneyadviceservice.org.uk/en/tools/workplace-pension-advice-tool

Slide 17

Slide 17 text

@codescrum The new budget tool https://www.moneyadviceservice.org.uk/en/tools/the-budget-and-you

Slide 18

Slide 18 text

@codescrum Other Interesting Projects ● Smart-answers-builder file://localhost/Users/User/Github/smart-answer-builder/index.html ● Performance management apps (backdrop) https://www.gov.uk/performance/dashboard ● CMS: whitehall / publisher / frontend ● Puppet modules

Slide 19

Slide 19 text

@codescrum Thank you & Questions