[christmas] Add backfill UI and server function for recording past draws - #389
Merged
Conversation
Owner
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a Backfill a past year section to the Manage page, letting administrators enter who gave to whom in years that predate the app.
Once recorded, a backfilled year is indistinguishable from a normally drawn one: the "no repeat receivers" constraint can see it, and its letter is excluded from future draws. Entries are stored through the same revision counter as a regular draw, so recording the same year twice produces a second revision rather than overwriting the first.
The form lays out one row per pool member in a responsive grid. Receivers are chosen from a dropdown; leaving a row blank omits that person from the record, since old paper records are often incomplete. Duplicate receivers are flagged inline before saving rather than surfaced as a server error. The year and letter fields are editable, and if a record already exists for the chosen pool and year a notice appears with a link to load it for editing.
On the server side,
record_past_drawvalidates that the submitted pairings form a valid partial permutation — no self-gifts, no giver appearing twice, no receiver appearing twice — before inserting.configandseedare left null rather than invented, which causes the pool page to omit the "How it was drawn" line for those years instead of displaying something untrue.