Skip to content

BaseballHelm: Enforce season module toggles at runtime, not just in settings storage #503

Description

@njrini99-code

Problem

Season Settings exposes seven "What this season runs" toggles (roster_enabled, schedule_enabled, etc.) and persists them via updateSeason, but no other application code reads baseball_seasons or those columns — toggles are write-only configuration.

Evidence

  • Toggle keys written in updateSeason (team-season-settings.ts lines ~312-324)
  • UI renders BASEBALL_SEASON_MODULE_TOGGLES (SeasonSettingsClient.tsx lines ~332-347)
  • Repo-wide, baseball_seasons is referenced only in team-season-settings.ts and baseball-team-season-settings.ts types

Why it matters

Coaches disable stats or roster for an archived/off-season record expecting modules to stop; routes and mutations keep working unchanged.

Acceptance criteria

  • Mutations/routes for roster, schedule, stats, practice templates, lift groups, baselines, and player status check the current season's corresponding *_enabled flag server-side.
  • Disabling a module returns a clear 403 and hides the nav entry.
  • Test: flip stats_enabled off → stat write action denied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    baseballBaseballHelmbugIncorrect behavior or regression

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions