feat(venue): add ranking fields (originalsFit, travelBand, priority) + use payTier — for the AdminVenues Prospect Score#868
Merged
Conversation
Venue schema + validation for the AdminVenues Prospect Score (JaMmusic#1139): originalsFit (none|some|loves), travelBand (local|regional|far), priority (0-5). Enum validation refactored data-driven to keep cognitive complexity in bounds. 6 new tests; coverage over the 90/80/80/90 gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
be84fc0 to
75f36fd
Compare
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.
Summary
Adds three optional venue ranking fields to feed the AdminVenues 'Prospect Score' sort (JaMmusic#1139): originalsFit (none|some|loves — how much a venue welcomes original music), travelBand (local|regional|far — coarse distance from Salem, VA, no geocoding), and priority (0–5 manual boost). Existing payTier is kept for the pay value. Fields are optional/soft (no migration), persist via the existing PUT/POST
...bodyspread, and return on GET automatically; the score itself is computed client-side so weights stay tunable without a deploy. Enum validation was refactored to a data-driven table (invalidEnum/invalidPriority) to keep validateBody under the cognitive-complexity limit as fields grow.Closes #867
How to test locally
From web-jam-back/:
npm test(runs eslint ./src, jscpd, then vitest with coverage). Expected: lint clean, jscpd under threshold, all tests pass, coverage over the 90/80/80/90 gate.Test evidence
npm test green: eslint clean (no errors), jscpd passed, full vitest suite passed. Coverage summary — Statements 91.4% (1329/1454), Branches 84.25% (765/908), Functions 84.34% (194/230), Lines 91.99% (1103/1199); venue-controller.ts 90.79% stmts / 85.03% branch / 100% func. 6 new venue-controller tests (reject invalid originalsFit/travelBand/out-of-range+non-numeric priority; accept+pass-through the ranking fields).
🤖 Work by Claude Code — Opus 4.8