Skip to content

feat(routes-f): recurring date series generator#955

Open
dmystical-coder wants to merge 1 commit into
StreamFi-x:devfrom
dmystical-coder:feat/788-recurring-dates
Open

feat(routes-f): recurring date series generator#955
dmystical-coder wants to merge 1 commit into
StreamFi-x:devfrom
dmystical-coder:feat/788-recurring-dates

Conversation

@dmystical-coder
Copy link
Copy Markdown
Contributor

Summary

Implements the recurring date series generator (#788).

POST /api/routes-f/recurring-dates with { start, frequency, interval?, count?, until? }{ dates, count }

Approach

  • Supports daily | weekly | monthly | yearly frequencies with an optional positive interval (default 1).
  • Each occurrence is computed directly from start (not incrementally), which avoids drift and keeps day-of-month anchoring correct.
  • Month-end rollover: the day is clamped to the target month's last valid day but anchored to the original start day — Jan 31 monthly → Feb 29, Mar 31, Apr 30, May 31; Feb 29 yearly → Feb 28 on non-leap years and Feb 29 again on the next leap year.
  • Hard cap of 1000 dates regardless of 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.
  • Validates the frequency enum, positive-integer interval, valid ISO start/until, and until ≥ start.

Tests

Cover each frequency, interval handling, Jan-31 month-end rollover, Feb-29 yearly clamp/restore, until inclusivity, 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/validate helper, matching the merged fiscal-quarter/deep-merge routes.

Closes #788

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
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@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.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(routes-f): recurring date series generator

1 participant