Conversation
What was broken The Engagement Data report could export the wrong country or null for some members because it did not follow the same location precedence as the Profile app. Root cause The engagement member enrichment SQL only resolved country from competition-country data and the denormalized member country field, so it ignored home-country data that the Profile app prefers. What was changed Updated the engagement member enrichment SQL to resolve country names through the lookups country table with homeCountryCode first, then competitionCountryCode, then the stored member country fallback. Updated the engagement report service documentation to reflect the profile-aligned country precedence. Any added/updated tests Added src/reports/topcoder/topcoder-reports.sql.spec.ts to lock the Engagement Data country precedence in focused SQL regression coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
QA found that the Engagement Data report could still show the wrong country or null for some members even after the original PM-4800 report was added. The remaining examples were members whose Profile app location showed a home-country value like Japan or Sri Lanka while the export showed Aruba or null.
Root cause
The engagement member enrichment SQL was resolving country from competition-country data and the denormalized member country field instead of following the Profile app's home-country-first fallback order.
What was changed
Updated the engagement member enrichment SQL to resolve country names through the lookups country table with homeCountryCode first, then competitionCountryCode, then the stored member country fallback.
Updated the engagement report service documentation to reflect the profile-aligned country precedence.
Any added/updated tests
Added src/reports/topcoder/topcoder-reports.sql.spec.ts to lock the Engagement Data country precedence in focused SQL regression coverage.
Validated with
pnpm test -- src/reports/topcoder/topcoder-reports.service.spec.ts src/reports/topcoder/topcoder-reports.sql.spec.ts,pnpm lint, andpnpm build.Full
pnpm teststill fails on existing SFDC suites already red ondevelop:src/reports/sfdc/sfdc-reports.dto.spec.ts,src/reports/sfdc/sfdc-reports.module.spec.ts,src/reports/sfdc/sfdc-reports.controller.spec.ts, andsrc/reports/sfdc/sfdc-reports.service.spec.ts.