Recurring bill generation from cycle rules #38

Closed
opened 2026-05-16 15:23:50 -05:00 by null · 1 comment
Owner

Problem: Quarterly, annual, and biweekly cycle types are stored (cycle_type, cycle_day, billing_cycle) but never acted on. resolveDueDate() only uses due_day, and getCycleRange() always returns the calendar month. No scheduled job creates tracker entries from these rules.

Scope:

  • Scheduler (cron or on-tracker-load) that generates next month's tracker entries based on each bill's cycle rules
  • Bills with billing_cycle = quarterly should only appear in their assigned month (every 3rd month from cycle_day)
  • Bills with billing_cycle = annually should only appear in their assigned month
  • Bills with cycle_type = biweekly should calculate correct due dates within the month
  • resolveDueDate() and getCycleRange() must respect cycle_type and cycle_day

Implementation notes:

  • Modify services/statusService.jsresolveDueDate() and getCycleRange()
  • Add scheduled job in routes/tracker.js or a new services/scheduler.js
  • Update TrackerPage.jsx to show/hide bills based on their cycle eligibility

Estimated effort: 8-10 hours

Depends on: #8 (closed — recurring payment rules foundation)

**Problem:** Quarterly, annual, and biweekly cycle types are stored (`cycle_type`, `cycle_day`, `billing_cycle`) but never acted on. `resolveDueDate()` only uses `due_day`, and `getCycleRange()` always returns the calendar month. No scheduled job creates tracker entries from these rules. **Scope:** - Scheduler (cron or on-tracker-load) that generates next month's tracker entries based on each bill's cycle rules - Bills with `billing_cycle = quarterly` should only appear in their assigned month (every 3rd month from `cycle_day`) - Bills with `billing_cycle = annually` should only appear in their assigned month - Bills with `cycle_type = biweekly` should calculate correct due dates within the month - `resolveDueDate()` and `getCycleRange()` must respect `cycle_type` and `cycle_day` **Implementation notes:** - Modify `services/statusService.js` — `resolveDueDate()` and `getCycleRange()` - Add scheduled job in `routes/tracker.js` or a new `services/scheduler.js` - Update `TrackerPage.jsx` to show/hide bills based on their cycle eligibility **Estimated effort:** 8-10 hours Depends on: #8 (closed — recurring payment rules foundation)
null added the
backend
feature
priority:high
labels 2026-05-16 15:28:54 -05:00
Author
Owner

Fixed in 1f1c505. getCycleRange now called per-bill so quarterly/annual bills check their full window, not just the calendar month. Null-guard added after buildTrackerRow() prevents TypeError on cyclically-inactive bills.

Fixed in `1f1c505`. `getCycleRange` now called per-bill so quarterly/annual bills check their full window, not just the calendar month. Null-guard added after `buildTrackerRow()` prevents TypeError on cyclically-inactive bills.
null closed this issue 2026-06-03 21:55:25 -05:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: null/BillTracker#38
No description provided.