feat(player): support home/away jersey numbers #71
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
umpire274/bs_scoring!71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/managing-jersey-number"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
💡 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
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".
When a JSON record includes
away_numberwith a non-integer type, such as a quoted string in hand-edited data,and_then(|v| v.as_i64())turns it intoNoneand 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,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—checkedinsert_team_lineup(src/cli/screens/game.rs:613-626) and lineup import'sload_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 newaway_numbercannot actually be used for game lineups.Useful? React with 👍 / 👎.