rubyforgood / rubyforgood/human-essentials
Rework calculation of number of people to allow number of kits per person to be taken into account
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 593
- Forks
- 593
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 41
Description
Summary
We had been assuming 1 kit per person in our calcs regarding number of people served in the annual report. This is not alwaus right -- so we'll need to take into account the kit item quantity per individual
Why change?
Accuracy of annual report numbers which impacts grant writing, which impacts the funds and materials the banks have to distribute
Details
We are in the progress of taking kits into account for various numbers in the annual survey (login as org_admin1@example.com, Reports | Annual Survey). We'd been assuming 1 kit per person. We have found out that for weird local-to-state reasons, this is not always the case.
In the calculation of number of people served (currently for diapers, but we are working on period products), we currently assume 1 kit per person. Instead, we need to use the quantity per individual field (item.distribution_quantity) on the item that corresponds to the kit -- if it is not set (or is 0), assume 1 kit per person, otherwise use the given value per person.
(That is, the number of people served by the kit would be the number of kits divided by that value)
Criteria for completion
- calculations changed to take into account the quantity per individual on the kit
- tests modified and/or added to support this change
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the Annual Survey calculation for people served and trace the kit item’s distribution_quantity field. Update or add tests covering unset, zero, and nonzero quantities, and verify that the annual report uses the resulting people-served count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- analytics, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100