Feature: Add country dropdown to player registration #229

Closed
opened 2026-03-28 22:26:32 +00:00 by forgejo_admin · 0 comments

Type

Feature

Lineage

Standalone — discovered during session reviewing registration form. 8 of 55 players are international (Turkey, Bahamas, England, Brazil, Tanzania, France). Country data is buried in free-text hometown field.

Repo

forgejo_admin/basketball-api

User Story

As an admin
I want to see each player's country of origin as structured data
So that I can identify and support international players in the program

Context

The program has players from 6+ countries. Currently country is only discoverable by reading the free-text hometown field (e.g. "Turkey,Istanbul", "Nassau Bahamas", "Bath, England"). Marcus needs a filterable field. Adding a country column with ISO country codes gives structured data without disrupting the existing hometown free text.

Default to "US" so domestic families have zero extra friction. International families see the dropdown and know they're welcome.

File Targets

Files to modify:

  • src/basketball_api/models.py — add country column to Player model (nullable, default "US")
  • alembic/versions/028_add_player_country.py — migration to add column
  • src/basketball_api/routes/register.py — accept country in registration form
  • src/basketball_api/routes/public.py — include country in PublicPlayerResponse
  • src/basketball_api/routes/admin.py — include country in admin player list
  • tests/ — update relevant tests

Files NOT to touch:

  • hometown field — keep as-is, free text is fine for display
  • Parent model — country is per-player, not per-parent

Acceptance Criteria

  • Player model has country column (VARCHAR, default "US", nullable)
  • Registration form accepts country field
  • Public teams API returns country per player
  • Admin player list includes country
  • Default is "US" for existing players (migration backfill)
  • Tests pass

Test Expectations

  • Registration with country creates player with correct value
  • Registration without country defaults to "US"
  • Public API returns country field
  • Run: pytest tests/ -v

Constraints

  • Use ISO 3166-1 alpha-2 codes (US, TR, GB, BR, TZ, FR, BS, etc.)
  • Store as simple VARCHAR, not an enum — too many countries for an enum
  • Default "US" in migration for all existing 55 players
  • Frontend dropdown is a separate ticket (westside-landing repo)

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-westside-basketball
  • Frontend companion ticket needed for westside-landing dropdown
### Type Feature ### Lineage Standalone — discovered during session reviewing registration form. 8 of 55 players are international (Turkey, Bahamas, England, Brazil, Tanzania, France). Country data is buried in free-text hometown field. ### Repo `forgejo_admin/basketball-api` ### User Story As an admin I want to see each player's country of origin as structured data So that I can identify and support international players in the program ### Context The program has players from 6+ countries. Currently country is only discoverable by reading the free-text `hometown` field (e.g. "Turkey,Istanbul", "Nassau Bahamas", "Bath, England"). Marcus needs a filterable field. Adding a `country` column with ISO country codes gives structured data without disrupting the existing hometown free text. Default to "US" so domestic families have zero extra friction. International families see the dropdown and know they're welcome. ### File Targets Files to modify: - `src/basketball_api/models.py` — add `country` column to Player model (nullable, default "US") - `alembic/versions/028_add_player_country.py` — migration to add column - `src/basketball_api/routes/register.py` — accept `country` in registration form - `src/basketball_api/routes/public.py` — include `country` in PublicPlayerResponse - `src/basketball_api/routes/admin.py` — include `country` in admin player list - `tests/` — update relevant tests Files NOT to touch: - `hometown` field — keep as-is, free text is fine for display - Parent model — country is per-player, not per-parent ### Acceptance Criteria - [ ] Player model has `country` column (VARCHAR, default "US", nullable) - [ ] Registration form accepts `country` field - [ ] Public teams API returns `country` per player - [ ] Admin player list includes `country` - [ ] Default is "US" for existing players (migration backfill) - [ ] Tests pass ### Test Expectations - [ ] Registration with country creates player with correct value - [ ] Registration without country defaults to "US" - [ ] Public API returns country field - Run: `pytest tests/ -v` ### Constraints - Use ISO 3166-1 alpha-2 codes (US, TR, GB, BR, TZ, FR, BS, etc.) - Store as simple VARCHAR, not an enum — too many countries for an enum - Default "US" in migration for all existing 55 players - Frontend dropdown is a separate ticket (westside-landing repo) ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-westside-basketball` - Frontend companion ticket needed for westside-landing dropdown
forgejo_admin 2026-03-28 22:37:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#229
No description provided.