blurts-server
blurts-server copied to clipboard
MNTOR-4448: merge dup subscriber script
References:
Jira: MNTOR-4448
Description
This script is meant to be run as a one-off job that needs to be run in a pod. It implements the cohort-based strategy for merging duplicate subscriber entries where multiple subscribers share the same fxa_uid. The script:
-
- Identifies all duplicate fxa_uids
-
- Categorizes them into 4 cohorts based on paid status and activity
-
- Processes each cohort with appropriate merge logic
-
- Updates related tables to point to the winning subscriber record
-
- Performs all operations in transactions with logging
How to test
See additional testing doc / explaination
Checklist (Definition of Done)
- [x] Commits in this PR are minimal and have descriptive commit messages.
- [x] I've added or updated the relevant sections in readme and/or code comments
- [x] I've added a unit test to test for potential regressions of this bug.
- [x] Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
- [x] All acceptance criteria are met.
- [x] Jira ticket has been updated (if needed) to match changes made during the development process.
- [x] Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.
Preview URL :rocket: : https://blurts-server-pr-5907-mgjlpikfea-uk.a.run.app