Skip to content

Energy points

Intro

Energy points are points that can be released into an organisation to show growth. Various actions on Flowcode release points into the organisation, and these actions release differing amounts of energy points.

What releases energy points

Energy points can be released by the following actions:

  • Completing a task: When a Task is created, there is a requirement to add the energy points allocated to that task, 1,2,3,5,8,13,21.
  • Completing a project: Projects are hard wired at 10 points per week.
  • Completing an objective: SO’s (O), are hard wired at 55 points per month, 135 per quarter.

Tracking energy points

Once a related activity releases energy points, a record is added to the global energy points table. This table tracks a number of attributes which are helpful for aggregation.

  • organisation_id: The organisation ID of the associated organisation
  • user_id: The user ID of the associated user
  • task_id: The task ID if the energy was generated from a task
  • project_id: The project ID if the energy was generated from a project
  • objective_id: The objective ID if the energy was generated from an objective

Model observers

In order to track and log energy points, we use model observers. These observers will check for changes in status, owner, length, department across:

  • Tasks
  • Projects
  • Objectives

If any of those items have changes, the EnergyService class will update or remove the record appropriately

EnergyService

The energy service class will create, update or remove energy records for:

  • Tasks
  • Projects
  • Objectives

Unit tests

All unit tests are in the EnergyPointServiceTest class