Skip to content

Replace op_volunteer_shifts.noshow with a nullable checked_in (keep the three states) #840

In progress

Description

@mbhewitt

From Mew's 2026-11-26 roadmap (item 3):

since we are no longer tied to shiftboard, invert the no-show to be checked-in so it matches the rest of our pardgm. Lots of places to verify this is correct.

Today

op_volunteer_shifts.noshow is a string with three states, and the UI has no "mark no-show" control, only a check-in toggle:

stored meaning today
'' checked in
'Yes' toggled off ("checked out"), or set by the auto-finalize job; the score and reports treat it as a no-show
'X' or NULL added, nothing recorded yet

Proposal (for Mew to confirm)

Add checked_in TINYINT NULL: 1 = checked in, 0 = marked not checked in, NULL = nothing recorded. Backfill ''->1, 'Yes'->0, 'X'/NULL->NULL. The penalty fires on an explicit 0 only (#771). Expand/contract: add and backfill, switch every writer and reader, drop noshow later. Do it in the same migration as #620's flags-to-timestamps work for this table, outside an event.

Places to change and verify (grep of main; each needs a test)

  • Writers: components/api/shiftVolunteers.ts (check-in toggle), pages/api/shifts/[timeId]/volunteers/index.ts (add flow, ON DUPLICATE KEY), components/api/shiftAddRules.ts ("X"/""), lib/shiftLeadNudge.ts (auto-finalize), client toggles in ShiftVolunteers.tsx and VolunteerShifts.tsx.
  • Readers: the same volunteers API (isCheckedIn is a raw string), pages/api/volunteers/[shiftboardId]/shifts, pages/api/volunteers/index.ts (Attended/Absent/Remaining), Volunteers.tsx, lib/shiftLeadNudge.logic.ts, types under components/types/.
  • Tests: tests/unit/actingAs.test.ts, e2e/helpers/db.ts, e2e/tests/04-check-in.spec.ts.
  • Schema/docs: database/scheduler_schema.sql, database/README.md (its description of Yes is already wrong), OnPlayaData/yearly_update_sql.txt (resets noshow='X' yearly), on-playa schema files. Archived yearly dumps stay as they are.
  • Downstream: tools/census_reports_gsheet.py, scripts/onplaya_watchdog.py (runs during the event), etl/shift_history.py (PR Permanent shift record: op_shift_history + op_shift_time_stats (#759) #808).
  • Legacy PHP: onplayalib2.php processNoShows() joins op_volunteer_shifts.noshow to shiftboard2. Other PHP and census-python read legacy shiftboard2.noshow only.
  • Out of scope: sb_shifts.noshow / Shiftboard's No Show column (other system's data).
  • Other consumers I cannot see (ops bot, ad-hoc SQL): please list.

Related: #798 (parked API says "checked_in: true/false", deliberately no no-show field), #764, #775, #771, #620/#783, #634/#834, #573, #446, #772, PR #808.

Conflicts to resolve

Depends on / blocks: decide first, then ship with #620's op_volunteer_shifts step. Blocks the final schema of #759 / PR #808, #771 score rebuild, #839, #843 (merge rules), #798.

Questions for Mew

  1. Three states (checked in / marked not checked in / nothing recorded) or two? Rescue and the score need the difference.
  2. After an event, should auto-finalize write 0 (as 'Yes' today) or leave NULL? That decides whether anyone is penalized automatically (Auto-finalize no-show is intentional, but 'Yes' conflates "didn't show" with "lead never recorded" — needs provenance before it feeds a scored penalty #764).
  3. Who may set an explicit "absent", given the UI only has the toggle (Cannot distinguish 'never came to the event' from 'no-showed a shift' #775 asks for "never came" and "excused")?
  4. One migration with Roadmap: replace boolean add/remove/update/delete flags with timestamps + an SCD change log #620's work on this table, or earlier and separately?
  5. Ship outside the event (before the 2027 season), keeping both columns for a season?
  6. History: copy new values only for app rows and leave older rows as "not marked absent" with a provenance flag?
  7. Rename API fields (isCheckedIn, noShow) now, or keep the old names for tablets until after the season?
  8. Retire the PHP processNoShows() and PHP score (no write-back, Volunteer experience scoring is PHP-only and no Shiftboard history is imported — blocks lane suggestions, roster ordering, and ticket/camp decisions in the app #771 rebuilds the score)? Who else queries this column?

Activity

  1. added
    enhancement
    needs: Mew
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementneeds: Mew

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions