Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Children served not calculated correctly if there are kits #4915

Open
2 tasks
cielf opened this issue Jan 5, 2025 · 0 comments
Open
2 tasks

Children served not calculated correctly if there are kits #4915

cielf opened this issue Jan 5, 2025 · 0 comments
Labels

Comments

@cielf
Copy link
Collaborator

cielf commented Jan 5, 2025

Summary

The children served number is not including children served with kits appropriately

Why fix?

Consistency. Corrextness.

Details

Regarding the Annual Survey
This method:
def children_served_with_kits_containing_disposables
organization
.distributions
.for_year(year)
.joins(line_items: {item: :kit})
.merge(Item.disposable)
.where.not(items: {kit_id: nil})
.distinct
.count("kits.id")
end

counts kits that are disposables (which will be 0), not kits that have disposables

Fix it.

(You probably shouldn't take this one unless you are familiar with both the annual survey and kits. And you might need to do SQL for this. So it's a little advanced)

Criteria for completion

  • behaviour as decribed
  • tests to confirm the behaviour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant