Flow & dependencies
How data flows between features and what each feature depends on. Use this to troubleshoot when something is missing (e.g. no candidates, no votes, coach can’t add a player).
Coach login
↑ Return to topWhat it does: Coaches log in with team name (from awards_teams) and password to access Add Candidate, All Conference vote, All State vote, and All American vote.
Dependencies
- awards_teams – Teams must exist. Import via
npm run import-awards-teams(or script). - Password – Set per team in Admin → Edit Team → Reset Password (or bulk
npm run reset-passwords).
Coach login → awards_teams (team_name, school_name) + password set
If coaches can’t log in: Confirm the team exists on the Admin Dashboard and has a password set. Team name must match exactly (case-sensitive).
Add Candidate (All State nominee)
↑ Return to topWhat it does: A logged-in coach adds a player from their school as an All State candidate. The player is stored in rosters with awards_team_id, year, coach ranking, stats, and nomination_status.
Dependencies (in order)
- Coach must be logged in (see Coach login).
- All State team rankings should be saved before nominations open. Ranks 1–8 get 3 auto-approved nominations, 9–16 get 2, and 17+ get 1. Unranked teams use the default quota, which can be lower than the intended ranking-based allotment.
- all_state_nomination_config – Default quota per team, nomination open/closed gate, and optional closure message. Optional all_state_team_quota overrides per team.
- All Conference 1st Team and all_state_eligibility CSV rows populate the dropdown/autofill hints. They do not block manual entry; the server allows a coach to nominate any player from that coach's school when required fields are complete.
- Within quota →
nomination_status = 'approved'; over quota →pending_approvaluntil committee approval votes are net positive.
Add Candidate → Coach login → All State rankings/quotas → nomination gate → optional eligibility hints → rosters (awards_team_id, year, nomination_status)
If a team has too few auto-approved slots: Save All State rankings or quota overrides before nominations open, then approve affected pending nominees as needed.
Add All American nomination
↑ Return to topWhat it does: Logged-in coaches submit All-American nominations for any player / any school. Rows are stored in candidates with award_type = 'All-American', nominating_awards_team_id, season_year, coach notes in character_notes, and nomination_status = 'pending_approval' until an admin approves them for the coach ballot.
Committee approval: Admins use /admin/all-american/approval to set nomination_status to approved, rejected, or back to pending.
Quick fill: GET /api/all-american/nomination-picks lists All Conference 1st Team selections (all schools) and all All State roster nominees for the year.
Add All American → coach login → optional quick fill → POST /api/all-american/nominations → candidates (pending) → admin approval → All American ballot
All American committee approval
↑ Return to topWhat it does: Lists coach-submitted All-American rows (nominating_awards_team_id set) for a season year. Committee or admin sets nomination_status to approved (coach ballot), rejected, or pending_approval (re-open).
API: GET /api/admin/all-american/nominations?year=&status= and PATCH /api/admin/all-american/nominations/:id/status (admin token).
Admin → /admin/all-american/approval → candidates.nomination_status → GET /api/all-american/candidates (approved only)
All State candidates (voting pool)
↑ Return to topWhat it does: The list of players that appear when coaches vote for All State (by position). Used by the All State vote page and by admin when dropping players or viewing the pool.
Dependencies (in order)
- rosters with
awards_team_id(coach-nominated) andyearmatching the selected year. If no such rosters exist, the app falls back to the candidates table. - nomination_status – Only
approvedorpending_approvalwith net committee “approve” votes are included. - all_state_round_dropped_players – Players dropped for the selected year/round are excluded from the pool.
- Honorable Mention rounds – Rounds beginning with
hm_exclude players already selected for All State 1st Team.
All State candidates = rosters (year, nomination_status) → pending approval votes → exclude dropped for (year, round) → HM excludes All State 1st Team
If “no candidates” on the vote page: Ensure coaches have added nominees (Add All State), nomination config/quotas and approval votes are set so players are approved, and none are dropped for that round.
All State voting
↑ Return to topWhat it does: Coaches rank players by position (Attack, Midfield, Defense, Goalie). One vote per coach per year per round, stored in all_state_votes.
Dependencies
- all_state_voting_sessions – A row must exist for (year, round).
status = 'active'to allow voting;access_code_hashoptional (if set, coach must enter the code). - All State candidates (see above) – At least one candidate per position for the round, or the position will show empty.
- all_state_coach_player_tags – Optional private coach Shortlist tags by coach, year, round, and roster player. These do not affect submitted votes or admin aggregates.
- Coach must be logged in.
All State voting → session (year, round) active + access code if set → candidates exist for round → coach login → all_state_votes
Shortlist: Coaches can check Shortlist beside selected rank rows or in All Player Stats. Shortlist only narrows the rank dropdowns for that coach and round; it does not filter the stats modal or change eligibility.
If voting is “closed” or code rejected: In Admin → All State Voting Control, set the round’s status to Active and ensure the access code (if used) matches what coaches enter.
All American
↑ Return to topWhat it does: Coaches rank approved All-American nominees from the candidates table (award_type All-American). The ballot is not computed from All State 1st Team results. Committee grids on /all-american save to all_american_selections.
Dependencies
- candidates – Rows with
award_typeAll-American andnomination_statusapproved appear on the coach ballot. Use/admin/all-american/approvalto approve coach nominations. - rosters (optional) – When
player_name+school_namematch andyearis null or matches the selected year, stats are merged for display. - all_american_votes – One JSON rankings row per coach per year.
All American ballot = approved All-American candidates + optional rosters merge → GET /api/all-american/candidates → coach vote → all_american_votes
If “no All American candidates”: Add or approve All-American nominee rows in candidates. Empty ballots are not fixed by completing All State voting alone.
All Conference
↑ Return to topWhat it does: Coaches add names to a shared all_conference_vote_pool by conference, year, and level (1st / 2nd / HM). The committee sets final grids on /all-conference into all_conference_selections. Conferences and school–conference mapping define which conference a coach sees.
Dependencies (in order)
- conferences – Conference names (e.g. Yellow, Green, Red, METRO, GISL, Illinois, Independent). Seeded on app start if empty.
- conference_schools – Maps
school_nametoconference_id. A coach’s school must be in a conference for them to see that conference’s nomination page. - awards_teams – Coach login;
school_nameis used to look up conference. - all_conference_team_rankings must be saved before slot checks. Per level: ranks 1–2 get 3 slots, 3–5 get 2, 6–8 get 1, unranked schools get 0 unless overridden.
- all_conference_team_quota and all_conference_returned_slots handle overrides and returned slots. Open pool per level = 5 + returned slots.
- Candidate/roster data – usually from rosters, optionally enriched by league-stats zip uploads in conference_league_field_stats and conference_league_goalie_stats.
All Conference → conferences + conference_schools → rankings/quotas/returns → optional league stats → all_conference_vote_pool → all_conference_selections
If slot counts look too low: Save rankings for that conference/year before coaches or committee members rely on the checks. Add quota overrides only for known edge cases.
Troubleshooting: something missing?
↑ Return to topUse the table below to find what to check and fix when a feature or list is empty or broken.
| Symptom | What to check | Fix |
|---|---|---|
| Coach can’t log in | Team exists? Password set? | Admin → Edit Team → Reset Password; or npm run reset-passwords. Ensure team name matches exactly. |
| Player missing from Add Candidate dropdown | Dropdown/autofill source is missing | Save player on committee All Conference 1st Team for that year, or Admin → All State → Eligibility CSV. Coaches can still manually type a nominee from their own school. |
| No All State candidates on vote page | Rosters with awards_team_id + year; nomination_status; pending approval votes; dropped players | Coaches add nominees (Add Candidate). Check nomination config/quotas and approval votes. Ensure players aren’t dropped for that round. |
| All Conference slots look too low | all_conference_team_rankings for conference + year | Admin → All Conference → save rankings before using slot checks. Add quota overrides or returned slots only when intentional. |
| All State nomination quota looks too low | all_state_team_rankings, default quota, team overrides | Admin → All State Control → save team rankings before nominations open. Then approve affected pending nominees if nominations already happened. |
| All State voting “closed” or access code wrong | all_state_voting_sessions for year + round | Admin → All State Voting Control → set Status to Active; set or clear Access Code to match what coaches use. |
| Shortlist only hides players | all_state_coach_player_tags for logged-in coach + year + round | Turn off Shortlist only, tag players in All Player Stats, or confirm current rank picks remain selected. Shortlist is private and round-specific. |
| No All American candidates | candidates: award_type All-American, nomination_status approved |
Add or approve All-American nominee rows at /admin/all-american/approval. The ballot does not depend on All State 1st Team derivation. |
| Coach doesn’t see a conference (All Conference) | conference_schools: school_name → conference_id | Ensure the team’s school_name is in conference_schools for the desired conference. Seed or update via DB/script if needed. |
| Pending nominees not in pool | all_state_approval_votes (committee votes) | Admin → All State Control → Pending approval: have committee members cast approve/reject; nominees with net approve appear in pool. |
For per-page usage details, see Admin Help. For new features to test, see Recent updates.