feat(player): support home/away jersey numbers #71

Merged
umpire274 merged 1 commit from feature/managing-jersey-number into main 2026-06-03 10:50:23 +02:00
umpire274 commented 2026-06-03 10:48:00 +02:00 (Migrated from github.com)
  • Add away jersey number for players
  • Default away number to home number when omitted
  • Allow jersey number 0
  • Update player creation workflow
  • Refactor Player::new using NewPlayer struct
  • Update database schema and migrations
  • Update import/export formats
  • Update changelog for v0.11.3
- Add away jersey number for players - Default away number to home number when omitted - Allow jersey number 0 - Update player creation workflow - Refactor Player::new using NewPlayer struct - Update database schema and migrations - Update import/export formats - Update changelog for v0.11.3
chatgpt-codex-connector[bot] (Migrated from github.com) reviewed 2026-06-03 10:51:45 +02:00
chatgpt-codex-connector[bot] (Migrated from github.com) left a comment

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4de3c1204

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `b4de3c1204` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-06-03 10:51:45 +02:00

P2 Badge Reject malformed away_number values in JSON imports

When a JSON record includes away_number with a non-integer type, such as a quoted string in hand-edited data, and_then(|v| v.as_i64()) turns it into None and this branch silently defaults it to the home number. That produces a successful import with the wrong away jersey number instead of reporting the invalid field; only an actually omitted compatibility field should take this default.

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Reject malformed away_number values in JSON imports** When a JSON record includes `away_number` with a non-integer type, such as a quoted string in hand-edited data, `and_then(|v| v.as_i64())` turns it into `None` and this branch silently defaults it to the home number. That produces a successful import with the wrong away jersey number instead of reporting the invalid field; only an actually omitted compatibility field should take this default. Useful? React with 👍 / 👎.
@ -7,6 +7,7 @@ pub struct Player {
pub id: Option<i64>,
pub team_id: i64,
pub number: i32,
pub away_number: i32,
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-06-03 10:51:45 +02:00

P1 Badge Use away numbers when resolving away lineups

When a player has different home/away numbers, this field is persisted/exported, but game flows still look up roster entries solely by Player::number—checked insert_team_lineup (src/cli/screens/game.rs:613-626) and lineup import's load_roster_number_map (src/cli/screens/game.rs:1212-1214). In an away game, entering or importing the away jersey number is rejected as not found, so the new away_number cannot actually be used for game lineups.

Useful? React with 👍 / 👎.

**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Use away numbers when resolving away lineups** When a player has different home/away numbers, this field is persisted/exported, but game flows still look up roster entries solely by `Player::number`—checked `insert_team_lineup` (`src/cli/screens/game.rs:613-626`) and lineup import's `load_roster_number_map` (`src/cli/screens/game.rs:1212-1214`). In an away game, entering or importing the away jersey number is rejected as not found, so the new `away_number` cannot actually be used for game lineups. Useful? React with 👍 / 👎.
Sign in to join this conversation.
No description provided.