Skip to content

Better engagement handling#88

Merged
jmgasper merged 16 commits into
masterfrom
develop
Apr 24, 2026
Merged

Better engagement handling#88
jmgasper merged 16 commits into
masterfrom
develop

Conversation

jmgasper and others added 16 commits April 10, 2026 13:39
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.
What was broken
The Engagement Data report could still show the wrong country or null for some members after the first QA follow-up. Members whose profile location resolved from home or competition country codes could still export the stale legacy country value instead.

Root cause
The previous fix expanded the SQL lookup coverage, but it still collapsed country resolution into a single SQL field that fell back to members.member.country. That legacy field can be stale and does not match how the profile UI resolves member location.

What was changed
Split engagement member enrichment into separate home-country and competition-country resolution fields plus the raw profile country codes.
Resolved the final export country in the report service with the same home-country-first precedence the profile UI uses, and removed the stale members.member.country fallback.
Expanded SQL coverage to resolve country names through both lookups.Country and identity.country so legacy alpha-2, alpha-3, and lookup-id values still map correctly.
Updated the report documentation to match the current country sources.

Any added/updated tests
Updated src/reports/topcoder/topcoder-reports.service.spec.ts to cover the profile-style country precedence for the report output.
Updated src/reports/topcoder/topcoder-reports.sql.spec.ts to lock the SQL against falling back to members.member.country.
PM-4886 Allow multiple countries in member search
PM 4886 Fix talent search api response
 Better handling of engagements ID in SFDC payments report PM-4918
@jmgasper jmgasper merged commit 5724ce3 into master Apr 24, 2026
6 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.

2 participants