Enforce default ±2 month gig-spacing in getCandidates and add date fallback parsing - #1037
Open
JoshuaVSherman wants to merge 1 commit into
Open
Enforce default ±2 month gig-spacing in getCandidates and add date fallback parsing#1037JoshuaVSherman wants to merge 1 commit into
JoshuaVSherman wants to merge 1 commit into
Conversation
…allback parsing (web-jam-back#1036 "Enforce default ±2 month gig-spacing in getCandidates and add date fallback parsing")
JoshuaVSherman
marked this pull request as ready for review
August 19, 2026 07:17
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
DEFAULT_GIG_SPACING_MONTHS = 2inOutreachController.excludeUpcomingGigVenuesandOutreachController.buildCandidateReasonwhen a venue'sgigIntervalis0or unset (null/undefined), preventing candidates with nearby booked gigs from being pitched by default.gigIntervalvalues > 0 (e.g. 3, 6) when configured on a venue document.buildCandidateReasonto evaluate spacing againstgigIntervalMonths(defaulting to 2) and formatsspacingNoteas'no gigs yet'when no gigs exist, or'clear — nearest gig ~X mo away'when gigs are spaced adequately.parseTargetDateshelper and updatesparseTargetWeekendto parse ISO start and end dates fromtargetDatesstrings (e.g.2026-10-16 to 2026-10-18,2026-10-16 - 2026-10-18,2026-10-16) whentargetWeekendobject is not provided inreq.query.test/unit/outreach/outreach-controller.spec.tsto assert the default 2-month spacing behavior and testtargetDatesfallback parsing.Closes #1036
How to test locally
npx vitest run test/unit/outreach/outreach-controller.spec.tsto verify all candidate spacing andtargetDatesfallback tests pass.gigInterval: 0(or unset) and a gig 1 month away from target windoww. VerifyGET /outreach/candidatesexcludes the venue.gigInterval: 0(or unset) and a gig 3 months away fromw. VerifyGET /outreach/candidatesincludes the venue withreason.gigIntervalMonths: 2andreason.spacingNote: 'clear — nearest gig ~3 mo away'.gigInterval: 3and a gig 2.5 months away fromw. VerifyGET /outreach/candidatesexcludes the venue.targetDatesstring fallback:GET /outreach/candidates?targetDates=2026-10-16 to 2026-10-18.wresolves to2026-10-16and candidate filtering properly excludes venues with gigs in September 2026.npm run test:lintnpm run typechecknpm run jscpdnpm testTest evidence
🤖 Work by Antigravity — Gemini Flash (Medium)