Skip to content

Improve organisation and naming of controllers and methods #5225

Open
@theseanything

Description

@theseanything

As discussed in #5212, we'd like to improve the organisation and naming of the controllers and their methods. After that ADR has been implemented we will have the following controller structure:

SmartAnswerController

  • index (Index page)
  • show (Start page)
  • visualise (Visualisation page)

FlowController

  • start (Redirect to the first flow question)
  • show (Question and outcome pages)
  • update (Redirect to next question or outcome)
  • destroy (Clear responses and redirect to start page)

@kevindew raised that it is confusing having "SmartAnswersController" and "FlowController", as it unclear what each is responsible for. This may be further exacerbated by the concepts "Smart Answer" and "Flow" not having been strictly defined or existing conflicting usage.

The other change proposed was moving the visualise method from SmartAnswerController to the FlowController, due to it being publicly available in production environment. Start page and index pages are not rendered or accessible from Smart Answers in production. However, it's not clear whether visualise is a feature we support for public use, outside its primary use as a tool to help flow development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions