Skip to content

PM-5880 - exclude specific users from general statistics - #152

Merged
vas3a merged 1 commit into
developfrom
PM-5880_exclude-specific-users
Aug 28, 2026
Merged

PM-5880 - exclude specific users from general statistics#152
vas3a merged 1 commit into
developfrom
PM-5880_exclude-specific-users

Conversation

@vas3a

@vas3a vas3a commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces the ability to exclude specific user IDs from general statistics reports, such as country member details and top winners by country. This exclusion is configurable via a new environment variable and is consistently applied across the backend logic and SQL queries. The changes also include robust parsing of configuration values and comprehensive test coverage for the new feature.

Configuration and Exclusion Logic:

  • Added REPORTS_EXCLUDED_USER_IDS environment variable to README.md to allow configuration of user IDs to be excluded from general statistics reports.
  • Updated GeneralStatisticsService (src/statistics/general-statistics.service.ts) to parse the new exclusion config, handle both JSON arrays and comma-separated lists, and ensure all IDs are treated as strings. [1] [2]

SQL Query Updates:

  • Modified SQL queries in sql/reports/statistics/general/country-member-details.sql and sql/reports/statistics/general/top-winners-by-country.sql to exclude rows where the user ID matches any in the exclusion list. [1] [2]

Backend Integration:

  • Updated all database queries in GeneralStatisticsService to pass the excluded user IDs as a parameter to SQL, ensuring exclusions are enforced at the query level. [1] [2]

Testing Improvements:

  • Enhanced unit tests in src/statistics/general-statistics.service.spec.ts to verify that excluded user IDs are correctly handled, including cases with defaults and unset configs. Also updated SQL snapshot tests to check for the new exclusion logic. [1] [2] [3] [4] [5] [6]

@vas3a
vas3a merged commit 453d111 into develop Aug 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant