consuldemocracy / consuldemocracy

Consul Democracy - Open Government and E-Participation Web Software

Home Page:https://consuldemocracy.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poll and budget demographic stats change over time

javierm opened this issue · comments

References

  • Demographic stats were introduced in commit 132397b for budgets and in commit be68c8c for polls; this bug has always been present in these statistics

Current Behavior

A few years after a poll/budget has finished, the displayed stats might change. It happens because the stats reflect people's current age, gender and geozone, instead of their data at the time they voted.

Expected Behavior

Demographic stats should refer to the time when the process took place.

Notes

For poll voters, we actually store their demographic information at the time they voted in the poll_voters table, so maybe tweaking the participants method could be enough 🤔.

For budget investments, however, we don't currently store this information. We could calculate the age based on when the process took place, but there's no way to track whether someone has changed their gender or their geozone since then.

Pull request #5533 improves the calculation of age stats (not as precise as using the information in poll_voters would be, in the case of polls, though), which solves the most important problem in this issue; after all, not everybody changes their gender or their geozone, but most people certainly change their age as time goes by.