๐Ÿ‘ฅ User Management

Combine duplicate player records and re-aggregate stats

๐Ÿ”’ Admin Tool
-
Total Records
-
Auth Users ๐Ÿ”
-
Linked (users coll)
-
Legacy Profiles
-
Migrated
-
โš ๏ธ Issues
โ„น๏ธ How to Combine Player Records (e.g., Joe/Joseph)
  1. Search for player name variants (e.g., "Joe Smith" and "Joseph Smith")
  2. Select the records to merge as Source (data moves FROM these)
  3. Select ONE record as the Target (data moves TO this)
  4. Preview shows actual playerStats and pitchingStats data
  5. Execute merge moves all season/game docs and deletes source docs
  6. Run the Aggregator afterward to rebuild career totals!
โš ๏ธ This tool merges at the source level:
  • playerStats/{source}/seasons/* โ†’ playerStats/{target}/seasons/*
  • playerStats/{source}/games/* โ†’ playerStats/{target}/games/*
  • pitchingStats subcollections are also moved
  • Source documents are deleted after copying
  • aggregatedPlayerStats/{source} is marked as migrated
๐Ÿ” Find Player Records
๐Ÿ”Ž Direct playerStats Lookup (for records not in aggregatedPlayerStats)

โšก Merge Preview

๐Ÿ“ฅ Source Records (will be merged)

โ†’

๐Ÿ“ค Target Record (receives all stats)

๐Ÿ“Š Combined Career Stats Preview
๐Ÿ“… Seasons to Merge
Season Team G AB H R AVG Source
๐Ÿ“Š Profile Setup Status

Track which authenticated users have completed the profile setup guide.

-
Total Auth Users
-
Setup Complete
-
Partial Setup
-
Not Started
-
Has FCM Token
-
In Directory
-
Active (30 days)
-
Stale (60+ days)
User โ†• 1๏ธโƒฃ 2๏ธโƒฃ 3๏ธโƒฃ Role Joined โ†“ Last Visit โ†•
Loading user data...

๐Ÿ”ง Repair Orphaned Stats (Auth UID โ†’ Legacy ID)
โš ๏ธ What this does: Finds playerStats documents stored under a Firebase auth UID (caused by a merge bug now fixed). Moves seasons/games to the correct legacy snake_case path, then deletes the orphaned UID doc. Run the Aggregator afterward.
๐Ÿ“ง Bulk Email Update

Upload a CSV or Excel file to update the email field in users/{id} for any player โ€” auth or non-auth. Matched by player name against the loaded player list.

๐Ÿ“‹ Expected format: Any CSV or Excel with at least a name column and an email column. You'll map the columns after upload.
Writes only the email field to users/{documentId} โ€” no other fields touched.
๐Ÿ“ง

Click to upload or drag & drop

CSV, XLSX, or XLS

๐Ÿ“‹ Operation Log
Ready. Search for players to begin...