Add percentage complete to Organizations and Programs
Closed this issue · 0 comments
peregrinator commented
In order to help quantify where effort needs to be focus/expended by an org or admin in getting data in the system we need to add a completion mechanism to programs. This can start as a simple percentage of fields complete.
ProgramCompletionRateCalculator
- create a ProgramCompletionRateCalculator class that handles the calculation of this metric
- the
completion_rate
method accepts an Object (either Org or Program right now) and a hash of weights => attributes (see below)- divide the total weight by the number of items in the group to get the contribution of each item - check the items value on the passed object and if an item isn't nil or empty (may be an association) then add it's value to the overall completeness
Organization and Program
- add completion_rate method that calls the ProgramCompletionRateCalculator with self and it's list of completion weights
- add a COMPLETION_WEIGHTS constant that is the total weight of the group and an array of attributes in that group
ruby COMPLETION_WEIGHTS = { "0.5" => [:name, :location], "0.3" => [:program_days, :program_times] }
User View
- display metric to logged in users
- on an org page
- on a program page
- Percentage complete should only be shown for organizations that have had at least one associated user as marked as attended. See #20
Admin View
- Add a data completion area to the admin dashboard to help easily get a sense of where things stand.
- Show completion for orgs without an associated user that is marked as attended and show that no user has attended (See #20).