feat(routes-f): recurring date series generator#955
Open
dmystical-coder wants to merge 1 commit into
Open
Conversation
Add POST /api/routes-f/recurring-dates accepting { start, frequency,
interval?, count?, until? } and returning { dates, count }. Supports
daily/weekly/monthly/yearly recurrence, caps output at 1000 dates, and
handles month-end rollover by clamping the day-of-month while anchoring
each occurrence to the original start day (Jan 31 -> Feb 29, Mar 31).
Closes StreamFi-x#788
|
@dmystical-coder is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@dmystical-coder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Implements the recurring date series generator (#788).
POST /api/routes-f/recurring-dateswith{ start, frequency, interval?, count?, until? }→{ dates, count }Approach
daily | weekly | monthly | yearlyfrequencies with an optional positiveinterval(default 1).start(not incrementally), which avoids drift and keeps day-of-month anchoring correct.count/until; generation stops at whichever of count,until(inclusive), or the cap comes first. The loop is bounded by the cap so unbounded rules still terminate.start/until, anduntil ≥ start.Tests
Cover each frequency, interval handling, Jan-31 month-end rollover, Feb-29 yearly clamp/restore,
untilinclusivity, count/until/cap precedence, the unbounded cap, and the route's validation 400s.Scope
All files live under
app/api/routes-f/recurring-dates/; the only import is the existing in-folder_lib/validatehelper, matching the mergedfiscal-quarter/deep-mergeroutes.Closes #788